export type AddPartnerRequest = {organizationId: string}; export type UpdateApiApiV1OrganizationsOrganizationIdPartnerArgs = {organizationId: string, body: AddPartnerRequest}; export type UpdateApiApiV1OrganizationsOrganizationIdPartnerOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add partner * * PUT /api/v1/organizations/{organizationId}/partner */ export const updateApiApiV1OrganizationsOrganizationIdPartner = async (args: UpdateApiApiV1OrganizationsOrganizationIdPartnerArgs, options: UpdateApiApiV1OrganizationsOrganizationIdPartnerOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/organizations/${encodeURIComponent(String(args.organizationId))}/partner${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };