pub struct ProjectMethods<'a, C>where
C: '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 as cloudresourcemanager1;
use cloudresourcemanager1::{CloudResourceManager, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = CloudResourceManager::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `clear_org_policy(...)`, `create(...)`, `delete(...)`, `get(...)`, `get_ancestry(...)`, `get_effective_org_policy(...)`, `get_iam_policy(...)`, `get_org_policy(...)`, `list(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)`, `set_iam_policy(...)`, `set_org_policy(...)`, `test_iam_permissions(...)`, `undelete(...)` and `update(...)`
// to build up your call.
let rb = hub.projects();Implementations§
Source§impl<'a, C> ProjectMethods<'a, C>
impl<'a, C> ProjectMethods<'a, C>
Sourcepub fn clear_org_policy(
&self,
request: ClearOrgPolicyRequest,
resource: &str,
) -> ProjectClearOrgPolicyCall<'a, C>
pub fn clear_org_policy( &self, request: ClearOrgPolicyRequest, resource: &str, ) -> ProjectClearOrgPolicyCall<'a, C>
Create a builder to help you perform the following task:
Clears a Policy from a resource.
§Arguments
request- No description provided.resource- Name of the resource for thePolicyto clear.
Sourcepub fn create(&self, request: Project) -> ProjectCreateCall<'a, C>
pub fn create(&self, request: Project) -> ProjectCreateCall<'a, C>
Create a builder to help you perform the following task:
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. Authorization requires the Google IAM permission resourcemanager.projects.create on the specified parent for the new project. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as 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.
Sourcepub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, C>
pub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, C>
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). Required.
Sourcepub fn get(&self, project_id: &str) -> ProjectGetCall<'a, C>
pub fn get(&self, project_id: &str) -> ProjectGetCall<'a, C>
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).
Sourcepub fn get_ancestry(
&self,
request: GetAncestryRequest,
project_id: &str,
) -> ProjectGetAncestryCall<'a, C>
pub fn get_ancestry( &self, request: GetAncestryRequest, project_id: &str, ) -> ProjectGetAncestryCall<'a, C>
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).
Sourcepub fn get_effective_org_policy(
&self,
request: GetEffectiveOrgPolicyRequest,
resource: &str,
) -> ProjectGetEffectiveOrgPolicyCall<'a, C>
pub fn get_effective_org_policy( &self, request: GetEffectiveOrgPolicyRequest, resource: &str, ) -> ProjectGetEffectiveOrgPolicyCall<'a, C>
Create a builder to help you perform the following task:
Gets the effective Policy on a resource. This is the result of merging Policies in the resource hierarchy. The returned Policy will not have an etagset because it is a computed Policy across multiple resources. Subtrees of Resource Manager resource hierarchy with ‘under:’ prefix will not be expanded.
§Arguments
request- No description provided.resource- The name of the resource to start computing the effectivePolicy.
Sourcepub fn get_iam_policy(
&self,
request: GetIamPolicyRequest,
resource: &str,
) -> ProjectGetIamPolicyCall<'a, C>
pub fn get_iam_policy( &self, request: GetIamPolicyRequest, resource: &str, ) -> ProjectGetIamPolicyCall<'a, C>
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. Authorization requires the Google IAM permission resourcemanager.projects.getIamPolicy on the project. For additional information about resource (e.g. my-project-id) 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.
Sourcepub fn get_org_policy(
&self,
request: GetOrgPolicyRequest,
resource: &str,
) -> ProjectGetOrgPolicyCall<'a, C>
pub fn get_org_policy( &self, request: GetOrgPolicyRequest, resource: &str, ) -> ProjectGetOrgPolicyCall<'a, C>
Create a builder to help you perform the following task:
Gets a Policy on a resource. If no Policy is set on the resource, a Policy is returned with default values including POLICY_TYPE_NOT_SET for the policy_type oneof. The etag value can be used with SetOrgPolicy() to create or update a Policy during read-modify-write.
§Arguments
request- No description provided.resource- Name of the resource thePolicyis set on.
Sourcepub fn list(&self) -> ProjectListCall<'a, C>
pub fn list(&self) -> ProjectListCall<'a, C>
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.
Sourcepub fn list_available_org_policy_constraints(
&self,
request: ListAvailableOrgPolicyConstraintsRequest,
resource: &str,
) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C>
pub fn list_available_org_policy_constraints( &self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str, ) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C>
Create a builder to help you perform the following task:
Lists Constraints that could be applied on the specified resource.
§Arguments
request- No description provided.resource- Name of the resource to listConstraintsfor.
Sourcepub fn list_org_policies(
&self,
request: ListOrgPoliciesRequest,
resource: &str,
) -> ProjectListOrgPolicyCall<'a, C>
pub fn list_org_policies( &self, request: ListOrgPoliciesRequest, resource: &str, ) -> ProjectListOrgPolicyCall<'a, C>
Create a builder to help you perform the following task:
Lists all the Policies set for a particular resource.
§Arguments
request- No description provided.resource- Name of the resource to list Policies for.
Sourcepub fn set_iam_policy(
&self,
request: SetIamPolicyRequest,
resource: &str,
) -> ProjectSetIamPolicyCall<'a, C>
pub fn set_iam_policy( &self, request: SetIamPolicyRequest, resource: &str, ) -> ProjectSetIamPolicyCall<'a, C>
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. For additional information about resource (e.g. my-project-id) structure and identification, see Resource Names. 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. + You can only grant ownership of a project to a member by using the Google Cloud console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + 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. 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.
Sourcepub fn set_org_policy(
&self,
request: SetOrgPolicyRequest,
resource: &str,
) -> ProjectSetOrgPolicyCall<'a, C>
pub fn set_org_policy( &self, request: SetOrgPolicyRequest, resource: &str, ) -> ProjectSetOrgPolicyCall<'a, C>
Create a builder to help you perform the following task:
Updates the specified Policy on the resource. Creates a new Policy for that Constraint on the resource if one does not exist. Not supplying an etag on the request Policy results in an unconditional write of the Policy.
§Arguments
request- No description provided.resource- Resource name of the resource to attach thePolicy.
Sourcepub fn test_iam_permissions(
&self,
request: TestIamPermissionsRequest,
resource: &str,
) -> ProjectTestIamPermissionCall<'a, C>
pub fn test_iam_permissions( &self, request: TestIamPermissionsRequest, resource: &str, ) -> ProjectTestIamPermissionCall<'a, C>
Create a builder to help you perform the following task:
Returns permissions that a caller has on the specified Project. For additional information about resource (e.g. my-project-id) structure and identification, see Resource Names. There are no permissions required for making this API call.
§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.
Sourcepub fn undelete(
&self,
request: UndeleteProjectRequest,
project_id: &str,
) -> ProjectUndeleteCall<'a, C>
pub fn undelete( &self, request: UndeleteProjectRequest, project_id: &str, ) -> ProjectUndeleteCall<'a, C>
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).
Sourcepub fn update(
&self,
request: Project,
project_id: &str,
) -> ProjectUpdateCall<'a, C>
pub fn update( &self, request: Project, project_id: &str, ) -> ProjectUpdateCall<'a, C>
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). Required.
Trait Implementations§
impl<'a, C> MethodsBuilder for ProjectMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for ProjectMethods<'a, C>
impl<'a, C> !RefUnwindSafe for ProjectMethods<'a, C>
impl<'a, C> Send for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for ProjectMethods<'a, C>
impl<'a, C> !UnwindSafe for ProjectMethods<'a, C>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more