pub struct ProjectMethods<'a, S>
where S: 'a,
{ /* private fields */ }
Expand description

A builder providing access to all methods supported on project resources. It is not used directly, but through the CloudResourceManager hub.

§Example

Instantiate a resource builder

extern crate hyper;
extern crate hyper_rustls;
extern crate google_cloudresourcemanager1_beta1 as cloudresourcemanager1_beta1;
 
use std::default::Default;
use cloudresourcemanager1_beta1::{CloudResourceManager, oauth2, hyper, hyper_rustls, chrono, FieldMask};
 
let secret: oauth2::ApplicationSecret = Default::default();
let auth = oauth2::InstalledFlowAuthenticator::builder(
        secret,
        oauth2::InstalledFlowReturnMethod::HTTPRedirect,
    ).build().await.unwrap();
let mut hub = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `create(...)`, `delete(...)`, `get(...)`, `get_ancestry(...)`, `get_iam_policy(...)`, `list(...)`, `set_iam_policy(...)`, `test_iam_permissions(...)`, `undelete(...)` and `update(...)`
// to build up your call.
let rb = hub.projects();

Implementations§

source§

impl<'a, S> ProjectMethods<'a, S>

source

pub fn create(&self, request: Project) -> ProjectCreateCall<'a, S>

Create a builder to help you perform the following task:

Creates a Project resource. Initially, the Project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the Project. Several APIs are activated automatically for the Project, including Google Cloud Storage. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as project, folder, or organization. This method does not associate the new project with a billing account. You can set or update the billing account associated with a project using the [projects.updateBillingInfo] (/billing/reference/rest/v1/projects/updateBillingInfo) method.

§Arguments
  • request - No description provided.
source

pub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, S>

Create a builder to help you perform the following task:

Marks the Project identified by the specified project_id (for example, my-project-123) for deletion. This method will only affect the Project if it has a lifecycle state of ACTIVE. This method changes the Project’s lifecycle state from ACTIVE to 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, and the Project remains visible to ListProjects. However, you cannot update the project. After the deletion completes, the Project is not retrievable by the GetProject and ListProjects methods. The caller must have delete permissions for this Project.

§Arguments
  • projectId - The Project ID (for example, foo-bar-123).
source

pub fn get(&self, project_id: &str) -> ProjectGetCall<'a, S>

Create a builder to help you perform the following task:

Retrieves the Project identified by the specified project_id (for example, my-project-123). The caller must have read permissions for this Project.

§Arguments
  • projectId - Required. The Project ID (for example, my-project-123).
source

pub fn get_ancestry( &self, request: GetAncestryRequest, project_id: &str ) -> ProjectGetAncestryCall<'a, S>

Create a builder to help you perform the following task:

Gets a list of ancestors in the resource hierarchy for the Project identified by the specified project_id (for example, my-project-123). The caller must have read permissions for this Project.

§Arguments
  • request - No description provided.
  • projectId - Required. The Project ID (for example, my-project-123).
source

pub fn get_iam_policy( &self, request: GetIamPolicyRequest, resource: &str ) -> ProjectGetIamPolicyCall<'a, S>

Create a builder to help you perform the following task:

Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. For additional information about resource structure and identification, see Resource Names.

§Arguments
  • request - No description provided.
  • resource - REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.
source

pub fn list(&self) -> ProjectListCall<'a, S>

Create a builder to help you perform the following task:

Lists Projects that the caller has the resourcemanager.projects.get permission on and satisfy the specified filter. 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 method. NOTE: If the request filter contains a parent.type and parent.id and the caller has the resourcemanager.projects.list permission on the parent, the results will be drawn from an alternate index which provides more consistent results. In future versions of this API, this List method will be split into List and Search to properly capture the behavioral difference.

source

pub fn set_iam_policy( &self, request: SetIamPolicyRequest, resource: &str ) -> ProjectSetIamPolicyCall<'a, S>

Create a builder to help you perform the following task:

Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. The following constraints apply when using setIamPolicy(): + Project does not support allUsers and allAuthenticatedUsers as members in a Binding of a Policy. + The owner role can be granted to a user, serviceAccount, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using setIamPolicy(). The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + Invitations to grant the owner role cannot be sent using setIamPolicy(); they must be sent only using the Cloud Platform Console. + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling setIamPolicy() to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. Authorization requires the Google IAM permission resourcemanager.projects.setIamPolicy on the project

§Arguments
  • request - No description provided.
  • resource - REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.
source

pub fn test_iam_permissions( &self, request: TestIamPermissionsRequest, resource: &str ) -> ProjectTestIamPermissionCall<'a, S>

Create a builder to help you perform the following task:

Returns permissions that a caller has on the specified Project.

§Arguments
  • request - No description provided.
  • resource - REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.
source

pub fn undelete( &self, request: UndeleteProjectRequest, project_id: &str ) -> ProjectUndeleteCall<'a, S>

Create a builder to help you perform the following task:

Restores the Project identified by the specified project_id (for example, my-project-123). You can only use this method for a Project that has a lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot be restored. The caller must have undelete permissions for this Project.

§Arguments
  • request - No description provided.
  • projectId - Required. The project ID (for example, foo-bar-123).
source

pub fn update( &self, request: Project, project_id: &str ) -> ProjectUpdateCall<'a, S>

Create a builder to help you perform the following task:

Updates the attributes of the Project identified by the specified project_id (for example, my-project-123). The caller must have modify permissions for this Project.

§Arguments
  • request - No description provided.
  • projectId - The project ID (for example, my-project-123).

Trait Implementations§

source§

impl<'a, S> MethodsBuilder for ProjectMethods<'a, S>

Auto Trait Implementations§

§

impl<'a, S> !RefUnwindSafe for ProjectMethods<'a, S>

§

impl<'a, S> Send for ProjectMethods<'a, S>
where S: Sync,

§

impl<'a, S> Sync for ProjectMethods<'a, S>
where S: Sync,

§

impl<'a, S> Unpin for ProjectMethods<'a, S>

§

impl<'a, S> !UnwindSafe for ProjectMethods<'a, S>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more