archastro.platform.v1.resources.team_memberships

  1# Copyright (c) 2026 ArchAstro Inc. All Rights Reserved.
  2# This file is auto-generated by @archastro/sdk-generator. Do not edit.
  3# Content hash: 286483c03131
  4
  5from __future__ import annotations
  6
  7import builtins
  8
  9from ...runtime.http_client import HttpClient, SyncHttpClient
 10from ...types.teams import TeamMembershipListResponse
 11
 12
 13class AsyncTeamMembershipResource:
 14    def __init__(self, http: HttpClient):
 15        self._http = http
 16
 17    async def list(
 18        self,
 19        *,
 20        team: builtins.list[str] | None = None,
 21        user: builtins.list[str] | None = None,
 22        agent: builtins.list[str] | None = None,
 23        page: int | None = None,
 24        page_size: int | None = None,
 25    ) -> TeamMembershipListResponse:
 26        """
 27        List team memberships
 28        Returns a paginated list of team memberships across all teams accessible to
 29        the authenticated caller. Use the `team`, `user`, and `agent` filters to
 30        narrow results to a specific team or principal.
 31        This endpoint requires S2S (service-to-service) authentication. Callers
 32        authenticated with a user token receive a 401. Each membership includes the
 33        resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
 34        profile picture derived from the associated user or agent at request time.
 35        Results are returned in offset-based pages. Pass `page` and `page_size` to
 36        navigate; the response includes `has_next` and `has_prev` to determine
 37        whether adjacent pages exist.
 38
 39        Args:
 40            team: Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
 41            user: Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
 42            agent: Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
 43            page: Page number to retrieve, starting at `1`. Defaults to `1`.
 44            page_size: Number of memberships to return per page. Defaults to `25`.
 45
 46        Returns:
 47            Paginated list of team memberships matching the applied filters.
 48        """
 49        query: dict[str, object] = {}
 50        if team is not None:
 51            query["team"] = team
 52        if user is not None:
 53            query["user"] = user
 54        if agent is not None:
 55            query["agent"] = agent
 56        if page is not None:
 57            query["page"] = page
 58        if page_size is not None:
 59            query["page_size"] = page_size
 60        return await self._http.request(
 61            "/api/v1/team_memberships",
 62            query=query,
 63            response_type=TeamMembershipListResponse,
 64        )
 65
 66    async def delete(self, team_membership: str) -> None:
 67        """
 68        Remove a team membership by ID
 69        Removes a team membership identified directly by its membership ID. On
 70        success, returns 204 No Content.
 71        This endpoint is intended for server-to-server callers that already hold the
 72        membership ID. To remove a member by user or agent ID instead, use the team
 73        members delete endpoint. The caller must have permission to manage the team
 74        that the membership belongs to.
 75
 76        Args:
 77            team_membership: Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
 78
 79        Returns:
 80            Empty response. Returns 204 No Content on success.
 81        """
 82        await self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE")
 83
 84
 85class TeamMembershipResource:
 86    def __init__(self, http: SyncHttpClient):
 87        self._http = http
 88
 89    def list(
 90        self,
 91        *,
 92        team: builtins.list[str] | None = None,
 93        user: builtins.list[str] | None = None,
 94        agent: builtins.list[str] | None = None,
 95        page: int | None = None,
 96        page_size: int | None = None,
 97    ) -> TeamMembershipListResponse:
 98        """
 99        List team memberships
100        Returns a paginated list of team memberships across all teams accessible to
101        the authenticated caller. Use the `team`, `user`, and `agent` filters to
102        narrow results to a specific team or principal.
103        This endpoint requires S2S (service-to-service) authentication. Callers
104        authenticated with a user token receive a 401. Each membership includes the
105        resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
106        profile picture derived from the associated user or agent at request time.
107        Results are returned in offset-based pages. Pass `page` and `page_size` to
108        navigate; the response includes `has_next` and `has_prev` to determine
109        whether adjacent pages exist.
110
111        Args:
112            team: Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
113            user: Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
114            agent: Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
115            page: Page number to retrieve, starting at `1`. Defaults to `1`.
116            page_size: Number of memberships to return per page. Defaults to `25`.
117
118        Returns:
119            Paginated list of team memberships matching the applied filters.
120        """
121        query: dict[str, object] = {}
122        if team is not None:
123            query["team"] = team
124        if user is not None:
125            query["user"] = user
126        if agent is not None:
127            query["agent"] = agent
128        if page is not None:
129            query["page"] = page
130        if page_size is not None:
131            query["page_size"] = page_size
132        return self._http.request(
133            "/api/v1/team_memberships",
134            query=query,
135            response_type=TeamMembershipListResponse,
136        )
137
138    def delete(self, team_membership: str) -> None:
139        """
140        Remove a team membership by ID
141        Removes a team membership identified directly by its membership ID. On
142        success, returns 204 No Content.
143        This endpoint is intended for server-to-server callers that already hold the
144        membership ID. To remove a member by user or agent ID instead, use the team
145        members delete endpoint. The caller must have permission to manage the team
146        that the membership belongs to.
147
148        Args:
149            team_membership: Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
150
151        Returns:
152            Empty response. Returns 204 No Content on success.
153        """
154        self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE")
class AsyncTeamMembershipResource:
14class AsyncTeamMembershipResource:
15    def __init__(self, http: HttpClient):
16        self._http = http
17
18    async def list(
19        self,
20        *,
21        team: builtins.list[str] | None = None,
22        user: builtins.list[str] | None = None,
23        agent: builtins.list[str] | None = None,
24        page: int | None = None,
25        page_size: int | None = None,
26    ) -> TeamMembershipListResponse:
27        """
28        List team memberships
29        Returns a paginated list of team memberships across all teams accessible to
30        the authenticated caller. Use the `team`, `user`, and `agent` filters to
31        narrow results to a specific team or principal.
32        This endpoint requires S2S (service-to-service) authentication. Callers
33        authenticated with a user token receive a 401. Each membership includes the
34        resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
35        profile picture derived from the associated user or agent at request time.
36        Results are returned in offset-based pages. Pass `page` and `page_size` to
37        navigate; the response includes `has_next` and `has_prev` to determine
38        whether adjacent pages exist.
39
40        Args:
41            team: Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
42            user: Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
43            agent: Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
44            page: Page number to retrieve, starting at `1`. Defaults to `1`.
45            page_size: Number of memberships to return per page. Defaults to `25`.
46
47        Returns:
48            Paginated list of team memberships matching the applied filters.
49        """
50        query: dict[str, object] = {}
51        if team is not None:
52            query["team"] = team
53        if user is not None:
54            query["user"] = user
55        if agent is not None:
56            query["agent"] = agent
57        if page is not None:
58            query["page"] = page
59        if page_size is not None:
60            query["page_size"] = page_size
61        return await self._http.request(
62            "/api/v1/team_memberships",
63            query=query,
64            response_type=TeamMembershipListResponse,
65        )
66
67    async def delete(self, team_membership: str) -> None:
68        """
69        Remove a team membership by ID
70        Removes a team membership identified directly by its membership ID. On
71        success, returns 204 No Content.
72        This endpoint is intended for server-to-server callers that already hold the
73        membership ID. To remove a member by user or agent ID instead, use the team
74        members delete endpoint. The caller must have permission to manage the team
75        that the membership belongs to.
76
77        Args:
78            team_membership: Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
79
80        Returns:
81            Empty response. Returns 204 No Content on success.
82        """
83        await self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE")
AsyncTeamMembershipResource(http: archastro.platform.runtime.http_client.HttpClient)
15    def __init__(self, http: HttpClient):
16        self._http = http
async def list( self, *, team: list[str] | None = None, user: list[str] | None = None, agent: list[str] | None = None, page: int | None = None, page_size: int | None = None) -> archastro.platform.types.teams.TeamMembershipListResponse:
18    async def list(
19        self,
20        *,
21        team: builtins.list[str] | None = None,
22        user: builtins.list[str] | None = None,
23        agent: builtins.list[str] | None = None,
24        page: int | None = None,
25        page_size: int | None = None,
26    ) -> TeamMembershipListResponse:
27        """
28        List team memberships
29        Returns a paginated list of team memberships across all teams accessible to
30        the authenticated caller. Use the `team`, `user`, and `agent` filters to
31        narrow results to a specific team or principal.
32        This endpoint requires S2S (service-to-service) authentication. Callers
33        authenticated with a user token receive a 401. Each membership includes the
34        resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
35        profile picture derived from the associated user or agent at request time.
36        Results are returned in offset-based pages. Pass `page` and `page_size` to
37        navigate; the response includes `has_next` and `has_prev` to determine
38        whether adjacent pages exist.
39
40        Args:
41            team: Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
42            user: Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
43            agent: Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
44            page: Page number to retrieve, starting at `1`. Defaults to `1`.
45            page_size: Number of memberships to return per page. Defaults to `25`.
46
47        Returns:
48            Paginated list of team memberships matching the applied filters.
49        """
50        query: dict[str, object] = {}
51        if team is not None:
52            query["team"] = team
53        if user is not None:
54            query["user"] = user
55        if agent is not None:
56            query["agent"] = agent
57        if page is not None:
58            query["page"] = page
59        if page_size is not None:
60            query["page_size"] = page_size
61        return await self._http.request(
62            "/api/v1/team_memberships",
63            query=query,
64            response_type=TeamMembershipListResponse,
65        )

