export type UpdateApiApiOrgIdExtendTrialPeriodArgs = {org_id: string, body: {new_end_date: number, org_id: string}}; export type UpdateApiApiOrgIdExtendTrialPeriodOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Extend organization trial period * * PUT /api/{org_id}/extend_trial_period */ export const updateApiApiOrgIdExtendTrialPeriod = async (args: UpdateApiApiOrgIdExtendTrialPeriodArgs, options: UpdateApiApiOrgIdExtendTrialPeriodOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/${encodeURIComponent(String(args.org_id))}/extend_trial_period${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 res.text() };