export type MindbodyRestApiCommonModelsSiteSettingsLiabilityRelease = {RequireInConsumerMode?: boolean | undefined, Text?: string | undefined, IntroParagraph?: string | undefined}; export type CreateApiSettingsLiabilityReleaseArgs = {Authorization: string, SiteId: number, body: MindbodyRestApiCommonModelsSiteSettingsLiabilityRelease}; export type CreateApiSettingsLiabilityReleaseOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Adds a subscriber's Liability Release Waiver * * POST /Settings/LiabilityRelease */ export const createApiSettingsLiabilityRelease = async (args: CreateApiSettingsLiabilityReleaseArgs, options?: CreateApiSettingsLiabilityReleaseOptions) => { const {baseUrl = "https://api.mindbodyonline.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args.SiteId != null) headers.set("SiteId", String(args.SiteId)) const url = `${baseUrl.replace(/\/+$/, '')}/Settings/LiabilityRelease${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };