# Google Cloud Talent Solution v4 API - Class ServiceCollectionExtensions (2.8.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.8.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.7.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.7.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.6.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.6.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.5.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/2.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/1.4.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/1.3.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/1.2.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/1.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/1.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)

    public static class ServiceCollectionExtensions

Reference documentation and code samples for the Google Cloud Talent Solution v4 API class ServiceCollectionExtensions.

Static class to provide extension methods to configure API clients.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ServiceCollectionExtensions

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Microsoft.Extensions.DependencyInjection](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Microsoft.Extensions.DependencyInjection)

## Assembly

Google.Cloud.Talent.V4.dll

## Methods

### AddCompanyServiceClient(IServiceCollection, Action\<CompanyServiceClientBuilder\>)

    public static IServiceCollection AddCompanyServiceClient(this IServiceCollection services, Action<CompanyServiceClientBuilder> action = null)

Adds a singleton [CompanyServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompanyServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompanyServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddCompanyServiceClient(IServiceCollection, Action\<IServiceProvider, CompanyServiceClientBuilder\>)

    public static IServiceCollection AddCompanyServiceClient(this IServiceCollection services, Action<IServiceProvider, CompanyServiceClientBuilder> action)

Adds a singleton [CompanyServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompanyServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompanyServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddCompletionClient(IServiceCollection, Action\<CompletionClientBuilder\>)

    public static IServiceCollection AddCompletionClient(this IServiceCollection services, Action<CompletionClientBuilder> action = null)

Adds a singleton [CompletionClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompletionClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompletionClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddCompletionClient(IServiceCollection, Action\<IServiceProvider, CompletionClientBuilder\>)

    public static IServiceCollection AddCompletionClient(this IServiceCollection services, Action<IServiceProvider, CompletionClientBuilder> action)

Adds a singleton [CompletionClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompletionClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.CompletionClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddEventServiceClient(IServiceCollection, Action\<EventServiceClientBuilder\>)

    public static IServiceCollection AddEventServiceClient(this IServiceCollection services, Action<EventServiceClientBuilder> action = null)

Adds a singleton [EventServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.EventServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.EventServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddEventServiceClient(IServiceCollection, Action\<IServiceProvider, EventServiceClientBuilder\>)

    public static IServiceCollection AddEventServiceClient(this IServiceCollection services, Action<IServiceProvider, EventServiceClientBuilder> action)

Adds a singleton [EventServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.EventServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.EventServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddJobServiceClient(IServiceCollection, Action\<JobServiceClientBuilder\>)

    public static IServiceCollection AddJobServiceClient(this IServiceCollection services, Action<JobServiceClientBuilder> action = null)

Adds a singleton [JobServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.JobServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.JobServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddJobServiceClient(IServiceCollection, Action\<IServiceProvider, JobServiceClientBuilder\>)

    public static IServiceCollection AddJobServiceClient(this IServiceCollection services, Action<IServiceProvider, JobServiceClientBuilder> action)

Adds a singleton [JobServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.JobServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.JobServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddTenantServiceClient(IServiceCollection, Action\<TenantServiceClientBuilder\>)

    public static IServiceCollection AddTenantServiceClient(this IServiceCollection services, Action<TenantServiceClientBuilder> action = null)

Adds a singleton [TenantServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.TenantServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.TenantServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |

### AddTenantServiceClient(IServiceCollection, Action\<IServiceProvider, TenantServiceClientBuilder\>)

    public static IServiceCollection AddTenantServiceClient(this IServiceCollection services, Action<IServiceProvider, TenantServiceClientBuilder> action)

Adds a singleton [TenantServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.TenantServiceClient) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `https://learn.microsoft.com/dotnet/api/system.action-2System.IServiceProviderhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Talent.V4/latest/Google.Cloud.Talent.V4.TenantServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/microsoft.extensions.dependencyinjection.iservicecollection` |   |