BigQuery Data Policy v1 API - Class DataPolicyServiceClient (1.3.0)

public abstract class DataPolicyServiceClient

Reference documentation and code samples for the BigQuery Data Policy v1 API class DataPolicyServiceClient.

DataPolicyService client wrapper, for convenient use.

Inheritance

object > DataPolicyServiceClient

Namespace

Google.Cloud.BigQuery.DataPolicies.V1

Assembly

Google.Cloud.BigQuery.DataPolicies.V1.dll

Remarks

Data Policy Service provides APIs for managing the label-policy bindings.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default DataPolicyService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual DataPolicyService.DataPolicyServiceClient GrpcClient { get; }

The underlying gRPC DataPolicyService client

Property Value
TypeDescription
DataPolicyServiceDataPolicyServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static DataPolicyServiceClient Create()

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

Returns
TypeDescription
DataPolicyServiceClient

The created DataPolicyServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskDataPolicyServiceClient

The task representing the created DataPolicyServiceClient.

CreateDataPolicy(LocationName, DataPolicy, CallSettings)

public virtual DataPolicy CreateDataPolicy(LocationName parent, DataPolicy dataPolicy, CallSettings callSettings = null)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
parentLocationName

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

dataPolicyDataPolicy

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
DataPolicy dataPolicy = new DataPolicy();
// Make the request
DataPolicy response = dataPolicyServiceClient.CreateDataPolicy(parent, dataPolicy);

CreateDataPolicy(CreateDataPolicyRequest, CallSettings)

public virtual DataPolicy CreateDataPolicy(CreateDataPolicyRequest request, CallSettings callSettings = null)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
requestCreateDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
CreateDataPolicyRequest request = new CreateDataPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    DataPolicy = new DataPolicy(),
};
// Make the request
DataPolicy response = dataPolicyServiceClient.CreateDataPolicy(request);

CreateDataPolicy(string, DataPolicy, CallSettings)

public virtual DataPolicy CreateDataPolicy(string parent, DataPolicy dataPolicy, CallSettings callSettings = null)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
parentstring

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

dataPolicyDataPolicy

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
DataPolicy dataPolicy = new DataPolicy();
// Make the request
DataPolicy response = dataPolicyServiceClient.CreateDataPolicy(parent, dataPolicy);

CreateDataPolicyAsync(LocationName, DataPolicy, CallSettings)

public virtual Task<DataPolicy> CreateDataPolicyAsync(LocationName parent, DataPolicy dataPolicy, CallSettings callSettings = null)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
parentLocationName

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

dataPolicyDataPolicy

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
DataPolicy dataPolicy = new DataPolicy();
// Make the request
DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(parent, dataPolicy);

CreateDataPolicyAsync(LocationName, DataPolicy, CancellationToken)

public virtual Task<DataPolicy> CreateDataPolicyAsync(LocationName parent, DataPolicy dataPolicy, CancellationToken cancellationToken)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
parentLocationName

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

dataPolicyDataPolicy

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
DataPolicy dataPolicy = new DataPolicy();
// Make the request
DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(parent, dataPolicy);

CreateDataPolicyAsync(CreateDataPolicyRequest, CallSettings)

public virtual Task<DataPolicy> CreateDataPolicyAsync(CreateDataPolicyRequest request, CallSettings callSettings = null)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
requestCreateDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateDataPolicyRequest request = new CreateDataPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    DataPolicy = new DataPolicy(),
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(request);

CreateDataPolicyAsync(CreateDataPolicyRequest, CancellationToken)

public virtual Task<DataPolicy> CreateDataPolicyAsync(CreateDataPolicyRequest request, CancellationToken cancellationToken)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
requestCreateDataPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
CreateDataPolicyRequest request = new CreateDataPolicyRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    DataPolicy = new DataPolicy(),
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(request);

CreateDataPolicyAsync(string, DataPolicy, CallSettings)

public virtual Task<DataPolicy> CreateDataPolicyAsync(string parent, DataPolicy dataPolicy, CallSettings callSettings = null)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
parentstring

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

