Cloud Resource Manager v3 API - Class ProjectsClient (2.4.0)

public abstract class ProjectsClient

Reference documentation and code samples for the Cloud Resource Manager v3 API class ProjectsClient.

Projects client wrapper, for convenient use.

Inheritance

object > ProjectsClient

Derived Types

Namespace

Google.Cloud.ResourceManager.V3

Assembly

Google.Cloud.ResourceManager.V3.dll

Remarks

Manages Google Cloud Projects.

Properties

CreateProjectOperationsClient

public virtual OperationsClient CreateProjectOperationsClient { get; }

The long-running operations client for CreateProject.

Property Value
TypeDescription
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the Projects service, which is a host of "cloudresourcemanager.googleapis.com" and a port of 443.

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Projects scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteProjectOperationsClient

public virtual OperationsClient DeleteProjectOperationsClient { get; }

The long-running operations client for DeleteProject.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual Projects.ProjectsClient GrpcClient { get; }

The underlying gRPC Projects client

Property Value
TypeDescription
ProjectsProjectsClient

MoveProjectOperationsClient

public virtual OperationsClient MoveProjectOperationsClient { get; }

The long-running operations client for MoveProject.

Property Value
TypeDescription
OperationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

UndeleteProjectOperationsClient

public virtual OperationsClient UndeleteProjectOperationsClient { get; }

The long-running operations client for UndeleteProject.

Property Value
TypeDescription
OperationsClient

UpdateProjectOperationsClient

public virtual OperationsClient UpdateProjectOperationsClient { get; }

The long-running operations client for UpdateProject.

Property Value
TypeDescription
OperationsClient

Methods

Create()

public static ProjectsClient Create()

Synchronously creates a ProjectsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProjectsClientBuilder.

Returns
TypeDescription
ProjectsClient

The created ProjectsClient.

CreateAsync(CancellationToken)

public static Task<ProjectsClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a ProjectsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ProjectsClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskProjectsClient

The task representing the created ProjectsClient.

CreateProject(CreateProjectRequest, CallSettings)

public virtual Operation<Project, CreateProjectMetadata> CreateProject(CreateProjectRequest request, CallSettings callSettings = null)

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
requestCreateProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectCreateProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
CreateProjectRequest request = new CreateProjectRequest
{
    Project = new Project(),
};
// Make the request
Operation<Project, CreateProjectMetadata> response = projectsClient.CreateProject(request);

// Poll until the returned long-running operation is complete
Operation<Project, CreateProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, CreateProjectMetadata> retrievedResponse = projectsClient.PollOnceCreateProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

CreateProject(Project, CallSettings)

public virtual Operation<Project, CreateProjectMetadata> CreateProject(Project project, CallSettings callSettings = null)

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
projectProject

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 Organization, the parent will be set to that Organization.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectCreateProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
Project project = new Project();
// Make the request
Operation<Project, CreateProjectMetadata> response = projectsClient.CreateProject(project);

// Poll until the returned long-running operation is complete
Operation<Project, CreateProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, CreateProjectMetadata> retrievedResponse = projectsClient.PollOnceCreateProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

CreateProjectAsync(CreateProjectRequest, CallSettings)

public virtual Task<Operation<Project, CreateProjectMetadata>> CreateProjectAsync(CreateProjectRequest request, CallSettings callSettings = null)

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
requestCreateProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectCreateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
CreateProjectRequest request = new CreateProjectRequest
{
    Project = new Project(),
};
// Make the request
Operation<Project, CreateProjectMetadata> response = await projectsClient.CreateProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, CreateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, CreateProjectMetadata> retrievedResponse = await projectsClient.PollOnceCreateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

CreateProjectAsync(CreateProjectRequest, CancellationToken)

public virtual Task<Operation<Project, CreateProjectMetadata>> CreateProjectAsync(CreateProjectRequest request, CancellationToken cancellationToken)

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
requestCreateProjectRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectCreateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
CreateProjectRequest request = new CreateProjectRequest
{
    Project = new Project(),
};
// Make the request
Operation<Project, CreateProjectMetadata> response = await projectsClient.CreateProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, CreateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, CreateProjectMetadata> retrievedResponse = await projectsClient.PollOnceCreateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

CreateProjectAsync(Project, CallSettings)

public virtual Task<Operation<Project, CreateProjectMetadata>> CreateProjectAsync(Project project, CallSettings callSettings = null)

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
projectProject

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 Organization, the parent will be set to that Organization.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectCreateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
Project project = new Project();
// Make the request
Operation<Project, CreateProjectMetadata> response = await projectsClient.CreateProjectAsync(project);

