groups
Creates, updates, deletes, gets or lists a groups
resource.
Overview
Name | groups |
Type | Resource |
Id | googleadmin.directory.groups |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
id | string | Read-only. The unique ID of a group. A group id can be used as a group request URI's groupKey . |
name | string | The group's display name. |
adminCreated | boolean | Read-only. Value is true if this group was created by an administrator rather than a user. |
aliases | array | Read-only. The list of a group's alias email addresses. To add, update, or remove a group's aliases, use the groups.aliases methods. If edited in a group's POST or PUT request, the edit is ignored. |
description | string | An extended description to help users determine the purpose of a group. For example, you can include information about who should join the group, the types of messages to send to the group, links to FAQs about the group, or related groups. Maximum length is 4,096 characters. |
directMembersCount | string (int64) | The number of users that are direct members of the group. If a group is a member (child) of this group (the parent), members of the child group are not counted in the directMembersCount property of the parent group. |
email | string | The group's email address. If your account has multiple domains, select the appropriate domain for the email address. The email must be unique. This property is required when creating a group. Group email addresses are subject to the same character usage rules as usernames, see the help center for details. |
etag | string | ETag of the resource. |
kind | string | The type of the API resource. For Groups resources, the value is admin#directory#group . (default: admin#directory#group) |
nonEditableAliases | array | Read-only. The list of the group's non-editable alias email addresses that are outside of the account's primary domain or subdomains. These are functioning email addresses used by the group. This is a read-only property returned in the API's response for a group. If edited in a group's POST or PUT request, the edit is ignored. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | Read-only. The unique ID of a group. A group id can be used as a group request URI's groupKey . |
name | string | The group's display name. |
adminCreated | boolean | Read-only. Value is true if this group was created by an administrator rather than a user. |
aliases | array | Read-only. The list of a group's alias email addresses. To add, update, or remove a group's aliases, use the groups.aliases methods. If edited in a group's POST or PUT request, the edit is ignored. |
description | string | An extended description to help users determine the purpose of a group. For example, you can include information about who should join the group, the types of messages to send to the group, links to FAQs about the group, or related groups. Maximum length is 4,096 characters. |
directMembersCount | string (int64) | The number of users that are direct members of the group. If a group is a member (child) of this group (the parent), members of the child group are not counted in the directMembersCount property of the parent group. |
email | string | The group's email address. If your account has multiple domains, select the appropriate domain for the email address. The email must be unique. This property is required when creating a group. Group email addresses are subject to the same character usage rules as usernames, see the help center for details. |
etag | string | ETag of the resource. |
kind | string | The type of the API resource. For Groups resources, the value is admin#directory#group . (default: admin#directory#group) |
nonEditableAliases | array | Read-only. The list of the group's non-editable alias email addresses that are outside of the account's primary domain or subdomains. These are functioning email addresses used by the group. This is a read-only property returned in the API's response for a group. If edited in a group's POST or PUT request, the edit is ignored. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | groupKey | Retrieves a group's properties. | |
list | select | domain | customer , maxResults , orderBy , pageToken , query , sortOrder , userKey | Retrieves all groups of a domain or of a user given a userKey (paginated). |
insert | insert | Creates a group. | ||
patch | update | groupKey | Updates a group's properties. This method supports patch semantics. | |
update | replace | groupKey | Updates a group's properties. | |
delete | delete | groupKey | Deletes a group. |
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 |
---|---|---|
domain | string | |
groupKey | string | |
customer | string | |
maxResults | integer (int32) | |
orderBy | string | |
pageToken | string | |
query | string | |
sortOrder | string | |
userKey | string |
SELECT
examples
- get
- list
Retrieves a group's properties.
SELECT
id,
name,
adminCreated,
aliases,
description,
directMembersCount,
email,
etag,
kind,
nonEditableAliases
FROM googleadmin.directory.groups
WHERE groupKey = '{{ groupKey }}' -- required;
Retrieves all groups of a domain or of a user given a userKey (paginated).
SELECT
id,
name,
adminCreated,
aliases,
description,
directMembersCount,
email,
etag,
kind,
nonEditableAliases
FROM googleadmin.directory.groups
WHERE domain = '{{ domain }}' -- required
AND customer = '{{ customer }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND query = '{{ query }}'
AND sortOrder = '{{ sortOrder }}'
AND userKey = '{{ userKey }}';
INSERT
examples
- insert
- Manifest
Creates a group.
INSERT INTO googleadmin.directory.groups (
data__id,
data__email,
data__name,
data__description,
data__adminCreated,
data__directMembersCount,
data__kind,
data__etag,
data__aliases,
data__nonEditableAliases
)
SELECT
'{{ id }}',
'{{ email }}',
'{{ name }}',
'{{ description }}',
{{ adminCreated }},
'{{ directMembersCount }}',
'{{ kind }}',
'{{ etag }}',
'{{ aliases }}',
'{{ nonEditableAliases }}'
RETURNING
id,
name,
adminCreated,
aliases,
description,
directMembersCount,
email,
etag,
kind,
nonEditableAliases
;
# Description fields are for documentation purposes
- name: groups
props:
- name: id
value: string
description: >
Read-only. The unique ID of a group. A group `id` can be used as a group request URI's `groupKey`.
- name: email
value: string
description: >
The group's email address. If your account has multiple domains, select the appropriate domain for the email address. The `email` must be unique. This property is required when creating a group. Group email addresses are subject to the same character usage rules as usernames, see the [help center](https://support.google.com/a/answer/9193374) for details.
- name: name
value: string
description: >
The group's display name.
- name: description
value: string
description: >
An extended description to help users determine the purpose of a group. For example, you can include information about who should join the group, the types of messages to send to the group, links to FAQs about the group, or related groups. Maximum length is `4,096` characters.
- name: adminCreated
value: boolean
description: >
Read-only. Value is `true` if this group was created by an administrator rather than a user.
- name: directMembersCount
value: string
description: >
The number of users that are direct members of the group. If a group is a member (child) of this group (the parent), members of the child group are not counted in the `directMembersCount` property of the parent group.
- name: kind
value: string
description: >
The type of the API resource. For Groups resources, the value is `admin#directory#group`.
default: admin#directory#group
- name: etag
value: string
description: >
ETag of the resource.
- name: aliases
value: array
description: >
Read-only. The list of a group's alias email addresses. To add, update, or remove a group's aliases, use the `groups.aliases` methods. If edited in a group's POST or PUT request, the edit is ignored.
- name: nonEditableAliases
value: array
description: >
Read-only. The list of the group's non-editable alias email addresses that are outside of the account's primary domain or subdomains. These are functioning email addresses used by the group. This is a read-only property returned in the API's response for a group. If edited in a group's POST or PUT request, the edit is ignored.
UPDATE
examples
- patch
Updates a group's properties. This method supports patch semantics.
UPDATE googleadmin.directory.groups
SET
data__id = '{{ id }}',
data__email = '{{ email }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__adminCreated = {{ adminCreated }},
data__directMembersCount = '{{ directMembersCount }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__aliases = '{{ aliases }}',
data__nonEditableAliases = '{{ nonEditableAliases }}'
WHERE
groupKey = '{{ groupKey }}' --required
RETURNING
id,
name,
adminCreated,
aliases,
description,
directMembersCount,
email,
etag,
kind,
nonEditableAliases;
REPLACE
examples
- update
Updates a group's properties.
REPLACE googleadmin.directory.groups
SET
data__id = '{{ id }}',
data__email = '{{ email }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__adminCreated = {{ adminCreated }},
data__directMembersCount = '{{ directMembersCount }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__aliases = '{{ aliases }}',
data__nonEditableAliases = '{{ nonEditableAliases }}'
WHERE
groupKey = '{{ groupKey }}' --required
RETURNING
id,
name,
adminCreated,
aliases,
description,
directMembersCount,
email,
etag,
kind,
nonEditableAliases;
DELETE
examples
- delete
Deletes a group.
DELETE FROM googleadmin.directory.groups
WHERE groupKey = '{{ groupKey }}' --required;