Data Catalog v1 API - Class PolicyTagManagerSerializationClient (2.8.0)

public abstract class PolicyTagManagerSerializationClient

Reference documentation and code samples for the Data Catalog v1 API class PolicyTagManagerSerializationClient.

PolicyTagManagerSerialization client wrapper, for convenient use.

Inheritance

object > PolicyTagManagerSerializationClient

Namespace

Google.Cloud.DataCatalog.V1

Assembly

Google.Cloud.DataCatalog.V1.dll

Remarks

Policy Tag Manager Serialization API service allows you to manipulate your policy tags and taxonomies in a serialized format.

Taxonomy is a hierarchical group of policy tags.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default PolicyTagManagerSerialization scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

The default PolicyTagManagerSerialization scopes are:

GrpcClient

public virtual PolicyTagManagerSerialization.PolicyTagManagerSerializationClient GrpcClient { get; }

The underlying gRPC PolicyTagManagerSerialization client

Property Value
TypeDescription
PolicyTagManagerSerializationPolicyTagManagerSerializationClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
TypeDescription
IAMPolicyClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static PolicyTagManagerSerializationClient Create()

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

Returns
TypeDescription
PolicyTagManagerSerializationClient

The created PolicyTagManagerSerializationClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskPolicyTagManagerSerializationClient

The task representing the created PolicyTagManagerSerializationClient.

ExportTaxonomies(ExportTaxonomiesRequest, CallSettings)

public virtual ExportTaxonomiesResponse ExportTaxonomies(ExportTaxonomiesRequest request, CallSettings callSettings = null)

Exports taxonomies in the requested type and returns them, including their policy tags. The requested taxonomies must belong to the same project.

This method generates SerializedTaxonomy protocol buffers with nested policy tags that can be used as input for ImportTaxonomies calls.

Parameters
NameDescription
requestExportTaxonomiesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ExportTaxonomiesResponse

The RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.Create();
// Initialize request argument(s)
ExportTaxonomiesRequest request = new ExportTaxonomiesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    TaxonomiesAsTaxonomyNames =
    {
        TaxonomyName.FromProjectLocationTaxonomy("[PROJECT]", "[LOCATION]", "[TAXONOMY]"),
    },
    SerializedTaxonomies = false,
};
// Make the request
ExportTaxonomiesResponse response = policyTagManagerSerializationClient.ExportTaxonomies(request);

ExportTaxonomiesAsync(ExportTaxonomiesRequest, CallSettings)

public virtual Task<ExportTaxonomiesResponse> ExportTaxonomiesAsync(ExportTaxonomiesRequest request, CallSettings callSettings = null)

Exports taxonomies in the requested type and returns them, including their policy tags. The requested taxonomies must belong to the same project.

This method generates SerializedTaxonomy protocol buffers with nested policy tags that can be used as input for ImportTaxonomies calls.

Parameters
NameDescription
requestExportTaxonomiesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskExportTaxonomiesResponse

A Task containing the RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = await PolicyTagManagerSerializationClient.CreateAsync();
// Initialize request argument(s)
ExportTaxonomiesRequest request = new ExportTaxonomiesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    TaxonomiesAsTaxonomyNames =
    {
        TaxonomyName.FromProjectLocationTaxonomy("[PROJECT]", "[LOCATION]", "[TAXONOMY]"),
    },
    SerializedTaxonomies = false,
};
// Make the request
ExportTaxonomiesResponse response = await policyTagManagerSerializationClient.ExportTaxonomiesAsync(request);

ExportTaxonomiesAsync(ExportTaxonomiesRequest, CancellationToken)

public virtual Task<ExportTaxonomiesResponse> ExportTaxonomiesAsync(ExportTaxonomiesRequest request, CancellationToken cancellationToken)

Exports taxonomies in the requested type and returns them, including their policy tags. The requested taxonomies must belong to the same project.

This method generates SerializedTaxonomy protocol buffers with nested policy tags that can be used as input for ImportTaxonomies calls.

Parameters
NameDescription
requestExportTaxonomiesRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskExportTaxonomiesResponse

A Task containing the RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = await PolicyTagManagerSerializationClient.CreateAsync();
// Initialize request argument(s)
ExportTaxonomiesRequest request = new ExportTaxonomiesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    TaxonomiesAsTaxonomyNames =
    {
        TaxonomyName.FromProjectLocationTaxonomy("[PROJECT]", "[LOCATION]", "[TAXONOMY]"),
    },
    SerializedTaxonomies = false,
};
// Make the request
ExportTaxonomiesResponse response = await policyTagManagerSerializationClient.ExportTaxonomiesAsync(request);

ImportTaxonomies(ImportTaxonomiesRequest, CallSettings)

public virtual ImportTaxonomiesResponse ImportTaxonomies(ImportTaxonomiesRequest request, CallSettings callSettings = null)

Creates new taxonomies (including their policy tags) in a given project by importing from inlined or cross-regional sources.

For a cross-regional source, new taxonomies are created by copying from a source in another region.

For an inlined source, taxonomies and policy tags are created in bulk using nested protocol buffer structures.

Parameters
NameDescription
requestImportTaxonomiesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
ImportTaxonomiesResponse

The RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.Create();
// Initialize request argument(s)
ImportTaxonomiesRequest request = new ImportTaxonomiesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    InlineSource = new InlineSource(),
};
// Make the request
ImportTaxonomiesResponse response = policyTagManagerSerializationClient.ImportTaxonomies(request);

ImportTaxonomiesAsync(ImportTaxonomiesRequest, CallSettings)