// Poll until the returned long-running operation is complete
Operation<Project, CreateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, CreateProjectMetadata> retrievedResponse = await projectsClient.PollOnceCreateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

CreateProjectAsync(Project, CancellationToken)

public virtual Task<Operation<Project, CreateProjectMetadata>> CreateProjectAsync(Project project, CancellationToken cancellationToken)

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
projectProject

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 Organization, the parent will be set to that Organization.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectCreateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
Project project = new Project();
// Make the request
Operation<Project, CreateProjectMetadata> response = await projectsClient.CreateProjectAsync(project);

// Poll until the returned long-running operation is complete
Operation<Project, CreateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, CreateProjectMetadata> retrievedResponse = await projectsClient.PollOnceCreateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProject(ProjectName, CallSettings)

public virtual Operation<Project, DeleteProjectMetadata> DeleteProject(ProjectName name, CallSettings callSettings = null)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
nameProjectName

Required. The name of the Project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectDeleteProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, DeleteProjectMetadata> response = projectsClient.DeleteProject(name);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = projectsClient.PollOnceDeleteProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProject(DeleteProjectRequest, CallSettings)

public virtual Operation<Project, DeleteProjectMetadata> DeleteProject(DeleteProjectRequest request, CallSettings callSettings = null)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
requestDeleteProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectDeleteProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
DeleteProjectRequest request = new DeleteProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Project, DeleteProjectMetadata> response = projectsClient.DeleteProject(request);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = projectsClient.PollOnceDeleteProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProject(string, CallSettings)

public virtual Operation<Project, DeleteProjectMetadata> DeleteProject(string name, CallSettings callSettings = null)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
namestring

Required. The name of the Project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectDeleteProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, DeleteProjectMetadata> response = projectsClient.DeleteProject(name);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = projectsClient.PollOnceDeleteProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProjectAsync(ProjectName, CallSettings)

public virtual Task<Operation<Project, DeleteProjectMetadata>> DeleteProjectAsync(ProjectName name, CallSettings callSettings = null)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
nameProjectName

Required. The name of the Project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, DeleteProjectMetadata> response = await projectsClient.DeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceDeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProjectAsync(ProjectName, CancellationToken)

public virtual Task<Operation<Project, DeleteProjectMetadata>> DeleteProjectAsync(ProjectName name, CancellationToken cancellationToken)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
nameProjectName

Required. The name of the Project (for example, projects/415104041262).

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, DeleteProjectMetadata> response = await projectsClient.DeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceDeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProjectAsync(DeleteProjectRequest, CallSettings)

public virtual Task<Operation<Project, DeleteProjectMetadata>> DeleteProjectAsync(DeleteProjectRequest request, CallSettings callSettings = null)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
requestDeleteProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
DeleteProjectRequest request = new DeleteProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Project, DeleteProjectMetadata> response = await projectsClient.DeleteProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceDeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProjectAsync(DeleteProjectRequest, CancellationToken)

public virtual Task<Operation<Project, DeleteProjectMetadata>> DeleteProjectAsync(DeleteProjectRequest request, CancellationToken cancellationToken)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
requestDeleteProjectRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
DeleteProjectRequest request = new DeleteProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Project, DeleteProjectMetadata> response = await projectsClient.DeleteProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceDeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, DeleteProjectMetadata>> DeleteProjectAsync(string name, CallSettings callSettings = null)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
namestring

Required. The name of the Project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, DeleteProjectMetadata> response = await projectsClient.DeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceDeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

DeleteProjectAsync(string, CancellationToken)

public virtual Task<Operation<Project, DeleteProjectMetadata>> DeleteProjectAsync(string name, CancellationToken cancellationToken)

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 [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE].

This method changes the Project's lifecycle state from [ACTIVE][google.cloud.resourcemanager.v3.Project.State.ACTIVE] to [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Project.State.DELETE_REQUESTED]. 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 [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects] 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
namestring

Required. The name of the Project (for example, projects/415104041262).

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, DeleteProjectMetadata> response = await projectsClient.DeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, DeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, DeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceDeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

GetIamPolicy(IResourceName, CallSettings)

public virtual Policy GetIamPolicy(IResourceName resource, CallSettings callSettings = null)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = projectsClient.GetIamPolicy(resource);

GetIamPolicy(GetIamPolicyRequest, CallSettings)

public virtual Policy GetIamPolicy(GetIamPolicyRequest request, CallSettings callSettings = null)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = projectsClient.GetIamPolicy(request);

