BigQuery Data Policy v1beta1 API - Class DataPolicyServiceClient (1.0.0-beta03)

public abstract class DataPolicyServiceClient

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

DataPolicyService client wrapper, for convenient use.

Inheritance

object > DataPolicyServiceClient

Namespace

Google.Cloud.BigQuery.DataPolicies.V1Beta1

Assembly

Google.Cloud.BigQuery.DataPolicies.V1Beta1.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
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default DataPolicyService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual DataPolicyService.DataPolicyServiceClient GrpcClient { get; }

The underlying gRPC DataPolicyService client

Property Value
Type Description
DataPolicyServiceDataPolicyServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
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
Type Description
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
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
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
Name Description
parent LocationName

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

dataPolicy DataPolicy

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request CreateDataPolicyRequest

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
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
Name Description
parent string

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

dataPolicy DataPolicy

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent LocationName

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

dataPolicy DataPolicy

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent LocationName

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

dataPolicy DataPolicy

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
request CreateDataPolicyRequest

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
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
Name Description
request CreateDataPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
parent string

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

dataPolicy DataPolicy

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent string

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

dataPolicy DataPolicy

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
name DataPolicyName

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

callSettings CallSettings

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
Name Description
request DeleteDataPolicyRequest

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

callSettings CallSettings

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
Name Description
name string

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

callSettings CallSettings

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
Name Description
name DataPolicyName

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name DataPolicyName

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
request DeleteDataPolicyRequest

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
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
Name Description
request DeleteDataPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
name string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name string

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
name DataPolicyName

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request GetDataPolicyRequest

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
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
Name Description
name string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name DataPolicyName

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name DataPolicyName

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
request GetDataPolicyRequest

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
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
Name Description
request GetDataPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
name string

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
name string

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
request GetIamPolicyRequest

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
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
Name Description
request GetIamPolicyRequest

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
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
Name Description
request GetIamPolicyRequest

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
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
Name Description
parent LocationName

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

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request ListDataPoliciesRequest

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
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]"),
};
// 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
Name Description
parent string

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

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
parent LocationName

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

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request ListDataPoliciesRequest

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
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]"),
};
// 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
Name Description
parent string

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

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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;

SetIamPolicy(SetIamPolicyRequest, CallSettings)

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

Sets the IAM policy for the specified data policy.

Parameters
Name Description
request SetIamPolicyRequest

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
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
Name Description
request SetIamPolicyRequest

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
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
Name Description
request SetIamPolicyRequest

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

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

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

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

Parameters
Name Description
request TestIamPermissionsRequest

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
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
Name Description
request TestIamPermissionsRequest

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
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
Name Description
request TestIamPermissionsRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
dataPolicy DataPolicy

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.

updateMask FieldMask

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
request UpdateDataPolicyRequest

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
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
Name Description
dataPolicy DataPolicy

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.

updateMask FieldMask

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
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
Name Description
dataPolicy DataPolicy

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.

updateMask FieldMask

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.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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
Name Description
request UpdateDataPolicyRequest

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
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
Name Description
request UpdateDataPolicyRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
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);