Class v3.ProjectsClient (4.1.3)

Manages Google Cloud Projects. v3

Package

@google-cloud/resource-manager

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of ProjectsClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof gax.fallback

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

Properties

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

projectsStub

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

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

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

Methods

checkCreateProjectProgress(name)

checkCreateProjectProgress(name: string): Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.CreateProjectMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.CreateProjectMetadata>>

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

Example

  /**
   * 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 Project to create.
   *  Project ID is required. If the requested ID is unavailable, the request
   *  fails.
   *  If the `parent` field is set, the `resourcemanager.projects.create`
   *  permission is checked on the parent resource. If no parent is set and
   *  the authorization credentials belong to an Organziation, the parent
   *  will be set to that Organization.
   */
  // const project = 'my-project'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

  async function callCreateProject() {
    // Construct request
    const request = {
      project,
    };

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

  callCreateProject();

checkDeleteProjectProgress(name)

checkDeleteProjectProgress(name: string): Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.DeleteProjectMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.DeleteProjectMetadata>>

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

Example

  /**
   * 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 Project (for example, `projects/415104041262`).
   */
  // const name = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callDeleteProject();

checkMoveProjectProgress(name)

checkMoveProjectProgress(name: string): Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.MoveProjectMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.MoveProjectMetadata>>

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

Example

  /**
   * 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 project to move.
   */
  // const name = 'abc123'
  /**
   *  Required. The new parent to move the Project under.
   */
  // const destinationParent = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callMoveProject();

checkUndeleteProjectProgress(name)

checkUndeleteProjectProgress(name: string): Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.UndeleteProjectMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.UndeleteProjectMetadata>>

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

Example

  /**
   * 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 project (for example, `projects/415104041262`).
   *  Required.
   */
  // const name = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callUndeleteProject();

checkUpdateProjectProgress(name)

checkUpdateProjectProgress(name: string): Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.UpdateProjectMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.resourcemanager.v3.Project, protos.google.cloud.resourcemanager.v3.UpdateProjectMetadata>>

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

Example

  /**
   * 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 new definition of the project.
   */
  // const project = 'my-project'
  /**
   *  Optional. An update mask to selectively update fields.
   */
  // const updateMask = {}

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

  async function callUpdateProject() {
    // Construct request
    const request = {
      project,
    };

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

  callUpdateProject();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

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

Returns
TypeDescription
Promise<void>

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

createProject(request, options)

createProject(request?: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Request that a new project be created. The result is an Operation which can be used to track the creation process. This process usually takes a few seconds, but can sometimes take much longer. The tracking Operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ICreateProjectRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

  /**
   * 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 Project to create.
   *  Project ID is required. If the requested ID is unavailable, the request
   *  fails.
   *  If the `parent` field is set, the `resourcemanager.projects.create`
   *  permission is checked on the parent resource. If no parent is set and
   *  the authorization credentials belong to an Organziation, the parent
   *  will be set to that Organization.
   */
  // const project = 'my-project'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

  async function callCreateProject() {
    // Construct request
    const request = {
      project,
    };

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

  callCreateProject();

createProject(request, options, callback)

createProject(request: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ICreateProjectRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createProject(request, callback)

createProject(request: protos.google.cloud.resourcemanager.v3.ICreateProjectRequest, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ICreateProjectRequest
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.ICreateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteProject(request, options)

deleteProject(request?: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Marks the project identified by the specified name (for example, projects/415104041262) for deletion.

This method will only affect the project if it has a lifecycle state of .

This method changes the Project's lifecycle state from to . The deletion starts at an unspecified time, at which point the Project is no longer accessible.

Until the deletion completes, you can check the lifecycle state checked by retrieving the project with [GetProject] [google.cloud.resourcemanager.v3.Projects.GetProject], and the project remains visible to [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects]. However, you cannot update the project.

After the deletion completes, the project is not retrievable by the [GetProject] [google.cloud.resourcemanager.v3.Projects.GetProject], [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects], and methods.

This method behaves idempotently, such that deleting a DELETE_REQUESTED project will not cause an error, but also won't do anything.

The caller must have resourcemanager.projects.delete permissions for this project.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

  /**
   * 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 Project (for example, `projects/415104041262`).
   */
  // const name = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callDeleteProject();

deleteProject(request, options, callback)

deleteProject(request: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteProject(request, callback)

deleteProject(request: protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IDeleteProjectRequest
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IDeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

folderPath(folder)

folderPath(folder: string): string;

Return a fully-qualified folder resource name string.

Parameter
NameDescription
folder string
Returns
TypeDescription
string

{string} Resource name string.

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
    ]>;

Returns the IAM access control policy for the specified project. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource 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 Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

    // Run request
    const response = await resourcemanagerClient.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
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request protos.google.iam.v1.IGetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.IGetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProject(request, options)

getProject(request?: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, options?: CallOptions): Promise<[
        protos.google.cloud.resourcemanager.v3.IProject,
        protos.google.cloud.resourcemanager.v3.IGetProjectRequest | undefined,
        {} | undefined
    ]>;

Retrieves the project identified by the specified name (for example, projects/415104041262).

The caller must have resourcemanager.projects.get permission for this project.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IGetProjectRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IGetProjectRequest | undefined, {} | undefined ]>

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

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the project (for example, `projects/415104041262`).
   */
  // const name = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

    // Run request
    const response = await resourcemanagerClient.getProject(request);
    console.log(response);
  }

  callGetProject();

getProject(request, options, callback)

getProject(request: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, options: CallOptions, callback: Callback<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IGetProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IGetProjectRequest
options CallOptions
callback Callback<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IGetProjectRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProject(request, callback)

getProject(request: protos.google.cloud.resourcemanager.v3.IGetProjectRequest, callback: Callback<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IGetProjectRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IGetProjectRequest
callback Callback<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IGetProjectRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

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

getProjectId(callback)

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

initialize()

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

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

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

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

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

listProjects(request, options)

listProjects(request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.resourcemanager.v3.IProject[],
        protos.google.cloud.resourcemanager.v3.IListProjectsRequest | null,
        protos.google.cloud.resourcemanager.v3.IListProjectsResponse
    ]>;

Lists projects that are direct children of the specified folder or organization resource. list() provides a strongly consistent view of the projects underneath the specified parent resource. list() returns projects sorted based upon the (ascending) lexical ordering of their display_name. The caller must have resourcemanager.projects.list permission on the identified parent.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IListProjectsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.resourcemanager.v3.IProject[], protos.google.cloud.resourcemanager.v3.IListProjectsRequest | null, protos.google.cloud.resourcemanager.v3.IListProjectsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Project]. 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 listProjectsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

listProjects(request, options, callback)

listProjects(request: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.resourcemanager.v3.IListProjectsRequest, protos.google.cloud.resourcemanager.v3.IListProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IListProjectsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.resourcemanager.v3.IListProjectsRequest, protos.google.cloud.resourcemanager.v3.IListProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>
Returns
TypeDescription
void

listProjects(request, callback)

listProjects(request: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, callback: PaginationCallback<protos.google.cloud.resourcemanager.v3.IListProjectsRequest, protos.google.cloud.resourcemanager.v3.IListProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IListProjectsRequest
callback PaginationCallback<protos.google.cloud.resourcemanager.v3.IListProjectsRequest, protos.google.cloud.resourcemanager.v3.IListProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>
Returns
TypeDescription
void

listProjectsAsync(request, options)

listProjectsAsync(request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.resourcemanager.v3.IProject>;

Equivalent to listProjects, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IListProjectsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.resourcemanager.v3.IProject>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Project]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the parent resource to list projects under.
   *  For example, setting this field to 'folders/1234' would list all projects
   *  directly under that folder.
   */
  // const parent = 'abc123'
  /**
   *  Optional. A pagination token returned from a previous call to ListProjects 
   *  google.cloud.resourcemanager.v3.Projects.ListProjects 
   *  that indicates from where listing should continue.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. The maximum number of projects to return in the response.
   *  The server can return fewer projects than requested.
   *  If unspecified, server picks an appropriate default.
   */
  // const pageSize = 1234
  /**
   *  Optional. Indicate that projects in the `DELETE_REQUESTED` state should also be
   *  returned. Normally only `ACTIVE` projects are returned.
   */
  // const showDeleted = true

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callListProjects();

listProjectsStream(request, options)

listProjectsStream(request?: protos.google.cloud.resourcemanager.v3.IListProjectsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IListProjectsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Project] 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 listProjectsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

matchFolderFromFolderName(folderName)

matchFolderFromFolderName(folderName: string): string | number;

Parse the folder from Folder resource.

Parameter
NameDescription
folderName string

A fully-qualified path representing Folder resource.

Returns
TypeDescription
string | number

{string} A string representing the folder.

matchOrganizationFromOrganizationName(organizationName)

matchOrganizationFromOrganizationName(organizationName: string): string | number;

Parse the organization from Organization resource.

Parameter
NameDescription
organizationName string

A fully-qualified path representing Organization resource.

Returns
TypeDescription
string | number

{string} A string representing the organization.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
NameDescription
projectName string

A fully-qualified path representing Project resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchTagBindingFromTagBindingName(tagBindingName)

matchTagBindingFromTagBindingName(tagBindingName: string): string | number;

Parse the tag_binding from TagBinding resource.

Parameter
NameDescription
tagBindingName string

A fully-qualified path representing TagBinding resource.

Returns
TypeDescription
string | number

{string} A string representing the tag_binding.

matchTagKeyFromTagKeyName(tagKeyName)

matchTagKeyFromTagKeyName(tagKeyName: string): string | number;

Parse the tag_key from TagKey resource.

Parameter
NameDescription
tagKeyName string

A fully-qualified path representing TagKey resource.

Returns
TypeDescription
string | number

{string} A string representing the tag_key.

matchTagValueFromTagValueName(tagValueName)

matchTagValueFromTagValueName(tagValueName: string): string | number;

Parse the tag_value from TagValue resource.

Parameter
NameDescription
tagValueName string

A fully-qualified path representing TagValue resource.

Returns
TypeDescription
string | number

{string} A string representing the tag_value.

moveProject(request, options)

moveProject(request?: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Move a project to another place in your resource hierarchy, under a new resource parent.

Returns an operation which can be used to track the process of the project move workflow. Upon success, the Operation.response field will be populated with the moved project.

The caller must have resourcemanager.projects.update permission on the project and have resourcemanager.projects.move permission on the project's current and proposed new parent.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IMoveProjectRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

  /**
   * 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 project to move.
   */
  // const name = 'abc123'
  /**
   *  Required. The new parent to move the Project under.
   */
  // const destinationParent = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callMoveProject();

moveProject(request, options, callback)

moveProject(request: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IMoveProjectRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

moveProject(request, callback)

moveProject(request: protos.google.cloud.resourcemanager.v3.IMoveProjectRequest, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IMoveProjectRequest
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IMoveProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

organizationPath(organization)

organizationPath(organization: string): string;

Return a fully-qualified organization resource name string.

Parameter
NameDescription
organization string
Returns
TypeDescription
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
NameDescription
project string
Returns
TypeDescription
string

{string} Resource name string.

searchProjects(request, options)

searchProjects(request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.resourcemanager.v3.IProject[],
        protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest | null,
        protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse
    ]>;

Search for projects that the caller has both resourcemanager.projects.get permission on, and also satisfy the specified query.

This method returns projects in an unspecified order.

This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the method.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.resourcemanager.v3.IProject[], protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest | null, protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of [Project]. 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 searchProjectsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

searchProjects(request, options, callback)

searchProjects(request: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>
Returns
TypeDescription
void

searchProjects(request, callback)

searchProjects(request: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, callback: PaginationCallback<protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest
callback PaginationCallback<protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, protos.google.cloud.resourcemanager.v3.ISearchProjectsResponse | null | undefined, protos.google.cloud.resourcemanager.v3.IProject>
Returns
TypeDescription
void

searchProjectsAsync(request, options)

searchProjectsAsync(request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.resourcemanager.v3.IProject>;

Equivalent to searchProjects, but returns an iterable object.

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

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.resourcemanager.v3.IProject>

{Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Project]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Optional. A query string for searching for projects that the caller has
   *  `resourcemanager.projects.get` permission to. If multiple fields are
   *  included in the query, the it will return results that match any of the
   *  fields. Some eligible fields are:
   *  ```
   *  | Field                   | Description                                  |
   *  |-------------------------|----------------------------------------------|
   *  | displayName, name       | Filters by displayName.                      |
   *  | parent                  | Project's parent. (for example: folders/123,
   *  organizations/*) Prefer parent field over parent.type and parent.id. |
   *  | parent.type             | Parent's type: `folder` or `organization`.   |
   *  | parent.id               | Parent's id number (for example: 123)        |
   *  | id, projectId           | Filters by projectId.                        |
   *  | state, lifecycleState   | Filters by state.                            |
   *  | labels                  | Filters by label name or value.              |
   *  | labels.

searchProjectsStream(request, options)

searchProjectsStream(request?: protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.ISearchProjectsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing [Project] 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 searchProjectsAsync() method described below for async iteration which you can stop as needed. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples.

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
    ]>;

Sets the IAM access control policy for the specified project.

CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings.

Note: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles.

The following constraints apply when using setIamPolicy():

  • Project does not support allUsers and allAuthenticatedUsers as members in a Binding of a Policy.

  • The owner role can be granted to a user, serviceAccount, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization.

  • Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited using the Cloud Platform console and must accept the invitation.

  • A user cannot be granted the owner role using setIamPolicy(). The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation.

  • Invitations to grant the owner role cannot be sent using setIamPolicy(); they must be sent only using the Cloud Platform Console.

  • Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected.

  • If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling setIamPolicy() to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified.

  • Calling this method requires enabling the App Engine Admin API.

Parameters
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource 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 Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

    // Run request
    const response = await resourcemanagerClient.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
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
options CallOptions
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request protos.google.iam.v1.ISetIamPolicyRequest
callback Callback<protos.google.iam.v1.IPolicy, protos.google.iam.v1.ISetIamPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

tagBindingPath(tagBinding)

tagBindingPath(tagBinding: string): string;

Return a fully-qualified tagBinding resource name string.

Parameter
NameDescription
tagBinding string
Returns
TypeDescription
string

{string} Resource name string.

tagKeyPath(tagKey)

tagKeyPath(tagKey: string): string;

Return a fully-qualified tagKey resource name string.

Parameter
NameDescription
tagKey string
Returns
TypeDescription
string

{string} Resource name string.

tagValuePath(tagValue)

tagValuePath(tagValue: string): string;

Return a fully-qualified tagValue resource name string.

Parameter
NameDescription
tagValue string
Returns
TypeDescription
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
    ]>;

Returns permissions that a caller has on the specified project.

Parameters
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  REQUIRED: The resource 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 = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

    // Run request
    const response = await resourcemanagerClient.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
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
options CallOptions
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request protos.google.iam.v1.ITestIamPermissionsRequest
callback Callback<protos.google.iam.v1.ITestIamPermissionsResponse, protos.google.iam.v1.ITestIamPermissionsRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

undeleteProject(request, options)

undeleteProject(request?: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Restores the project identified by the specified name (for example, projects/415104041262). You can only use this method for a project that has a lifecycle state of [DELETE_REQUESTED] [Projects.State.DELETE_REQUESTED]. After deletion starts, the project cannot be restored.

The caller must have resourcemanager.projects.undelete permission for this project.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

  /**
   * 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 project (for example, `projects/415104041262`).
   *  Required.
   */
  // const name = 'abc123'

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

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

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

  callUndeleteProject();

undeleteProject(request, options, callback)

undeleteProject(request: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

undeleteProject(request, callback)

undeleteProject(request: protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IUndeleteProjectRequest
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUndeleteProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateProject(request, options)

updateProject(request?: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the display_name and labels of the project identified by the specified name (for example, projects/415104041262). Deleting all labels requires an update mask for labels field.

The caller must have resourcemanager.projects.update permission for this project.

Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

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

Example

  /**
   * 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 new definition of the project.
   */
  // const project = 'my-project'
  /**
   *  Optional. An update mask to selectively update fields.
   */
  // const updateMask = {}

  // Imports the Resourcemanager library
  const {ProjectsClient} = require('@google-cloud/resource-manager').v3;

  // Instantiates a client
  const resourcemanagerClient = new ProjectsClient();

  async function callUpdateProject() {
    // Construct request
    const request = {
      project,
    };

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

  callUpdateProject();

updateProject(request, options, callback)

updateProject(request: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateProject(request, callback)

updateProject(request: protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest, callback: Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request protos.google.cloud.resourcemanager.v3.IUpdateProjectRequest
callback Callback<LROperation<protos.google.cloud.resourcemanager.v3.IProject, protos.google.cloud.resourcemanager.v3.IUpdateProjectMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void