pub struct ProjectClient { /* private fields */ }Expand description
Calls ProjectService.
Projects: the namespace every resource is created in. A project belongs to
one organization, and every resource name of the other APIs starts with
it, projects/{project}/....
Implementations§
Source§impl ProjectClient
impl ProjectClient
Sourcepub fn new(client: &Client) -> Self
pub fn new(client: &Client) -> Self
Returns a client of ProjectService that sends its calls through client.
Sourcepub fn service(&self) -> &Service
pub fn service(&self) -> &Service
The endpoint the client sends its calls to, which also serves the operations its methods answer with.
Sourcepub async fn get_project(
&self,
request: GetProjectRequest,
) -> Result<Project, Error>
pub async fn get_project( &self, request: GetProjectRequest, ) -> Result<Project, Error>
Returns a project.
Sourcepub async fn list_projects(
&self,
request: ListProjectsRequest,
) -> Result<ListProjectsResponse, Error>
pub async fn list_projects( &self, request: ListProjectsRequest, ) -> Result<ListProjectsResponse, Error>
Lists an organization’s projects, oldest first.
Sourcepub fn all_projects(&self, request: ListProjectsRequest) -> Pages<Project>
pub fn all_projects(&self, request: ListProjectsRequest) -> Pages<Project>
Returns everything list_projects lists from request’s page on, fetching the next page as the stream reaches it. A page that fails ends the stream with its error.
Sourcepub async fn create_project(
&self,
request: CreateProjectRequest,
) -> Result<Project, Error>
pub async fn create_project( &self, request: CreateProjectRequest, ) -> Result<Project, Error>
Creates a project in an organization::State::Active organization, under the id the caller
chooses. The caller becomes the project’s owner, and the project is
billed to the organization’s default billing account. An id in use, or
used by a project that was deleted, is refused as a CONFLICT.
Sourcepub async fn update_project(
&self,
request: UpdateProjectRequest,
) -> Result<Project, Error>
pub async fn update_project( &self, request: UpdateProjectRequest, ) -> Result<Project, Error>
Renames a project.
Sourcepub async fn delete_project(
&self,
request: DeleteProjectRequest,
) -> Result<Empty, Error>
pub async fn delete_project( &self, request: DeleteProjectRequest, ) -> Result<Empty, Error>
Deletes a project. Refused as a CONFLICT while the project
still has a resource you can delete yourself: an instance that isn’t terminated, an image, a key
pair, a volume or snapshot that isn’t deleted, a NAT gateway, a floating
IP, a VPC, or a DNS policy other than its default one. The refusal names
every kind left, in the order to delete them. Nothing you can delete
yourself is deleted on your behalf. The project’s default DNS policy,
its quota and every role granted on it go with it; roles granted on the
organization stay.
Sourcepub async fn get_project_quota(
&self,
request: GetProjectQuotaRequest,
) -> Result<ProjectQuota, Error>
pub async fn get_project_quota( &self, request: GetProjectQuotaRequest, ) -> Result<ProjectQuota, Error>
Returns a project’s quota: the budget of each kind of resource the project may hold, if one is set, and how much of it the project uses.
Sourcepub async fn update_project_quota(
&self,
request: UpdateProjectQuotaRequest,
) -> Result<ProjectQuota, Error>
pub async fn update_project_quota( &self, request: UpdateProjectQuotaRequest, ) -> Result<ProjectQuota, Error>
Sets or removes a project’s budgets. A budget named in update_mask
is set to the value given, or removed when the value is left out.