Class v1.KeyTrackingServiceClient (0.1.1)

Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK. v1

Package

@google-cloud/kms-inventory

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of KeyTrackingServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.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 KeyTrackingServiceClient({fallback: 'rest'}, 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;
    };

keyTrackingServiceStub

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

pathTemplates

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

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.

cryptoKeyPath(project, location, keyRing, cryptoKey)

cryptoKeyPath(project: string, location: string, keyRing: string, cryptoKey: string): string;

Return a fully-qualified cryptoKey resource name string.

Parameters
NameDescription
project string
location string
keyRing string
cryptoKey string
Returns
TypeDescription
string

{string} Resource name string.

cryptoKeyVersionPath(project, location, keyRing, cryptoKey, cryptoKeyVersion)

cryptoKeyVersionPath(project: string, location: string, keyRing: string, cryptoKey: string, cryptoKeyVersion: string): string;

Return a fully-qualified cryptoKeyVersion resource name string.

Parameters
NameDescription
project string
location string
keyRing string
cryptoKey string
cryptoKeyVersion string
Returns
TypeDescription
string

{string} Resource name string.

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

getProtectedResourcesSummary(request, options)

getProtectedResourcesSummary(request?: protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest, options?: CallOptions): Promise<[
        protos.google.cloud.kms.inventory.v1.IProtectedResourcesSummary,
        (protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest | undefined),
        {} | undefined
    ]>;

Returns aggregate information about the resources protected by the given Cloud KMS . Only resources within the same Cloud organization as the key will be returned. The project that holds the key must be part of an organization in order for this call to succeed.

Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.kms.inventory.v1.IProtectedResourcesSummary, (protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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. The resource name of the
   *  CryptoKey google.cloud.kms.v1.CryptoKey.
   */
  // const name = 'abc123'

  // Imports the Inventory library
  const {KeyTrackingServiceClient} = require('@google-cloud/kms-inventory').v1;

  // Instantiates a client
  const inventoryClient = new KeyTrackingServiceClient();

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

    // Run request
    const response = await inventoryClient.getProtectedResourcesSummary(request);
    console.log(response);
  }

  callGetProtectedResourcesSummary();

getProtectedResourcesSummary(request, options, callback)

getProtectedResourcesSummary(request: protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest, options: CallOptions, callback: Callback<protos.google.cloud.kms.inventory.v1.IProtectedResourcesSummary, protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest
options CallOptions
callback Callback<protos.google.cloud.kms.inventory.v1.IProtectedResourcesSummary, protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProtectedResourcesSummary(request, callback)

getProtectedResourcesSummary(request: protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest, callback: Callback<protos.google.cloud.kms.inventory.v1.IProtectedResourcesSummary, protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest
callback Callback<protos.google.cloud.kms.inventory.v1.IProtectedResourcesSummary, protos.google.cloud.kms.inventory.v1.IGetProtectedResourcesSummaryRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

importJobPath(project, location, keyRing, importJob)

importJobPath(project: string, location: string, keyRing: string, importJob: string): string;

Return a fully-qualified importJob resource name string.

Parameters
NameDescription
project string
location string
keyRing string
importJob string
Returns
TypeDescription
string

{string} Resource name string.

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.

keyRingPath(project, location, keyRing)

keyRingPath(project: string, location: string, keyRing: string): string;

Return a fully-qualified keyRing resource name string.

Parameters
NameDescription
project string
location string
keyRing string
Returns
TypeDescription
string

{string} Resource name string.

matchCryptoKeyFromCryptoKeyName(cryptoKeyName)

matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the crypto_key from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key.

matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName)

matchCryptoKeyFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;

Parse the crypto_key from CryptoKeyVersion resource.

Parameter
NameDescription
cryptoKeyVersionName string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key.

matchCryptoKeyFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName)

matchCryptoKeyFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName: string): string | number;

Parse the crypto_key from ProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_crypto_key_version_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key.

matchCryptoKeyFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName)

matchCryptoKeyFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName: string): string | number;

Parse the crypto_key from ProjectLocationKeyRingCryptoKeyProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key.

matchCryptoKeyFromPublicKeyName(publicKeyName)

matchCryptoKeyFromPublicKeyName(publicKeyName: string): string | number;

Parse the crypto_key from PublicKey resource.

Parameter
NameDescription
publicKeyName string

A fully-qualified path representing PublicKey resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key.

matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName)

matchCryptoKeyVersionFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;

Parse the crypto_key_version from CryptoKeyVersion resource.

Parameter
NameDescription
cryptoKeyVersionName string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key_version.

matchCryptoKeyVersionFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName)

matchCryptoKeyVersionFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName: string): string | number;

Parse the crypto_key_version from ProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_crypto_key_version_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key_version.

matchCryptoKeyVersionFromPublicKeyName(publicKeyName)

