# Policy Troubleshooter v1 API - Class IamCheckerClient (2.6.0)

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

- [2.6.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/2.5.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/2.4.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/2.3.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/2.2.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/2.1.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/2.0.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/1.2.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/1.1.0/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient)

    public abstract class IamCheckerClient

Reference documentation and code samples for the Policy Troubleshooter v1 API class IamCheckerClient.

IamChecker client wrapper, for convenient use.

## Inheritance

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

## 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)

## Derived Types

[IamCheckerClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClientImpl)

## Namespace

[Google.Cloud.PolicyTroubleshooter.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1)

## Assembly

Google.Cloud.PolicyTroubleshooter.V1.dll

## Remarks

IAM Policy Troubleshooter service.

This service helps you troubleshoot access issues for Google Cloud resources.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the IamChecker service, which is a host of "policytroubleshooter.googleapis.com"
and a port of 443.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default IamChecker scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default IamChecker scopes are:

- <https://www.googleapis.com/auth/cloud-platform>

<br />

### GrpcClient

    public virtual IamChecker.IamCheckerClient GrpcClient { get; }

The underlying gRPC IamChecker client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamChecker.IamCheckerClient` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

## Methods

### Create()

    public static IamCheckerClient Create()

Synchronously creates a [IamCheckerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient) using the default credentials, endpoint and settings.
To specify custom credentials or other settings, use [IamCheckerClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient` | The created [IamCheckerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient). |

### CreateAsync(CancellationToken)

    public static Task<IamCheckerClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a [IamCheckerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [IamCheckerClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient` | The task representing the created [IamCheckerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient). |

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient#Google_Cloud_PolicyTroubleshooter_V1_IamCheckerClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient#Google_Cloud_PolicyTroubleshooter_V1_IamCheckerClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient#Google_Cloud_PolicyTroubleshooter_V1_IamCheckerClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.IamCheckerClient#Google_Cloud_PolicyTroubleshooter_V1_IamCheckerClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.

### TroubleshootIamPolicy(TroubleshootIamPolicyRequest, CallSettings)

    public virtual TroubleshootIamPolicyResponse TroubleshootIamPolicy(TroubleshootIamPolicyRequest request, CallSettings callSettings = null)

Checks whether a principal has a specific permission for a specific
resource, and explains why the principal does or does not have that
permission.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.TroubleshootIamPolicyRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.TroubleshootIamPolicyResponse` | The RPC response. |

**Example**

    // Create client
    IamCheckerClient iamCheckerClient = IamCheckerClient.Create();
    // Initialize request argument(s)
    TroubleshootIamPolicyRequest request = new TroubleshootIamPolicyRequest
    {
        AccessTuple = new AccessTuple(),
    };
    // Make the request
    TroubleshootIamPolicyResponse response = iamCheckerClient.TroubleshootIamPolicy(request);

### TroubleshootIamPolicyAsync(TroubleshootIamPolicyRequest, CallSettings)

    public virtual Task<TroubleshootIamPolicyResponse> TroubleshootIamPolicyAsync(TroubleshootIamPolicyRequest request, CallSettings callSettings = null)

Checks whether a principal has a specific permission for a specific
resource, and explains why the principal does or does not have that
permission.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.TroubleshootIamPolicyRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.TroubleshootIamPolicyResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    IamCheckerClient iamCheckerClient = await IamCheckerClient.CreateAsync();
    // Initialize request argument(s)
    TroubleshootIamPolicyRequest request = new TroubleshootIamPolicyRequest
    {
        AccessTuple = new AccessTuple(),
    };
    // Make the request
    TroubleshootIamPolicyResponse response = await iamCheckerClient.TroubleshootIamPolicyAsync(request);

### TroubleshootIamPolicyAsync(TroubleshootIamPolicyRequest, CancellationToken)

    public virtual Task<TroubleshootIamPolicyResponse> TroubleshootIamPolicyAsync(TroubleshootIamPolicyRequest request, CancellationToken cancellationToken)

Checks whether a principal has a specific permission for a specific
resource, and explains why the principal does or does not have that
permission.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.TroubleshootIamPolicyRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.PolicyTroubleshooter.V1/latest/Google.Cloud.PolicyTroubleshooter.V1.TroubleshootIamPolicyResponse` | A Task containing the RPC response. |

**Example**

    // Create client
    IamCheckerClient iamCheckerClient = await IamCheckerClient.CreateAsync();
    // Initialize request argument(s)
    TroubleshootIamPolicyRequest request = new TroubleshootIamPolicyRequest
    {
        AccessTuple = new AccessTuple(),
    };
    // Make the request
    TroubleshootIamPolicyResponse response = await iamCheckerClient.TroubleshootIamPolicyAsync(request);