1 | import type { RawAxiosRequestHeaders } from 'axios';
|
2 | import type { GetTeamSpaceMembershipParams, GetSpaceParams, QueryParams, CollectionProp, GetOrganizationParams } from '../../common-types';
|
3 | import type { TeamSpaceMembershipProps, CreateTeamSpaceMembershipProps } from '../../export-types';
|
4 | import type { OptionalDefaults } from '../wrappers/wrap';
|
5 | export type TeamSpaceMembershipPlainClientAPI = {
|
6 | /**
|
7 | * Fetch a single team space membership by its ID
|
8 | * @param params the team and space IDs
|
9 | * @returns the requested team space membership
|
10 | * @throws if the request fails, or the team space membership or space are not found
|
11 | * @example
|
12 | * ```javascript
|
13 | * const teamSpaceMembership = await client.teamSpaceMembership.get({
|
14 | * spaceId: '<space_id>',
|
15 | * teamSpaceMembershipId: '<team_space_membership_id>'
|
16 | * })
|
17 | * ```
|
18 | */
|
19 | get(params: OptionalDefaults<GetTeamSpaceMembershipParams>): Promise<TeamSpaceMembershipProps>;
|
20 | /**
|
21 | * Fetch all team space memberships for a given space
|
22 | * @param params the space ID and optional pagination query parameters
|
23 | * @returns A collection of team space memberships
|
24 | * @throws if the request fails, or the space is not found
|
25 | * @example
|
26 | * ```javascript
|
27 | * const teamSpaceMemberships = await client.teamSpaceMembership.getMany({
|
28 | * spaceId: '<space_id>',
|
29 | * query: {
|
30 | * limit: 10,
|
31 | * }
|
32 | * })
|
33 | * ```
|
34 | */
|
35 | getMany(params: OptionalDefaults<GetSpaceParams & QueryParams>): Promise<CollectionProp<TeamSpaceMembershipProps>>;
|
36 | /**
|
37 | * Fetch a team space membership for a given organization
|
38 | * @param params the space ID and optional pagination query parameters
|
39 | * @returns A collection of team space memberships
|
40 | * @throws if the request fails, or the space is not found
|
41 | * @example
|
42 | * ```javascript
|
43 | * const teamSpaceMembership = await client.teamSpaceMembership.getForOrganization({
|
44 | * organizationId: '<organization_id>',
|
45 | * teamSpaceMembershipId: '<team_space_membership_id>'
|
46 | * })
|
47 | * ```
|
48 | */
|
49 | getForOrganization(params: OptionalDefaults<GetOrganizationParams & {
|
50 | teamSpaceMembershipId: string;
|
51 | }>): Promise<TeamSpaceMembershipProps>;
|
52 | /**
|
53 | * Fetch all team space memberships for a given organization
|
54 | * @param params the organization ID and optional filter and pagination query parameters
|
55 | * @returns A collection of team space memberships
|
56 | * @throws if the request fails, or the organization is not found
|
57 | * @example
|
58 | * ```javascript
|
59 | * const teamSpaceMemberships = await client.teamSpaceMembership.getManyForOrganization({
|
60 | * organizationId: '<organization_id>',
|
61 | * query: {
|
62 | * teamId: '<team_id>',
|
63 | * limit: 10,
|
64 | * }
|
65 | * })
|
66 | * ```
|
67 | */
|
68 | getManyForOrganization(params: OptionalDefaults<GetOrganizationParams & QueryParams & {
|
69 | teamId?: string;
|
70 | }>): Promise<CollectionProp<TeamSpaceMembershipProps>>;
|
71 | /**
|
72 | * Create a new team space membership
|
73 | * @param params the space and team IDs
|
74 | * @param rawData the role links and a flag indicating whether or not the user is an admin
|
75 | * @returns the created team space membership
|
76 | * @throws if the request fails, or the organization or team are not found
|
77 | * @example
|
78 | * ```javascript
|
79 | * const teamSpaceMembership = await client.teamSpaceMembership.create({
|
80 | * organizationId: '<organization_id>',
|
81 | * teamId: '<team_id>',
|
82 | * }, {
|
83 | * admin: false,
|
84 | * roles: []
|
85 | * })
|
86 | * ```
|
87 | */
|
88 | create(params: OptionalDefaults<GetSpaceParams & {
|
89 | teamId: string;
|
90 | }>, rawData: CreateTeamSpaceMembershipProps, headers?: RawAxiosRequestHeaders): Promise<TeamSpaceMembershipProps>;
|
91 | /**
|
92 | * Update a team space membership
|
93 | * @param params the space and team space membership IDs
|
94 | * @param rawData the team space membership data
|
95 | * @returns the updated team space membership
|
96 | * @throws if the request fails, or the space or team space membership are not found
|
97 | * @example
|
98 | * ```javascript
|
99 | * let teamSpaceMembership = await client.teamSpaceMembership.get({
|
100 | * spaceId: '<space_id>',
|
101 | * teamSpaceMembershipId: '<team_space_membership_id>'
|
102 | * })
|
103 | *
|
104 | * teamMembership = await client.teamMembership.update({
|
105 | * spaceId: '<space_id>',
|
106 | * teamSpaceMembershipId: '<team_space_membership_id>'
|
107 | * }, {
|
108 | * ...teamSpaceMembership,
|
109 | * admin: true,
|
110 | * })
|
111 | * ```
|
112 | */
|
113 | update(params: OptionalDefaults<GetTeamSpaceMembershipParams>, rawData: TeamSpaceMembershipProps, headers?: RawAxiosRequestHeaders): Promise<TeamSpaceMembershipProps>;
|
114 | /**
|
115 | * Delete a team space membership
|
116 | * @param params the space and team space membership IDs
|
117 | * @throws if the request fails, or the space or team space membership are not found
|
118 | * @example
|
119 | * ```javascript
|
120 | * await client.teamSpaceMembership.delete({
|
121 | * spaceId: '<space_id>',
|
122 | * teamSpaceMembershipId: '<team_space_membership_id>'
|
123 | * })
|
124 | * ```
|
125 | */
|
126 | delete(params: OptionalDefaults<GetTeamSpaceMembershipParams>): Promise<void>;
|
127 | };
|