dataPolicyDataPolicy

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
DataPolicy dataPolicy = new DataPolicy();
// Make the request
DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(parent, dataPolicy);

CreateDataPolicyAsync(string, DataPolicy, CancellationToken)

public virtual Task<DataPolicy> CreateDataPolicyAsync(string parent, DataPolicy dataPolicy, CancellationToken cancellationToken)

Creates a new data policy under a project with the given dataPolicyId (used as the display name), policy tag, and data policy type.

Parameters
NameDescription
parentstring

Required. Resource name of the project that the data policy will belong to. The format is projects/{project_number}/locations/{location_id}.

dataPolicyDataPolicy

Required. The data policy to create. The name field does not need to be provided for the data policy creation.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
DataPolicy dataPolicy = new DataPolicy();
// Make the request
DataPolicy response = await dataPolicyServiceClient.CreateDataPolicyAsync(parent, dataPolicy);

DeleteDataPolicy(DataPolicyName, CallSettings)

public virtual void DeleteDataPolicy(DataPolicyName name, CallSettings callSettings = null)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
nameDataPolicyName

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
DataPolicyName name = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]");
// Make the request
dataPolicyServiceClient.DeleteDataPolicy(name);

DeleteDataPolicy(DeleteDataPolicyRequest, CallSettings)

public virtual void DeleteDataPolicy(DeleteDataPolicyRequest request, CallSettings callSettings = null)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
requestDeleteDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
DeleteDataPolicyRequest request = new DeleteDataPolicyRequest
{
    DataPolicyName = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]"),
};
// Make the request
dataPolicyServiceClient.DeleteDataPolicy(request);

DeleteDataPolicy(string, CallSettings)

public virtual void DeleteDataPolicy(string name, CallSettings callSettings = null)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
namestring

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataPolicies/[DATA_POLICY]";
// Make the request
dataPolicyServiceClient.DeleteDataPolicy(name);

DeleteDataPolicyAsync(DataPolicyName, CallSettings)

public virtual Task DeleteDataPolicyAsync(DataPolicyName name, CallSettings callSettings = null)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
nameDataPolicyName

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DataPolicyName name = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]");
// Make the request
await dataPolicyServiceClient.DeleteDataPolicyAsync(name);

DeleteDataPolicyAsync(DataPolicyName, CancellationToken)

public virtual Task DeleteDataPolicyAsync(DataPolicyName name, CancellationToken cancellationToken)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
nameDataPolicyName

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DataPolicyName name = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]");
// Make the request
await dataPolicyServiceClient.DeleteDataPolicyAsync(name);

DeleteDataPolicyAsync(DeleteDataPolicyRequest, CallSettings)

public virtual Task DeleteDataPolicyAsync(DeleteDataPolicyRequest request, CallSettings callSettings = null)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
requestDeleteDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteDataPolicyRequest request = new DeleteDataPolicyRequest
{
    DataPolicyName = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]"),
};
// Make the request
await dataPolicyServiceClient.DeleteDataPolicyAsync(request);

DeleteDataPolicyAsync(DeleteDataPolicyRequest, CancellationToken)

public virtual Task DeleteDataPolicyAsync(DeleteDataPolicyRequest request, CancellationToken cancellationToken)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
requestDeleteDataPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteDataPolicyRequest request = new DeleteDataPolicyRequest
{
    DataPolicyName = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]"),
};
// Make the request
await dataPolicyServiceClient.DeleteDataPolicyAsync(request);

DeleteDataPolicyAsync(string, CallSettings)

public virtual Task DeleteDataPolicyAsync(string name, CallSettings callSettings = null)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
namestring

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataPolicies/[DATA_POLICY]";
// Make the request
await dataPolicyServiceClient.DeleteDataPolicyAsync(name);

DeleteDataPolicyAsync(string, CancellationToken)

public virtual Task DeleteDataPolicyAsync(string name, CancellationToken cancellationToken)

Deletes the data policy specified by its resource name.

Parameters
NameDescription
namestring

