Skip to content

Latest commit

 

History

History
132 lines (94 loc) · 4.23 KB

GroupMembership.md

File metadata and controls

132 lines (94 loc) · 4.23 KB

GroupMembership

Method HTTP request
list GET /v2/admin/users/{userId}/groupMemberships
page GET /v2/admin/users/{userId}/groupMemberships

list

Lists all GroupMemberships.

This is a paged endpoint. Each page may be smaller or larger than the requested page size. However, it is guaranteed that if there are more results available, the nextPageToken field will be populated. To get the next page, make the same request again, but set the value of the pageToken query parameter to be value of the nextPageToken value of the previous response. If there is no nextPageToken field in the response, you are on the last page.

Parameters

Name Type Description Notes
user_id PrincipalId userId
page_size Optional[PageSize] pageSize [optional]
transitive Optional[pydantic.StrictBool] transitive [optional]

Return type

ResourceIterator[GroupMembership]

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# PrincipalId | userId
user_id = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[pydantic.StrictBool] | transitive
transitive = None


try:
    for group_membership in foundry_client.admin.User.GroupMembership.list(
        user_id,
        page_size=page_size,
        transitive=transitive,
    ):
        pprint(group_membership)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling GroupMembership.list: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListGroupMembershipsResponse application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

page

Lists all GroupMemberships.

This is a paged endpoint. Each page may be smaller or larger than the requested page size. However, it is guaranteed that if there are more results available, the nextPageToken field will be populated. To get the next page, make the same request again, but set the value of the pageToken query parameter to be value of the nextPageToken value of the previous response. If there is no nextPageToken field in the response, you are on the last page.

Parameters

Name Type Description Notes
user_id PrincipalId userId
page_size Optional[PageSize] pageSize [optional]
page_token Optional[PageToken] pageToken [optional]
transitive Optional[pydantic.StrictBool] transitive [optional]

Return type

ListGroupMembershipsResponse

Example

from foundry.v2 import FoundryClient
import foundry
from pprint import pprint

foundry_client = FoundryClient(
    auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
)

# PrincipalId | userId
user_id = None
# Optional[PageSize] | pageSize
page_size = None
# Optional[PageToken] | pageToken
page_token = None
# Optional[pydantic.StrictBool] | transitive
transitive = None


try:
    api_response = foundry_client.admin.User.GroupMembership.page(
        user_id,
        page_size=page_size,
        page_token=page_token,
        transitive=transitive,
    )
    print("The page response:\n")
    pprint(api_response)
except foundry.PalantirRPCException as e:
    print("HTTP error when calling GroupMembership.page: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 ListGroupMembershipsResponse application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]