List team memberships Returns a paginated list of team memberships across all teams accessible to the authenticated caller. Use the team, user, and agent filters to narrow results to a specific team or principal. This endpoint requires S2S (service-to-service) authentication. Callers authenticated with a user token receive a 401. Each membership includes the resolved type ("user", "agent", or "unknown"), display name, and profile picture derived from the associated user or agent at request time. Results are returned in offset-based pages. Pass page and page_size to navigate; the response includes has_next and has_prev to determine whether adjacent pages exist.

Arguments:
  • team: Filter results to memberships belonging to these team IDs (tm_...). Multiple values are combined with OR.
  • user: Filter results to memberships held by these user IDs (usr_...). Multiple values are combined with OR.
  • agent: Filter results to memberships held by these agent IDs (agt_...). Multiple values are combined with OR.
  • page: Page number to retrieve, starting at 1. Defaults to 1.
  • page_size: Number of memberships to return per page. Defaults to 25.
Returns:

Paginated list of team memberships matching the applied filters.

async def delete(self, team_membership: str) -> None:
67    async def delete(self, team_membership: str) -> None:
68        """
69        Remove a team membership by ID
70        Removes a team membership identified directly by its membership ID. On
71        success, returns 204 No Content.
72        This endpoint is intended for server-to-server callers that already hold the
73        membership ID. To remove a member by user or agent ID instead, use the team
74        members delete endpoint. The caller must have permission to manage the team
75        that the membership belongs to.
76
77        Args:
78            team_membership: Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
79
80        Returns:
81            Empty response. Returns 204 No Content on success.
82        """
83        await self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE")

