export type MindbodyRestApiDtoModelsSubscribersMobileMobileAccount = {SiteId?: number | undefined, SiteName?: string | undefined, LogoUrl?: string | undefined, StaffId?: number | undefined, LocationId?: number | undefined, LocationName?: string | undefined}; export type MindbodyRestApiDtoModelsSubscribersMobileControllerMobileFeedbackRequest = {Accounts?: Array | undefined, AppName?: string | undefined, AppVersion?: string | undefined, OsVersion?: string | undefined, Device?: string | undefined, Rating?: number | undefined, Message?: string | undefined}; export type CreateApiFeedbackArgs = {body: MindbodyRestApiDtoModelsSubscribersMobileControllerMobileFeedbackRequest}; export type CreateApiFeedbackOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Endpoint used to process feedback requests. * * POST /Feedback */ export const createApiFeedback = async (args: CreateApiFeedbackArgs, options?: CreateApiFeedbackOptions) => { const {baseUrl = "https://api.mindbodyonline.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/Feedback${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 };