1.1.0 (latest) 1.0.0

    public static class ServiceCollectionExtensions

Reference documentation and code samples for the Gemini Enterprise for Customer Experience v1 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.Ces.V1/latest/Microsoft.Extensions.DependencyInjection.md.txt)

## Assembly

Google.Cloud.Ces.V1.dll

## Methods

### AddAgentServiceClient(IServiceCollection, Action\<AgentServiceClientBuilder\>)

    public static IServiceCollection AddAgentServiceClient(this IServiceCollection services, Action<AgentServiceClientBuilder> action = null)

Adds a singleton [AgentServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.AgentServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionAgentServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddAgentServiceClient(IServiceCollection, Action\<IServiceProvider, AgentServiceClientBuilder\>)

    public static IServiceCollection AddAgentServiceClient(this IServiceCollection services, Action<IServiceProvider, AgentServiceClientBuilder> action)

Adds a singleton [AgentServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.AgentServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionSystem.IServiceProviderAgentServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddSessionServiceClient(IServiceCollection, Action\<SessionServiceClientBuilder\>)

    public static IServiceCollection AddSessionServiceClient(this IServiceCollection services, Action<SessionServiceClientBuilder> action = null)

Adds a singleton [SessionServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.SessionServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionSessionServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddSessionServiceClient(IServiceCollection, Action\<IServiceProvider, SessionServiceClientBuilder\>)

    public static IServiceCollection AddSessionServiceClient(this IServiceCollection services, Action<IServiceProvider, SessionServiceClientBuilder> action)

Adds a singleton [SessionServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.SessionServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionSystem.IServiceProviderSessionServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddToolServiceClient(IServiceCollection, Action\<ToolServiceClientBuilder\>)

    public static IServiceCollection AddToolServiceClient(this IServiceCollection services, Action<ToolServiceClientBuilder> action = null)

Adds a singleton [ToolServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.ToolServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionToolServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddToolServiceClient(IServiceCollection, Action\<IServiceProvider, ToolServiceClientBuilder\>)

    public static IServiceCollection AddToolServiceClient(this IServiceCollection services, Action<IServiceProvider, ToolServiceClientBuilder> action)

Adds a singleton [ToolServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.ToolServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionSystem.IServiceProviderToolServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddWidgetServiceClient(IServiceCollection, Action\<WidgetServiceClientBuilder\>)

    public static IServiceCollection AddWidgetServiceClient(this IServiceCollection services, Action<WidgetServiceClientBuilder> action = null)

Adds a singleton [WidgetServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.WidgetServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionWidgetServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |

### AddWidgetServiceClient(IServiceCollection, Action\<IServiceProvider, WidgetServiceClientBuilder\>)

    public static IServiceCollection AddWidgetServiceClient(this IServiceCollection services, Action<IServiceProvider, WidgetServiceClientBuilder> action)

Adds a singleton [WidgetServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Ces.V1/latest/Google.Cloud.Ces.V1.WidgetServiceClient.md.txt) to `services`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `services` | `IServiceCollection` The service collection to add the client to. The services are used to configure the client when requested. |
| `action` | `ActionSystem.IServiceProviderWidgetServiceClientBuilder` An optional action to invoke on the client builder. This is invoked before services from `services` are used. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `IServiceCollection` |   |