2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-10-23 00:15:11 -07:00
2021-12-03 00:44:16 -08:00
export const groupOperations : INodeProperties [ ] = [
2020-10-23 00:15:11 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-10-23 00:15:11 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a group' ,
2022-07-10 13:50:51 -07:00
action : 'Create a group' ,
2020-10-23 00:15:11 -07:00
} ,
{
name : 'Delete' ,
value : 'delete' ,
description : 'Delete a group' ,
2022-07-10 13:50:51 -07:00
action : 'Delete a group' ,
2020-10-23 00:15:11 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a group' ,
2022-07-10 13:50:51 -07:00
action : 'Get a group' ,
2020-10-23 00:15:11 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-10-23 00:15:11 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many groups' ,
2022-09-08 08:10:13 -07:00
action : 'Get many groups' ,
2020-10-23 00:15:11 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a group' ,
2022-07-10 13:50:51 -07:00
action : 'Update a group' ,
2020-10-23 00:15:11 -07:00
} ,
] ,
default : 'create' ,
2020-10-23 00:19:45 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-10-23 00:15:11 -07:00
2021-12-03 00:44:16 -08:00
export const groupFields : INodeProperties [ ] = [
2020-10-23 00:15:11 -07:00
/* -------------------------------------------------------------------------- */
/* group:create */
/* -------------------------------------------------------------------------- */
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-23 00:15:11 -07:00
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'create' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
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" ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'create' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
options : [
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
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.' ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "The group's display name" ,
2020-10-23 00:15:11 -07:00
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* group:delete */
/* -------------------------------------------------------------------------- */
{
displayName : 'Group ID' ,
name : 'groupId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'delete' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID." ,
2020-10-23 00:15:11 -07:00
} ,
/* -------------------------------------------------------------------------- */
/* group:get */
/* -------------------------------------------------------------------------- */
{
displayName : 'Group ID' ,
name : 'groupId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'get' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID." ,
2020-10-23 00:15:11 -07:00
} ,
/* -------------------------------------------------------------------------- */
/* group:getAll */
/* -------------------------------------------------------------------------- */
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'group' ] ,
returnAll : [ false ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 500 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'getAll' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
options : [
{
displayName : 'Customer' ,
name : 'customer' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"The unique ID for the customer's G Suite account. In case of a multi-domain account, to fetch all groups for a customer, fill this field instead of domain." ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Domain' ,
name : 'domain' ,
type : 'string' ,
default : '' ,
description : 'The domain name. Use this field to get fields from only one domain.' ,
} ,
{
displayName : 'Order By' ,
name : 'orderBy' ,
type : 'options' ,
options : [
{
name : 'Email' ,
value : 'email' ,
} ,
] ,
default : '' ,
2022-05-06 14:01:25 -07:00
description : 'Property to use for sorting results' ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Query' ,
name : 'query' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Query string search. Complete documentation is <a href="https://developers.google.com/admin-sdk/directory/v1/guides/search-groups">at</a>.' ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Sort Order' ,
name : 'sortOrder' ,
type : 'options' ,
options : [
{
name : 'Ascending' ,
value : 'ASCENDING' ,
} ,
{
name : 'Descending' ,
value : 'DESCENDING' ,
} ,
] ,
default : '' ,
description : 'Whether to return results in ascending or descending order' ,
} ,
{
displayName : 'User ID' ,
name : 'userId' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"Email or immutable ID of the user if only those groups are to be listed, the given user is a member of. If it's an ID, it should match with the ID of the user object." ,
2020-10-23 00:15:11 -07:00
} ,
] ,
} ,
/* -------------------------------------------------------------------------- */
/* group:update */
/* -------------------------------------------------------------------------- */
{
displayName : 'Group ID' ,
name : 'groupId' ,
type : 'string' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
"Identifies the group in the API request. The value can be the group's email address, group alias, or the unique group ID." ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
operation : [ 'update' ] ,
resource : [ 'group' ] ,
2020-10-23 00:15:11 -07:00
} ,
} ,
options : [
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
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.' ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Email' ,
name : 'email' ,
type : 'string' ,
2022-06-20 07:54:01 -07:00
placeholder : 'name@email.com' ,
2020-10-23 00:15:11 -07:00
default : '' ,
2022-08-17 08:50:24 -07:00
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." ,
2020-10-23 00:15:11 -07:00
} ,
{
displayName : 'Name' ,
name : 'name' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description : "The group's display name" ,
2020-10-23 00:15:11 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;