public virtual Task<ImportTaxonomiesResponse> ImportTaxonomiesAsync(ImportTaxonomiesRequest request, CallSettings callSettings = null)

Creates new taxonomies (including their policy tags) in a given project by importing from inlined or cross-regional sources.

For a cross-regional source, new taxonomies are created by copying from a source in another region.

For an inlined source, taxonomies and policy tags are created in bulk using nested protocol buffer structures.

Parameters
NameDescription
requestImportTaxonomiesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskImportTaxonomiesResponse

A Task containing the RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = await PolicyTagManagerSerializationClient.CreateAsync();
// Initialize request argument(s)
ImportTaxonomiesRequest request = new ImportTaxonomiesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    InlineSource = new InlineSource(),
};
// Make the request
ImportTaxonomiesResponse response = await policyTagManagerSerializationClient.ImportTaxonomiesAsync(request);

ImportTaxonomiesAsync(ImportTaxonomiesRequest, CancellationToken)

public virtual Task<ImportTaxonomiesResponse> ImportTaxonomiesAsync(ImportTaxonomiesRequest request, CancellationToken cancellationToken)

Creates new taxonomies (including their policy tags) in a given project by importing from inlined or cross-regional sources.

For a cross-regional source, new taxonomies are created by copying from a source in another region.

For an inlined source, taxonomies and policy tags are created in bulk using nested protocol buffer structures.

Parameters
NameDescription
requestImportTaxonomiesRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskImportTaxonomiesResponse

A Task containing the RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = await PolicyTagManagerSerializationClient.CreateAsync();
// Initialize request argument(s)
ImportTaxonomiesRequest request = new ImportTaxonomiesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    InlineSource = new InlineSource(),
};
// Make the request
ImportTaxonomiesResponse response = await policyTagManagerSerializationClient.ImportTaxonomiesAsync(request);

ReplaceTaxonomy(ReplaceTaxonomyRequest, CallSettings)

public virtual Taxonomy ReplaceTaxonomy(ReplaceTaxonomyRequest request, CallSettings callSettings = null)

Replaces (updates) a taxonomy and all its policy tags.

The taxonomy and its entire hierarchy of policy tags must be represented literally by SerializedTaxonomy and the nested SerializedPolicyTag messages.

This operation automatically does the following:

  • Deletes the existing policy tags that are missing from the SerializedPolicyTag.
  • Creates policy tags that don't have resource names. They are considered new.
  • Updates policy tags with valid resources names accordingly.
Parameters
NameDescription
requestReplaceTaxonomyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Taxonomy

The RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = PolicyTagManagerSerializationClient.Create();
// Initialize request argument(s)
ReplaceTaxonomyRequest request = new ReplaceTaxonomyRequest
{
    TaxonomyName = TaxonomyName.FromProjectLocationTaxonomy("[PROJECT]", "[LOCATION]", "[TAXONOMY]"),
    SerializedTaxonomy = new SerializedTaxonomy(),
};
// Make the request
Taxonomy response = policyTagManagerSerializationClient.ReplaceTaxonomy(request);

ReplaceTaxonomyAsync(ReplaceTaxonomyRequest, CallSettings)

public virtual Task<Taxonomy> ReplaceTaxonomyAsync(ReplaceTaxonomyRequest request, CallSettings callSettings = null)

Replaces (updates) a taxonomy and all its policy tags.

The taxonomy and its entire hierarchy of policy tags must be represented literally by SerializedTaxonomy and the nested SerializedPolicyTag messages.

This operation automatically does the following:

  • Deletes the existing policy tags that are missing from the SerializedPolicyTag.
  • Creates policy tags that don't have resource names. They are considered new.
  • Updates policy tags with valid resources names accordingly.
Parameters
NameDescription
requestReplaceTaxonomyRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTaxonomy

A Task containing the RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = await PolicyTagManagerSerializationClient.CreateAsync();
// Initialize request argument(s)
ReplaceTaxonomyRequest request = new ReplaceTaxonomyRequest
{
    TaxonomyName = TaxonomyName.FromProjectLocationTaxonomy("[PROJECT]", "[LOCATION]", "[TAXONOMY]"),
    SerializedTaxonomy = new SerializedTaxonomy(),
};
// Make the request
Taxonomy response = await policyTagManagerSerializationClient.ReplaceTaxonomyAsync(request);

ReplaceTaxonomyAsync(ReplaceTaxonomyRequest, CancellationToken)

public virtual Task<Taxonomy> ReplaceTaxonomyAsync(ReplaceTaxonomyRequest request, CancellationToken cancellationToken)

Replaces (updates) a taxonomy and all its policy tags.

The taxonomy and its entire hierarchy of policy tags must be represented literally by SerializedTaxonomy and the nested SerializedPolicyTag messages.

This operation automatically does the following:

  • Deletes the existing policy tags that are missing from the SerializedPolicyTag.
  • Creates policy tags that don't have resource names. They are considered new.
  • Updates policy tags with valid resources names accordingly.
Parameters
NameDescription
requestReplaceTaxonomyRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTaxonomy

A Task containing the RPC response.

Example
// Create client
PolicyTagManagerSerializationClient policyTagManagerSerializationClient = await PolicyTagManagerSerializationClient.CreateAsync();
// Initialize request argument(s)
ReplaceTaxonomyRequest request = new ReplaceTaxonomyRequest
{
    TaxonomyName = TaxonomyName.FromProjectLocationTaxonomy("[PROJECT]", "[LOCATION]", "[TAXONOMY]"),
    SerializedTaxonomy = new SerializedTaxonomy(),
};
// Make the request
Taxonomy response = await policyTagManagerSerializationClient.ReplaceTaxonomyAsync(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.