Remove a team membership by ID Removes a team membership identified directly by its membership ID. On success, returns 204 No Content. This endpoint is intended for server-to-server callers that already hold the membership ID. To remove a member by user or agent ID instead, use the team members delete endpoint. The caller must have permission to manage the team that the membership belongs to.

Arguments:
  • team_membership: Team membership ID (tmb_...) to remove. The membership must be within the caller's app scope.
Returns:

Empty response. Returns 204 No Content on success.

class TeamMembershipResource:
 86class TeamMembershipResource:
 87    def __init__(self, http: SyncHttpClient):
 88        self._http = http
 89
 90    def list(
 91        self,
 92        *,
 93        team: builtins.list[str] | None = None,
 94        user: builtins.list[str] | None = None,
 95        agent: builtins.list[str] | None = None,
 96        page: int | None = None,
 97        page_size: int | None = None,
 98    ) -> TeamMembershipListResponse:
 99        """
100        List team memberships
101        Returns a paginated list of team memberships across all teams accessible to
102        the authenticated caller. Use the `team`, `user`, and `agent` filters to
103        narrow results to a specific team or principal.
104        This endpoint requires S2S (service-to-service) authentication. Callers
105        authenticated with a user token receive a 401. Each membership includes the
106        resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
107        profile picture derived from the associated user or agent at request time.
108        Results are returned in offset-based pages. Pass `page` and `page_size` to
109        navigate; the response includes `has_next` and `has_prev` to determine
110        whether adjacent pages exist.
111
112        Args:
113            team: Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
114            user: Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
115            agent: Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
116            page: Page number to retrieve, starting at `1`. Defaults to `1`.
117            page_size: Number of memberships to return per page. Defaults to `25`.
118
119        Returns:
120            Paginated list of team memberships matching the applied filters.
121        """
122        query: dict[str, object] = {}
123        if team is not None:
124            query["team"] = team
125        if user is not None:
126            query["user"] = user
127        if agent is not None:
128            query["agent"] = agent
129        if page is not None:
130            query["page"] = page
131        if page_size is not None:
132            query["page_size"] = page_size
133        return self._http.request(
134            "/api/v1/team_memberships",
135            query=query,
136            response_type=TeamMembershipListResponse,
137        )
138
139    def delete(self, team_membership: str) -> None:
140        """
141        Remove a team membership by ID
142        Removes a team membership identified directly by its membership ID. On
143        success, returns 204 No Content.
144        This endpoint is intended for server-to-server callers that already hold the
145        membership ID. To remove a member by user or agent ID instead, use the team
146        members delete endpoint. The caller must have permission to manage the team
147        that the membership belongs to.
148
149        Args:
150            team_membership: Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
151
152        Returns:
153            Empty response. Returns 204 No Content on success.
154        """
155        self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE")
TeamMembershipResource(http: archastro.platform.runtime.http_client.SyncHttpClient)
87    def __init__(self, http: SyncHttpClient):
88        self._http = http
def list( self, *, team: list[str] | None = None, user: list[str] | None = None, agent: list[str] | None = None, page: int | None = None, page_size: int | None = None) -> archastro.platform.types.teams.TeamMembershipListResponse:
 90    def list(
 91        self,
 92        *,
 93        team: builtins.list[str] | None = None,
 94        user: builtins.list[str] | None = None,
 95        agent: builtins.list[str] | None = None,
 96        page: int | None = None,
 97        page_size: int | None = None,
 98    ) -> TeamMembershipListResponse:
 99        """
100        List team memberships
101        Returns a paginated list of team memberships across all teams accessible to
102        the authenticated caller. Use the `team`, `user`, and `agent` filters to
103        narrow results to a specific team or principal.
104        This endpoint requires S2S (service-to-service) authentication. Callers
105        authenticated with a user token receive a 401. Each membership includes the
106        resolved `type` (`"user"`, `"agent"`, or `"unknown"`), display name, and
107        profile picture derived from the associated user or agent at request time.
108        Results are returned in offset-based pages. Pass `page` and `page_size` to
109        navigate; the response includes `has_next` and `has_prev` to determine
110        whether adjacent pages exist.
111
112        Args:
113            team: Filter results to memberships belonging to these team IDs (`tm_...`). Multiple values are combined with OR.
114            user: Filter results to memberships held by these user IDs (`usr_...`). Multiple values are combined with OR.
115            agent: Filter results to memberships held by these agent IDs (`agt_...`). Multiple values are combined with OR.
116            page: Page number to retrieve, starting at `1`. Defaults to `1`.
117            page_size: Number of memberships to return per page. Defaults to `25`.
118
119        Returns:
120            Paginated list of team memberships matching the applied filters.
121        """
122        query: dict[str, object] = {}
123        if team is not None:
124            query["team"] = team
125        if user is not None:
126            query["user"] = user
127        if agent is not None:
128            query["agent"] = agent
129        if page is not None:
130            query["page"] = page
131        if page_size is not None:
132            query["page_size"] = page_size
133        return self._http.request(
134            "/api/v1/team_memberships",
135            query=query,
136            response_type=TeamMembershipListResponse,
137        )

