Class ProjectsResource
The "projects" collection of methods.
Inherited Members
Namespace: Google.Apis.CloudResourceManager.v1
Assembly: Google.Apis.CloudResourceManager.v1.dll
Syntax
public class ProjectsResource
Constructors
ProjectsResource(IClientService)
Constructs a new resource.
Declaration
public ProjectsResource(IClientService service)
Parameters
Type | Name | Description |
---|---|---|
IClientService | service |
Methods
ClearOrgPolicy(ClearOrgPolicyRequest, string)
Clears a Policy
from a resource.
Declaration
public virtual ProjectsResource.ClearOrgPolicyRequest ClearOrgPolicy(ClearOrgPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
ClearOrgPolicyRequest | body | The body of the request. |
string | resource | Name of the resource for the |
Returns
Type | Description |
---|---|
ProjectsResource.ClearOrgPolicyRequest |
Create(Project)
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.
Declaration
public virtual ProjectsResource.CreateRequest Create(Project body)
Parameters
Type | Name | Description |
---|---|---|
Project | body | The body of the request. |
Returns
Type | Description |
---|---|
ProjectsResource.CreateRequest |
Delete(string)
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.
Declaration
public virtual ProjectsResource.DeleteRequest Delete(string projectId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The Project ID (for example, |
Returns
Type | Description |
---|---|
ProjectsResource.DeleteRequest |
Get(string)
Retrieves the Project identified by the specified project_id
(for example, my-project-123
). The caller
must have read permissions for this Project.
Declaration
public virtual ProjectsResource.GetRequest Get(string projectId)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | Required. The Project ID (for example, |
Returns
Type | Description |
---|---|
ProjectsResource.GetRequest |
GetAncestry(GetAncestryRequest, string)
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.
Declaration
public virtual ProjectsResource.GetAncestryRequest GetAncestry(GetAncestryRequest body, string projectId)
Parameters
Type | Name | Description |
---|---|---|
GetAncestryRequest | body | The body of the request. |
string | projectId | Required. The Project ID (for example, |
Returns
Type | Description |
---|---|
ProjectsResource.GetAncestryRequest |
GetEffectiveOrgPolicy(GetEffectiveOrgPolicyRequest, string)
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 etag
set because it is a computed Policy
across
multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be
expanded.
Declaration
public virtual ProjectsResource.GetEffectiveOrgPolicyRequest GetEffectiveOrgPolicy(GetEffectiveOrgPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
GetEffectiveOrgPolicyRequest | body | The body of the request. |
string | resource | The name of the resource to start computing the effective |
Returns
Type | Description |
---|---|
ProjectsResource.GetEffectiveOrgPolicyRequest |
GetIamPolicy(GetIamPolicyRequest, string)
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.
Declaration
public virtual ProjectsResource.GetIamPolicyRequest GetIamPolicy(GetIamPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
GetIamPolicyRequest | body | The body of the request. |
string | resource | REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field. |
Returns
Type | Description |
---|---|
ProjectsResource.GetIamPolicyRequest |
GetOrgPolicy(GetOrgPolicyRequest, string)
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.
Declaration
public virtual ProjectsResource.GetOrgPolicyRequest GetOrgPolicy(GetOrgPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
GetOrgPolicyRequest | body | The body of the request. |
string | resource | Name of the resource the |
Returns
Type | Description |
---|---|
ProjectsResource.GetOrgPolicyRequest |
List()
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.
Declaration
public virtual ProjectsResource.ListRequest List()
Returns
Type | Description |
---|---|
ProjectsResource.ListRequest |
ListAvailableOrgPolicyConstraints(ListAvailableOrgPolicyConstraintsRequest, string)
Lists Constraints
that could be applied on the specified resource.
Declaration
public virtual ProjectsResource.ListAvailableOrgPolicyConstraintsRequest ListAvailableOrgPolicyConstraints(ListAvailableOrgPolicyConstraintsRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
ListAvailableOrgPolicyConstraintsRequest | body | The body of the request. |
string | resource | Name of the resource to list |
Returns
Type | Description |
---|---|
ProjectsResource.ListAvailableOrgPolicyConstraintsRequest |
ListOrgPolicies(ListOrgPoliciesRequest, string)
Lists all the Policies
set for a particular resource.
Declaration
public virtual ProjectsResource.ListOrgPoliciesRequest ListOrgPolicies(ListOrgPoliciesRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
ListOrgPoliciesRequest | body | The body of the request. |
string | resource | Name of the resource to list Policies for. |
Returns
Type | Description |
---|---|
ProjectsResource.ListOrgPoliciesRequest |
SetIamPolicy(SetIamPolicyRequest, string)
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
Declaration
public virtual ProjectsResource.SetIamPolicyRequest SetIamPolicy(SetIamPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
SetIamPolicyRequest | body | The body of the request. |
string | resource | REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field. |
Returns
Type | Description |
---|---|
ProjectsResource.SetIamPolicyRequest |
SetOrgPolicy(SetOrgPolicyRequest, string)
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
.
Declaration
public virtual ProjectsResource.SetOrgPolicyRequest SetOrgPolicy(SetOrgPolicyRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
SetOrgPolicyRequest | body | The body of the request. |
string | resource | Resource name of the resource to attach the |
Returns
Type | Description |
---|---|
ProjectsResource.SetOrgPolicyRequest |
TestIamPermissions(TestIamPermissionsRequest, string)
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.
Declaration
public virtual ProjectsResource.TestIamPermissionsRequest TestIamPermissions(TestIamPermissionsRequest body, string resource)
Parameters
Type | Name | Description |
---|---|---|
TestIamPermissionsRequest | body | The body of the request. |
string | resource | REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field. |
Returns
Type | Description |
---|---|
ProjectsResource.TestIamPermissionsRequest |
Undelete(UndeleteProjectRequest, string)
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.
Declaration
public virtual ProjectsResource.UndeleteRequest Undelete(UndeleteProjectRequest body, string projectId)
Parameters
Type | Name | Description |
---|---|---|
UndeleteProjectRequest | body | The body of the request. |
string | projectId | Required. The project ID (for example, |
Returns
Type | Description |
---|---|
ProjectsResource.UndeleteRequest |
Update(Project, string)
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.
Declaration
public virtual ProjectsResource.UpdateRequest Update(Project body, string projectId)
Parameters
Type | Name | Description |
---|---|---|
Project | body | The body of the request. |
string | projectId | The project ID (for example, |
Returns
Type | Description |
---|---|
ProjectsResource.UpdateRequest |