Class v2.StorageControlClient (0.7.0)

StorageControl service includes selected control plane operations. v2

Package

@google-cloud/storage-control

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of StorageControlClient.

Parameters
Name Description
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 StorageControlClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

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.

storageControlStub

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

universeDomain

get universeDomain(): string;

warn

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

Methods

anywhereCachePath(project, bucket, anywhereCache)

anywhereCachePath(project: string, bucket: string, anywhereCache: string): string;

Return a fully-qualified anywhereCache resource name string.

Parameters
Name Description
project string
bucket string
anywhereCache string
Returns
Type Description
string

{string} Resource name string.

bucketPath(project, bucket)

bucketPath(project: string, bucket: string): string;

Return a fully-qualified bucket resource name string.

Parameters
Name Description
project string
bucket string
Returns
Type Description
string

{string} Resource name string.

cancelOperation(request, optionsOrCallback, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
Name Description
request CancelOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkCreateAnywhereCacheProgress(name)

checkCreateAnywhereCacheProgress(name: string): Promise<LROperation<protos.google.storage.control.v2.AnywhereCache, protos.google.storage.control.v2.CreateAnywhereCacheMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.storage.control.v2.AnywhereCache, protos.google.storage.control.v2.CreateAnywhereCacheMetadata>>

{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 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 bucket to which this cache belongs.
   *  Format: `projects/{project}/buckets/{bucket}`
   */
  // const parent = 'abc123'
  /**
   *  Required. Properties of the Anywhere Cache instance being created.
   *  The parent bucket name is specified in the `parent` field. Server uses the
   *  default value of `ttl` or `admission_policy` if not specified in
   *  request.
   */
  // const anywhereCache = {}
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callCreateAnywhereCache();

checkRenameFolderProgress(name)

checkRenameFolderProgress(name: string): Promise<LROperation<protos.google.storage.control.v2.Folder, protos.google.storage.control.v2.RenameFolderMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.storage.control.v2.Folder, protos.google.storage.control.v2.RenameFolderMetadata>>

{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 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 source folder being renamed.
   *  Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
   */
  // const name = 'abc123'
  /**
   *  Required. The destination folder ID, e.g. `foo/bar/`.
   */
  // const destinationFolderId = 'abc123'
  /**
   *  Makes the operation only succeed conditional on whether the source
   *  folder's current metageneration matches the given value.
   */
  // const ifMetagenerationMatch = 1234
  /**
   *  Makes the operation only succeed conditional on whether the source
   *  folder's current metageneration does not match the given value.
   */
  // const ifMetagenerationNotMatch = 1234
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callRenameFolder();

checkUpdateAnywhereCacheProgress(name)

checkUpdateAnywhereCacheProgress(name: string): Promise<LROperation<protos.google.storage.control.v2.AnywhereCache, protos.google.storage.control.v2.UpdateAnywhereCacheMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.storage.control.v2.AnywhereCache, protos.google.storage.control.v2.UpdateAnywhereCacheMetadata>>

{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 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 Anywhere Cache instance to be updated.
   */
  // const anywhereCache = {}
  /**
   *  Required. List of fields to be updated. Mutable fields of AnywhereCache
   *  include `ttl` and `admission_policy`.
   *  To specify ALL fields, specify a single field with the value `*`. Note: We
   *  recommend against doing this. If a new field is introduced at a later time,
   *  an older client updating with the `*` may accidentally reset the new
   *  field's value.
   *  Not specifying any fields is an error.
   */
  // const updateMask = {}
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callUpdateAnywhereCache() {
    // Construct request
    const request = {
      anywhereCache,
      updateMask,
    };

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

  callUpdateAnywhereCache();

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
Type Description
Promise<void>

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

createAnywhereCache(request, options)

createAnywhereCache(request?: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates an Anywhere Cache instance.

Parameters
Name Description
request ICreateAnywhereCacheRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, 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 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 bucket to which this cache belongs.
   *  Format: `projects/{project}/buckets/{bucket}`
   */
  // const parent = 'abc123'
  /**
   *  Required. Properties of the Anywhere Cache instance being created.
   *  The parent bucket name is specified in the `parent` field. Server uses the
   *  default value of `ttl` or `admission_policy` if not specified in
   *  request.
   */
  // const anywhereCache = {}
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callCreateAnywhereCache();

createAnywhereCache(request, options, callback)

createAnywhereCache(request: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, options: CallOptions, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateAnywhereCacheRequest
options CallOptions
callback Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createAnywhereCache(request, callback)

createAnywhereCache(request: protos.google.storage.control.v2.ICreateAnywhereCacheRequest, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateAnywhereCacheRequest
callback Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.ICreateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createFolder(request, options)

createFolder(request?: protos.google.storage.control.v2.ICreateFolderRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IFolder,
        protos.google.storage.control.v2.ICreateFolderRequest | undefined,
        {} | undefined
    ]>;

Creates a new folder. This operation is only applicable to a hierarchical namespace enabled bucket.

Parameters
Name Description
request ICreateFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Folder. 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. Name of the bucket in which the folder will reside. The bucket
   *  must be a hierarchical namespace enabled bucket.
   */
  // const parent = 'abc123'
  /**
   *  Required. Properties of the new folder being created.
   *  The bucket and name of the folder are specified in the parent and folder_id
   *  fields, respectively. Populating those fields in `folder` will result in an
   *  error.
   */
  // const folder = {}
  /**
   *  Required. The full name of a folder, including all its parent folders.
   *  Folders use single '/' characters as a delimiter.
   *  The folder_id must end with a slash.
   *  For example, the folder_id of "books/biographies/" would create a new
   *  "biographies/" folder under the "books/" folder.
   */
  // const folderId = 'abc123'
  /**
   *  Optional. If true, parent folder doesn't have to be present and all missing
   *  ancestor folders will be created atomically.
   */
  // const recursive = true
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callCreateFolder() {
    // Construct request
    const request = {
      parent,
      folder,
      folderId,
    };

    // Run request
    const response = await controlClient.createFolder(request);
    console.log(response);
  }

  callCreateFolder();

createFolder(request, options, callback)

createFolder(request: protos.google.storage.control.v2.ICreateFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateFolderRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createFolder(request, callback)

createFolder(request: protos.google.storage.control.v2.ICreateFolderRequest, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateFolderRequest
callback Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.ICreateFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createManagedFolder(request, options)

createManagedFolder(request?: protos.google.storage.control.v2.ICreateManagedFolderRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IManagedFolder,
        protos.google.storage.control.v2.ICreateManagedFolderRequest | undefined,
        {} | undefined
    ]>;

Creates a new managed folder.

Parameters
Name Description
request ICreateManagedFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ManagedFolder. 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. Name of the bucket this managed folder belongs to.
   */
  // const parent = 'abc123'
  /**
   *  Required. Properties of the managed folder being created.
   *  The bucket and managed folder names are specified in the `parent` and
   *  `managed_folder_id` fields. Populating these fields in `managed_folder`
   *  will result in an error.
   */
  // const managedFolder = {}
  /**
   *  Required. The name of the managed folder. It uses a single `/` as delimiter
   *  and leading and trailing `/` are allowed.
   */
  // const managedFolderId = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callCreateManagedFolder() {
    // Construct request
    const request = {
      parent,
      managedFolder,
      managedFolderId,
    };

    // Run request
    const response = await controlClient.createManagedFolder(request);
    console.log(response);
  }

  callCreateManagedFolder();

createManagedFolder(request, options, callback)

createManagedFolder(request: protos.google.storage.control.v2.ICreateManagedFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateManagedFolderRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createManagedFolder(request, callback)

createManagedFolder(request: protos.google.storage.control.v2.ICreateManagedFolderRequest, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateManagedFolderRequest
callback Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.ICreateManagedFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteFolder(request, options)

deleteFolder(request?: protos.google.storage.control.v2.IDeleteFolderRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.storage.control.v2.IDeleteFolderRequest | undefined,
        {} | undefined
    ]>;

Permanently deletes an empty folder. This operation is only applicable to a hierarchical namespace enabled bucket.

Parameters
Name Description
request IDeleteFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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. Name of the folder.
   *  Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
   */
  // const name = 'abc123'
  /**
   *  Makes the operation only succeed conditional on whether the folder's
   *  current metageneration matches the given value.
   */
  // const ifMetagenerationMatch = 1234
  /**
   *  Makes the operation only succeed conditional on whether the folder's
   *  current metageneration does not match the given value.
   */
  // const ifMetagenerationNotMatch = 1234
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.deleteFolder(request);
    console.log(response);
  }

  callDeleteFolder();

deleteFolder(request, options, callback)

deleteFolder(request: protos.google.storage.control.v2.IDeleteFolderRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteFolderRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteFolder(request, callback)

deleteFolder(request: protos.google.storage.control.v2.IDeleteFolderRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteFolderRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteManagedFolder(request, options)

deleteManagedFolder(request?: protos.google.storage.control.v2.IDeleteManagedFolderRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.storage.control.v2.IDeleteManagedFolderRequest | undefined,
        {} | undefined
    ]>;

Permanently deletes an empty managed folder.

Parameters
Name Description
request IDeleteManagedFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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. Name of the managed folder.
   *  Format:
   *  `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
   */
  // const name = 'abc123'
  /**
   *  The operation succeeds conditional on the managed folder's current
   *  metageneration matching the value here specified.
   */
  // const ifMetagenerationMatch = 1234
  /**
   *  The operation succeeds conditional on the managed folder's current
   *  metageneration NOT matching the value here specified.
   */
  // const ifMetagenerationNotMatch = 1234
  /**
   *  Allows deletion of a managed folder even if it is not empty.
   *  A managed folder is empty if it manages no child managed folders or
   *  objects. Caller must have permission for
   *  storage.managedFolders.setIamPolicy.
   */
  // const allowNonEmpty = true
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.deleteManagedFolder(request);
    console.log(response);
  }

  callDeleteManagedFolder();

deleteManagedFolder(request, options, callback)

deleteManagedFolder(request: protos.google.storage.control.v2.IDeleteManagedFolderRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteManagedFolderRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteManagedFolder(request, callback)

deleteManagedFolder(request: protos.google.storage.control.v2.IDeleteManagedFolderRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteManagedFolderRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.storage.control.v2.IDeleteManagedFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteOperation(request, optionsOrCallback, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request DeleteOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

disableAnywhereCache(request, options)

disableAnywhereCache(request?: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IAnywhereCache,
        protos.google.storage.control.v2.IDisableAnywhereCacheRequest | undefined,
        {} | undefined
    ]>;

Disables an Anywhere Cache instance. A disabled instance is read-only. The disablement could be revoked by calling ResumeAnywhereCache. The cache instance will be deleted automatically if it remains in the disabled state for at least one hour.

Parameters
Name Description
request IDisableAnywhereCacheRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AnywhereCache. 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. The name field in the request should be:
   *  `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
   */
  // const name = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.disableAnywhereCache(request);
    console.log(response);
  }

  callDisableAnywhereCache();

disableAnywhereCache(request, options, callback)

disableAnywhereCache(request: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDisableAnywhereCacheRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

disableAnywhereCache(request, callback)

disableAnywhereCache(request: protos.google.storage.control.v2.IDisableAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDisableAnywhereCacheRequest
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IDisableAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

folderLocationIntelligenceConfigPath(folder, location)

folderLocationIntelligenceConfigPath(folder: string, location: string): string;

Return a fully-qualified folderLocationIntelligenceConfig resource name string.

Parameters
Name Description
folder string
location string
Returns
Type Description
string

{string} Resource name string.

folderPath(project, bucket, folder)

folderPath(project: string, bucket: string, folder: string): string;

Return a fully-qualified folder resource name string.

Parameters
Name Description
project string
bucket string
folder string
Returns
Type Description
string

{string} Resource name string.

getAnywhereCache(request, options)

getAnywhereCache(request?: protos.google.storage.control.v2.IGetAnywhereCacheRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IAnywhereCache,
        protos.google.storage.control.v2.IGetAnywhereCacheRequest | undefined,
        {} | undefined
    ]>;

Gets an Anywhere Cache instance.

Parameters
Name Description
request IGetAnywhereCacheRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AnywhereCache. 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. The name field in the request should be:
   *  `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
   */
  // const name = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getAnywhereCache(request);
    console.log(response);
  }

  callGetAnywhereCache();

getAnywhereCache(request, options, callback)

getAnywhereCache(request: protos.google.storage.control.v2.IGetAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetAnywhereCacheRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getAnywhereCache(request, callback)

getAnywhereCache(request: protos.google.storage.control.v2.IGetAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetAnywhereCacheRequest
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IGetAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFolder(request, options)

getFolder(request?: protos.google.storage.control.v2.IGetFolderRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IFolder,
        protos.google.storage.control.v2.IGetFolderRequest | undefined,
        {} | undefined
    ]>;

Returns metadata for the specified folder. This operation is only applicable to a hierarchical namespace enabled bucket.

Parameters
Name Description
request IGetFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Folder. 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. Name of the folder.
   *  Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
   */
  // const name = 'abc123'
  /**
   *  Makes the operation only succeed conditional on whether the folder's
   *  current metageneration matches the given value.
   */
  // const ifMetagenerationMatch = 1234
  /**
   *  Makes the operation only succeed conditional on whether the folder's
   *  current metageneration does not match the given value.
   */
  // const ifMetagenerationNotMatch = 1234
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getFolder(request);
    console.log(response);
  }

  callGetFolder();

getFolder(request, options, callback)

getFolder(request: protos.google.storage.control.v2.IGetFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFolderRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFolder(request, callback)

getFolder(request: protos.google.storage.control.v2.IGetFolderRequest, callback: Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFolderRequest
callback Callback<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IGetFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFolderIntelligenceConfig(request, options)

getFolderIntelligenceConfig(request?: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IIntelligenceConfig,
        (protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | undefined),
        {} | undefined
    ]>;

Returns the Folder scoped singleton IntelligenceConfig resource.

Parameters
Name Description
request IGetFolderIntelligenceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IIntelligenceConfig, (protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | 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. The name of the `IntelligenceConfig` resource associated with
   *  your folder.
   *  Format: `folders/{id}/locations/global/intelligenceConfig`
   */
  // const name = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getFolderIntelligenceConfig(request);
    console.log(response);
  }

  callGetFolderIntelligenceConfig();

getFolderIntelligenceConfig(request, options, callback)

getFolderIntelligenceConfig(request: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFolderIntelligenceConfigRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getFolderIntelligenceConfig(request, callback)

getFolderIntelligenceConfig(request: protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetFolderIntelligenceConfigRequest
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getIamPolicy(request, options)

getIamPolicy(request?: protos.google.iam.v1.IGetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.IGetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Gets the IAM policy for a specified bucket. The resource field in the request should be projects/_/buckets/{bucket} for a bucket, or projects/_/buckets/{bucket}/managedFolders/{managedFolder} for a managed folder.

Parameters
Name Description
request IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy. 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: The resource for which the policy is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  OPTIONAL: A `GetPolicyOptions` object for specifying options to
   *  `GetIamPolicy`.
   */
  // const options = {}

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callGetIamPolicy() {
    // Construct request
    const request = {
      resource,
    };

    // Run request
    const response = await controlClient.getIamPolicy(request);
    console.log(response);
  }

  callGetIamPolicy();

getIamPolicy(request, options, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getIamPolicy(request, callback)

getIamPolicy(request: protos.google.iam.v1.IGetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getManagedFolder(request, options)

getManagedFolder(request?: protos.google.storage.control.v2.IGetManagedFolderRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IManagedFolder,
        protos.google.storage.control.v2.IGetManagedFolderRequest | undefined,
        {} | undefined
    ]>;

Returns metadata for the specified managed folder.

Parameters
Name Description
request IGetManagedFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ManagedFolder. 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. Name of the managed folder.
   *  Format:
   *  `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
   */
  // const name = 'abc123'
  /**
   *  The operation succeeds conditional on the managed folder's current
   *  metageneration matching the value here specified.
   */
  // const ifMetagenerationMatch = 1234
  /**
   *  The operation succeeds conditional on the managed folder's current
   *  metageneration NOT matching the value here specified.
   */
  // const ifMetagenerationNotMatch = 1234
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getManagedFolder(request);
    console.log(response);
  }

  callGetManagedFolder();

getManagedFolder(request, options, callback)

getManagedFolder(request: protos.google.storage.control.v2.IGetManagedFolderRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetManagedFolderRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getManagedFolder(request, callback)

getManagedFolder(request: protos.google.storage.control.v2.IGetManagedFolderRequest, callback: Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetManagedFolderRequest
callback Callback<protos.google.storage.control.v2.IManagedFolder, protos.google.storage.control.v2.IGetManagedFolderRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getOperation(request, optionsOrCallback, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters
Name Description
request GetOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getOrganizationIntelligenceConfig(request, options)

getOrganizationIntelligenceConfig(request?: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IIntelligenceConfig,
        (protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | undefined),
        {} | undefined
    ]>;

Returns the Organization scoped singleton IntelligenceConfig resource.

Parameters
Name Description
request IGetOrganizationIntelligenceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IIntelligenceConfig, (protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | 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. The name of the `IntelligenceConfig` resource associated with
   *  your organization.
   *  Format: `organizations/{org_id}/locations/global/intelligenceConfig`
   */
  // const name = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getOrganizationIntelligenceConfig(request);
    console.log(response);
  }

  callGetOrganizationIntelligenceConfig();

getOrganizationIntelligenceConfig(request, options, callback)

getOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetOrganizationIntelligenceConfigRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getOrganizationIntelligenceConfig(request, callback)

getOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetOrganizationIntelligenceConfigRequest
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

getProjectIntelligenceConfig(request, options)

getProjectIntelligenceConfig(request?: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IIntelligenceConfig,
        (protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | undefined),
        {} | undefined
    ]>;

Returns the Project scoped singleton IntelligenceConfig resource.

Parameters
Name Description
request IGetProjectIntelligenceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IIntelligenceConfig, (protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | 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. The name of the `IntelligenceConfig` resource associated with
   *  your project.
   *  Format: `projects/{id}/locations/global/intelligenceConfig`
   */
  // const name = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getProjectIntelligenceConfig(request);
    console.log(response);
  }

  callGetProjectIntelligenceConfig();

getProjectIntelligenceConfig(request, options, callback)

getProjectIntelligenceConfig(request: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetProjectIntelligenceConfigRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectIntelligenceConfig(request, callback)

getProjectIntelligenceConfig(request: protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetProjectIntelligenceConfigRequest
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IGetProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getStorageLayout(request, options)

getStorageLayout(request?: protos.google.storage.control.v2.IGetStorageLayoutRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IStorageLayout,
        protos.google.storage.control.v2.IGetStorageLayoutRequest | undefined,
        {} | undefined
    ]>;

Returns the storage layout configuration for a given bucket.

Parameters
Name Description
request IGetStorageLayoutRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | 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. The name of the StorageLayout resource.
   *  Format: `projects/{project}/buckets/{bucket}/storageLayout`
   */
  // const name = 'abc123'
  /**
   *  An optional prefix used for permission check. It is useful when the caller
   *  only has limited permissions under a specific prefix.
   */
  // const prefix = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.getStorageLayout(request);
    console.log(response);
  }

  callGetStorageLayout();

getStorageLayout(request, options, callback)

getStorageLayout(request: protos.google.storage.control.v2.IGetStorageLayoutRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetStorageLayoutRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getStorageLayout(request, callback)

getStorageLayout(request: protos.google.storage.control.v2.IGetStorageLayoutRequest, callback: Callback<protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetStorageLayoutRequest
callback Callback<protos.google.storage.control.v2.IStorageLayout, protos.google.storage.control.v2.IGetStorageLayoutRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Type Description
Promise<{ [name: string]: Function; }>

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

listAnywhereCaches(request, options)

listAnywhereCaches(request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IAnywhereCache[],
        protos.google.storage.control.v2.IListAnywhereCachesRequest | null,
        protos.google.storage.control.v2.IListAnywhereCachesResponse
    ]>;

Lists Anywhere Cache instances for a given bucket.

Parameters
Name Description
request IListAnywhereCachesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IAnywhereCache[], protos.google.storage.control.v2.IListAnywhereCachesRequest | null, protos.google.storage.control.v2.IListAnywhereCachesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of AnywhereCache. 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 listAnywhereCachesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listAnywhereCaches(request, options, callback)

listAnywhereCaches(request: protos.google.storage.control.v2.IListAnywhereCachesRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.control.v2.IListAnywhereCachesRequest, protos.google.storage.control.v2.IListAnywhereCachesResponse | null | undefined, protos.google.storage.control.v2.IAnywhereCache>): void;
Parameters
Name Description
request IListAnywhereCachesRequest
options CallOptions
callback PaginationCallback<protos.google.storage.control.v2.IListAnywhereCachesRequest, protos.google.storage.control.v2.IListAnywhereCachesResponse | null | undefined, protos.google.storage.control.v2.IAnywhereCache>
Returns
Type Description
void

listAnywhereCaches(request, callback)

listAnywhereCaches(request: protos.google.storage.control.v2.IListAnywhereCachesRequest, callback: PaginationCallback<protos.google.storage.control.v2.IListAnywhereCachesRequest, protos.google.storage.control.v2.IListAnywhereCachesResponse | null | undefined, protos.google.storage.control.v2.IAnywhereCache>): void;
Parameters
Name Description
request IListAnywhereCachesRequest
callback PaginationCallback<protos.google.storage.control.v2.IListAnywhereCachesRequest, protos.google.storage.control.v2.IListAnywhereCachesResponse | null | undefined, protos.google.storage.control.v2.IAnywhereCache>
Returns
Type Description
void

listAnywhereCachesAsync(request, options)

listAnywhereCachesAsync(request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, options?: CallOptions): AsyncIterable<protos.google.storage.control.v2.IAnywhereCache>;

Equivalent to listAnywhereCaches, but returns an iterable object.

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

Parameters
Name Description
request IListAnywhereCachesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.storage.control.v2.IAnywhereCache>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AnywhereCache. 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 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 bucket to which this cache belongs.
   */
  // const parent = 'abc123'
  /**
   *  Maximum number of caches to return in a single response.
   *  The service will use this parameter or 1,000 items, whichever is smaller.
   */
  // const pageSize = 1234
  /**
   *  A previously-returned page token representing part of the larger set of
   *  results to view.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callListAnywhereCaches();

listAnywhereCachesStream(request, options)

listAnywhereCachesStream(request?: protos.google.storage.control.v2.IListAnywhereCachesRequest, options?: CallOptions): Transform;

Equivalent to listAnywhereCaches, but returns a NodeJS Stream object.

Parameters
Name Description
request IListAnywhereCachesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing AnywhereCache 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 listAnywhereCachesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listFolders(request, options)

listFolders(request?: protos.google.storage.control.v2.IListFoldersRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IFolder[],
        protos.google.storage.control.v2.IListFoldersRequest | null,
        protos.google.storage.control.v2.IListFoldersResponse
    ]>;

Retrieves a list of folders. This operation is only applicable to a hierarchical namespace enabled bucket.

Parameters
Name Description
request IListFoldersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IFolder[], protos.google.storage.control.v2.IListFoldersRequest | null, protos.google.storage.control.v2.IListFoldersResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Folder. 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 listFoldersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listFolders(request, options, callback)

listFolders(request: protos.google.storage.control.v2.IListFoldersRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.control.v2.IListFoldersRequest, protos.google.storage.control.v2.IListFoldersResponse | null | undefined, protos.google.storage.control.v2.IFolder>): void;
Parameters
Name Description
request IListFoldersRequest
options CallOptions
callback PaginationCallback<protos.google.storage.control.v2.IListFoldersRequest, protos.google.storage.control.v2.IListFoldersResponse | null | undefined, protos.google.storage.control.v2.IFolder>
Returns
Type Description
void

listFolders(request, callback)

listFolders(request: protos.google.storage.control.v2.IListFoldersRequest, callback: PaginationCallback<protos.google.storage.control.v2.IListFoldersRequest, protos.google.storage.control.v2.IListFoldersResponse | null | undefined, protos.google.storage.control.v2.IFolder>): void;
Parameters
Name Description
request IListFoldersRequest
callback PaginationCallback<protos.google.storage.control.v2.IListFoldersRequest, protos.google.storage.control.v2.IListFoldersResponse | null | undefined, protos.google.storage.control.v2.IFolder>
Returns
Type Description
void

listFoldersAsync(request, options)

listFoldersAsync(request?: protos.google.storage.control.v2.IListFoldersRequest, options?: CallOptions): AsyncIterable<protos.google.storage.control.v2.IFolder>;

Equivalent to listFolders, but returns an iterable object.

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

Parameters
Name Description
request IListFoldersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.storage.control.v2.IFolder>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Folder. 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 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 bucket in which to look for folders. The bucket must
   *  be a hierarchical namespace enabled bucket.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of folders to return in a single response. The
   *  service will use this parameter or 1,000 items, whichever is smaller.
   */
  // const pageSize = 1234
  /**
   *  Optional. A previously-returned page token representing part of the larger
   *  set of results to view.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filter results to folders whose names begin with this prefix.
   *  If set, the value must either be an empty string or end with a '/'.
   */
  // const prefix = 'abc123'
  /**
   *  Optional. If set, returns results in a directory-like mode. The results
   *  will only include folders that either exactly match the above prefix, or
   *  are one level below the prefix. The only supported value is '/'.
   */
  // const delimiter = 'abc123'
  /**
   *  Optional. Filter results to folders whose names are lexicographically equal
   *  to or after lexicographic_start. If lexicographic_end is also set, the
   *  folders listed have names between lexicographic_start (inclusive) and
   *  lexicographic_end (exclusive).
   */
  // const lexicographicStart = 'abc123'
  /**
   *  Optional. Filter results to folders whose names are lexicographically
   *  before lexicographic_end. If lexicographic_start is also set, the folders
   *  listed have names between lexicographic_start (inclusive) and
   *  lexicographic_end (exclusive).
   */
  // const lexicographicEnd = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callListFolders();

listFoldersStream(request, options)

listFoldersStream(request?: protos.google.storage.control.v2.IListFoldersRequest, options?: CallOptions): Transform;

Equivalent to listFolders, but returns a NodeJS Stream object.

Parameters
Name Description
request IListFoldersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing Folder 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 listFoldersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listManagedFolders(request, options)

listManagedFolders(request?: protos.google.storage.control.v2.IListManagedFoldersRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IManagedFolder[],
        protos.google.storage.control.v2.IListManagedFoldersRequest | null,
        protos.google.storage.control.v2.IListManagedFoldersResponse
    ]>;

Retrieves a list of managed folders for a given bucket.

Parameters
Name Description
request IListManagedFoldersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IManagedFolder[], protos.google.storage.control.v2.IListManagedFoldersRequest | null, protos.google.storage.control.v2.IListManagedFoldersResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of ManagedFolder. 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 listManagedFoldersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listManagedFolders(request, options, callback)

listManagedFolders(request: protos.google.storage.control.v2.IListManagedFoldersRequest, options: CallOptions, callback: PaginationCallback<protos.google.storage.control.v2.IListManagedFoldersRequest, protos.google.storage.control.v2.IListManagedFoldersResponse | null | undefined, protos.google.storage.control.v2.IManagedFolder>): void;
Parameters
Name Description
request IListManagedFoldersRequest
options CallOptions
callback PaginationCallback<protos.google.storage.control.v2.IListManagedFoldersRequest, protos.google.storage.control.v2.IListManagedFoldersResponse | null | undefined, protos.google.storage.control.v2.IManagedFolder>
Returns
Type Description
void

listManagedFolders(request, callback)

listManagedFolders(request: protos.google.storage.control.v2.IListManagedFoldersRequest, callback: PaginationCallback<protos.google.storage.control.v2.IListManagedFoldersRequest, protos.google.storage.control.v2.IListManagedFoldersResponse | null | undefined, protos.google.storage.control.v2.IManagedFolder>): void;
Parameters
Name Description
request IListManagedFoldersRequest
callback PaginationCallback<protos.google.storage.control.v2.IListManagedFoldersRequest, protos.google.storage.control.v2.IListManagedFoldersResponse | null | undefined, protos.google.storage.control.v2.IManagedFolder>
Returns
Type Description
void

listManagedFoldersAsync(request, options)

listManagedFoldersAsync(request?: protos.google.storage.control.v2.IListManagedFoldersRequest, options?: CallOptions): AsyncIterable<protos.google.storage.control.v2.IManagedFolder>;

Equivalent to listManagedFolders, but returns an iterable object.

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

Parameters
Name Description
request IListManagedFoldersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.storage.control.v2.IManagedFolder>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ManagedFolder. 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 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 bucket this managed folder belongs to.
   */
  // const parent = 'abc123'
  /**
   *  Optional. Maximum number of managed folders to return in a single response.
   *  The service will use this parameter or 1,000 items, whichever is smaller.
   */
  // const pageSize = 1234
  /**
   *  Optional. A previously-returned page token representing part of the larger
   *  set of results to view.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. Filter results to match managed folders with name starting with
   *  this prefix.
   */
  // const prefix = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callListManagedFolders();

listManagedFoldersStream(request, options)

listManagedFoldersStream(request?: protos.google.storage.control.v2.IListManagedFoldersRequest, options?: CallOptions): Transform;

Equivalent to listManagedFolders, but returns a NodeJS Stream object.

Parameters
Name Description
request IListManagedFoldersRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Transform

{Stream} An object stream which emits an object representing ManagedFolder 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 listManagedFoldersAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listOperationsAsync(request, options)

listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
Name Description
request ListOperationsRequest

The request object that will be sent.

options CallOptions

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Returns
Type Description
AsyncIterable<protos.google.longrunning.IOperation>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

managedFolderPath(project, bucket, managedFolder)

managedFolderPath(project: string, bucket: string, managedFolder: string): string;

Return a fully-qualified managedFolder resource name string.

Parameters
Name Description
project string
bucket string
managedFolder string
Returns
Type Description
string

{string} Resource name string.

matchAnywhereCacheFromAnywhereCacheName(anywhereCacheName)

matchAnywhereCacheFromAnywhereCacheName(anywhereCacheName: string): string | number;

Parse the anywhere_cache from AnywhereCache resource.

Parameter
Name Description
anywhereCacheName string

A fully-qualified path representing AnywhereCache resource.

Returns
Type Description
string | number

{string} A string representing the anywhere_cache.

matchBucketFromAnywhereCacheName(anywhereCacheName)

matchBucketFromAnywhereCacheName(anywhereCacheName: string): string | number;

Parse the bucket from AnywhereCache resource.

Parameter
Name Description
anywhereCacheName string

A fully-qualified path representing AnywhereCache resource.

Returns
Type Description
string | number

{string} A string representing the bucket.

matchBucketFromBucketName(bucketName)

matchBucketFromBucketName(bucketName: string): string | number;

Parse the bucket from Bucket resource.

Parameter
Name Description
bucketName string

A fully-qualified path representing Bucket resource.

Returns
Type Description
string | number

{string} A string representing the bucket.

matchBucketFromFolderName(folderName)

matchBucketFromFolderName(folderName: string): string | number;

Parse the bucket from Folder resource.

Parameter
Name Description
folderName string

A fully-qualified path representing Folder resource.

Returns
Type Description
string | number

{string} A string representing the bucket.

matchBucketFromManagedFolderName(managedFolderName)

matchBucketFromManagedFolderName(managedFolderName: string): string | number;

Parse the bucket from ManagedFolder resource.

Parameter
Name Description
managedFolderName string

A fully-qualified path representing ManagedFolder resource.

Returns
Type Description
string | number

{string} A string representing the bucket.

matchBucketFromStorageLayoutName(storageLayoutName)

matchBucketFromStorageLayoutName(storageLayoutName: string): string | number;

Parse the bucket from StorageLayout resource.

Parameter
Name Description
storageLayoutName string

A fully-qualified path representing StorageLayout resource.

Returns
Type Description
string | number

{string} A string representing the bucket.

matchFolderFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName)

matchFolderFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName: string): string | number;

Parse the folder from FolderLocationIntelligenceConfig resource.

Parameter
Name Description
folderLocationIntelligenceConfigName string

A fully-qualified path representing folder_location_intelligenceConfig resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderName(folderName)

matchFolderFromFolderName(folderName: string): string | number;

Parse the folder from Folder resource.

Parameter
Name Description
folderName string

A fully-qualified path representing Folder resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchLocationFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName)

matchLocationFromFolderLocationIntelligenceConfigName(folderLocationIntelligenceConfigName: string): string | number;

Parse the location from FolderLocationIntelligenceConfig resource.

Parameter
Name Description
folderLocationIntelligenceConfigName string

A fully-qualified path representing folder_location_intelligenceConfig resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName)

matchLocationFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName: string): string | number;

Parse the location from OrgLocationIntelligenceConfig resource.

Parameter
Name Description
orgLocationIntelligenceConfigName string

A fully-qualified path representing org_location_intelligenceConfig resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName)

matchLocationFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName: string): string | number;

Parse the location from ProjectLocationIntelligenceConfig resource.

Parameter
Name Description
projectLocationIntelligenceConfigName string

A fully-qualified path representing project_location_intelligenceConfig resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchManagedFolderFromManagedFolderName(managedFolderName)

matchManagedFolderFromManagedFolderName(managedFolderName: string): string | number;

Parse the managed_folder from ManagedFolder resource.

Parameter
Name Description
managedFolderName string

A fully-qualified path representing ManagedFolder resource.

Returns
Type Description
string | number

{string} A string representing the managed_folder.

matchOrgFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName)

matchOrgFromOrgLocationIntelligenceConfigName(orgLocationIntelligenceConfigName: string): string | number;

Parse the org from OrgLocationIntelligenceConfig resource.

Parameter
Name Description
orgLocationIntelligenceConfigName string

A fully-qualified path representing org_location_intelligenceConfig resource.

Returns
Type Description
string | number

{string} A string representing the org.

matchProjectFromAnywhereCacheName(anywhereCacheName)

matchProjectFromAnywhereCacheName(anywhereCacheName: string): string | number;

Parse the project from AnywhereCache resource.

Parameter
Name Description
anywhereCacheName string

A fully-qualified path representing AnywhereCache resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromBucketName(bucketName)

matchProjectFromBucketName(bucketName: string): string | number;

Parse the project from Bucket resource.

Parameter
Name Description
bucketName string

A fully-qualified path representing Bucket resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromFolderName(folderName)

matchProjectFromFolderName(folderName: string): string | number;

Parse the project from Folder resource.

Parameter
Name Description
folderName string

A fully-qualified path representing Folder resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromManagedFolderName(managedFolderName)

matchProjectFromManagedFolderName(managedFolderName: string): string | number;

Parse the project from ManagedFolder resource.

Parameter
Name Description
managedFolderName string

A fully-qualified path representing ManagedFolder resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName)

matchProjectFromProjectLocationIntelligenceConfigName(projectLocationIntelligenceConfigName: string): string | number;

Parse the project from ProjectLocationIntelligenceConfig resource.

Parameter
Name Description
projectLocationIntelligenceConfigName string

A fully-qualified path representing project_location_intelligenceConfig resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
Name Description
projectName string

A fully-qualified path representing Project resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromStorageLayoutName(storageLayoutName)

matchProjectFromStorageLayoutName(storageLayoutName: string): string | number;

Parse the project from StorageLayout resource.

Parameter
Name Description
storageLayoutName string

A fully-qualified path representing StorageLayout resource.

Returns
Type Description
string | number

{string} A string representing the project.

orgLocationIntelligenceConfigPath(org, location)

orgLocationIntelligenceConfigPath(org: string, location: string): string;

Return a fully-qualified orgLocationIntelligenceConfig resource name string.

Parameters
Name Description
org string
location string
Returns
Type Description
string

{string} Resource name string.

pauseAnywhereCache(request, options)

pauseAnywhereCache(request?: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IAnywhereCache,
        protos.google.storage.control.v2.IPauseAnywhereCacheRequest | undefined,
        {} | undefined
    ]>;

Pauses an Anywhere Cache instance.

Parameters
Name Description
request IPauseAnywhereCacheRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AnywhereCache. 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. The name field in the request should be:
   *  `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
   */
  // const name = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.pauseAnywhereCache(request);
    console.log(response);
  }

  callPauseAnywhereCache();

pauseAnywhereCache(request, options, callback)

pauseAnywhereCache(request: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IPauseAnywhereCacheRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

pauseAnywhereCache(request, callback)

pauseAnywhereCache(request: protos.google.storage.control.v2.IPauseAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IPauseAnywhereCacheRequest
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IPauseAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

projectLocationIntelligenceConfigPath(project, location)

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

Return a fully-qualified projectLocationIntelligenceConfig resource name string.

Parameters
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
Name Description
project string
Returns
Type Description
string

{string} Resource name string.

renameFolder(request, options)

renameFolder(request?: protos.google.storage.control.v2.IRenameFolderRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Renames a source folder to a destination folder. This operation is only applicable to a hierarchical namespace enabled bucket. During a rename, the source and destination folders are locked until the long running operation completes.

Parameters
Name Description
request IRenameFolderRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, 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 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 source folder being renamed.
   *  Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
   */
  // const name = 'abc123'
  /**
   *  Required. The destination folder ID, e.g. `foo/bar/`.
   */
  // const destinationFolderId = 'abc123'
  /**
   *  Makes the operation only succeed conditional on whether the source
   *  folder's current metageneration matches the given value.
   */
  // const ifMetagenerationMatch = 1234
  /**
   *  Makes the operation only succeed conditional on whether the source
   *  folder's current metageneration does not match the given value.
   */
  // const ifMetagenerationNotMatch = 1234
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

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

  callRenameFolder();

renameFolder(request, options, callback)

renameFolder(request: protos.google.storage.control.v2.IRenameFolderRequest, options: CallOptions, callback: Callback<LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRenameFolderRequest
options CallOptions
callback Callback<LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

renameFolder(request, callback)

renameFolder(request: protos.google.storage.control.v2.IRenameFolderRequest, callback: Callback<LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRenameFolderRequest
callback Callback<LROperation<protos.google.storage.control.v2.IFolder, protos.google.storage.control.v2.IRenameFolderMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

resumeAnywhereCache(request, options)

resumeAnywhereCache(request?: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IAnywhereCache,
        protos.google.storage.control.v2.IResumeAnywhereCacheRequest | undefined,
        {} | undefined
    ]>;

Resumes a disabled or paused Anywhere Cache instance.

Parameters
Name Description
request IResumeAnywhereCacheRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing AnywhereCache. 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. The name field in the request should be:
   *  `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
   */
  // const name = 'abc123'
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

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

    // Run request
    const response = await controlClient.resumeAnywhereCache(request);
    console.log(response);
  }

  callResumeAnywhereCache();

resumeAnywhereCache(request, options, callback)

resumeAnywhereCache(request: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IResumeAnywhereCacheRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

resumeAnywhereCache(request, callback)

resumeAnywhereCache(request: protos.google.storage.control.v2.IResumeAnywhereCacheRequest, callback: Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IResumeAnywhereCacheRequest
callback Callback<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IResumeAnywhereCacheRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

setIamPolicy(request, options)

setIamPolicy(request?: protos.google.iam.v1.ISetIamPolicyRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.IPolicy,
        protos.google.iam.v1.ISetIamPolicyRequest | undefined,
        {} | undefined
    ]>;

Updates an IAM policy for the specified bucket. The resource field in the request should be projects/_/buckets/{bucket} for a bucket, or projects/_/buckets/{bucket}/managedFolders/{managedFolder} for a managed folder.

Parameters
Name Description
request ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Policy. 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: The resource for which the policy is being specified.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  REQUIRED: The complete policy to be applied to the `resource`. The size of
   *  the policy is limited to a few 10s of KB. An empty policy is a
   *  valid policy but certain Cloud Platform services (such as Projects)
   *  might reject them.
   */
  // const policy = {}
  /**
   *  OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
   *  the fields in the mask will be modified. If no mask is provided, the
   *  following default mask is used:
   *  `paths: "bindings, etag"`
   */
  // const updateMask = {}

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callSetIamPolicy() {
    // Construct request
    const request = {
      resource,
      policy,
    };

    // Run request
    const response = await controlClient.setIamPolicy(request);
    console.log(response);
  }

  callSetIamPolicy();

setIamPolicy(request, options, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

setIamPolicy(request, callback)

setIamPolicy(request: protos.google.iam.v1.ISetIamPolicyRequest, callback: Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

storageLayoutPath(project, bucket)

storageLayoutPath(project: string, bucket: string): string;

Return a fully-qualified storageLayout resource name string.

Parameters
Name Description
project string
bucket string
Returns
Type Description
string

{string} Resource name string.

testIamPermissions(request, options)

testIamPermissions(request?: protos.google.iam.v1.ITestIamPermissionsRequest, options?: CallOptions): Promise<[
        protos.google.iam.v1.ITestIamPermissionsResponse,
        protos.google.iam.v1.ITestIamPermissionsRequest | undefined,
        {} | undefined
    ]>;

Tests a set of permissions on the given bucket, object, or managed folder to see which, if any, are held by the caller. The resource field in the request should be projects/_/buckets/{bucket} for a bucket, projects/_/buckets/{bucket}/objects/{object} for an object, or projects/_/buckets/{bucket}/managedFolders/{managedFolder} for a managed folder.

Parameters
Name Description
request ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing TestIamPermissionsResponse. 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: The resource for which the policy detail is being requested.
   *  See the operation documentation for the appropriate value for this field.
   */
  // const resource = 'abc123'
  /**
   *  The set of permissions to check for the `resource`. Permissions with
   *  wildcards (such as '*' or 'storage.*') are not allowed. For more
   *  information see
   *  IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
   */
  // const permissions = ['abc','def']

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callTestIamPermissions() {
    // Construct request
    const request = {
      resource,
      permissions,
    };

    // Run request
    const response = await controlClient.testIamPermissions(request);
    console.log(response);
  }

  callTestIamPermissions();

testIamPermissions(request, options, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, options: CallOptions, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ITestIamPermissionsRequest
options CallOptions
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

testIamPermissions(request, callback)

testIamPermissions(request: protos.google.iam.v1.ITestIamPermissionsRequest, callback: Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ITestIamPermissionsRequest
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateAnywhereCache(request, options)

updateAnywhereCache(request?: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates an Anywhere Cache instance. Mutable fields include ttl and admission_policy.

Parameters
Name Description
request IUpdateAnywhereCacheRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, 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 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 Anywhere Cache instance to be updated.
   */
  // const anywhereCache = {}
  /**
   *  Required. List of fields to be updated. Mutable fields of AnywhereCache
   *  include `ttl` and `admission_policy`.
   *  To specify ALL fields, specify a single field with the value `*`. Note: We
   *  recommend against doing this. If a new field is introduced at a later time,
   *  an older client updating with the `*` may accidentally reset the new
   *  field's value.
   *  Not specifying any fields is an error.
   */
  // const updateMask = {}
  /**
   *  Optional. A unique identifier for this request. UUID is the recommended
   *  format, but other formats are still accepted. This request is only
   *  idempotent if a `request_id` is provided.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callUpdateAnywhereCache() {
    // Construct request
    const request = {
      anywhereCache,
      updateMask,
    };

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

  callUpdateAnywhereCache();

updateAnywhereCache(request, options, callback)

updateAnywhereCache(request: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, options: CallOptions, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateAnywhereCacheRequest
options CallOptions
callback Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateAnywhereCache(request, callback)

updateAnywhereCache(request: protos.google.storage.control.v2.IUpdateAnywhereCacheRequest, callback: Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateAnywhereCacheRequest
callback Callback<LROperation<protos.google.storage.control.v2.IAnywhereCache, protos.google.storage.control.v2.IUpdateAnywhereCacheMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateFolderIntelligenceConfig(request, options)

updateFolderIntelligenceConfig(request?: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IIntelligenceConfig,
        (protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | undefined),
        {} | undefined
    ]>;

Updates the Folder scoped singleton IntelligenceConfig resource.

Parameters
Name Description
request IUpdateFolderIntelligenceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IIntelligenceConfig, (protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | 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. The `IntelligenceConfig` resource to be updated.
   */
  // const intelligenceConfig = {}
  /**
   *  Required. The `update_mask` that specifies the fields within the
   *  `IntelligenceConfig` resource that should be modified by this update. Only
   *  the listed fields are updated.
   */
  // const updateMask = {}
  /**
   *  Optional. The ID that uniquely identifies the request, preventing duplicate
   *  processing.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callUpdateFolderIntelligenceConfig() {
    // Construct request
    const request = {
      intelligenceConfig,
      updateMask,
    };

    // Run request
    const response = await controlClient.updateFolderIntelligenceConfig(request);
    console.log(response);
  }

  callUpdateFolderIntelligenceConfig();

updateFolderIntelligenceConfig(request, options, callback)

updateFolderIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateFolderIntelligenceConfigRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateFolderIntelligenceConfig(request, callback)

updateFolderIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateFolderIntelligenceConfigRequest
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateFolderIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateOrganizationIntelligenceConfig(request, options)

updateOrganizationIntelligenceConfig(request?: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IIntelligenceConfig,
        (protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | undefined),
        {} | undefined
    ]>;

Updates the Organization scoped singleton IntelligenceConfig resource.

Parameters
Name Description
request IUpdateOrganizationIntelligenceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IIntelligenceConfig, (protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | 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. The `IntelligenceConfig` resource to be updated.
   */
  // const intelligenceConfig = {}
  /**
   *  Required. The `update_mask` that specifies the fields within the
   *  `IntelligenceConfig` resource that should be modified by this update. Only
   *  the listed fields are updated.
   */
  // const updateMask = {}
  /**
   *  Optional. The ID that uniquely identifies the request, preventing duplicate
   *  processing.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callUpdateOrganizationIntelligenceConfig() {
    // Construct request
    const request = {
      intelligenceConfig,
      updateMask,
    };

    // Run request
    const response = await controlClient.updateOrganizationIntelligenceConfig(request);
    console.log(response);
  }

  callUpdateOrganizationIntelligenceConfig();

updateOrganizationIntelligenceConfig(request, options, callback)

updateOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateOrganizationIntelligenceConfigRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateOrganizationIntelligenceConfig(request, callback)

updateOrganizationIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateOrganizationIntelligenceConfigRequest
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateOrganizationIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateProjectIntelligenceConfig(request, options)

updateProjectIntelligenceConfig(request?: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, options?: CallOptions): Promise<[
        protos.google.storage.control.v2.IIntelligenceConfig,
        (protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | undefined),
        {} | undefined
    ]>;

Updates the Project scoped singleton IntelligenceConfig resource.

Parameters
Name Description
request IUpdateProjectIntelligenceConfigRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.storage.control.v2.IIntelligenceConfig, (protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | 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. The `IntelligenceConfig` resource to be updated.
   */
  // const intelligenceConfig = {}
  /**
   *  Required. The `update_mask` that specifies the fields within the
   *  `IntelligenceConfig` resource that should be modified by this update. Only
   *  the listed fields are updated.
   */
  // const updateMask = {}
  /**
   *  Optional. The ID that uniquely identifies the request, preventing duplicate
   *  processing.
   */
  // const requestId = 'abc123'

  // Imports the Control library
  const {StorageControlClient} = require('@google-cloud/storage-control').v2;

  // Instantiates a client
  const controlClient = new StorageControlClient();

  async function callUpdateProjectIntelligenceConfig() {
    // Construct request
    const request = {
      intelligenceConfig,
      updateMask,
    };

    // Run request
    const response = await controlClient.updateProjectIntelligenceConfig(request);
    console.log(response);
  }

  callUpdateProjectIntelligenceConfig();

updateProjectIntelligenceConfig(request, options, callback)

updateProjectIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, options: CallOptions, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateProjectIntelligenceConfigRequest
options CallOptions
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateProjectIntelligenceConfig(request, callback)

updateProjectIntelligenceConfig(request: protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest, callback: Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateProjectIntelligenceConfigRequest
callback Callback<protos.google.storage.control.v2.IIntelligenceConfig, protos.google.storage.control.v2.IUpdateProjectIntelligenceConfigRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void