Policy Troubleshooter v3 API - Class PolicyTroubleshooterClient (1.1.0)

public abstract class PolicyTroubleshooterClient

Reference documentation and code samples for the Policy Troubleshooter v3 API class PolicyTroubleshooterClient.

PolicyTroubleshooter client wrapper, for convenient use.

Inheritance

object > PolicyTroubleshooterClient

Namespace

Google.Cloud.PolicyTroubleshooter.Iam.V3

Assembly

Google.Cloud.PolicyTroubleshooter.Iam.V3.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 PolicyTroubleshooter service, which is a host of "policytroubleshooter.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default PolicyTroubleshooter scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default PolicyTroubleshooter scopes are:

GrpcClient

public virtual PolicyTroubleshooter.PolicyTroubleshooterClient GrpcClient { get; }

The underlying gRPC PolicyTroubleshooter client

Property Value
Type Description
PolicyTroubleshooterPolicyTroubleshooterClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static PolicyTroubleshooterClient Create()

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

Returns
Type Description
PolicyTroubleshooterClient

The created PolicyTroubleshooterClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskPolicyTroubleshooterClient

The task representing the created PolicyTroubleshooterClient.

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
Type Description
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 doesn't have that permission.

Parameters
Name Description
request TroubleshootIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TroubleshootIamPolicyResponse

The RPC response.

Example
// Create client
PolicyTroubleshooterClient policyTroubleshooterClient = PolicyTroubleshooterClient.Create();
// Initialize request argument(s)
TroubleshootIamPolicyRequest request = new TroubleshootIamPolicyRequest
{
    AccessTuple = new AccessTuple(),
};
// Make the request
TroubleshootIamPolicyResponse response = policyTroubleshooterClient.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 doesn't have that permission.

Parameters
Name Description
request TroubleshootIamPolicyRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTroubleshootIamPolicyResponse

A Task containing the RPC response.

Example
// Create client
PolicyTroubleshooterClient policyTroubleshooterClient = await PolicyTroubleshooterClient.CreateAsync();
// Initialize request argument(s)
TroubleshootIamPolicyRequest request = new TroubleshootIamPolicyRequest
{
    AccessTuple = new AccessTuple(),
};
// Make the request
TroubleshootIamPolicyResponse response = await policyTroubleshooterClient.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 doesn't have that permission.

Parameters
Name Description
request TroubleshootIamPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTroubleshootIamPolicyResponse

A Task containing the RPC response.

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