Reference documentation and code samples for the Google Apps Chat V1 Client class ListMembershipsRequest.
Request message for listing memberships.
Generated from protobuf messagegoogle.chat.v1.ListMembershipsRequest
Namespace
Google \ Apps \ Chat \ V1
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ parent
string
Required. The resource name of the space for which to fetch a membership list. Format: spaces/{space}
↳ page_size
int
Optional. The maximum number of memberships to return. The service might return fewer than this value. If unspecified, at most 100 memberships are returned. The maximum value is 1000. If you use a value more than 1000, it's automatically changed to 1000. Negative values return anINVALID_ARGUMENTerror.
↳ page_token
string
Optional. A page token, received from a previous call to list memberships. Provide this parameter to retrieve the subsequent page. When paginating, all other parameters provided should match the call that provided the page token. Passing different values to the other parameters might lead to unexpected results.
↳ filter
string
Optional. A query filter. You can filter memberships by a member's role (role) and type (member.type). To filter by role, setroletoROLE_MEMBERorROLE_MANAGER. To filter by type, setmember.typetoHUMANorBOT. You can also filter formember.typeusing the!=operator. To filter by both role and type, use theANDoperator. To filter by either role or type, use theORoperator. Eithermember.type = "HUMAN"ormember.type != "BOT"is required whenuse_admin_accessis set to true. Other member type filters will be rejected. For example, the following queries are valid:role = "ROLE_MANAGER" OR role = "ROLE_MEMBER" member.type = "HUMAN" AND role = "ROLE_MANAGER" member.type != "BOT"The following queries are invalid:member.type = "HUMAN" AND member.type = "BOT" role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"Invalid queries are rejected by the server with anINVALID_ARGUMENTerror.
↳ show_groups
bool
Optional. Whentrue, also returns memberships associated with aGoogle Group, in addition to other types of memberships. If afilteris set,Google Groupmemberships that don't match the filter criteria aren't returned.
↳ show_invited
bool
Optional. Whentrue, also returns memberships associated withinvitedmembers, in addition to other types of memberships. If a filter is set,invitedmemberships that don't match the filter criteria aren't returned. Currently requiresuser authentication.
↳ use_admin_access
bool
Optional. Whentrue, the method runs using the user's Google Workspace administrator privileges. The calling user must be a Google Workspace administrator with themanage chat and spaces conversations privilege. Requires either thechat.admin.memberships.readonlyorchat.admin.membershipsOAuth 2.0 scope. Listing app memberships in a space isn't supported when using admin access.
getParent
Required. The resource name of the space for which to fetch a membership
list.
Format: spaces/{space}
Returns
Type
Description
string
setParent
Required. The resource name of the space for which to fetch a membership
list.
Format: spaces/{space}
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getPageSize
Optional. The maximum number of memberships to return. The service might
return fewer than this value.
If unspecified, at most 100 memberships are returned.
The maximum value is 1000. If you use a value more than 1000, it's
automatically changed to 1000.
Negative values return anINVALID_ARGUMENTerror.
Returns
Type
Description
int
setPageSize
Optional. The maximum number of memberships to return. The service might
return fewer than this value.
If unspecified, at most 100 memberships are returned.
The maximum value is 1000. If you use a value more than 1000, it's
automatically changed to 1000.
Negative values return anINVALID_ARGUMENTerror.
Parameter
Name
Description
var
int
Returns
Type
Description
$this
getPageToken
Optional. A page token, received from a previous call to list memberships.
Provide this parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that
provided the page token. Passing different values to the other parameters
might lead to unexpected results.
Returns
Type
Description
string
setPageToken
Optional. A page token, received from a previous call to list memberships.
Provide this parameter to retrieve the subsequent page.
When paginating, all other parameters provided should match the call that
provided the page token. Passing different values to the other parameters
might lead to unexpected results.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getFilter
Optional. A query filter.
You can filter memberships by a member's role
(role)
and type
(member.type).
To filter by role, setroletoROLE_MEMBERorROLE_MANAGER.
To filter by type, setmember.typetoHUMANorBOT. You can also
filter formember.typeusing the!=operator.
To filter by both role and type, use theANDoperator. To filter by
either role or type, use theORoperator.
Eithermember.type = "HUMAN"ormember.type != "BOT"is required
whenuse_admin_accessis set to true. Other member type filters will be
rejected.
For example, the following queries are valid:
role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
member.type = "HUMAN" AND role = "ROLE_MANAGER"
member.type != "BOT"
The following queries are invalid:
member.type = "HUMAN" AND member.type = "BOT"
role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
Invalid queries are rejected by the server with anINVALID_ARGUMENTerror.
Returns
Type
Description
string
setFilter
Optional. A query filter.
You can filter memberships by a member's role
(role)
and type
(member.type).
To filter by role, setroletoROLE_MEMBERorROLE_MANAGER.
To filter by type, setmember.typetoHUMANorBOT. You can also
filter formember.typeusing the!=operator.
To filter by both role and type, use theANDoperator. To filter by
either role or type, use theORoperator.
Eithermember.type = "HUMAN"ormember.type != "BOT"is required
whenuse_admin_accessis set to true. Other member type filters will be
rejected.
For example, the following queries are valid:
role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
member.type = "HUMAN" AND role = "ROLE_MANAGER"
member.type != "BOT"
The following queries are invalid:
member.type = "HUMAN" AND member.type = "BOT"
role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
Invalid queries are rejected by the server with anINVALID_ARGUMENTerror.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getShowGroups
Optional. Whentrue, also returns memberships associated with aGoogle Group, in
addition to other types of memberships. If afilteris set,Google Groupmemberships that don't match the filter criteria aren't returned.
Returns
Type
Description
bool
setShowGroups
Optional. Whentrue, also returns memberships associated with aGoogle Group, in
addition to other types of memberships. If afilteris set,Google Groupmemberships that don't match the filter criteria aren't returned.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
getShowInvited
Optional. Whentrue, also returns memberships associated withinvitedmembers, in
addition to other types of memberships. If a
filter is set,invitedmemberships
that don't match the filter criteria aren't returned.
Optional. Whentrue, also returns memberships associated withinvitedmembers, in
addition to other types of memberships. If a
filter is set,invitedmemberships
that don't match the filter criteria aren't returned.
Optional. Whentrue, the method runs using the user's Google Workspace
administrator privileges.
The calling user must be a Google Workspace administrator with themanage chat and spaces conversations
privilege.
Requires either thechat.admin.memberships.readonlyorchat.admin.membershipsOAuth 2.0
scope.
Listing app memberships in a space isn't supported when using admin access.
Returns
Type
Description
bool
setUseAdminAccess
Optional. Whentrue, the method runs using the user's Google Workspace
administrator privileges.
The calling user must be a Google Workspace administrator with themanage chat and spaces conversations
privilege.
Requires either thechat.admin.memberships.readonlyorchat.admin.membershipsOAuth 2.0
scope.
Listing app memberships in a space isn't supported when using admin access.
Parameter
Name
Description
var
bool
Returns
Type
Description
$this
static::build
Parameter
Name
Description
parent
string
Required. The resource name of the space for which to fetch a membership
list.
Format: spaces/{space}
Please seeChatServiceClient::spaceName()for help formatting this field.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Google Apps Chat V1 Client - Class ListMembershipsRequest (0.12.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.12.0 (latest)](/php/docs/reference/apps-chat/latest/Chat.V1.ListMembershipsRequest)\n- [0.11.2](/php/docs/reference/apps-chat/0.11.2/Chat.V1.ListMembershipsRequest)\n- [0.10.0](/php/docs/reference/apps-chat/0.10.0/Chat.V1.ListMembershipsRequest)\n- [0.9.0](/php/docs/reference/apps-chat/0.9.0/Chat.V1.ListMembershipsRequest)\n- [0.8.1](/php/docs/reference/apps-chat/0.8.1/Chat.V1.ListMembershipsRequest)\n- [0.7.2](/php/docs/reference/apps-chat/0.7.2/Chat.V1.ListMembershipsRequest)\n- [0.6.1](/php/docs/reference/apps-chat/0.6.1/Chat.V1.ListMembershipsRequest)\n- [0.5.0](/php/docs/reference/apps-chat/0.5.0/Chat.V1.ListMembershipsRequest)\n- [0.4.0](/php/docs/reference/apps-chat/0.4.0/Chat.V1.ListMembershipsRequest)\n- [0.3.0](/php/docs/reference/apps-chat/0.3.0/Chat.V1.ListMembershipsRequest)\n- [0.2.0](/php/docs/reference/apps-chat/0.2.0/Chat.V1.ListMembershipsRequest)\n- [0.1.4](/php/docs/reference/apps-chat/0.1.4/Chat.V1.ListMembershipsRequest) \nReference documentation and code samples for the Google Apps Chat V1 Client class ListMembershipsRequest.\n\nRequest message for listing memberships.\n\nGenerated from protobuf message `google.chat.v1.ListMembershipsRequest`\n\nNamespace\n---------\n\nGoogle \\\\ Apps \\\\ Chat \\\\ V1\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getParent\n\nRequired. The resource name of the space for which to fetch a membership\nlist.\n\nFormat: spaces/{space}\n\n### setParent\n\nRequired. The resource name of the space for which to fetch a membership\nlist.\n\nFormat: spaces/{space}\n\n### getPageSize\n\nOptional. The maximum number of memberships to return. The service might\nreturn fewer than this value.\n\nIf unspecified, at most 100 memberships are returned.\nThe maximum value is 1000. If you use a value more than 1000, it's\nautomatically changed to 1000.\nNegative values return an `INVALID_ARGUMENT` error.\n\n### setPageSize\n\nOptional. The maximum number of memberships to return. The service might\nreturn fewer than this value.\n\nIf unspecified, at most 100 memberships are returned.\nThe maximum value is 1000. If you use a value more than 1000, it's\nautomatically changed to 1000.\nNegative values return an `INVALID_ARGUMENT` error.\n\n### getPageToken\n\nOptional. A page token, received from a previous call to list memberships.\n\nProvide this parameter to retrieve the subsequent page.\nWhen paginating, all other parameters provided should match the call that\nprovided the page token. Passing different values to the other parameters\nmight lead to unexpected results.\n\n### setPageToken\n\nOptional. A page token, received from a previous call to list memberships.\n\nProvide this parameter to retrieve the subsequent page.\nWhen paginating, all other parameters provided should match the call that\nprovided the page token. Passing different values to the other parameters\nmight lead to unexpected results.\n\n### getFilter\n\nOptional. A query filter.\n\nYou can filter memberships by a member's role\n([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole))\nand type\n([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)).\nTo filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.\nTo filter by type, set `member.type` to `HUMAN` or `BOT`. You can also\nfilter for `member.type` using the `!=` operator.\nTo filter by both role and type, use the `AND` operator. To filter by\neither role or type, use the `OR` operator.\nEither `member.type = \"HUMAN\"` or `member.type != \"BOT\"` is required\nwhen `use_admin_access` is set to true. Other member type filters will be\nrejected.\nFor example, the following queries are valid: \n\n role = \"ROLE_MANAGER\" OR role = \"ROLE_MEMBER\"\n member.type = \"HUMAN\" AND role = \"ROLE_MANAGER\"\n member.type != \"BOT\"\n\nThe following queries are invalid: \n\n member.type = \"HUMAN\" AND member.type = \"BOT\"\n role = \"ROLE_MANAGER\" AND role = \"ROLE_MEMBER\"\n\nInvalid queries are rejected by the server with an `INVALID_ARGUMENT`\nerror.\n\n### setFilter\n\nOptional. A query filter.\n\nYou can filter memberships by a member's role\n([`role`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole))\nand type\n([`member.type`](https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type)).\nTo filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.\nTo filter by type, set `member.type` to `HUMAN` or `BOT`. You can also\nfilter for `member.type` using the `!=` operator.\nTo filter by both role and type, use the `AND` operator. To filter by\neither role or type, use the `OR` operator.\nEither `member.type = \"HUMAN\"` or `member.type != \"BOT\"` is required\nwhen `use_admin_access` is set to true. Other member type filters will be\nrejected.\nFor example, the following queries are valid: \n\n role = \"ROLE_MANAGER\" OR role = \"ROLE_MEMBER\"\n member.type = \"HUMAN\" AND role = \"ROLE_MANAGER\"\n member.type != \"BOT\"\n\nThe following queries are invalid: \n\n member.type = \"HUMAN\" AND member.type = \"BOT\"\n role = \"ROLE_MANAGER\" AND role = \"ROLE_MEMBER\"\n\nInvalid queries are rejected by the server with an `INVALID_ARGUMENT`\nerror.\n\n### getShowGroups\n\nOptional. When `true`, also returns memberships associated with a\n[Google Group](/php/docs/reference/apps-chat/latest/Chat.V1.Membership#_Google_Apps_Chat_V1_Membership__getGroupMember__), in\naddition to other types of memberships. If a\n[filter](/php/docs/reference/apps-chat/latest/Chat.V1.ListMembershipsRequest#_Google_Apps_Chat_V1_ListMembershipsRequest__getFilter__) is set,\n[Google Group](/php/docs/reference/apps-chat/latest/Chat.V1.Membership#_Google_Apps_Chat_V1_Membership__getGroupMember__)\nmemberships that don't match the filter criteria aren't returned.\n\n### setShowGroups\n\nOptional. When `true`, also returns memberships associated with a\n[Google Group](/php/docs/reference/apps-chat/latest/Chat.V1.Membership#_Google_Apps_Chat_V1_Membership__getGroupMember__), in\naddition to other types of memberships. If a\n[filter](/php/docs/reference/apps-chat/latest/Chat.V1.ListMembershipsRequest#_Google_Apps_Chat_V1_ListMembershipsRequest__getFilter__) is set,\n[Google Group](/php/docs/reference/apps-chat/latest/Chat.V1.Membership#_Google_Apps_Chat_V1_Membership__getGroupMember__)\nmemberships that don't match the filter criteria aren't returned.\n\n### getShowInvited\n\nOptional. When `true`, also returns memberships associated with\n[invited](/php/docs/reference/apps-chat/latest/Chat.V1.Membership.MembershipState#_Google_Apps_Chat_V1_Membership_MembershipState__INVITED) members, in\naddition to other types of memberships. If a\nfilter is set,\n[invited](/php/docs/reference/apps-chat/latest/Chat.V1.Membership.MembershipState#_Google_Apps_Chat_V1_Membership_MembershipState__INVITED) memberships\nthat don't match the filter criteria aren't returned.\n\nCurrently requires [user\nauthentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).\n\n### setShowInvited\n\nOptional. When `true`, also returns memberships associated with\n[invited](/php/docs/reference/apps-chat/latest/Chat.V1.Membership.MembershipState#_Google_Apps_Chat_V1_Membership_MembershipState__INVITED) members, in\naddition to other types of memberships. If a\nfilter is set,\n[invited](/php/docs/reference/apps-chat/latest/Chat.V1.Membership.MembershipState#_Google_Apps_Chat_V1_Membership_MembershipState__INVITED) memberships\nthat don't match the filter criteria aren't returned.\n\nCurrently requires [user\nauthentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user).\n\n### getUseAdminAccess\n\nOptional. When `true`, the method runs using the user's Google Workspace\nadministrator privileges.\n\nThe calling user must be a Google Workspace administrator with the\n[manage chat and spaces conversations\nprivilege](https://support.google.com/a/answer/13369245).\nRequires either the `chat.admin.memberships.readonly` or\n`chat.admin.memberships` [OAuth 2.0\nscope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).\nListing app memberships in a space isn't supported when using admin access.\n\n### setUseAdminAccess\n\nOptional. When `true`, the method runs using the user's Google Workspace\nadministrator privileges.\n\nThe calling user must be a Google Workspace administrator with the\n[manage chat and spaces conversations\nprivilege](https://support.google.com/a/answer/13369245).\nRequires either the `chat.admin.memberships.readonly` or\n`chat.admin.memberships` [OAuth 2.0\nscope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes).\nListing app memberships in a space isn't supported when using admin access.\n\n### static::build"]]