# API hub v1 API - Class ServiceCollectionExtensions (1.2.0)

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

- [1.2.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/1.1.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/1.0.0/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)

    public static class ServiceCollectionExtensions

Reference documentation and code samples for the API hub 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.ApiHub.V1/latest/Microsoft.Extensions.DependencyInjection)

## Assembly

Google.Cloud.ApiHub.V1.dll

## Methods

### AddApiHubClient(IServiceCollection, Action\<ApiHubClientBuilder\>)

    public static IServiceCollection AddApiHubClient(this IServiceCollection services, Action<ApiHubClientBuilder> action = null)

Adds a singleton [ApiHubClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubClientBuilder` 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` |   |

### AddApiHubClient(IServiceCollection, Action\<IServiceProvider, ApiHubClientBuilder\>)

    public static IServiceCollection AddApiHubClient(this IServiceCollection services, Action<IServiceProvider, ApiHubClientBuilder> action)

Adds a singleton [ApiHubClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubClientBuilder` 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` |   |

### AddApiHubCollectClient(IServiceCollection, Action\<ApiHubCollectClientBuilder\>)

    public static IServiceCollection AddApiHubCollectClient(this IServiceCollection services, Action<ApiHubCollectClientBuilder> action = null)

Adds a singleton [ApiHubCollectClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCollectClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCollectClientBuilder` 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` |   |

### AddApiHubCollectClient(IServiceCollection, Action\<IServiceProvider, ApiHubCollectClientBuilder\>)

    public static IServiceCollection AddApiHubCollectClient(this IServiceCollection services, Action<IServiceProvider, ApiHubCollectClientBuilder> action)

Adds a singleton [ApiHubCollectClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCollectClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCollectClientBuilder` 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` |   |

### AddApiHubCurateClient(IServiceCollection, Action\<ApiHubCurateClientBuilder\>)

    public static IServiceCollection AddApiHubCurateClient(this IServiceCollection services, Action<ApiHubCurateClientBuilder> action = null)

Adds a singleton [ApiHubCurateClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCurateClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCurateClientBuilder` 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` |   |

### AddApiHubCurateClient(IServiceCollection, Action\<IServiceProvider, ApiHubCurateClientBuilder\>)

    public static IServiceCollection AddApiHubCurateClient(this IServiceCollection services, Action<IServiceProvider, ApiHubCurateClientBuilder> action)

Adds a singleton [ApiHubCurateClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCurateClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubCurateClientBuilder` 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` |   |

### AddApiHubDependenciesClient(IServiceCollection, Action\<ApiHubDependenciesClientBuilder\>)

    public static IServiceCollection AddApiHubDependenciesClient(this IServiceCollection services, Action<ApiHubDependenciesClientBuilder> action = null)

Adds a singleton [ApiHubDependenciesClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDependenciesClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDependenciesClientBuilder` 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` |   |

### AddApiHubDependenciesClient(IServiceCollection, Action\<IServiceProvider, ApiHubDependenciesClientBuilder\>)

    public static IServiceCollection AddApiHubDependenciesClient(this IServiceCollection services, Action<IServiceProvider, ApiHubDependenciesClientBuilder> action)

Adds a singleton [ApiHubDependenciesClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDependenciesClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDependenciesClientBuilder` 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` |   |

### AddApiHubDiscoveryClient(IServiceCollection, Action\<ApiHubDiscoveryClientBuilder\>)

    public static IServiceCollection AddApiHubDiscoveryClient(this IServiceCollection services, Action<ApiHubDiscoveryClientBuilder> action = null)

Adds a singleton [ApiHubDiscoveryClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDiscoveryClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDiscoveryClientBuilder` 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` |   |

### AddApiHubDiscoveryClient(IServiceCollection, Action\<IServiceProvider, ApiHubDiscoveryClientBuilder\>)

    public static IServiceCollection AddApiHubDiscoveryClient(this IServiceCollection services, Action<IServiceProvider, ApiHubDiscoveryClientBuilder> action)

Adds a singleton [ApiHubDiscoveryClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDiscoveryClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubDiscoveryClientBuilder` 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` |   |

### AddApiHubPluginClient(IServiceCollection, Action\<ApiHubPluginClientBuilder\>)

    public static IServiceCollection AddApiHubPluginClient(this IServiceCollection services, Action<ApiHubPluginClientBuilder> action = null)

Adds a singleton [ApiHubPluginClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubPluginClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubPluginClientBuilder` 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` |   |

### AddApiHubPluginClient(IServiceCollection, Action\<IServiceProvider, ApiHubPluginClientBuilder\>)

    public static IServiceCollection AddApiHubPluginClient(this IServiceCollection services, Action<IServiceProvider, ApiHubPluginClientBuilder> action)

Adds a singleton [ApiHubPluginClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubPluginClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ApiHubPluginClientBuilder` 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` |   |

### AddHostProjectRegistrationServiceClient(IServiceCollection, Action\<HostProjectRegistrationServiceClientBuilder\>)

    public static IServiceCollection AddHostProjectRegistrationServiceClient(this IServiceCollection services, Action<HostProjectRegistrationServiceClientBuilder> action = null)

Adds a singleton [HostProjectRegistrationServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClientBuilder` 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` |   |

### AddHostProjectRegistrationServiceClient(IServiceCollection, Action\<IServiceProvider, HostProjectRegistrationServiceClientBuilder\>)

    public static IServiceCollection AddHostProjectRegistrationServiceClient(this IServiceCollection services, Action<IServiceProvider, HostProjectRegistrationServiceClientBuilder> action)

Adds a singleton [HostProjectRegistrationServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClientBuilder` 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` |   |

### AddLintingServiceClient(IServiceCollection, Action\<LintingServiceClientBuilder\>)

    public static IServiceCollection AddLintingServiceClient(this IServiceCollection services, Action<LintingServiceClientBuilder> action = null)

Adds a singleton [LintingServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.LintingServiceClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.LintingServiceClientBuilder` 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` |   |

### AddLintingServiceClient(IServiceCollection, Action\<IServiceProvider, LintingServiceClientBuilder\>)

    public static IServiceCollection AddLintingServiceClient(this IServiceCollection services, Action<IServiceProvider, LintingServiceClientBuilder> action)

Adds a singleton [LintingServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.LintingServiceClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.LintingServiceClientBuilder` 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` |   |

### AddProvisioningClient(IServiceCollection, Action\<ProvisioningClientBuilder\>)

    public static IServiceCollection AddProvisioningClient(this IServiceCollection services, Action<ProvisioningClientBuilder> action = null)

Adds a singleton [ProvisioningClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ProvisioningClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ProvisioningClientBuilder` 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` |   |

### AddProvisioningClient(IServiceCollection, Action\<IServiceProvider, ProvisioningClientBuilder\>)

    public static IServiceCollection AddProvisioningClient(this IServiceCollection services, Action<IServiceProvider, ProvisioningClientBuilder> action)

Adds a singleton [ProvisioningClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ProvisioningClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.ProvisioningClientBuilder` 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` |   |

### AddRuntimeProjectAttachmentServiceClient(IServiceCollection, Action\<RuntimeProjectAttachmentServiceClientBuilder\>)

    public static IServiceCollection AddRuntimeProjectAttachmentServiceClient(this IServiceCollection services, Action<RuntimeProjectAttachmentServiceClientBuilder> action = null)

Adds a singleton [RuntimeProjectAttachmentServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.RuntimeProjectAttachmentServiceClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.RuntimeProjectAttachmentServiceClientBuilder` 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` |   |

### AddRuntimeProjectAttachmentServiceClient(IServiceCollection, Action\<IServiceProvider, RuntimeProjectAttachmentServiceClientBuilder\>)

    public static IServiceCollection AddRuntimeProjectAttachmentServiceClient(this IServiceCollection services, Action<IServiceProvider, RuntimeProjectAttachmentServiceClientBuilder> action)

Adds a singleton [RuntimeProjectAttachmentServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.RuntimeProjectAttachmentServiceClient) 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.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.RuntimeProjectAttachmentServiceClientBuilder` 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` |   |