Class v1p4beta1.AssetServiceClient (5.5.0)

Asset service definition. v1p4beta1

Package

@google-cloud/asset

Constructors

(constructor)(opts)

constructor(opts?: ClientOptions);

Construct an instance of AssetServiceClient.

Parameter
NameDescription
opts ClientOptions

Properties

apiEndpoint

static get apiEndpoint(): string;

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

assetServiceStub

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

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

analyzeIamPolicy(request, options)

analyzeIamPolicy(request?: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse,
        protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Analyzes IAM policies based on the specified request. Returns a list of matching the request.

Parameters
NameDescription
request IAnalyzeIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing [AnalyzeIamPolicyResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The request query.
   */
  // const analysisQuery = {}
  /**
   *  Optional. The request options.
   */
  // const options = {}

  // Imports the Asset library
  const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1;

  // Instantiates a client
  const assetClient = new AssetServiceClient();

  async function callAnalyzeIamPolicy() {
    // Construct request
    const request = {
      analysisQuery,
    };

    // Run request
    const response = await assetClient.analyzeIamPolicy(request);
    console.log(response);
  }

  callAnalyzeIamPolicy();

analyzeIamPolicy(request, options, callback)

analyzeIamPolicy(request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IAnalyzeIamPolicyRequest
options CallOptions
callback Callback<protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

analyzeIamPolicy(request, callback)

analyzeIamPolicy(request: protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest, callback: Callback<protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IAnalyzeIamPolicyRequest
callback Callback<protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyResponse, protos.google.cloud.asset.v1p4beta1.IAnalyzeIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

checkExportIamPolicyAnalysisProgress(name)

checkExportIamPolicyAnalysisProgress(name: string): Promise<LROperation<protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest>>;

Check the status of the long running operation returned by exportIamPolicyAnalysis().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.ExportIamPolicyAnalysisRequest>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The request query.
   */
  // const analysisQuery = {}
  /**
   *  Optional. The request options.
   */
  // const options = {}
  /**
   *  Required. Output configuration indicating where the results will be output to.
   */
  // const outputConfig = {}

  // Imports the Asset library
  const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1;

  // Instantiates a client
  const assetClient = new AssetServiceClient();

  async function callExportIamPolicyAnalysis() {
    // Construct request
    const request = {
      analysisQuery,
      outputConfig,
    };

    // Run request
    const [operation] = await assetClient.exportIamPolicyAnalysis(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportIamPolicyAnalysis();

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.

exportIamPolicyAnalysis(request, options)

exportIamPolicyAnalysis(request?: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Exports IAM policy analysis based on the specified request. This API implements the API allowing you to keep track of the export. The metadata contains the request to help callers to map responses to requests.

Parameters
NameDescription
request IExportIamPolicyAnalysisRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) for more details and examples.

Example

  /**
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The request query.
   */
  // const analysisQuery = {}
  /**
   *  Optional. The request options.
   */
  // const options = {}
  /**
   *  Required. Output configuration indicating where the results will be output to.
   */
  // const outputConfig = {}

  // Imports the Asset library
  const {AssetServiceClient} = require('@google-cloud/asset').v1p4beta1;

  // Instantiates a client
  const assetClient = new AssetServiceClient();

  async function callExportIamPolicyAnalysis() {
    // Construct request
    const request = {
      analysisQuery,
      outputConfig,
    };

    // Run request
    const [operation] = await assetClient.exportIamPolicyAnalysis(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callExportIamPolicyAnalysis();

exportIamPolicyAnalysis(request, options, callback)

exportIamPolicyAnalysis(request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IExportIamPolicyAnalysisRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

exportIamPolicyAnalysis(request, callback)

exportIamPolicyAnalysis(request: protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest, callback: Callback<LROperation<protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IExportIamPolicyAnalysisRequest
callback Callback<LROperation<protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisResponse, protos.google.cloud.asset.v1p4beta1.IExportIamPolicyAnalysisRequest>, protos.google.longrunning.IOperation | 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

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.