roles
Creates, updates, deletes, gets or lists a roles
resource.
Overview
Name | roles |
Type | Resource |
Id | googleadmin.directory.roles |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
etag | string | ETag of the resource. |
isSuperAdminRole | boolean | Returns true if the role is a super admin role. |
isSystemRole | boolean | Returns true if this is a pre-defined system role. |
kind | string | The type of the API resource. This is always admin#directory#role . (default: admin#directory#role) |
roleDescription | string | A short description of the role. |
roleId | string (int64) | ID of the role. |
roleName | string | Name of the role. |
rolePrivileges | array | The set of privileges that are granted to this role. |
Successful response
Name | Datatype | Description |
---|---|---|
etag | string | ETag of the resource. |
isSuperAdminRole | boolean | Returns true if the role is a super admin role. |
isSystemRole | boolean | Returns true if this is a pre-defined system role. |
kind | string | The type of the API resource. This is always admin#directory#role . (default: admin#directory#role) |
roleDescription | string | A short description of the role. |
roleId | string (int64) | ID of the role. |
roleName | string | Name of the role. |
rolePrivileges | array | The set of privileges that are granted to this role. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | customer , roleId | Retrieves a role. | |
list | select | customer | maxResults , pageToken | Retrieves a paginated list of all the roles in a domain. |
insert | insert | customer | Creates a role. | |
patch | update | customer , roleId | Patches a role. | |
update | replace | customer , roleId | Updates a role. | |
delete | delete | customer , roleId | Deletes a role. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
customer | string | |
roleId | string | |
maxResults | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Retrieves a role.
SELECT
etag,
isSuperAdminRole,
isSystemRole,
kind,
roleDescription,
roleId,
roleName,
rolePrivileges
FROM googleadmin.directory.roles
WHERE customer = '{{ customer }}' -- required
AND roleId = '{{ roleId }}' -- required;
Retrieves a paginated list of all the roles in a domain.
SELECT
etag,
isSuperAdminRole,
isSystemRole,
kind,
roleDescription,
roleId,
roleName,
rolePrivileges
FROM googleadmin.directory.roles
WHERE customer = '{{ customer }}' -- required
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- insert
- Manifest
Creates a role.
INSERT INTO googleadmin.directory.roles (
data__roleId,
data__roleName,
data__roleDescription,
data__rolePrivileges,
data__isSystemRole,
data__isSuperAdminRole,
data__kind,
data__etag,
customer
)
SELECT
'{{ roleId }}',
'{{ roleName }}',
'{{ roleDescription }}',
'{{ rolePrivileges }}',
{{ isSystemRole }},
{{ isSuperAdminRole }},
'{{ kind }}',
'{{ etag }}',
'{{ customer }}'
RETURNING
etag,
isSuperAdminRole,
isSystemRole,
kind,
roleDescription,
roleId,
roleName,
rolePrivileges
;
# Description fields are for documentation purposes
- name: roles
props:
- name: customer
value: string
description: Required parameter for the roles resource.
- name: roleId
value: string
description: >
ID of the role.
- name: roleName
value: string
description: >
Name of the role.
- name: roleDescription
value: string
description: >
A short description of the role.
- name: rolePrivileges
value: array
description: >
The set of privileges that are granted to this role.
- name: isSystemRole
value: boolean
description: >
Returns `true` if this is a pre-defined system role.
- name: isSuperAdminRole
value: boolean
description: >
Returns `true` if the role is a super admin role.
- name: kind
value: string
description: >
The type of the API resource. This is always `admin#directory#role`.
default: admin#directory#role
- name: etag
value: string
description: >
ETag of the resource.
UPDATE
examples
- patch
Patches a role.
UPDATE googleadmin.directory.roles
SET
data__roleId = '{{ roleId }}',
data__roleName = '{{ roleName }}',
data__roleDescription = '{{ roleDescription }}',
data__rolePrivileges = '{{ rolePrivileges }}',
data__isSystemRole = {{ isSystemRole }},
data__isSuperAdminRole = {{ isSuperAdminRole }},
data__kind = '{{ kind }}',
data__etag = '{{ etag }}'
WHERE
customer = '{{ customer }}' --required
AND roleId = '{{ roleId }}' --required
RETURNING
etag,
isSuperAdminRole,
isSystemRole,
kind,
roleDescription,
roleId,
roleName,
rolePrivileges;
REPLACE
examples
- update
Updates a role.
REPLACE googleadmin.directory.roles
SET
data__roleId = '{{ roleId }}',
data__roleName = '{{ roleName }}',
data__roleDescription = '{{ roleDescription }}',
data__rolePrivileges = '{{ rolePrivileges }}',
data__isSystemRole = {{ isSystemRole }},
data__isSuperAdminRole = {{ isSuperAdminRole }},
data__kind = '{{ kind }}',
data__etag = '{{ etag }}'
WHERE
customer = '{{ customer }}' --required
AND roleId = '{{ roleId }}' --required
RETURNING
etag,
isSuperAdminRole,
isSystemRole,
kind,
roleDescription,
roleId,
roleName,
rolePrivileges;
DELETE
examples
- delete
Deletes a role.
DELETE FROM googleadmin.directory.roles
WHERE customer = '{{ customer }}' --required
AND roleId = '{{ roleId }}' --required;