List team memberships Returns a paginated list of team memberships across all teams accessible to the authenticated caller. Use the team, user, and agent filters to narrow results to a specific team or principal. This endpoint requires S2S (service-to-service) authentication. Callers authenticated with a user token receive a 401. Each membership includes the resolved type ("user", "agent", or "unknown"), display name, and profile picture derived from the associated user or agent at request time. Results are returned in offset-based pages. Pass page and page_size to navigate; the response includes has_next and has_prev to determine whether adjacent pages exist.

Arguments:
  • team: Filter results to memberships belonging to these team IDs (tm_...). Multiple values are combined with OR.
  • user: Filter results to memberships held by these user IDs (usr_...). Multiple values are combined with OR.
  • agent: Filter results to memberships held by these agent IDs (agt_...). Multiple values are combined with OR.
  • page: Page number to retrieve, starting at 1. Defaults to 1.
  • page_size: Number of memberships to return per page. Defaults to 25.
Returns:

Paginated list of team memberships matching the applied filters.

def delete(self, team_membership: str) -> None:
139    def delete(self, team_membership: str) -> None:
140        """
141        Remove a team membership by ID
142        Removes a team membership identified directly by its membership ID. On
143        success, returns 204 No Content.
144        This endpoint is intended for server-to-server callers that already hold the
145        membership ID. To remove a member by user or agent ID instead, use the team
146        members delete endpoint. The caller must have permission to manage the team
147        that the membership belongs to.
148
149        Args:
150            team_membership: Team membership ID (`tmb_...`) to remove. The membership must be within the caller's app scope.
151
152        Returns:
153            Empty response. Returns 204 No Content on success.
154        """
155        self._http.request(f"/api/v1/team_memberships/{team_membership}", method="DELETE")

Remove a team membership by ID Removes a team membership identified directly by its membership ID. On success, returns 204 No Content. This endpoint is intended for server-to-server callers that already hold the membership ID. To remove a member by user or agent ID instead, use the team members delete endpoint. The caller must have permission to manage the team that the membership belongs to.

Arguments:
  • team_membership: Team membership ID (tmb_...) to remove. The membership must be within the caller's app scope.
Returns:

Empty response. Returns 204 No Content on success.