Class PolicyTagManagerSerializationClient (1.2.0)

public abstract 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 clients to manipulate their policy tags and taxonomies in serialized format, where 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
IReadOnlyList<String>
Remarks

The default PolicyTagManagerSerialization scopes are:

GrpcClient

public virtual PolicyTagManagerSerialization.PolicyTagManagerSerializationClient GrpcClient { get; }

The underlying gRPC PolicyTagManagerSerialization client

Property Value
TypeDescription
PolicyTagManagerSerialization.PolicyTagManagerSerializationClient

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(CancellationToken))

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
Task<PolicyTagManagerSerializationClient>

The task representing the created PolicyTagManagerSerializationClient.

ExportTaxonomies(ExportTaxonomiesRequest, CallSettings)

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

Exports taxonomies as the requested type and returns the taxonomies including their policy tags. The requested taxonomies must belong to one project.

SerializedTaxonomy protos with nested policy tags that are generated by this method can be used as input for future 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 as the requested type and returns the taxonomies including their policy tags. The requested taxonomies must belong to one project.

SerializedTaxonomy protos with nested policy tags that are generated by this method can be used as input for future 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
Task<ExportTaxonomiesResponse>

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 as the requested type and returns the taxonomies including their policy tags. The requested taxonomies must belong to one project.

SerializedTaxonomy protos with nested policy tags that are generated by this method can be used as input for future 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
Task<ExportTaxonomiesResponse>

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) by importing from inlined source or cross-regional source. New taxonomies will be created in a given parent project.

If using the cross-regional source, a new taxonomy is created by copying from a source in another region.

If using the inlined source, this method provides a way to bulk create taxonomies and policy tags using nested proto structure.

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) by importing from inlined source or cross-regional source. New taxonomies will be created in a given parent project.

If using the cross-regional source, a new taxonomy is created by copying from a source in another region.

If using the inlined source, this method provides a way to bulk create taxonomies and policy tags using nested proto structure.

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
Task<ImportTaxonomiesResponse>

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) by importing from inlined source or cross-regional source. New taxonomies will be created in a given parent project.

If using the cross-regional source, a new taxonomy is created by copying from a source in another region.

If using the inlined source, this method provides a way to bulk create taxonomies and policy tags using nested proto structure.

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
Task<ImportTaxonomiesResponse>

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);

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.