matchCryptoKeyVersionFromPublicKeyName(publicKeyName: string): string | number;

Parse the crypto_key_version from PublicKey resource.

Parameter
NameDescription
publicKeyName string

A fully-qualified path representing PublicKey resource.

Returns
TypeDescription
string | number

{string} A string representing the crypto_key_version.

matchImportJobFromImportJobName(importJobName)

matchImportJobFromImportJobName(importJobName: string): string | number;

Parse the import_job from ImportJob resource.

Parameter
NameDescription
importJobName string

A fully-qualified path representing ImportJob resource.

Returns
TypeDescription
string | number

{string} A string representing the import_job.

matchKeyRingFromCryptoKeyName(cryptoKeyName)

matchKeyRingFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the key_ring from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName)

matchKeyRingFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;

Parse the key_ring from CryptoKeyVersion resource.

Parameter
NameDescription
cryptoKeyVersionName string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchKeyRingFromImportJobName(importJobName)

matchKeyRingFromImportJobName(importJobName: string): string | number;

Parse the key_ring from ImportJob resource.

Parameter
NameDescription
importJobName string

A fully-qualified path representing ImportJob resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchKeyRingFromKeyRingName(keyRingName)

matchKeyRingFromKeyRingName(keyRingName: string): string | number;

Parse the key_ring from KeyRing resource.

Parameter
NameDescription
keyRingName string

A fully-qualified path representing KeyRing resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchKeyRingFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName)

matchKeyRingFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName: string): string | number;

Parse the key_ring from ProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_crypto_key_version_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchKeyRingFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName)

matchKeyRingFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName: string): string | number;

Parse the key_ring from ProjectLocationKeyRingCryptoKeyProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchKeyRingFromPublicKeyName(publicKeyName)

matchKeyRingFromPublicKeyName(publicKeyName: string): string | number;

Parse the key_ring from PublicKey resource.

Parameter
NameDescription
publicKeyName string

A fully-qualified path representing PublicKey resource.

Returns
TypeDescription
string | number

{string} A string representing the key_ring.

matchLocationFromCryptoKeyName(cryptoKeyName)

matchLocationFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the location from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName)

matchLocationFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;

Parse the location from CryptoKeyVersion resource.

Parameter
NameDescription
cryptoKeyVersionName string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromImportJobName(importJobName)

matchLocationFromImportJobName(importJobName: string): string | number;

Parse the location from ImportJob resource.

Parameter
NameDescription
importJobName string

A fully-qualified path representing ImportJob resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromKeyRingName(keyRingName)

matchLocationFromKeyRingName(keyRingName: string): string | number;

Parse the location from KeyRing resource.

Parameter
NameDescription
keyRingName string

A fully-qualified path representing KeyRing resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName)

matchLocationFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName: string): string | number;

Parse the location from ProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_crypto_key_version_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName)

matchLocationFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName: string): string | number;

Parse the location from ProjectLocationKeyRingCryptoKeyProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromPublicKeyName(publicKeyName)

matchLocationFromPublicKeyName(publicKeyName: string): string | number;

Parse the location from PublicKey resource.

Parameter
NameDescription
publicKeyName string

A fully-qualified path representing PublicKey resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchOrganizationFromOrganizationName(organizationName)

matchOrganizationFromOrganizationName(organizationName: string): string | number;

Parse the organization from Organization resource.

Parameter
NameDescription
organizationName string

A fully-qualified path representing Organization resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchProjectFromCryptoKeyName(cryptoKeyName)

matchProjectFromCryptoKeyName(cryptoKeyName: string): string | number;

Parse the project from CryptoKey resource.

Parameter
NameDescription
cryptoKeyName string

A fully-qualified path representing CryptoKey resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName)

matchProjectFromCryptoKeyVersionName(cryptoKeyVersionName: string): string | number;

Parse the project from CryptoKeyVersion resource.

Parameter
NameDescription
cryptoKeyVersionName string

A fully-qualified path representing CryptoKeyVersion resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromImportJobName(importJobName)

matchProjectFromImportJobName(importJobName: string): string | number;

Parse the project from ImportJob resource.

Parameter
NameDescription
importJobName string

A fully-qualified path representing ImportJob resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromKeyRingName(keyRingName)

matchProjectFromKeyRingName(keyRingName: string): string | number;

Parse the project from KeyRing resource.

Parameter
NameDescription
keyRingName string

A fully-qualified path representing KeyRing resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName)

matchProjectFromProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName: string): string | number;

Parse the project from ProjectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_crypto_key_version_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName)

matchProjectFromProjectLocationKeyRingCryptoKeyProtectedResourcesSummaryName(projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName: string): string | number;

Parse the project from ProjectLocationKeyRingCryptoKeyProtectedResourcesSummary resource.

Parameter
NameDescription
projectLocationKeyRingCryptoKeyProtectedResourcesSummaryName string

