export type GetApiV1PeopleMentionableArgs = {resource: string}; export type GetApiV1PeopleMentionableOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get members who can read a specific resource type * * GET /v1/people/mentionable */ export const getApiV1PeopleMentionable = async (args: GetApiV1PeopleMentionableArgs, options?: GetApiV1PeopleMentionableOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.resource != null) query.append("resource", String(args.resource)) if (apikey !== undefined) headers.set("X-API-Key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/people/mentionable${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };