public abstract class ProjectsClient
Reference documentation and code samples for the Cloud Resource Manager v3 API class ProjectsClient.
Projects client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.ResourceManager.V3Assembly
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Projects scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default Projects scopes are:
DeleteProjectOperationsClient
public virtual OperationsClient DeleteProjectOperationsClient { get; }
The long-running operations client for DeleteProject
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual Projects.ProjectsClient GrpcClient { get; }
The underlying gRPC Projects client
Property Value | |
---|---|
Type | Description |
ProjectsProjectsClient |
MoveProjectOperationsClient
public virtual OperationsClient MoveProjectOperationsClient { get; }
The long-running operations client for MoveProject
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
UndeleteProjectOperationsClient
public virtual OperationsClient UndeleteProjectOperationsClient { get; }
The long-running operations client for UndeleteProject
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
UpdateProjectOperationsClient
public virtual OperationsClient UpdateProjectOperationsClient { get; }
The long-running operations client for UpdateProject
.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
request | CreateProjectRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationProjectCreateProjectMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
project | Project Required. The Project to create. Project ID is required. If the requested ID is unavailable, the request fails. If the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationProjectCreateProjectMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateProjectRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectCreateProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | CreateProjectRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectCreateProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
project | Project Required. The Project to create. Project ID is required. If the requested ID is unavailable, the request fails. If the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectCreateProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
project | Project Required. The Project to create. Project ID is required. If the requested ID is unavailable, the request fails. If the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectCreateProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | ProjectName Required. The name of the Project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationProjectDeleteProjectMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteProjectRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationProjectDeleteProjectMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The name of the Project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationProjectDeleteProjectMetadata | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | ProjectName Required. The name of the Project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectDeleteProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | ProjectName Required. The name of the Project (for example, |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectDeleteProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteProjectRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectDeleteProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteProjectRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectDeleteProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The name of the Project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectDeleteProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The name of the Project (for example, |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationProjectDeleteProjectMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// 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 | |
---|---|
Name | Description |
resource | string REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Policy | The RPC response. |
// 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 | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | IResourceName REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetIamPolicyRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | string REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
resource | string REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskPolicy | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | ProjectName Required. The name of the project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Project | The RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetProjectRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Project | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The name of the project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Project | The RPC response. |
// 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 | |
---|---|
Name | Description |
name | ProjectName Required. The name of the project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProject | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | ProjectName Required. The name of the project (for example, |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProject | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetProjectRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProject | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetProjectRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProject | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The name of the project (for example, |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskProject | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | string Required. The name of the project (for example, |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskProject | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | IResourceName 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 |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListProjectsResponseProject | A pageable sequence of Project resources. |
// 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 | |
---|---|
Name | Description |
request | ListProjectsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListProjectsResponseProject | A pageable sequence of Project resources. |
// 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 | |
---|---|
Name | Description |
parent | string 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 |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListProjectsResponseProject | A pageable sequence of Project resources. |
// 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