import type { RawAxiosRequestHeaders } from 'axios'; import type { GetSpaceMembershipProps, GetSpaceParams, QueryParams, CollectionProp, GetOrganizationParams } from '../../common-types'; import type { OptionalDefaults } from '../wrappers/wrap'; import type { CreateSpaceMembershipProps, SpaceMembershipProps } from '../../entities/space-membership'; export type SpaceMembershipPlainClientAPI = { /** * Fetches a space membership for a given space * @param params the space and membership IDs * @returns the space membership * @throws if the request fails, or the space membership is not found * @example ```javascript * const spaceMembership = await client.spaceMembership.get({ * spaceId: '', * spaceMembershipId: '', * }); * ``` */ get(params: OptionalDefaults): Promise; /** * Fetches all of the memberships for a given space * @param params a space ID * @returns a collection of space memberships * @throws if the request fails, the space is not found, or the query parameters are malformed * @example ```javascript * const spaceMemberships = await client.spaceMembership.getMany({ * spaceId: '', * spaceMembershipId: '', * }); * ``` */ getMany(params: OptionalDefaults): Promise>; /** * Fetches the space membership within a given organization * @param params the organization and membership IDs * @returns the space membership * @throws if the request fails, or the organization or the space membership is not found * @example ```javascript * const spaceMembership = await client.spaceMembership.getForOrganization({ * spaceId: '', * spaceMembershipId: '', * }); * ``` */ getForOrganization(params: OptionalDefaults): Promise; /** * Fetches all of the space memberships within a given organization * @param params the organization and query parameterss * @returns a collection of space memberships * @throws if the request fails, the organization is not found, or the query parameters are malformed * @example ```javascript * const spaceMemberships = await client.spaceMembership.getManyForOrganization({ * organizationId: '', * spaceMembershipId: '', * }); * ``` */ getManyForOrganization(params: OptionalDefaults): Promise>; /** * Creates a space membership * @param params the space ID * @param data the space membership data * @returns the created space membership * @throws if the request fails, the space cannot be found, or the data is malformed * @example ```javascript * const spaceMembership = await client.spaceMembership.create( * { * spaceId: '', * }, * { * admin: false, * roles: [ * { * sys: { * type: 'Link', * linkType: 'Role', * id: '', * }, * }, * ], * email: 'foo@example.com', * } * ); * ``` */ create(params: OptionalDefaults, data: CreateSpaceMembershipProps, headers?: RawAxiosRequestHeaders): Promise; /** * Creates a space membership with a specific ID * @param params the space ID and chosen membership ID * @param data the space membership data * @returns the created space membership * @throws if the request fails, the space cannot be found, or the data is malformed * @example ```javascript * const spaceMembership = await client.spaceMembership.createWithId( * { * spaceId: '', * spaceMembershipId: '', * }, * { * admin: false, * roles: [ * { * sys: { * type: 'Link', * linkType: 'Role', * id: '', * }, * }, * ], * email: 'foo@example.com', * } * ); * ``` */ createWithId(params: OptionalDefaults, data: CreateSpaceMembershipProps, headers?: RawAxiosRequestHeaders): Promise; /** * Updates a space membership * @param params the space and membership IDs * @param rawData the space membership update * @returns the updated space membership * @throws if the request fails, the space membership is not found, or the payload is malformed * @example ```javascript * let spaceMembership = await client.spaceMembership.get({ * spaceId: '', * spaceMembershipId: '', * }); * * spaceMembership = await client.spaceMembership.update( * { * spaceId: '', * spaceMembershipId: '', * }, * { * ...spaceMembership, * admin: true, * } * ); * ``` */ update(params: OptionalDefaults, rawData: SpaceMembershipProps, headers?: RawAxiosRequestHeaders): Promise; /** * Deletes a space membership * @param params the space and membership IDs * @returns void * @throws if the request fails, or the space membership is not found * @example ```javascript * await client.spaceMembership.delete({ * spaceId: '', * spaceMembershipId: '', * }); * ``` */ delete(params: OptionalDefaults): Promise; };