GetIamPolicy(string, CallSettings)

public virtual Policy GetIamPolicy(string resource, CallSettings callSettings = null)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = projectsClient.GetIamPolicy(resource);

GetIamPolicyAsync(IResourceName, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CallSettings callSettings = null)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await projectsClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(IResourceName, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(IResourceName resource, CancellationToken cancellationToken)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Policy response = await projectsClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(GetIamPolicyRequest, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CallSettings callSettings = null)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await projectsClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(GetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(GetIamPolicyRequest request, CancellationToken cancellationToken)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
requestGetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
GetIamPolicyRequest request = new GetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Options = new GetPolicyOptions(),
};
// Make the request
Policy response = await projectsClient.GetIamPolicyAsync(request);

GetIamPolicyAsync(string, CallSettings)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CallSettings callSettings = null)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await projectsClient.GetIamPolicyAsync(resource);

GetIamPolicyAsync(string, CancellationToken)

public virtual Task<Policy> GetIamPolicyAsync(string resource, CancellationToken cancellationToken)

Returns the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123. Permission is denied if the policy or the resource do not exist.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
// Make the request
Policy response = await projectsClient.GetIamPolicyAsync(resource);

GetProject(ProjectName, CallSettings)

public virtual Project GetProject(ProjectName name, CallSettings callSettings = null)

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
nameProjectName

Required. The name of the project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Project

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Project response = projectsClient.GetProject(name);

GetProject(GetProjectRequest, CallSettings)

public virtual Project GetProject(GetProjectRequest request, CallSettings callSettings = null)

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
requestGetProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Project

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
GetProjectRequest request = new GetProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Project response = projectsClient.GetProject(request);

GetProject(string, CallSettings)

public virtual Project GetProject(string name, CallSettings callSettings = null)

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
namestring

Required. The name of the project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Project

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Project response = projectsClient.GetProject(name);

GetProjectAsync(ProjectName, CallSettings)

public virtual Task<Project> GetProjectAsync(ProjectName name, CallSettings callSettings = null)

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
nameProjectName

Required. The name of the project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskProject

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Project response = await projectsClient.GetProjectAsync(name);

GetProjectAsync(ProjectName, CancellationToken)

public virtual Task<Project> GetProjectAsync(ProjectName name, CancellationToken cancellationToken)

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
nameProjectName

Required. The name of the project (for example, projects/415104041262).

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskProject

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Project response = await projectsClient.GetProjectAsync(name);

GetProjectAsync(GetProjectRequest, CallSettings)

public virtual Task<Project> GetProjectAsync(GetProjectRequest request, CallSettings callSettings = null)

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
requestGetProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskProject

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
GetProjectRequest request = new GetProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Project response = await projectsClient.GetProjectAsync(request);

GetProjectAsync(GetProjectRequest, CancellationToken)

public virtual Task<Project> GetProjectAsync(GetProjectRequest request, CancellationToken cancellationToken)

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
requestGetProjectRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskProject

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
GetProjectRequest request = new GetProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Project response = await projectsClient.GetProjectAsync(request);

GetProjectAsync(string, CallSettings)

public virtual Task<Project> GetProjectAsync(string name, CallSettings callSettings = null)

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
namestring

Required. The name of the project (for example, projects/415104041262).

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskProject

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Project response = await projectsClient.GetProjectAsync(name);

GetProjectAsync(string, CancellationToken)

public virtual Task<Project> GetProjectAsync(string name, CancellationToken cancellationToken)

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
namestring

Required. The name of the project (for example, projects/415104041262).

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskProject

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Project response = await projectsClient.GetProjectAsync(name);

ListProjects(IResourceName, string, int?, CallSettings)

