export type OrganizationInvitation = {created_at: unknown, organization_id: string, token: unknown, invited_by_user_id: string, organization_name?: unknown | undefined, updated_at: unknown, id: string, invitation_type: 'one_time' | '24_hour', email?: unknown | undefined, message?: unknown | undefined, organization_role: 'owner' | 'member'}; export type PatchApiOrganizationInvitationArgs = {created_at?: unknown | undefined, organization_id?: string | undefined, token?: unknown | undefined, invited_by_user_id?: string | undefined, organization_name?: unknown | undefined, updated_at?: unknown | undefined, id?: string | undefined, invitation_type?: unknown | undefined, email?: unknown | undefined, message?: unknown | undefined, organization_role?: unknown | undefined, Prefer?: ('return=representation' | 'return=minimal' | 'return=none') | undefined, body: OrganizationInvitation}; export type PatchApiOrganizationInvitationOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /organization_invitation */ export const patchApiOrganizationInvitation = async (args: PatchApiOrganizationInvitationArgs, options?: PatchApiOrganizationInvitationOptions) => { const {baseUrl = "https://vnaabuozknwgxuvnfwjo.supabase.co:443", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.created_at != null) query.append("created_at", String(args.created_at)) if (args.organization_id != null) query.append("organization_id", String(args.organization_id)) if (args.token != null) query.append("token", String(args.token)) if (args.invited_by_user_id != null) query.append("invited_by_user_id", String(args.invited_by_user_id)) if (args.organization_name != null) query.append("organization_name", String(args.organization_name)) if (args.updated_at != null) query.append("updated_at", String(args.updated_at)) if (args.id != null) query.append("id", String(args.id)) if (args.invitation_type != null) query.append("invitation_type", String(args.invitation_type)) if (args.email != null) query.append("email", String(args.email)) if (args.message != null) query.append("message", String(args.message)) if (args.organization_role != null) query.append("organization_role", String(args.organization_role)) if (args.Prefer != null) headers.set("Prefer", String(args.Prefer)) const url = `${baseUrl.replace(/\/+$/, '')}/organization_invitation${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };