Skip to main content

memberships

Creates, updates, deletes, gets or lists a memberships resource.

Overview

Namememberships
TypeResource
Idgoogle.cloudidentity.memberships

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name of the Membership. Shall be of the form groups/{group}/memberships/{membership}.
createTimestring (google-datetime)Output only. The time when the Membership was created.
deliverySettingstringOutput only. Delivery setting associated with the membership.
preferredMemberKeyobjectA unique identifier for an entity in the Cloud Identity Groups API. An entity can represent either a group with an optional namespace or a user without a namespace. The combination of id and namespace must be unique; however, the same id can be used with different namespaces. (id: EntityKey)
rolesarrayThe MembershipRoles that apply to the Membership. If unspecified, defaults to a single MembershipRole with name MEMBER. Must not contain duplicate MembershipRoles with the same name.
typestringOutput only. The type of the membership.
updateTimestring (google-datetime)Output only. The time when the Membership was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectgroupsId, membershipsIdRetrieves a Membership.
listselectgroupsIdview, pageSize, pageTokenLists the Memberships within a Group.
createinsertgroupsIdCreates a Membership.
deletedeletegroupsId, membershipsIdDeletes a Membership.
lookupexecgroupsIdmemberKey.id, memberKey.namespaceLooks up the resource name of a Membership by its EntityKey.
modify_membership_rolesexecgroupsId, membershipsIdModifies the MembershipRoles of a Membership.
search_transitive_membershipsexecgroupsIdpageSize, pageTokenSearch transitive memberships of a group. Note: This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. If the account of the group is not one of these, a 403 (PERMISSION_DENIED) HTTP status code will be returned. A transitive membership is any direct or indirect membership of a group. Actor must have view permissions to all transitive memberships.
search_transitive_groupsexecgroupsIdquery, pageSize, pageTokenSearch transitive groups of a member. Note: This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. If the account of the member is not one of these, a 403 (PERMISSION_DENIED) HTTP status code will be returned. A transitive group is any group that has a direct or indirect membership to the member. Actor must have view permissions all transitive groups.
check_transitive_membershipexecgroupsIdqueryCheck a potential member for membership in a group. Note: This feature is only available to Google Workspace Enterprise Standard, Enterprise Plus, and Enterprise for Education; and Cloud Identity Premium accounts. If the account of the member is not one of these, a 403 (PERMISSION_DENIED) HTTP status code will be returned. A member has membership to a group as long as there is a single viewable transitive membership between the group and the member. The actor must have view permissions to at least one transitive membership between the member and group.
search_direct_groupsexecgroupsIdquery, pageSize, pageToken, orderBySearches direct groups of a member.

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.

NameDatatypeDescription
groupsIdstring
membershipsIdstring
memberKey.idstring
memberKey.namespacestring
orderBystring
pageSizeinteger (int32)
pageTokenstring
querystring
viewstring

SELECT examples

Retrieves a Membership.

SELECT
name,
createTime,
deliverySetting,
preferredMemberKey,
roles,
type,
updateTime
FROM google.cloudidentity.memberships
WHERE groupsId = '{{ groupsId }}' -- required
AND membershipsId = '{{ membershipsId }}' -- required;

INSERT examples

Creates a Membership.

INSERT INTO google.cloudidentity.memberships (
data__preferredMemberKey,
data__roles,
groupsId
)
SELECT
'{{ preferredMemberKey }}',
'{{ roles }}',
'{{ groupsId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a Membership.

DELETE FROM google.cloudidentity.memberships
WHERE groupsId = '{{ groupsId }}' --required
AND membershipsId = '{{ membershipsId }}' --required;

Lifecycle Methods

Looks up the resource name of a Membership by its EntityKey.

EXEC google.cloudidentity.memberships.lookup 
@groupsId='{{ groupsId }}' --required,
@memberKey.id='{{ memberKey.id }}',
@memberKey.namespace='{{ memberKey.namespace }}';