Binary Authorization v1beta1 API - Class SystemPolicyV1Beta1Client (2.0.0-beta07)

public abstract class SystemPolicyV1Beta1Client

Reference documentation and code samples for the Binary Authorization v1beta1 API class SystemPolicyV1Beta1Client.

SystemPolicyV1Beta1 client wrapper, for convenient use.

Inheritance

object > SystemPolicyV1Beta1Client

Namespace

Google.Cloud.BinaryAuthorization.V1Beta1

Assembly

Google.Cloud.BinaryAuthorization.V1Beta1.dll

Remarks

API for working with the system policy.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default SystemPolicyV1Beta1 scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default SystemPolicyV1Beta1 scopes are:

GrpcClient

public virtual SystemPolicyV1Beta1.SystemPolicyV1Beta1Client GrpcClient { get; }

The underlying gRPC SystemPolicyV1Beta1 client

Property Value
Type Description
SystemPolicyV1Beta1SystemPolicyV1Beta1Client

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static SystemPolicyV1Beta1Client Create()

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

Returns
Type Description
SystemPolicyV1Beta1Client

The created SystemPolicyV1Beta1Client.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskSystemPolicyV1Beta1Client

The task representing the created SystemPolicyV1Beta1Client.

GetSystemPolicy(GetSystemPolicyRequest, CallSettings)

public virtual Policy GetSystemPolicy(GetSystemPolicyRequest request, CallSettings callSettings = null)

Gets the current system policy in the specified location.

Parameters
Name Description
request GetSystemPolicyRequest

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
Policy

The RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.Create();
// Initialize request argument(s)
GetSystemPolicyRequest request = new GetSystemPolicyRequest
{
    PolicyName = PolicyName.FromProject("[PROJECT]"),
};
// Make the request
Policy response = systemPolicyV1Beta1Client.GetSystemPolicy(request);

GetSystemPolicy(PolicyName, CallSettings)

public virtual Policy GetSystemPolicy(PolicyName name, CallSettings callSettings = null)

Gets the current system policy in the specified location.

Parameters
Name Description
name PolicyName

Required. The resource name, in the format locations/*/policy. Note that the system policy is not associated with a project.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.Create();
// Initialize request argument(s)
PolicyName name = PolicyName.FromProject("[PROJECT]");
// Make the request
Policy response = systemPolicyV1Beta1Client.GetSystemPolicy(name);

GetSystemPolicy(string, CallSettings)

public virtual Policy GetSystemPolicy(string name, CallSettings callSettings = null)

Gets the current system policy in the specified location.

Parameters
Name Description
name string

Required. The resource name, in the format locations/*/policy. Note that the system policy is not associated with a project.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Policy

The RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = SystemPolicyV1Beta1Client.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/policy";
// Make the request
Policy response = systemPolicyV1Beta1Client.GetSystemPolicy(name);

GetSystemPolicyAsync(GetSystemPolicyRequest, CallSettings)

public virtual Task<Policy> GetSystemPolicyAsync(GetSystemPolicyRequest request, CallSettings callSettings = null)

Gets the current system policy in the specified location.

Parameters
Name Description
request GetSystemPolicyRequest

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
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = await SystemPolicyV1Beta1Client.CreateAsync();
// Initialize request argument(s)
GetSystemPolicyRequest request = new GetSystemPolicyRequest
{
    PolicyName = PolicyName.FromProject("[PROJECT]"),
};
// Make the request
Policy response = await systemPolicyV1Beta1Client.GetSystemPolicyAsync(request);

GetSystemPolicyAsync(GetSystemPolicyRequest, CancellationToken)

public virtual Task<Policy> GetSystemPolicyAsync(GetSystemPolicyRequest request, CancellationToken cancellationToken)

Gets the current system policy in the specified location.

Parameters
Name Description
request GetSystemPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = await SystemPolicyV1Beta1Client.CreateAsync();
// Initialize request argument(s)
GetSystemPolicyRequest request = new GetSystemPolicyRequest
{
    PolicyName = PolicyName.FromProject("[PROJECT]"),
};
// Make the request
Policy response = await systemPolicyV1Beta1Client.GetSystemPolicyAsync(request);

GetSystemPolicyAsync(PolicyName, CallSettings)

public virtual Task<Policy> GetSystemPolicyAsync(PolicyName name, CallSettings callSettings = null)

Gets the current system policy in the specified location.

Parameters
Name Description
name PolicyName

Required. The resource name, in the format locations/*/policy. Note that the system policy is not associated with a project.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = await SystemPolicyV1Beta1Client.CreateAsync();
// Initialize request argument(s)
PolicyName name = PolicyName.FromProject("[PROJECT]");
// Make the request
Policy response = await systemPolicyV1Beta1Client.GetSystemPolicyAsync(name);

GetSystemPolicyAsync(PolicyName, CancellationToken)

public virtual Task<Policy> GetSystemPolicyAsync(PolicyName name, CancellationToken cancellationToken)

Gets the current system policy in the specified location.

Parameters
Name Description
name PolicyName

Required. The resource name, in the format locations/*/policy. Note that the system policy is not associated with a project.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = await SystemPolicyV1Beta1Client.CreateAsync();
// Initialize request argument(s)
PolicyName name = PolicyName.FromProject("[PROJECT]");
// Make the request
Policy response = await systemPolicyV1Beta1Client.GetSystemPolicyAsync(name);

GetSystemPolicyAsync(string, CallSettings)

public virtual Task<Policy> GetSystemPolicyAsync(string name, CallSettings callSettings = null)

Gets the current system policy in the specified location.

Parameters
Name Description
name string

Required. The resource name, in the format locations/*/policy. Note that the system policy is not associated with a project.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = await SystemPolicyV1Beta1Client.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/policy";
// Make the request
Policy response = await systemPolicyV1Beta1Client.GetSystemPolicyAsync(name);

GetSystemPolicyAsync(string, CancellationToken)

public virtual Task<Policy> GetSystemPolicyAsync(string name, CancellationToken cancellationToken)

Gets the current system policy in the specified location.

Parameters
Name Description
name string

Required. The resource name, in the format locations/*/policy. Note that the system policy is not associated with a project.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskPolicy

A Task containing the RPC response.

Example
// Create client
SystemPolicyV1Beta1Client systemPolicyV1Beta1Client = await SystemPolicyV1Beta1Client.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/policy";
// Make the request
Policy response = await systemPolicyV1Beta1Client.GetSystemPolicyAsync(name);

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.