group_memberships
Creates, updates, deletes, gets or lists a group_memberships resource.
Overview
| Name | group_memberships |
| Type | Resource |
| Id | fivetran.teams.group_memberships |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string | The membership entity unique identifier (example: resource_id) |
created_at | string (date-time) | The timestamp that the user created their Fivetran account (example: 2024-01-01T00:00:00Z) |
role | string | The role the user has within the entity (example: Role Title) |
| Name | Datatype | Description |
|---|---|---|
id | string | The membership entity unique identifier (example: resource_id) |
created_at | string (date-time) | The timestamp that the user created their Fivetran account (example: 2024-01-01T00:00:00Z) |
role | string | The role the user has within the entity (example: Role Title) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | team_id, group_id | Returns details of a team membership in a group. | |
list | select | team_id | cursor, limit | Returns all groups in which a team has membership. |
create | insert | team_id, id, role | Adds a team as a member of a group. | |
update | update | team_id, group_id, role | Updates team membership in a group. | |
delete | delete | team_id, group_id | Removes a team's membership in 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 |
|---|---|---|
group_id | string | The unique identifier for the group within the Fivetran system. |
team_id | string | The unique identifier for the team within the account. |
cursor | string | Paging cursor, [read more about pagination](https://fivetran.com/docs/rest-api/pagination) |
limit | integer (int32) | Number of records to fetch per page. Accepts a number in the range 1..1000; the default value is 100. |
SELECT examples
- get
- list
Returns details of a team membership in a group.
SELECT
id,
created_at,
role
FROM fivetran.teams.group_memberships
WHERE team_id = '{{ team_id }}' -- required
AND group_id = '{{ group_id }}' -- required
;
Returns all groups in which a team has membership.
SELECT
id,
created_at,
role
FROM fivetran.teams.group_memberships
WHERE team_id = '{{ team_id }}' -- required
AND "limit" = '{{ limit }}'
;
INSERT examples
- create
- Manifest
Adds a team as a member of a group.
INSERT INTO fivetran.teams.group_memberships (
id,
role,
team_id
)
SELECT
'{{ id }}' /* required */,
'{{ role }}' /* required */,
'{{ team_id }}'
RETURNING
id,
created_at,
role
;
# Description fields are for documentation purposes
- name: group_memberships
props:
- name: team_id
value: "{{ team_id }}"
description: Required parameter for the group_memberships resource.
- name: id
value: "{{ id }}"
description: |
The group unique identifier
- name: role
value: "{{ role }}"
description: |
The team's role
UPDATE examples
- update
Updates team membership in a group.
UPDATE fivetran.teams.group_memberships
SET
role = '{{ role }}'
WHERE
team_id = '{{ team_id }}' --required
AND group_id = '{{ group_id }}' --required
AND role = '{{ role }}' --required
RETURNING
id,
created_at,
role;
DELETE examples
- delete
Removes a team's membership in a group.
DELETE FROM fivetran.teams.group_memberships
WHERE team_id = '{{ team_id }}' --required
AND group_id = '{{ group_id }}' --required
;