Class v1.PolicyTagManagerSerializationClient (4.1.1)

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

Package

@google-cloud/datacatalog

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of PolicyTagManagerSerializationClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new PolicyTagManagerSerializationClient({fallback: true}, gax); ```

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

policyTagManagerSerializationStub

policyTagManagerSerializationStub?: Promise<{
        [name: string]: Function;
    }>;

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

entryGroupPath(project, location, entryGroup)

entryGroupPath(project: string, location: string, entryGroup: string): string;

Return a fully-qualified entryGroup resource name string.

Parameters
NameDescription
project string
location string
entryGroup string
Returns
TypeDescription
string

{string} Resource name string.

entryPath(project, location, entryGroup, entry)

entryPath(project: string, location: string, entryGroup: string, entry: string): string;

Return a fully-qualified entry resource name string.

Parameters
NameDescription
project string
location string
entryGroup string
entry string
Returns
TypeDescription
string

{string} Resource name string.

exportTaxonomies(request, options)

exportTaxonomies(request?: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse,
        protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | undefined,
        {} | undefined
    ]>;

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
request IExportTaxonomiesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ExportTaxonomiesResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the project that the exported taxonomies belong
   *  to.
   */
  // const parent = 'abc123'
  /**
   *  Required. Resource names of the taxonomies to export.
   */
  // const taxonomies = ['abc','def']
  /**
   *  Serialized export taxonomies that contain all the policy
   *  tags as nested protocol buffers.
   */
  // const serializedTaxonomies = true

  // Imports the Datacatalog library
  const {PolicyTagManagerSerializationClient} = require('@google-cloud/datacatalog').v1;

  // Instantiates a client
  const datacatalogClient = new PolicyTagManagerSerializationClient();

  async function callExportTaxonomies() {
    // Construct request
    const request = {
      parent,
      taxonomies,
    };

    // Run request
    const response = await datacatalogClient.exportTaxonomies(request);
    console.log(response);
  }

  callExportTaxonomies();

exportTaxonomies(request, options, callback)

exportTaxonomies(request: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, options: CallOptions, callback: Callback<protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IExportTaxonomiesRequest
options CallOptions
callback Callback<protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

exportTaxonomies(request, callback)

exportTaxonomies(request: protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest, callback: Callback<protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IExportTaxonomiesRequest
callback Callback<protos.google.cloud.datacatalog.v1.IExportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IExportTaxonomiesRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

importTaxonomies(request, options)

importTaxonomies(request?: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse,
        protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | undefined,
        {} | undefined
    ]>;

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
request IImportTaxonomiesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ImportTaxonomiesResponse. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of project that the imported taxonomies will belong
   *  to.
   */
  // const parent = 'abc123'
  /**
   *  Inline source taxonomy to import.
   */
  // const inlineSource = {}
  /**
   *  Cross-regional source taxonomy to import.
   */
  // const crossRegionalSource = {}

  // Imports the Datacatalog library
  const {PolicyTagManagerSerializationClient} = require('@google-cloud/datacatalog').v1;

  // Instantiates a client
  const datacatalogClient = new PolicyTagManagerSerializationClient();

  async function callImportTaxonomies() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const response = await datacatalogClient.importTaxonomies(request);
    console.log(response);
  }

  callImportTaxonomies();

importTaxonomies(request, options, callback)

importTaxonomies(request: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, options: CallOptions, callback: Callback<protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IImportTaxonomiesRequest
options CallOptions
callback Callback<protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importTaxonomies(request, callback)

importTaxonomies(request: protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest, callback: Callback<protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IImportTaxonomiesRequest
callback Callback<protos.google.cloud.datacatalog.v1.IImportTaxonomiesResponse, protos.google.cloud.datacatalog.v1.IImportTaxonomiesRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchEntryFromEntryName(entryName)

matchEntryFromEntryName(entryName: string): string | number;

Parse the entry from Entry resource.

Parameter
NameDescription
entryName string

A fully-qualified path representing Entry resource.

Returns
TypeDescription
string | number

{string} A string representing the entry.

matchEntryFromTagName(tagName)

matchEntryFromTagName(tagName: string): string | number;

Parse the entry from Tag resource.

Parameter
NameDescription
tagName string

A fully-qualified path representing Tag resource.

Returns
TypeDescription
string | number

{string} A string representing the entry.

matchEntryGroupFromEntryGroupName(entryGroupName)

matchEntryGroupFromEntryGroupName(entryGroupName: string): string | number;

Parse the entry_group from EntryGroup resource.

Parameter
NameDescription
entryGroupName string

A fully-qualified path representing EntryGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the entry_group.

matchEntryGroupFromEntryName(entryName)

matchEntryGroupFromEntryName(entryName: string): string | number;

Parse the entry_group from Entry resource.

Parameter
NameDescription
entryName string

A fully-qualified path representing Entry resource.

Returns
TypeDescription
string | number

{string} A string representing the entry_group.

matchEntryGroupFromTagName(tagName)

matchEntryGroupFromTagName(tagName: string): string | number;

Parse the entry_group from Tag resource.

Parameter
NameDescription
tagName string

A fully-qualified path representing Tag resource.

Returns
TypeDescription
string | number

{string} A string representing the entry_group.

matchFieldFromTagTemplateFieldName(tagTemplateFieldName)

matchFieldFromTagTemplateFieldName(tagTemplateFieldName: string): string | number;

Parse the field from TagTemplateField resource.

Parameter
NameDescription
tagTemplateFieldName string

A fully-qualified path representing TagTemplateField resource.

Returns
TypeDescription
string | number

{string} A string representing the field.

matchLocationFromEntryGroupName(entryGroupName)

matchLocationFromEntryGroupName(entryGroupName: string): string | number;

Parse the location from EntryGroup resource.

Parameter
NameDescription
entryGroupName string

A fully-qualified path representing EntryGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromEntryName(entryName)

matchLocationFromEntryName(entryName: string): string | number;

Parse the location from Entry resource.

Parameter
NameDescription
entryName string

A fully-qualified path representing Entry resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromPolicyTagName(policyTagName)

matchLocationFromPolicyTagName(policyTagName: string): string | number;

Parse the location from PolicyTag resource.

Parameter
NameDescription
policyTagName string

A fully-qualified path representing PolicyTag resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromTagName(tagName)

matchLocationFromTagName(tagName: string): string | number;

Parse the location from Tag resource.

Parameter
NameDescription
tagName string

A fully-qualified path representing Tag resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromTagTemplateFieldName(tagTemplateFieldName)

matchLocationFromTagTemplateFieldName(tagTemplateFieldName: string): string | number;

Parse the location from TagTemplateField resource.

Parameter
NameDescription
tagTemplateFieldName string

A fully-qualified path representing TagTemplateField resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromTagTemplateName(tagTemplateName)

matchLocationFromTagTemplateName(tagTemplateName: string): string | number;

Parse the location from TagTemplate resource.

Parameter
NameDescription
tagTemplateName string

A fully-qualified path representing TagTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromTaxonomyName(taxonomyName)

matchLocationFromTaxonomyName(taxonomyName: string): string | number;

Parse the location from Taxonomy resource.

Parameter
NameDescription
taxonomyName string

A fully-qualified path representing Taxonomy resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchPolicyTagFromPolicyTagName(policyTagName)

matchPolicyTagFromPolicyTagName(policyTagName: string): string | number;

Parse the policy_tag from PolicyTag resource.

Parameter
NameDescription
policyTagName string

A fully-qualified path representing PolicyTag resource.

Returns
TypeDescription
string | number

{string} A string representing the policy_tag.

matchProjectFromEntryGroupName(entryGroupName)

matchProjectFromEntryGroupName(entryGroupName: string): string | number;

Parse the project from EntryGroup resource.

Parameter
NameDescription
entryGroupName string

A fully-qualified path representing EntryGroup resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromEntryName(entryName)

matchProjectFromEntryName(entryName: string): string | number;

Parse the project from Entry resource.

Parameter
NameDescription
entryName string

A fully-qualified path representing Entry resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromPolicyTagName(policyTagName)

matchProjectFromPolicyTagName(policyTagName: string): string | number;

Parse the project from PolicyTag resource.

Parameter
NameDescription
policyTagName string

A fully-qualified path representing PolicyTag resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromTagName(tagName)

matchProjectFromTagName(tagName: string): string | number;

Parse the project from Tag resource.

Parameter
NameDescription
tagName string

A fully-qualified path representing Tag resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromTagTemplateFieldName(tagTemplateFieldName)

matchProjectFromTagTemplateFieldName(tagTemplateFieldName: string): string | number;

Parse the project from TagTemplateField resource.

Parameter
NameDescription
tagTemplateFieldName string

A fully-qualified path representing TagTemplateField resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromTagTemplateName(tagTemplateName)

matchProjectFromTagTemplateName(tagTemplateName: string): string | number;

Parse the project from TagTemplate resource.

Parameter
NameDescription
tagTemplateName string

A fully-qualified path representing TagTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromTaxonomyName(taxonomyName)

matchProjectFromTaxonomyName(taxonomyName: string): string | number;

Parse the project from Taxonomy resource.

Parameter
NameDescription
taxonomyName string

A fully-qualified path representing Taxonomy resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchTagFromTagName(tagName)

matchTagFromTagName(tagName: string): string | number;

Parse the tag from Tag resource.

Parameter
NameDescription
tagName string

A fully-qualified path representing Tag resource.

Returns
TypeDescription
string | number

{string} A string representing the tag.

matchTagTemplateFromTagTemplateFieldName(tagTemplateFieldName)

matchTagTemplateFromTagTemplateFieldName(tagTemplateFieldName: string): string | number;

Parse the tag_template from TagTemplateField resource.

Parameter
NameDescription
tagTemplateFieldName string

A fully-qualified path representing TagTemplateField resource.

Returns
TypeDescription
string | number

{string} A string representing the tag_template.

matchTagTemplateFromTagTemplateName(tagTemplateName)

matchTagTemplateFromTagTemplateName(tagTemplateName: string): string | number;

Parse the tag_template from TagTemplate resource.

Parameter
NameDescription
tagTemplateName string

A fully-qualified path representing TagTemplate resource.

Returns
TypeDescription
string | number

{string} A string representing the tag_template.

matchTaxonomyFromPolicyTagName(policyTagName)

matchTaxonomyFromPolicyTagName(policyTagName: string): string | number;

Parse the taxonomy from PolicyTag resource.

Parameter
NameDescription
policyTagName string

A fully-qualified path representing PolicyTag resource.

Returns
TypeDescription
string | number

{string} A string representing the taxonomy.

matchTaxonomyFromTaxonomyName(taxonomyName)

matchTaxonomyFromTaxonomyName(taxonomyName: string): string | number;

Parse the taxonomy from Taxonomy resource.

Parameter
NameDescription
taxonomyName string

A fully-qualified path representing Taxonomy resource.

Returns
TypeDescription
string | number

{string} A string representing the taxonomy.

policyTagPath(project, location, taxonomy, policyTag)

policyTagPath(project: string, location: string, taxonomy: string, policyTag: string): string;

Return a fully-qualified policyTag resource name string.

Parameters
NameDescription
project string
location string
taxonomy string
policyTag string
Returns
TypeDescription
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

replaceTaxonomy(request, options)

replaceTaxonomy(request?: protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest, options?: CallOptions): Promise<[
        protos.google.cloud.datacatalog.v1.ITaxonomy,
        protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest | undefined,
        {} | undefined
    ]>;

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
request IReplaceTaxonomyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.datacatalog.v1.ITaxonomy, protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Resource name of the taxonomy to update.
   */
  // const name = 'abc123'
  /**
   *  Required. Taxonomy to update along with its child policy tags.
   */
  // const serializedTaxonomy = {}

  // Imports the Datacatalog library
  const {PolicyTagManagerSerializationClient} = require('@google-cloud/datacatalog').v1;

  // Instantiates a client
  const datacatalogClient = new PolicyTagManagerSerializationClient();

  async function callReplaceTaxonomy() {
    // Construct request
    const request = {
      name,
      serializedTaxonomy,
    };

    // Run request
    const response = await datacatalogClient.replaceTaxonomy(request);
    console.log(response);
  }

  callReplaceTaxonomy();

replaceTaxonomy(request, options, callback)

replaceTaxonomy(request: protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest, options: CallOptions, callback: Callback<protos.google.cloud.datacatalog.v1.ITaxonomy, protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IReplaceTaxonomyRequest
options CallOptions
callback Callback<protos.google.cloud.datacatalog.v1.ITaxonomy, protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

replaceTaxonomy(request, callback)

replaceTaxonomy(request: protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest, callback: Callback<protos.google.cloud.datacatalog.v1.ITaxonomy, protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IReplaceTaxonomyRequest
callback Callback<protos.google.cloud.datacatalog.v1.ITaxonomy, protos.google.cloud.datacatalog.v1.IReplaceTaxonomyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

tagPath(project, location, entryGroup, entry, tag)

tagPath(project: string, location: string, entryGroup: string, entry: string, tag: string): string;

Return a fully-qualified tag resource name string.

Parameters
NameDescription
project string
location string
entryGroup string
entry string
tag string
Returns
TypeDescription
string

{string} Resource name string.

tagTemplateFieldPath(project, location, tagTemplate, field)

tagTemplateFieldPath(project: string, location: string, tagTemplate: string, field: string): string;

Return a fully-qualified tagTemplateField resource name string.

Parameters
NameDescription
project string
location string
tagTemplate string
field string
Returns
TypeDescription
string

{string} Resource name string.

tagTemplatePath(project, location, tagTemplate)

tagTemplatePath(project: string, location: string, tagTemplate: string): string;

Return a fully-qualified tagTemplate resource name string.

Parameters
NameDescription
project string
location string
tagTemplate string
Returns
TypeDescription
string

{string} Resource name string.

taxonomyPath(project, location, taxonomy)

taxonomyPath(project: string, location: string, taxonomy: string): string;

Return a fully-qualified taxonomy resource name string.

Parameters
NameDescription
project string
location string
taxonomy string
Returns
TypeDescription
string

{string} Resource name string.