Required. Resource name of the data policy to delete. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataPolicies/[DATA_POLICY]";
// Make the request
await dataPolicyServiceClient.DeleteDataPolicyAsync(name);

GetDataPolicy(DataPolicyName, CallSettings)

public virtual DataPolicy GetDataPolicy(DataPolicyName name, CallSettings callSettings = null)

Gets the data policy specified by its resource name.

Parameters
NameDescription
nameDataPolicyName

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
DataPolicyName name = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]");
// Make the request
DataPolicy response = dataPolicyServiceClient.GetDataPolicy(name);

GetDataPolicy(GetDataPolicyRequest, CallSettings)

public virtual DataPolicy GetDataPolicy(GetDataPolicyRequest request, CallSettings callSettings = null)

Gets the data policy specified by its resource name.

Parameters
NameDescription
requestGetDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
GetDataPolicyRequest request = new GetDataPolicyRequest
{
    DataPolicyName = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]"),
};
// Make the request
DataPolicy response = dataPolicyServiceClient.GetDataPolicy(request);

GetDataPolicy(string, CallSettings)

public virtual DataPolicy GetDataPolicy(string name, CallSettings callSettings = null)

Gets the data policy specified by its resource name.

Parameters
NameDescription
namestring

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataPolicies/[DATA_POLICY]";
// Make the request
DataPolicy response = dataPolicyServiceClient.GetDataPolicy(name);

GetDataPolicyAsync(DataPolicyName, CallSettings)

public virtual Task<DataPolicy> GetDataPolicyAsync(DataPolicyName name, CallSettings callSettings = null)

Gets the data policy specified by its resource name.

Parameters
NameDescription
nameDataPolicyName

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DataPolicyName name = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]");
// Make the request
DataPolicy response = await dataPolicyServiceClient.GetDataPolicyAsync(name);

GetDataPolicyAsync(DataPolicyName, CancellationToken)

public virtual Task<DataPolicy> GetDataPolicyAsync(DataPolicyName name, CancellationToken cancellationToken)

Gets the data policy specified by its resource name.

Parameters
NameDescription
nameDataPolicyName

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DataPolicyName name = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]");
// Make the request
DataPolicy response = await dataPolicyServiceClient.GetDataPolicyAsync(name);

GetDataPolicyAsync(GetDataPolicyRequest, CallSettings)

public virtual Task<DataPolicy> GetDataPolicyAsync(GetDataPolicyRequest request, CallSettings callSettings = null)

Gets the data policy specified by its resource name.

Parameters
NameDescription
requestGetDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
GetDataPolicyRequest request = new GetDataPolicyRequest
{
    DataPolicyName = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]"),
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.GetDataPolicyAsync(request);

GetDataPolicyAsync(GetDataPolicyRequest, CancellationToken)

public virtual Task<DataPolicy> GetDataPolicyAsync(GetDataPolicyRequest request, CancellationToken cancellationToken)

Gets the data policy specified by its resource name.

