Policy Troubleshooter v1 API - Class IamCheckerClient (2.4.0)

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 > IamCheckerClient

Derived Types

Namespace

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
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default IamChecker scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default IamChecker scopes are:

GrpcClient

public virtual IamChecker.IamCheckerClient GrpcClient { get; }

The underlying gRPC IamChecker client

Property Value
TypeDescription
IamCheckerIamCheckerClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static IamCheckerClient Create()

Synchronously creates a IamCheckerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use IamCheckerClientBuilder.

Returns
TypeDescription
IamCheckerClient

The created IamCheckerClient.

CreateAsync(CancellationToken)

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

Asynchronously creates a IamCheckerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use IamCheckerClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskIamCheckerClient

The task representing the created IamCheckerClient.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(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
NameDescription
requestTroubleshootIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTroubleshootIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTroubleshootIamPolicyResponse

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
NameDescription
requestTroubleshootIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTroubleshootIamPolicyResponse

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