# C# Client Library

## Installation

Add this reference to your project's `.csproj` file:

```xml
<PackageReference Include="Tomba" Version="1.0.0" />
```

You can install packages from the command line With [.NET CLI](https://dotnet.microsoft.com/):

```bash
dotnet add package Tomba --version 1.0.0
```

## Usage

### Domain Search

Get email addresses found on the internet.

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Domain domain = new Domain(client);

HttpResponseMessage result = await domain.DomainSearch("stripe.com");
```

### Email Finder

Find the verified email address of any professional.

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Finder finder = new Finder(client);

HttpResponseMessage result = await finder.EmailFinder("stripe.com", "Fname", "Lname");
```

### Email Verifier

Verify the validity of any professional email address with the most complete email checker.

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Verifier verifier = new Verifier(client);

HttpResponseMessage result = await verifier.EmailVerifier("m@wordpress.org");
```

## Examples

### Get Account Information

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Account account = new Account(client);

HttpResponseMessage result = await account.GetAccount();
```

### Email Count

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Count count = new Count(client);

HttpResponseMessage result = await count.EmailCount("tomba.io");
```

### API Key Management

#### Create API Key

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Keys keys = new Keys(client);

HttpResponseMessage result = await keys.CreateKey();
```

#### Delete API Key

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Keys keys = new Keys(client);

HttpResponseMessage result = await keys.DeleteKey("");
```

#### Get All API Keys

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Keys keys = new Keys(client);

HttpResponseMessage result = await keys.GetKeys();
```

#### Reset API Key

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Keys keys = new Keys(client);

HttpResponseMessage result = await keys.ResetKey("");
```

### Lead Attributes Management

#### Create Lead Attribute

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsAttributes leadsAttributes = new LeadsAttributes(client);

HttpResponseMessage result = await leadsAttributes.CreateLeadAttribute();
```

#### Delete Lead Attribute

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsAttributes leadsAttributes = new LeadsAttributes(client);

HttpResponseMessage result = await leadsAttributes.DeleteLeadAttribute("[Lead_Attributes_ID]");
```

#### Get Lead Attributes

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsAttributes leadsAttributes = new LeadsAttributes(client);

HttpResponseMessage result = await leadsAttributes.GetLeadAttributes();
```

#### Update Lead Attribute

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsAttributes leadsAttributes = new LeadsAttributes(client);

HttpResponseMessage result = await leadsAttributes.UpdateLeadAttribute("[Lead_Attributes_ID]");
```

### Lead Lists Management

#### Create Lead List

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsLists leadsLists = new LeadsLists(client);

HttpResponseMessage result = await leadsLists.CreateList();
```

#### Delete Lead List

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsLists leadsLists = new LeadsLists(client);

HttpResponseMessage result = await leadsLists.DeleteListId("[LIST_ID]");
```

#### Get All Lead Lists

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsLists leadsLists = new LeadsLists(client);

HttpResponseMessage result = await leadsLists.GetLists();
```

#### Update Lead List

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

LeadsLists leadsLists = new LeadsLists(client);

HttpResponseMessage result = await leadsLists.UpdateListId("[List_ID]");
```

### Activity Logs

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Logs logs = new Logs(client);

HttpResponseMessage result = await logs.GetLogs();
```

### Email Sources

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Sources sources = new Sources(client);

HttpResponseMessage result = await sources.EmailSources("b.mohamed@tomba.io");
```

### Domain and Company Status

#### Auto Complete

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Status status = new Status(client);

HttpResponseMessage result = await status.AutoComplete("google");
```

#### Domain Status

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Status status = new Status(client);

HttpResponseMessage result = await status.DomainStatus("gmail.com");
```

### Usage Statistics

```cs
using Tomba;

Client client = new Client();

client
  .SetKey("ta_xxxx") // Your Key
  .SetSecret("ts_xxxx") // Your Secret
;

Usage usage = new Usage(client);

HttpResponseMessage result = await usage.GetUsage();
```

For more sample codes, check the [**examples/**](https://github.com/tomba-io/csharp/tree/master/examples) folder.
