Show / Hide Table of Contents

Class OrganizationsResource.RolesResource

The "roles" collection of methods.

Inheritance
object
OrganizationsResource.RolesResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.Iam.v1
Assembly: Google.Apis.Iam.v1.dll
Syntax
public class OrganizationsResource.RolesResource

Constructors

RolesResource(IClientService)

Constructs a new resource.

Declaration
public RolesResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Create(CreateRoleRequest, string)

Creates a new custom Role.

Declaration
public virtual OrganizationsResource.RolesResource.CreateRequest Create(CreateRoleRequest body, string parent)
Parameters
Type Name Description
CreateRoleRequest body

The body of the request.

string parent

The parent parameter's value depends on the target resource for the request, namely projects or organizations. Each resource type's parent value format is described below: * projects.roles.create: projects/{PROJECT_ID}. This method creates project-level custom roles. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles * organizations.roles.create: organizations/{ORGANIZATION_ID}. This method creates organization-level custom roles. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.

Returns
Type Description
OrganizationsResource.RolesResource.CreateRequest

Delete(string)

Deletes a custom Role. When you delete a custom role, the following changes occur immediately: * You cannot bind a principal to the custom role in an IAM Policy. * Existing bindings to the custom role are not changed, but they have no effect. * By default, the response from ListRoles does not include the custom role. A deleted custom role still counts toward the custom role limit until it is permanently deleted. You have 7 days to undelete the custom role. After 7 days, the following changes occur: * The custom role is permanently deleted and cannot be recovered. * If an IAM policy contains a binding to the custom role, the binding is permanently removed. * The custom role no longer counts toward your custom role limit.

Declaration
public virtual OrganizationsResource.RolesResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

The name parameter's value depends on the target resource for the request, namely projects or organizations. Each resource type's name value format is described below: * projects.roles.delete: projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}. This method deletes only custom roles that have been created at the project level. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID} * organizations.roles.delete: organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}. This method deletes only custom roles that have been created at the organization level. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID} Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.

Returns
Type Description
OrganizationsResource.RolesResource.DeleteRequest

Get(string)

Gets the definition of a Role.

Declaration
public virtual OrganizationsResource.RolesResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

The name parameter's value depends on the target resource for the request, namely roles, projects, or organizations. Each resource type's name value format is described below: * roles.get: roles/{ROLE_NAME}. This method returns results from all predefined roles in IAM. Example request URL: https://iam.googleapis.com/v1/roles/{ROLE_NAME} * projects.roles.get: projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}. This method returns only custom roles that have been created at the project level. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID} * organizations.roles.get: organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}. This method returns only custom roles that have been created at the organization level. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID} Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.

Returns
Type Description
OrganizationsResource.RolesResource.GetRequest

List(string)

Lists every predefined Role that IAM supports, or every custom role that is defined for an organization or project.

Declaration
public virtual OrganizationsResource.RolesResource.ListRequest List(string parent)
Parameters
Type Name Description
string parent

The parent parameter's value depends on the target resource for the request, namely roles, projects, or organizations. Each resource type's parent value format is described below: * roles.list: An empty string. This method doesn't require a resource; it simply returns all predefined roles in IAM. Example request URL: https://iam.googleapis.com/v1/roles * projects.roles.list: projects/{PROJECT_ID}. This method lists all project-level custom roles. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles * organizations.roles.list: organizations/{ORGANIZATION_ID}. This method lists all organization-level custom roles. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.

Returns
Type Description
OrganizationsResource.RolesResource.ListRequest

Patch(Role, string)

Updates the definition of a custom Role.

Declaration
public virtual OrganizationsResource.RolesResource.PatchRequest Patch(Role body, string name)
Parameters
Type Name Description
Role body

The body of the request.

string name

The name parameter's value depends on the target resource for the request, namely projects or organizations. Each resource type's name value format is described below: * projects.roles.patch: projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}. This method updates only custom roles that have been created at the project level. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID} * organizations.roles.patch: organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}. This method updates only custom roles that have been created at the organization level. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID} Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.

Returns
Type Description
OrganizationsResource.RolesResource.PatchRequest

Undelete(UndeleteRoleRequest, string)

Undeletes a custom Role.

Declaration
public virtual OrganizationsResource.RolesResource.UndeleteRequest Undelete(UndeleteRoleRequest body, string name)
Parameters
Type Name Description
UndeleteRoleRequest body

The body of the request.

string name

The name parameter's value depends on the target resource for the request, namely projects or organizations. Each resource type's name value format is described below: * projects.roles.undelete: projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID}. This method undeletes only custom roles that have been created at the project level. Example request URL: https://iam.googleapis.com/v1/projects/{PROJECT_ID}/roles/{CUSTOM_ROLE_ID} * organizations.roles.undelete: organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID}. This method undeletes only custom roles that have been created at the organization level. Example request URL: https://iam.googleapis.com/v1/organizations/{ORGANIZATION_ID}/roles/{CUSTOM_ROLE_ID} Note: Wildcard (*) values are invalid; you must specify a complete project ID or organization ID.

Returns
Type Description
OrganizationsResource.RolesResource.UndeleteRequest
In this article
Back to top Generated by DocFX