Class v1.StorageInsightsClient (0.1.1)

Service describing handlers for resources v1

Package

@google-cloud/storageinsights

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of StorageInsightsClient.

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 StorageInsightsClient({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;
    };

locationsClient

locationsClient: LocationsClient;

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.

storageInsightsStub

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

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.

createReportConfig(request, options)

createReportConfig(request?: protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest, options?: CallOptions): Promise<[
        protos.google.cloud.storageinsights.v1.IReportConfig,
        (protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest | undefined),
        {} | undefined
    ]>;

Creates a new ReportConfig in a given project and location.

Parameters
NameDescription
request ICreateReportConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.storageinsights.v1.IReportConfig, (protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest | 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. Value for parent.
   */
  // const parent = 'abc123'
  /**
   *  Required. The resource being created
   */
  // const reportConfig = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

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

    // Run request
    const response = await storageinsightsClient.createReportConfig(request);
    console.log(response);
  }

  callCreateReportConfig();

createReportConfig(request, options, callback)

createReportConfig(request: protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateReportConfigRequest
options CallOptions
callback Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createReportConfig(request, callback)

createReportConfig(request: protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest, callback: Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateReportConfigRequest
callback Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.ICreateReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteReportConfig(request, options)

deleteReportConfig(request?: protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest | undefined),
        {} | undefined
    ]>;

Deletes a single ReportConfig.

Parameters
NameDescription
request IDeleteReportConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest | 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. Name of the resource
   */
  // const name = 'abc123'
  /**
   *  Optional. If set, all ReportDetails for this ReportConfig will be deleted.
   */
  // const force = true
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

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

    // Run request
    const response = await storageinsightsClient.deleteReportConfig(request);
    console.log(response);
  }

  callDeleteReportConfig();

deleteReportConfig(request, options, callback)

deleteReportConfig(request: protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteReportConfigRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteReportConfig(request, callback)

deleteReportConfig(request: protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteReportConfigRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.cloud.storageinsights.v1.IDeleteReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getLocation(request, options, callback)

getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;

Gets information about a location.

Parameters
NameDescription
request LocationProtos.google.cloud.location.IGetLocationRequest

The request object that will be sent.

options CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>

Call options. See CallOptions for more details.

callback Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
Promise<google.cloud.location.ILocation>

{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

const [response] = await client.getLocation(request);

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

getReportConfig(request, options)

getReportConfig(request?: protos.google.cloud.storageinsights.v1.IGetReportConfigRequest, options?: CallOptions): Promise<[
        protos.google.cloud.storageinsights.v1.IReportConfig,
        (protos.google.cloud.storageinsights.v1.IGetReportConfigRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single ReportConfig.

Parameters
NameDescription
request IGetReportConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.storageinsights.v1.IReportConfig, (protos.google.cloud.storageinsights.v1.IGetReportConfigRequest | 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. Name of the resource
   */
  // const name = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

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

    // Run request
    const response = await storageinsightsClient.getReportConfig(request);
    console.log(response);
  }

  callGetReportConfig();

getReportConfig(request, options, callback)

getReportConfig(request: protos.google.cloud.storageinsights.v1.IGetReportConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IGetReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetReportConfigRequest
options CallOptions
callback Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IGetReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getReportConfig(request, callback)

getReportConfig(request: protos.google.cloud.storageinsights.v1.IGetReportConfigRequest, callback: Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IGetReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetReportConfigRequest
callback Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IGetReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getReportDetail(request, options)

getReportDetail(request?: protos.google.cloud.storageinsights.v1.IGetReportDetailRequest, options?: CallOptions): Promise<[
        protos.google.cloud.storageinsights.v1.IReportDetail,
        (protos.google.cloud.storageinsights.v1.IGetReportDetailRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single ReportDetail.

Parameters
NameDescription
request IGetReportDetailRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.storageinsights.v1.IReportDetail, (protos.google.cloud.storageinsights.v1.IGetReportDetailRequest | 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. Name of the resource
   */
  // const name = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

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

    // Run request
    const response = await storageinsightsClient.getReportDetail(request);
    console.log(response);
  }

  callGetReportDetail();

getReportDetail(request, options, callback)

getReportDetail(request: protos.google.cloud.storageinsights.v1.IGetReportDetailRequest, options: CallOptions, callback: Callback<protos.google.cloud.storageinsights.v1.IReportDetail, protos.google.cloud.storageinsights.v1.IGetReportDetailRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetReportDetailRequest
options CallOptions
callback Callback<protos.google.cloud.storageinsights.v1.IReportDetail, protos.google.cloud.storageinsights.v1.IGetReportDetailRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getReportDetail(request, callback)

getReportDetail(request: protos.google.cloud.storageinsights.v1.IGetReportDetailRequest, callback: Callback<protos.google.cloud.storageinsights.v1.IReportDetail, protos.google.cloud.storageinsights.v1.IGetReportDetailRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetReportDetailRequest
callback Callback<protos.google.cloud.storageinsights.v1.IReportDetail, protos.google.cloud.storageinsights.v1.IGetReportDetailRequest | 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.

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

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

Parameters
NameDescription
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<google.cloud.location.ILocation>

{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

const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
  // process response
}

listReportConfigs(request, options)

listReportConfigs(request?: protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.storageinsights.v1.IReportConfig[],
        protos.google.cloud.storageinsights.v1.IListReportConfigsRequest | null,
        protos.google.cloud.storageinsights.v1.IListReportConfigsResponse
    ]>;

Lists ReportConfigs in a given project and location.

Parameters
NameDescription
request IListReportConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.storageinsights.v1.IReportConfig[], protos.google.cloud.storageinsights.v1.IListReportConfigsRequest | null, protos.google.cloud.storageinsights.v1.IListReportConfigsResponse ]>

{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 listReportConfigsAsync() 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.

listReportConfigs(request, options, callback)

listReportConfigs(request: protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, protos.google.cloud.storageinsights.v1.IListReportConfigsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportConfig>): void;
Parameters
NameDescription
request IListReportConfigsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, protos.google.cloud.storageinsights.v1.IListReportConfigsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportConfig>
Returns
TypeDescription
void

listReportConfigs(request, callback)

listReportConfigs(request: protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, callback: PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, protos.google.cloud.storageinsights.v1.IListReportConfigsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportConfig>): void;
Parameters
NameDescription
request IListReportConfigsRequest
callback PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, protos.google.cloud.storageinsights.v1.IListReportConfigsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportConfig>
Returns
TypeDescription
void

listReportConfigsAsync(request, options)

listReportConfigsAsync(request?: protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.storageinsights.v1.IReportConfig>;

Equivalent to listReportConfigs, but returns an iterable object.

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

Parameters
NameDescription
request IListReportConfigsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.storageinsights.v1.IReportConfig>

{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. Parent value for ListReportConfigsRequest
   */
  // const parent = 'abc123'
  /**
   *  Requested page size. Server may return fewer items than requested.
   *  If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Filtering results
   */
  // const filter = 'abc123'
  /**
   *  Hint for how to order the results
   */
  // const orderBy = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

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

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

  callListReportConfigs();

listReportConfigsStream(request, options)

listReportConfigsStream(request?: protos.google.cloud.storageinsights.v1.IListReportConfigsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListReportConfigsRequest

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 listReportConfigsAsync() 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.

listReportDetails(request, options)

listReportDetails(request?: protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.storageinsights.v1.IReportDetail[],
        protos.google.cloud.storageinsights.v1.IListReportDetailsRequest | null,
        protos.google.cloud.storageinsights.v1.IListReportDetailsResponse
    ]>;

Lists ReportDetails in a given project and location.

Parameters
NameDescription
request IListReportDetailsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.storageinsights.v1.IReportDetail[], protos.google.cloud.storageinsights.v1.IListReportDetailsRequest | null, protos.google.cloud.storageinsights.v1.IListReportDetailsResponse ]>

{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 listReportDetailsAsync() 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.

listReportDetails(request, options, callback)

listReportDetails(request: protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, protos.google.cloud.storageinsights.v1.IListReportDetailsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportDetail>): void;
Parameters
NameDescription
request IListReportDetailsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, protos.google.cloud.storageinsights.v1.IListReportDetailsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportDetail>
Returns
TypeDescription
void

listReportDetails(request, callback)

listReportDetails(request: protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, callback: PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, protos.google.cloud.storageinsights.v1.IListReportDetailsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportDetail>): void;
Parameters
NameDescription
request IListReportDetailsRequest
callback PaginationCallback<protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, protos.google.cloud.storageinsights.v1.IListReportDetailsResponse | null | undefined, protos.google.cloud.storageinsights.v1.IReportDetail>
Returns
TypeDescription
void

listReportDetailsAsync(request, options)

listReportDetailsAsync(request?: protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.storageinsights.v1.IReportDetail>;

Equivalent to listReportDetails, but returns an iterable object.

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

Parameters
NameDescription
request IListReportDetailsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.storageinsights.v1.IReportDetail>

{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. Parent value for ListReportDetailsRequest
   */
  // const parent = 'abc123'
  /**
   *  Requested page size. Server may return fewer items than requested.
   *  If unspecified, server will pick an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  A token identifying a page of results the server should return.
   */
  // const pageToken = 'abc123'
  /**
   *  Filtering results
   */
  // const filter = 'abc123'
  /**
   *  Hint for how to order the results
   */
  // const orderBy = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

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

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

  callListReportDetails();

listReportDetailsStream(request, options)

listReportDetailsStream(request?: protos.google.cloud.storageinsights.v1.IListReportDetailsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListReportDetailsRequest

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 listReportDetailsAsync() 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.

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.

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.

matchLocationFromReportConfigName(reportConfigName)

matchLocationFromReportConfigName(reportConfigName: string): string | number;

Parse the location from ReportConfig resource.

Parameter
NameDescription
reportConfigName string

A fully-qualified path representing ReportConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromReportDetailName(reportDetailName)

matchLocationFromReportDetailName(reportDetailName: string): string | number;

Parse the location from ReportDetail resource.

Parameter
NameDescription
reportDetailName string

A fully-qualified path representing ReportDetail resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

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.

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.

matchProjectFromReportConfigName(reportConfigName)

matchProjectFromReportConfigName(reportConfigName: string): string | number;

Parse the project from ReportConfig resource.

Parameter
NameDescription
reportConfigName string

A fully-qualified path representing ReportConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromReportDetailName(reportDetailName)

matchProjectFromReportDetailName(reportDetailName: string): string | number;

Parse the project from ReportDetail resource.

Parameter
NameDescription
reportDetailName string

A fully-qualified path representing ReportDetail resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchReportConfigFromReportConfigName(reportConfigName)

matchReportConfigFromReportConfigName(reportConfigName: string): string | number;

Parse the report_config from ReportConfig resource.

Parameter
NameDescription
reportConfigName string

A fully-qualified path representing ReportConfig resource.

Returns
TypeDescription
string | number

{string} A string representing the report_config.

matchReportConfigFromReportDetailName(reportDetailName)

matchReportConfigFromReportDetailName(reportDetailName: string): string | number;

Parse the report_config from ReportDetail resource.

Parameter
NameDescription
reportDetailName string

A fully-qualified path representing ReportDetail resource.

Returns
TypeDescription
string | number

{string} A string representing the report_config.

matchReportDetailFromReportDetailName(reportDetailName)

matchReportDetailFromReportDetailName(reportDetailName: string): string | number;

Parse the report_detail from ReportDetail resource.

Parameter
NameDescription
reportDetailName string

A fully-qualified path representing ReportDetail resource.

Returns
TypeDescription
string | number

{string} A string representing the report_detail.

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.

reportConfigPath(project, location, reportConfig)

reportConfigPath(project: string, location: string, reportConfig: string): string;

Return a fully-qualified reportConfig resource name string.

Parameters
NameDescription
project string
location string
reportConfig string
Returns
TypeDescription
string

{string} Resource name string.

reportDetailPath(project, location, reportConfig, reportDetail)

reportDetailPath(project: string, location: string, reportConfig: string, reportDetail: string): string;

Return a fully-qualified reportDetail resource name string.

Parameters
NameDescription
project string
location string
reportConfig string
reportDetail string
Returns
TypeDescription
string

{string} Resource name string.

updateReportConfig(request, options)

updateReportConfig(request?: protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest, options?: CallOptions): Promise<[
        protos.google.cloud.storageinsights.v1.IReportConfig,
        (protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest | undefined),
        {} | undefined
    ]>;

Updates the parameters of a single ReportConfig.

Parameters
NameDescription
request IUpdateReportConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.storageinsights.v1.IReportConfig, (protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest | 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. Field mask is used to specify the fields to be overwritten in the
   *  ReportConfig resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The resource being updated
   */
  // const reportConfig = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Storageinsights library
  const {StorageInsightsClient} = require('@google-cloud/storageinsights').v1;

  // Instantiates a client
  const storageinsightsClient = new StorageInsightsClient();

  async function callUpdateReportConfig() {
    // Construct request
    const request = {
      updateMask,
      reportConfig,
    };

    // Run request
    const response = await storageinsightsClient.updateReportConfig(request);
    console.log(response);
  }

  callUpdateReportConfig();

updateReportConfig(request, options, callback)

updateReportConfig(request: protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateReportConfigRequest
options CallOptions
callback Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateReportConfig(request, callback)

updateReportConfig(request: protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest, callback: Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateReportConfigRequest
callback Callback<protos.google.cloud.storageinsights.v1.IReportConfig, protos.google.cloud.storageinsights.v1.IUpdateReportConfigRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void