Parameters
NameDescription
requestGetDataPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
GetDataPolicyRequest request = new GetDataPolicyRequest
{
    DataPolicyName = DataPolicyName.FromProjectLocationDataPolicy("[PROJECT]", "[LOCATION]", "[DATA_POLICY]"),
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.GetDataPolicyAsync(request);

GetDataPolicyAsync(string, CallSettings)

public virtual Task<DataPolicy> GetDataPolicyAsync(string name, CallSettings callSettings = null)

Gets the data policy specified by its resource name.

Parameters
NameDescription
namestring

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataPolicies/[DATA_POLICY]";
// Make the request
DataPolicy response = await dataPolicyServiceClient.GetDataPolicyAsync(name);

GetDataPolicyAsync(string, CancellationToken)

public virtual Task<DataPolicy> GetDataPolicyAsync(string name, CancellationToken cancellationToken)

Gets the data policy specified by its resource name.

Parameters
NameDescription
namestring

Required. Resource name of the requested data policy. Format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/dataPolicies/[DATA_POLICY]";
// Make the request
DataPolicy response = await dataPolicyServiceClient.GetDataPolicyAsync(name);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM policy for the specified data policy.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = dataPolicyServiceClient.GetIamPolicy(request);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Gets the IAM policy for the specified data policy.

Parameters
NameDescription
requestGetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await dataPolicyServiceClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Gets the IAM policy for the specified data policy.

Parameters
NameDescription
requestGetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await dataPolicyServiceClient.GetIamPolicyAsync(request);

ListDataPolicies(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListDataPoliciesResponse, DataPolicy> ListDataPolicies(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all of the data policies in the specified parent project.

Parameters
NameDescription
parentLocationName

Required. Resource name of the project for which to list data policies. Format is projects/{project_number}/locations/{location_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListDataPoliciesResponseDataPolicy

A pageable sequence of DataPolicy resources.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListDataPoliciesResponse, DataPolicy> response = dataPolicyServiceClient.ListDataPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (DataPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListDataPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<DataPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (DataPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListDataPolicies(ListDataPoliciesRequest, CallSettings)

public virtual PagedEnumerable<ListDataPoliciesResponse, DataPolicy> ListDataPolicies(ListDataPoliciesRequest request, CallSettings callSettings = null)

List all of the data policies in the specified parent project.

Parameters
NameDescription
requestListDataPoliciesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListDataPoliciesResponseDataPolicy

A pageable sequence of DataPolicy resources.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
ListDataPoliciesRequest request = new ListDataPoliciesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListDataPoliciesResponse, DataPolicy> response = dataPolicyServiceClient.ListDataPolicies(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (DataPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListDataPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<DataPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (DataPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListDataPolicies(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListDataPoliciesResponse, DataPolicy> ListDataPolicies(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all of the data policies in the specified parent project.

Parameters
NameDescription
parentstring

Required. Resource name of the project for which to list data policies. Format is projects/{project_number}/locations/{location_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListDataPoliciesResponseDataPolicy

A pageable sequence of DataPolicy resources.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListDataPoliciesResponse, DataPolicy> response = dataPolicyServiceClient.ListDataPolicies(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (DataPolicy item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListDataPoliciesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<DataPolicy> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (DataPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListDataPoliciesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListDataPoliciesResponse, DataPolicy> ListDataPoliciesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all of the data policies in the specified parent project.

Parameters
NameDescription
parentLocationName

Required. Resource name of the project for which to list data policies. Format is projects/{project_number}/locations/{location_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListDataPoliciesResponseDataPolicy

A pageable asynchronous sequence of DataPolicy resources.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListDataPoliciesResponse, DataPolicy> response = dataPolicyServiceClient.ListDataPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DataPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDataPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<DataPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (DataPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListDataPoliciesAsync(ListDataPoliciesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListDataPoliciesResponse, DataPolicy> ListDataPoliciesAsync(ListDataPoliciesRequest request, CallSettings callSettings = null)

List all of the data policies in the specified parent project.

Parameters
NameDescription
requestListDataPoliciesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListDataPoliciesResponseDataPolicy

A pageable asynchronous sequence of DataPolicy resources.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
ListDataPoliciesRequest request = new ListDataPoliciesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListDataPoliciesResponse, DataPolicy> response = dataPolicyServiceClient.ListDataPoliciesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DataPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDataPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<DataPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (DataPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListDataPoliciesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListDataPoliciesResponse, DataPolicy> ListDataPoliciesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List all of the data policies in the specified parent project.

Parameters
NameDescription
parentstring

Required. Resource name of the project for which to list data policies. Format is projects/{project_number}/locations/{location_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListDataPoliciesResponseDataPolicy

A pageable asynchronous sequence of DataPolicy resources.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListDataPoliciesResponse, DataPolicy> response = dataPolicyServiceClient.ListDataPoliciesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((DataPolicy item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDataPoliciesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (DataPolicy item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<DataPolicy> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (DataPolicy item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

RenameDataPolicy(RenameDataPolicyRequest, CallSettings)

public virtual DataPolicy RenameDataPolicy(RenameDataPolicyRequest request, CallSettings callSettings = null)

Renames the id (display name) of the specified data policy.

Parameters
NameDescription
requestRenameDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
RenameDataPolicyRequest request = new RenameDataPolicyRequest
{
    Name = "",
    NewDataPolicyId = "",
};
// Make the request
DataPolicy response = dataPolicyServiceClient.RenameDataPolicy(request);

RenameDataPolicy(string, string, CallSettings)

public virtual DataPolicy RenameDataPolicy(string name, string newDataPolicyId, CallSettings callSettings = null)

Renames the id (display name) of the specified data policy.

Parameters
NameDescription
namestring

Required. Resource name of the data policy to rename. The format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}

newDataPolicyIdstring

Required. The new data policy id.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
string name = "";
string newDataPolicyId = "";
// Make the request
DataPolicy response = dataPolicyServiceClient.RenameDataPolicy(name, newDataPolicyId);

RenameDataPolicyAsync(RenameDataPolicyRequest, CallSettings)

public virtual Task<DataPolicy> RenameDataPolicyAsync(RenameDataPolicyRequest request, CallSettings callSettings = null)

Renames the id (display name) of the specified data policy.

Parameters
NameDescription
requestRenameDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
RenameDataPolicyRequest request = new RenameDataPolicyRequest
{
    Name = "",
    NewDataPolicyId = "",
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.RenameDataPolicyAsync(request);

RenameDataPolicyAsync(RenameDataPolicyRequest, CancellationToken)

public virtual Task<DataPolicy> RenameDataPolicyAsync(RenameDataPolicyRequest request, CancellationToken cancellationToken)

Renames the id (display name) of the specified data policy.

Parameters
NameDescription
requestRenameDataPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
RenameDataPolicyRequest request = new RenameDataPolicyRequest
{
    Name = "",
    NewDataPolicyId = "",
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.RenameDataPolicyAsync(request);

RenameDataPolicyAsync(string, string, CallSettings)

public virtual Task<DataPolicy> RenameDataPolicyAsync(string name, string newDataPolicyId, CallSettings callSettings = null)

Renames the id (display name) of the specified data policy.

Parameters
NameDescription
namestring

Required. Resource name of the data policy to rename. The format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}

newDataPolicyIdstring

Required. The new data policy id.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
string newDataPolicyId = "";
// Make the request
DataPolicy response = await dataPolicyServiceClient.RenameDataPolicyAsync(name, newDataPolicyId);

RenameDataPolicyAsync(string, string, CancellationToken)

public virtual Task<DataPolicy> RenameDataPolicyAsync(string name, string newDataPolicyId, CancellationToken cancellationToken)

Renames the id (display name) of the specified data policy.

Parameters
NameDescription
namestring

Required. Resource name of the data policy to rename. The format is projects/{project_number}/locations/{location_id}/dataPolicies/{data_policy_id}

newDataPolicyIdstring

Required. The new data policy id.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "";
string newDataPolicyId = "";
// Make the request
DataPolicy response = await dataPolicyServiceClient.RenameDataPolicyAsync(name, newDataPolicyId);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM policy for the specified data policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = dataPolicyServiceClient.SetIamPolicy(request);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM policy for the specified data policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await dataPolicyServiceClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the IAM policy for the specified data policy.

Parameters
NameDescription
requestSetIamPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await dataPolicyServiceClient.SetIamPolicyAsync(request);

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.

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns the caller's permission on the specified data policy resource.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = dataPolicyServiceClient.TestIamPermissions(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns the caller's permission on the specified data policy resource.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await dataPolicyServiceClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns the caller's permission on the specified data policy resource.

Parameters
NameDescription
requestTestIamPermissionsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await dataPolicyServiceClient.TestIamPermissionsAsync(request);

UpdateDataPolicy(DataPolicy, FieldMask, CallSettings)

public virtual DataPolicy UpdateDataPolicy(DataPolicy dataPolicy, FieldMask updateMask, CallSettings callSettings = null)

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters
NameDescription
dataPolicyDataPolicy

Required. Update the data policy's metadata.

The target data policy is determined by the name field. Other fields are updated to the specified values based on the field masks.

updateMaskFieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update.

Updates to the name and dataPolicyId fields are not allowed.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
DataPolicy dataPolicy = new DataPolicy();
FieldMask updateMask = new FieldMask();
// Make the request
DataPolicy response = dataPolicyServiceClient.UpdateDataPolicy(dataPolicy, updateMask);

UpdateDataPolicy(UpdateDataPolicyRequest, CallSettings)

public virtual DataPolicy UpdateDataPolicy(UpdateDataPolicyRequest request, CallSettings callSettings = null)

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters
NameDescription
requestUpdateDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
DataPolicy

The RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = DataPolicyServiceClient.Create();
// Initialize request argument(s)
UpdateDataPolicyRequest request = new UpdateDataPolicyRequest
{
    DataPolicy = new DataPolicy(),
    UpdateMask = new FieldMask(),
};
// Make the request
DataPolicy response = dataPolicyServiceClient.UpdateDataPolicy(request);

UpdateDataPolicyAsync(DataPolicy, FieldMask, CallSettings)

public virtual Task<DataPolicy> UpdateDataPolicyAsync(DataPolicy dataPolicy, FieldMask updateMask, CallSettings callSettings = null)

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters
NameDescription
dataPolicyDataPolicy

Required. Update the data policy's metadata.

The target data policy is determined by the name field. Other fields are updated to the specified values based on the field masks.

updateMaskFieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update.

Updates to the name and dataPolicyId fields are not allowed.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DataPolicy dataPolicy = new DataPolicy();
FieldMask updateMask = new FieldMask();
// Make the request
DataPolicy response = await dataPolicyServiceClient.UpdateDataPolicyAsync(dataPolicy, updateMask);

UpdateDataPolicyAsync(DataPolicy, FieldMask, CancellationToken)

public virtual Task<DataPolicy> UpdateDataPolicyAsync(DataPolicy dataPolicy, FieldMask updateMask, CancellationToken cancellationToken)

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters
NameDescription
dataPolicyDataPolicy

Required. Update the data policy's metadata.

The target data policy is determined by the name field. Other fields are updated to the specified values based on the field masks.

updateMaskFieldMask

The update mask applies to the resource. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask If not set, defaults to all of the fields that are allowed to update.

Updates to the name and dataPolicyId fields are not allowed.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
DataPolicy dataPolicy = new DataPolicy();
FieldMask updateMask = new FieldMask();
// Make the request
DataPolicy response = await dataPolicyServiceClient.UpdateDataPolicyAsync(dataPolicy, updateMask);

UpdateDataPolicyAsync(UpdateDataPolicyRequest, CallSettings)

public virtual Task<DataPolicy> UpdateDataPolicyAsync(UpdateDataPolicyRequest request, CallSettings callSettings = null)

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters
NameDescription
requestUpdateDataPolicyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDataPolicyRequest request = new UpdateDataPolicyRequest
{
    DataPolicy = new DataPolicy(),
    UpdateMask = new FieldMask(),
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.UpdateDataPolicyAsync(request);

UpdateDataPolicyAsync(UpdateDataPolicyRequest, CancellationToken)

public virtual Task<DataPolicy> UpdateDataPolicyAsync(UpdateDataPolicyRequest request, CancellationToken cancellationToken)

Updates the metadata for an existing data policy. The target data policy can be specified by the resource name.

Parameters
NameDescription
requestUpdateDataPolicyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskDataPolicy

A Task containing the RPC response.

Example
// Create client
DataPolicyServiceClient dataPolicyServiceClient = await DataPolicyServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateDataPolicyRequest request = new UpdateDataPolicyRequest
{
    DataPolicy = new DataPolicy(),
    UpdateMask = new FieldMask(),
};
// Make the request
DataPolicy response = await dataPolicyServiceClient.UpdateDataPolicyAsync(request);