# Binary Authorization v1beta1 API - Class ServiceCollectionExtensions (2.0.0-beta09)

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

- [2.0.0-beta09 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [2.0.0-beta08](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/2.0.0-beta08/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)
- [1.0.0-beta05](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/1.0.0-beta05/Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions)

    public static class ServiceCollectionExtensions

Reference documentation and code samples for the Binary Authorization v1beta1 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.BinaryAuthorization.V1Beta1/latest/Microsoft.Extensions.DependencyInjection)

## Assembly

Google.Cloud.BinaryAuthorization.V1Beta1.dll

## Methods

### AddBinauthzManagementServiceV1Beta1Client(IServiceCollection, Action\<BinauthzManagementServiceV1Beta1ClientBuilder\>)

    public static IServiceCollection AddBinauthzManagementServiceV1Beta1Client(this IServiceCollection services, Action<BinauthzManagementServiceV1Beta1ClientBuilder> action = null)

Adds a singleton [BinauthzManagementServiceV1Beta1Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.BinauthzManagementServiceV1Beta1Client) 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.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.BinauthzManagementServiceV1Beta1ClientBuilder` 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` |   |

### AddBinauthzManagementServiceV1Beta1Client(IServiceCollection, Action\<IServiceProvider, BinauthzManagementServiceV1Beta1ClientBuilder\>)

    public static IServiceCollection AddBinauthzManagementServiceV1Beta1Client(this IServiceCollection services, Action<IServiceProvider, BinauthzManagementServiceV1Beta1ClientBuilder> action)

Adds a singleton [BinauthzManagementServiceV1Beta1Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.BinauthzManagementServiceV1Beta1Client) 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.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.BinauthzManagementServiceV1Beta1ClientBuilder` 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` |   |

### AddSystemPolicyV1Beta1Client(IServiceCollection, Action\<SystemPolicyV1Beta1ClientBuilder\>)

    public static IServiceCollection AddSystemPolicyV1Beta1Client(this IServiceCollection services, Action<SystemPolicyV1Beta1ClientBuilder> action = null)

Adds a singleton [SystemPolicyV1Beta1Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.SystemPolicyV1Beta1Client) 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.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.SystemPolicyV1Beta1ClientBuilder` 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` |   |

### AddSystemPolicyV1Beta1Client(IServiceCollection, Action\<IServiceProvider, SystemPolicyV1Beta1ClientBuilder\>)

    public static IServiceCollection AddSystemPolicyV1Beta1Client(this IServiceCollection services, Action<IServiceProvider, SystemPolicyV1Beta1ClientBuilder> action)

Adds a singleton [SystemPolicyV1Beta1Client](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.SystemPolicyV1Beta1Client) 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.BinaryAuthorization.V1Beta1/latest/Google.Cloud.BinaryAuthorization.V1Beta1.SystemPolicyV1Beta1ClientBuilder` 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` |   |