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
| 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. |
| 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 | maxResults, customer, query, pageToken, orderBy, userKey, sortOrder | 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 maxResults = '{{ maxResults }}'
AND customer = '{{ customer }}'
AND query = '{{ query }}'
AND pageToken = '{{ pageToken }}'
AND orderBy = '{{ orderBy }}'
AND userKey = '{{ userKey }}'
AND sortOrder = '{{ sortOrder }}'
;
INSERT examples
- insert
- Manifest
Creates a group.
INSERT INTO googleadmin.directory.groups (
data__email,
data__nonEditableAliases,
data__name,
data__id,
data__description,
data__kind,
data__aliases,
data__etag,
data__directMembersCount,
data__adminCreated
)
SELECT
'{{ email }}',
'{{ nonEditableAliases }}',
'{{ name }}',
'{{ id }}',
'{{ description }}',
'{{ kind }}',
'{{ aliases }}',
'{{ etag }}',
'{{ directMembersCount }}',
{{ adminCreated }}
RETURNING
id,
name,
adminCreated,
aliases,
description,
directMembersCount,
email,
etag,
kind,
nonEditableAliases
;
# Description fields are for documentation purposes
- name: groups
props:
- name: email
value: "{{ email }}"
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: nonEditableAliases
value:
- "{{ nonEditableAliases }}"
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.
- name: name
value: "{{ name }}"
description: |
The group's display name.
- name: id
value: "{{ id }}"
description: |
Read-only. The unique ID of a group. A group `id` can be used as a group request URI's `groupKey`.
- name: description
value: "{{ description }}"
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: kind
value: "{{ kind }}"
description: |
The type of the API resource. For Groups resources, the value is `admin#directory#group`.
default: admin#directory#group
- name: aliases
value:
- "{{ aliases }}"
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: etag
value: "{{ etag }}"
description: |
ETag of the resource.
- name: directMembersCount
value: "{{ directMembersCount }}"
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: adminCreated
value: {{ adminCreated }}
description: |
Read-only. Value is `true` if this group was created by an administrator rather than a user.
UPDATE examples
- patch
Updates a group's properties. This method supports patch semantics.
UPDATE googleadmin.directory.groups
SET
data__email = '{{ email }}',
data__nonEditableAliases = '{{ nonEditableAliases }}',
data__name = '{{ name }}',
data__id = '{{ id }}',
data__description = '{{ description }}',
data__kind = '{{ kind }}',
data__aliases = '{{ aliases }}',
data__etag = '{{ etag }}',
data__directMembersCount = '{{ directMembersCount }}',
data__adminCreated = {{ adminCreated }}
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__email = '{{ email }}',
data__nonEditableAliases = '{{ nonEditableAliases }}',
data__name = '{{ name }}',
data__id = '{{ id }}',
data__description = '{{ description }}',
data__kind = '{{ kind }}',
data__aliases = '{{ aliases }}',
data__etag = '{{ etag }}',
data__directMembersCount = '{{ directMembersCount }}',
data__adminCreated = {{ adminCreated }}
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
;