A fully-qualified path representing project_location_key_ring_crypto_key_protectedResourcesSummary resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromPublicKeyName(publicKeyName)

matchProjectFromPublicKeyName(publicKeyName: string): string | number;

Parse the project from PublicKey resource.

Parameter
NameDescription
publicKeyName string

A fully-qualified path representing PublicKey resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

organizationPath(organization)

organizationPath(organization: string): string;

Return a fully-qualified organization resource name string.

Parameter
NameDescription
organization string
Returns
TypeDescription
string

{string} Resource name string.

projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryPath(project, location, keyRing, cryptoKey, cryptoKeyVersion)

projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummaryPath(project: string, location: string, keyRing: string, cryptoKey: string, cryptoKeyVersion: string): string;

Return a fully-qualified projectLocationKeyRingCryptoKeyCryptoKeyVersionProtectedResourcesSummary resource name string.

Parameters
NameDescription
project string
location string
keyRing string
cryptoKey string
cryptoKeyVersion string
Returns
TypeDescription
string

{string} Resource name string.

projectLocationKeyRingCryptoKeyProtectedResourcesSummaryPath(project, location, keyRing, cryptoKey)

projectLocationKeyRingCryptoKeyProtectedResourcesSummaryPath(project: string, location: string, keyRing: string, cryptoKey: string): string;

Return a fully-qualified projectLocationKeyRingCryptoKeyProtectedResourcesSummary resource name string.

Parameters
NameDescription
project string
location string
keyRing string
cryptoKey string
Returns
TypeDescription
string

{string} Resource name string.

publicKeyPath(project, location, keyRing, cryptoKey, cryptoKeyVersion)

publicKeyPath(project: string, location: string, keyRing: string, cryptoKey: string, cryptoKeyVersion: string): string;

Return a fully-qualified publicKey resource name string.

Parameters
NameDescription
project string
location string
keyRing string
cryptoKey string
cryptoKeyVersion string
Returns
TypeDescription
string

{string} Resource name string.

searchProtectedResources(request, options)

searchProtectedResources(request?: protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.kms.inventory.v1.IProtectedResource[],
        protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest | null,
        protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesResponse
    ]>;

Returns metadata about the resources protected by the given Cloud KMS in the given Cloud organization.

Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.kms.inventory.v1.IProtectedResource[], protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest | null, protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using searchProtectedResourcesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

searchProtectedResources(request, options, callback)

searchProtectedResources(request: protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesResponse | null | undefined, protos.google.cloud.kms.inventory.v1.IProtectedResource>): void;
Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesResponse | null | undefined, protos.google.cloud.kms.inventory.v1.IProtectedResource>
Returns
TypeDescription
void

searchProtectedResources(request, callback)

searchProtectedResources(request: protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, callback: PaginationCallback<protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesResponse | null | undefined, protos.google.cloud.kms.inventory.v1.IProtectedResource>): void;
Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest
callback PaginationCallback<protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesResponse | null | undefined, protos.google.cloud.kms.inventory.v1.IProtectedResource>
Returns
TypeDescription
void

searchProtectedResourcesAsync(request, options)

searchProtectedResourcesAsync(request?: protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.kms.inventory.v1.IProtectedResource>;

Equivalent to searchProtectedResources, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.kms.inventory.v1.IProtectedResource>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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 organization.
   *  Example: organizations/123
   */
  // const scope = 'abc123'
  /**
   *  Required. The resource name of the
   *  CryptoKey google.cloud.kms.v1.CryptoKey.
   */
  // const cryptoKey = 'abc123'
  /**
   *  The maximum number of resources to return. The service may return fewer
   *  than this value.
   *  If unspecified, at most 500 resources will be returned.
   *  The maximum value is 500; values above 500 will be coerced to 500.
   */
  // const pageSize = 1234
  /**
   *  A page token, received from a previous
   *  KeyTrackingService.SearchProtectedResources google.cloud.kms.inventory.v1.KeyTrackingService.SearchProtectedResources 
   *  call. Provide this to retrieve the subsequent page.
   *  When paginating, all other parameters provided to
   *  KeyTrackingService.SearchProtectedResources google.cloud.kms.inventory.v1.KeyTrackingService.SearchProtectedResources 
   *  must match the call that provided the page token.
   */
  // const pageToken = 'abc123'

  // Imports the Inventory library
  const {KeyTrackingServiceClient} = require('@google-cloud/kms-inventory').v1;

  // Instantiates a client
  const inventoryClient = new KeyTrackingServiceClient();

  async function callSearchProtectedResources() {
    // Construct request
    const request = {
      scope,
      cryptoKey,
    };

    // Run request
    const iterable = await inventoryClient.searchProtectedResourcesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callSearchProtectedResources();

searchProtectedResourcesStream(request, options)

searchProtectedResourcesStream(request?: protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request protos.google.cloud.kms.inventory.v1.ISearchProtectedResourcesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using searchProtectedResourcesAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.