public virtual PagedEnumerable<ListProjectsResponse, Project> ListProjects(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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
parentIResourceName

Required. The name of the parent resource whose projects are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListProjectsResponseProject

A pageable sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedEnumerable<ListProjectsResponse, Project> response = projectsClient.ListProjects(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Project item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProjectsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjects(ListProjectsRequest, CallSettings)

public virtual PagedEnumerable<ListProjectsResponse, Project> ListProjects(ListProjectsRequest request, CallSettings callSettings = null)

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
requestListProjectsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListProjectsResponseProject

A pageable sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
ListProjectsRequest request = new ListProjectsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ShowDeleted = false,
};
// Make the request
PagedEnumerable<ListProjectsResponse, Project> response = projectsClient.ListProjects(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Project item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProjectsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjects(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListProjectsResponse, Project> ListProjects(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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
parentstring

Required. The name of the parent resource whose projects are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableListProjectsResponseProject

A pageable sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedEnumerable<ListProjectsResponse, Project> response = projectsClient.ListProjects(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Project item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListProjectsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectsAsync(IResourceName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListProjectsResponse, Project> ListProjectsAsync(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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
parentIResourceName

Required. The name of the parent resource whose projects are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListProjectsResponseProject

A pageable asynchronous sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedAsyncEnumerable<ListProjectsResponse, Project> response = projectsClient.ListProjectsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Project item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProjectsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectsAsync(ListProjectsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListProjectsResponse, Project> ListProjectsAsync(ListProjectsRequest request, CallSettings callSettings = null)

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
requestListProjectsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListProjectsResponseProject

A pageable asynchronous sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ListProjectsRequest request = new ListProjectsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    ShowDeleted = false,
};
// Make the request
PagedAsyncEnumerable<ListProjectsResponse, Project> response = projectsClient.ListProjectsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Project item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProjectsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListProjectsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListProjectsResponse, Project> ListProjectsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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
parentstring

Required. The name of the parent resource whose projects are being listed. Only children of this parent resource are listed; descendants are not listed.

If the parent is a folder, use the value folders/{folder_id}. If the parent is an organization, use the value organizations/{org_id}.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableListProjectsResponseProject

A pageable asynchronous sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedAsyncEnumerable<ListProjectsResponse, Project> response = projectsClient.ListProjectsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Project item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListProjectsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

MoveProject(ProjectName, IResourceName, CallSettings)

public virtual Operation<Project, MoveProjectMetadata> MoveProject(ProjectName name, IResourceName destinationParent, CallSettings callSettings = null)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
nameProjectName

Required. The name of the project to move.

destinationParentIResourceName

Required. The new parent to move the Project under.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectMoveProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
IResourceName destinationParent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Operation<Project, MoveProjectMetadata> response = projectsClient.MoveProject(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = projectsClient.PollOnceMoveProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProject(MoveProjectRequest, CallSettings)

public virtual Operation<Project, MoveProjectMetadata> MoveProject(MoveProjectRequest request, CallSettings callSettings = null)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
requestMoveProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectMoveProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
MoveProjectRequest request = new MoveProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
};
// Make the request
Operation<Project, MoveProjectMetadata> response = projectsClient.MoveProject(request);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = projectsClient.PollOnceMoveProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProject(string, string, CallSettings)

public virtual Operation<Project, MoveProjectMetadata> MoveProject(string name, string destinationParent, CallSettings callSettings = null)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
namestring

Required. The name of the project to move.

destinationParentstring

Required. The new parent to move the Project under.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectMoveProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
string destinationParent = "a/wildcard/resource";
// Make the request
Operation<Project, MoveProjectMetadata> response = projectsClient.MoveProject(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = projectsClient.PollOnceMoveProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProjectAsync(ProjectName, IResourceName, CallSettings)

public virtual Task<Operation<Project, MoveProjectMetadata>> MoveProjectAsync(ProjectName name, IResourceName destinationParent, CallSettings callSettings = null)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
nameProjectName

Required. The name of the project to move.

destinationParentIResourceName

Required. The new parent to move the Project under.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
IResourceName destinationParent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Operation<Project, MoveProjectMetadata> response = await projectsClient.MoveProjectAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = await projectsClient.PollOnceMoveProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProjectAsync(ProjectName, IResourceName, CancellationToken)

public virtual Task<Operation<Project, MoveProjectMetadata>> MoveProjectAsync(ProjectName name, IResourceName destinationParent, CancellationToken cancellationToken)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
nameProjectName

Required. The name of the project to move.

destinationParentIResourceName

Required. The new parent to move the Project under.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
IResourceName destinationParent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
Operation<Project, MoveProjectMetadata> response = await projectsClient.MoveProjectAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = await projectsClient.PollOnceMoveProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProjectAsync(MoveProjectRequest, CallSettings)

public virtual Task<Operation<Project, MoveProjectMetadata>> MoveProjectAsync(MoveProjectRequest request, CallSettings callSettings = null)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
requestMoveProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
MoveProjectRequest request = new MoveProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
};
// Make the request
Operation<Project, MoveProjectMetadata> response = await projectsClient.MoveProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = await projectsClient.PollOnceMoveProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProjectAsync(MoveProjectRequest, CancellationToken)

public virtual Task<Operation<Project, MoveProjectMetadata>> MoveProjectAsync(MoveProjectRequest request, CancellationToken cancellationToken)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
requestMoveProjectRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
MoveProjectRequest request = new MoveProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
    DestinationParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
};
// Make the request
Operation<Project, MoveProjectMetadata> response = await projectsClient.MoveProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = await projectsClient.PollOnceMoveProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProjectAsync(string, string, CallSettings)

public virtual Task<Operation<Project, MoveProjectMetadata>> MoveProjectAsync(string name, string destinationParent, CallSettings callSettings = null)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
namestring

Required. The name of the project to move.

destinationParentstring

Required. The new parent to move the Project under.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
string destinationParent = "a/wildcard/resource";
// Make the request
Operation<Project, MoveProjectMetadata> response = await projectsClient.MoveProjectAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = await projectsClient.PollOnceMoveProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

MoveProjectAsync(string, string, CancellationToken)

public virtual Task<Operation<Project, MoveProjectMetadata>> MoveProjectAsync(string name, string destinationParent, CancellationToken cancellationToken)

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.move permission on the project, on the project's current and proposed new parent.

If project has no current parent, or it currently does not have an associated organization resource, you will also need the resourcemanager.projects.setIamPolicy permission in the project.

Parameters
NameDescription
namestring

Required. The name of the project to move.

destinationParentstring

Required. The new parent to move the Project under.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
string destinationParent = "a/wildcard/resource";
// Make the request
Operation<Project, MoveProjectMetadata> response = await projectsClient.MoveProjectAsync(name, destinationParent);

// Poll until the returned long-running operation is complete
Operation<Project, MoveProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, MoveProjectMetadata> retrievedResponse = await projectsClient.PollOnceMoveProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

PollOnceCreateProject(string, CallSettings)

public virtual Operation<Project, CreateProjectMetadata> PollOnceCreateProject(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectCreateProjectMetadata

The result of polling the operation.

PollOnceCreateProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, CreateProjectMetadata>> PollOnceCreateProjectAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectCreateProjectMetadata

A task representing the result of polling the operation.

PollOnceDeleteProject(string, CallSettings)

public virtual Operation<Project, DeleteProjectMetadata> PollOnceDeleteProject(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectDeleteProjectMetadata

The result of polling the operation.

PollOnceDeleteProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, DeleteProjectMetadata>> PollOnceDeleteProjectAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectDeleteProjectMetadata

A task representing the result of polling the operation.

PollOnceMoveProject(string, CallSettings)

public virtual Operation<Project, MoveProjectMetadata> PollOnceMoveProject(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of MoveProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectMoveProjectMetadata

The result of polling the operation.

PollOnceMoveProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, MoveProjectMetadata>> PollOnceMoveProjectAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of MoveProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectMoveProjectMetadata

A task representing the result of polling the operation.

PollOnceUndeleteProject(string, CallSettings)

public virtual Operation<Project, UndeleteProjectMetadata> PollOnceUndeleteProject(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of UndeleteProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUndeleteProjectMetadata

The result of polling the operation.

PollOnceUndeleteProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> PollOnceUndeleteProjectAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of UndeleteProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A task representing the result of polling the operation.

PollOnceUpdateProject(string, CallSettings)

public virtual Operation<Project, UpdateProjectMetadata> PollOnceUpdateProject(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of UpdateProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUpdateProjectMetadata

The result of polling the operation.

PollOnceUpdateProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, UpdateProjectMetadata>> PollOnceUpdateProjectAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of UpdateProject.

Parameters
NameDescription
operationNamestring

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUpdateProjectMetadata

A task representing the result of polling the operation.

SearchProjects(SearchProjectsRequest, CallSettings)

public virtual PagedEnumerable<SearchProjectsResponse, Project> SearchProjects(SearchProjectsRequest request, CallSettings callSettings = null)

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 [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method.

Parameters
NameDescription
requestSearchProjectsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchProjectsResponseProject

A pageable sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
SearchProjectsRequest request = new SearchProjectsRequest { Query = "", };
// Make the request
PagedEnumerable<SearchProjectsResponse, Project> response = projectsClient.SearchProjects(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Project item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchProjectsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchProjects(string, string, int?, CallSettings)

public virtual PagedEnumerable<SearchProjectsResponse, Project> SearchProjects(string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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 [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method.

Parameters
NameDescription
querystring

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, then it will return results that match any of the fields. Some eligible fields are:

  • 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.<key> (where <key> is the name of a label): Filters by label name.

Search expressions are case insensitive.

Some examples queries:

  • name:how*: The project's name starts with "how".
  • name:Howl: The project's name is Howl or howl.
  • name:HOWL: Equivalent to above.
  • NAME:howl: Equivalent to above.
  • labels.color:*: The project has the label color.
  • labels.color:red: The project's label color has the value red.
  • labels.color:red labels.size:big: The project's label color has the value red or its label size has the value big.

If no query is specified, the call will return projects for which the user has the resourcemanager.projects.get permission.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerableSearchProjectsResponseProject

A pageable sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string query = "";
// Make the request
PagedEnumerable<SearchProjectsResponse, Project> response = projectsClient.SearchProjects(query);

// Iterate over all response items, lazily performing RPCs as required
foreach (Project item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (SearchProjectsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchProjectsAsync(SearchProjectsRequest, CallSettings)

public virtual PagedAsyncEnumerable<SearchProjectsResponse, Project> SearchProjectsAsync(SearchProjectsRequest request, CallSettings callSettings = null)

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 [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method.

Parameters
NameDescription
requestSearchProjectsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchProjectsResponseProject

A pageable asynchronous sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
SearchProjectsRequest request = new SearchProjectsRequest { Query = "", };
// Make the request
PagedAsyncEnumerable<SearchProjectsResponse, Project> response = projectsClient.SearchProjectsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Project item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchProjectsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SearchProjectsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchProjectsResponse, Project> SearchProjectsAsync(string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

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 [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject] method.

Parameters
NameDescription
querystring

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, then it will return results that match any of the fields. Some eligible fields are:

  • 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.<key> (where <key> is the name of a label): Filters by label name.

Search expressions are case insensitive.

Some examples queries:

  • name:how*: The project's name starts with "how".
  • name:Howl: The project's name is Howl or howl.
  • name:HOWL: Equivalent to above.
  • NAME:howl: Equivalent to above.
  • labels.color:*: The project has the label color.
  • labels.color:red: The project's label color has the value red.
  • labels.color:red labels.size:big: The project's label color has the value red or its label size has the value big.

If no query is specified, the call will return projects for which the user has the resourcemanager.projects.get permission.

pageTokenstring

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerableSearchProjectsResponseProject

A pageable asynchronous sequence of Project resources.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string query = "";
// Make the request
PagedAsyncEnumerable<SearchProjectsResponse, Project> response = projectsClient.SearchProjectsAsync(query);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Project item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((SearchProjectsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Project item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Project> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Project item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

SetIamPolicy(IResourceName, Policy, CallSettings)

public virtual Policy SetIamPolicy(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = projectsClient.SetIamPolicy(resource, policy);

SetIamPolicy(SetIamPolicyRequest, CallSettings)

public virtual Policy SetIamPolicy(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = projectsClient.SetIamPolicy(request);

SetIamPolicy(string, Policy, CallSettings)

public virtual Policy SetIamPolicy(string resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Policy

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = projectsClient.SetIamPolicy(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await projectsClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(IResourceName, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(IResourceName resource, Policy policy, CancellationToken cancellationToken)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
Policy policy = new Policy();
// Make the request
Policy response = await projectsClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(SetIamPolicyRequest, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CallSettings callSettings = null)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await projectsClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(SetIamPolicyRequest, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(SetIamPolicyRequest request, CancellationToken cancellationToken)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
requestSetIamPolicyRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
SetIamPolicyRequest request = new SetIamPolicyRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Policy = new Policy(),
    UpdateMask = new FieldMask(),
};
// Make the request
Policy response = await projectsClient.SetIamPolicyAsync(request);

SetIamPolicyAsync(string, Policy, CallSettings)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CallSettings callSettings = null)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await projectsClient.SetIamPolicyAsync(resource, policy);

SetIamPolicyAsync(string, Policy, CancellationToken)

public virtual Task<Policy> SetIamPolicyAsync(string resource, Policy policy, CancellationToken cancellationToken)

Sets the IAM access control policy for the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123.

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.

  • 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. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible.

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policyPolicy

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskPolicy

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
Policy policy = new Policy();
// Make the request
Policy response = await projectsClient.SetIamPolicyAsync(resource, policy);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TestIamPermissions(IResourceName, IEnumerable<string>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = projectsClient.TestIamPermissions(resource, permissions);

TestIamPermissions(TestIamPermissionsRequest, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = projectsClient.TestIamPermissions(request);

TestIamPermissions(string, IEnumerable<string>, CallSettings)

public virtual TestIamPermissionsResponse TestIamPermissions(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TestIamPermissionsResponse

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = projectsClient.TestIamPermissions(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await projectsClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(IResourceName, IEnumerable<string>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(IResourceName resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
resourceIResourceName

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
IResourceName resource = new UnparsedResourceName("a/wildcard/resource");
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await projectsClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(TestIamPermissionsRequest, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CallSettings callSettings = null)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await projectsClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(TestIamPermissionsRequest, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(TestIamPermissionsRequest request, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
requestTestIamPermissionsRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
TestIamPermissionsRequest request = new TestIamPermissionsRequest
{
    ResourceAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    Permissions = { "", },
};
// Make the request
TestIamPermissionsResponse response = await projectsClient.TestIamPermissionsAsync(request);

TestIamPermissionsAsync(string, IEnumerable<string>, CallSettings)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CallSettings callSettings = null)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await projectsClient.TestIamPermissionsAsync(resource, permissions);

TestIamPermissionsAsync(string, IEnumerable<string>, CancellationToken)

public virtual Task<TestIamPermissionsResponse> TestIamPermissionsAsync(string resource, IEnumerable<string> permissions, CancellationToken cancellationToken)

Returns permissions that a caller has on the specified project, in the format projects/{ProjectIdOrNumber} e.g. projects/123..

Parameters
NameDescription
resourcestring

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissionsIEnumerablestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskTestIamPermissionsResponse

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string resource = "a/wildcard/resource";
IEnumerable<string> permissions = new string[] { "", };
// Make the request
TestIamPermissionsResponse response = await projectsClient.TestIamPermissionsAsync(resource, permissions);

UndeleteProject(ProjectName, CallSettings)

public virtual Operation<Project, UndeleteProjectMetadata> UndeleteProject(ProjectName name, CallSettings callSettings = null)

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
nameProjectName

Required. The name of the project (for example, projects/415104041262).

Required.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUndeleteProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, UndeleteProjectMetadata> response = projectsClient.UndeleteProject(name);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = projectsClient.PollOnceUndeleteProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProject(UndeleteProjectRequest, CallSettings)

public virtual Operation<Project, UndeleteProjectMetadata> UndeleteProject(UndeleteProjectRequest request, CallSettings callSettings = null)

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
requestUndeleteProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUndeleteProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
UndeleteProjectRequest request = new UndeleteProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Project, UndeleteProjectMetadata> response = projectsClient.UndeleteProject(request);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = projectsClient.PollOnceUndeleteProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProject(string, CallSettings)

public virtual Operation<Project, UndeleteProjectMetadata> UndeleteProject(string name, CallSettings callSettings = null)

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
namestring

Required. The name of the project (for example, projects/415104041262).

Required.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUndeleteProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, UndeleteProjectMetadata> response = projectsClient.UndeleteProject(name);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = projectsClient.PollOnceUndeleteProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProjectAsync(ProjectName, CallSettings)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> UndeleteProjectAsync(ProjectName name, CallSettings callSettings = null)

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
nameProjectName

Required. The name of the project (for example, projects/415104041262).

Required.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, UndeleteProjectMetadata> response = await projectsClient.UndeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceUndeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProjectAsync(ProjectName, CancellationToken)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> UndeleteProjectAsync(ProjectName name, CancellationToken cancellationToken)

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
nameProjectName

Required. The name of the project (for example, projects/415104041262).

Required.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
// Make the request
Operation<Project, UndeleteProjectMetadata> response = await projectsClient.UndeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceUndeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProjectAsync(UndeleteProjectRequest, CallSettings)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> UndeleteProjectAsync(UndeleteProjectRequest request, CallSettings callSettings = null)

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
requestUndeleteProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
UndeleteProjectRequest request = new UndeleteProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Project, UndeleteProjectMetadata> response = await projectsClient.UndeleteProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceUndeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProjectAsync(UndeleteProjectRequest, CancellationToken)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> UndeleteProjectAsync(UndeleteProjectRequest request, CancellationToken cancellationToken)

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
requestUndeleteProjectRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
UndeleteProjectRequest request = new UndeleteProjectRequest
{
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
Operation<Project, UndeleteProjectMetadata> response = await projectsClient.UndeleteProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceUndeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProjectAsync(string, CallSettings)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> UndeleteProjectAsync(string name, CallSettings callSettings = null)

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
namestring

Required. The name of the project (for example, projects/415104041262).

Required.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, UndeleteProjectMetadata> response = await projectsClient.UndeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceUndeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UndeleteProjectAsync(string, CancellationToken)

public virtual Task<Operation<Project, UndeleteProjectMetadata>> UndeleteProjectAsync(string name, CancellationToken cancellationToken)

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
namestring

Required. The name of the project (for example, projects/415104041262).

Required.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectUndeleteProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
// Make the request
Operation<Project, UndeleteProjectMetadata> response = await projectsClient.UndeleteProjectAsync(name);

// Poll until the returned long-running operation is complete
Operation<Project, UndeleteProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UndeleteProjectMetadata> retrievedResponse = await projectsClient.PollOnceUndeleteProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UpdateProject(Project, FieldMask, CallSettings)

public virtual Operation<Project, UpdateProjectMetadata> UpdateProject(Project project, FieldMask updateMask, CallSettings callSettings = null)

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
projectProject

Required. The new definition of the project.

updateMaskFieldMask

Optional. An update mask to selectively update fields.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUpdateProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
Project project = new Project();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Project, UpdateProjectMetadata> response = projectsClient.UpdateProject(project, updateMask);

// Poll until the returned long-running operation is complete
Operation<Project, UpdateProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UpdateProjectMetadata> retrievedResponse = projectsClient.PollOnceUpdateProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UpdateProject(UpdateProjectRequest, CallSettings)

public virtual Operation<Project, UpdateProjectMetadata> UpdateProject(UpdateProjectRequest request, CallSettings callSettings = null)

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
requestUpdateProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
OperationProjectUpdateProjectMetadata

The RPC response.

Example
// Create client
ProjectsClient projectsClient = ProjectsClient.Create();
// Initialize request argument(s)
UpdateProjectRequest request = new UpdateProjectRequest
{
    Project = new Project(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Project, UpdateProjectMetadata> response = projectsClient.UpdateProject(request);

// Poll until the returned long-running operation is complete
Operation<Project, UpdateProjectMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UpdateProjectMetadata> retrievedResponse = projectsClient.PollOnceUpdateProject(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UpdateProjectAsync(Project, FieldMask, CallSettings)

public virtual Task<Operation<Project, UpdateProjectMetadata>> UpdateProjectAsync(Project project, FieldMask updateMask, CallSettings callSettings = null)

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
projectProject

Required. The new definition of the project.

updateMaskFieldMask

Optional. An update mask to selectively update fields.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUpdateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
Project project = new Project();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Project, UpdateProjectMetadata> response = await projectsClient.UpdateProjectAsync(project, updateMask);

// Poll until the returned long-running operation is complete
Operation<Project, UpdateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UpdateProjectMetadata> retrievedResponse = await projectsClient.PollOnceUpdateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UpdateProjectAsync(Project, FieldMask, CancellationToken)

public virtual Task<Operation<Project, UpdateProjectMetadata>> UpdateProjectAsync(Project project, FieldMask updateMask, CancellationToken cancellationToken)

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
projectProject

Required. The new definition of the project.

updateMaskFieldMask

Optional. An update mask to selectively update fields.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectUpdateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
Project project = new Project();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Project, UpdateProjectMetadata> response = await projectsClient.UpdateProjectAsync(project, updateMask);

// Poll until the returned long-running operation is complete
Operation<Project, UpdateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UpdateProjectMetadata> retrievedResponse = await projectsClient.PollOnceUpdateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UpdateProjectAsync(UpdateProjectRequest, CallSettings)

public virtual Task<Operation<Project, UpdateProjectMetadata>> UpdateProjectAsync(UpdateProjectRequest request, CallSettings callSettings = null)

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
requestUpdateProjectRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationProjectUpdateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
UpdateProjectRequest request = new UpdateProjectRequest
{
    Project = new Project(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Project, UpdateProjectMetadata> response = await projectsClient.UpdateProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, UpdateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UpdateProjectMetadata> retrievedResponse = await projectsClient.PollOnceUpdateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}

UpdateProjectAsync(UpdateProjectRequest, CancellationToken)

public virtual Task<Operation<Project, UpdateProjectMetadata>> UpdateProjectAsync(UpdateProjectRequest request, CancellationToken cancellationToken)

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
requestUpdateProjectRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskOperationProjectUpdateProjectMetadata

A Task containing the RPC response.

Example
// Create client
ProjectsClient projectsClient = await ProjectsClient.CreateAsync();
// Initialize request argument(s)
UpdateProjectRequest request = new UpdateProjectRequest
{
    Project = new Project(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Project, UpdateProjectMetadata> response = await projectsClient.UpdateProjectAsync(request);

// Poll until the returned long-running operation is complete
Operation<Project, UpdateProjectMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Project result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Project, UpdateProjectMetadata> retrievedResponse = await projectsClient.PollOnceUpdateProjectAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Project retrievedResult = retrievedResponse.Result;
}