export type GoogleOrder = {contactName?: (string | null) | undefined, contactEmail?: (string | null) | undefined, consumerContactName?: (string | null) | undefined, consumerFullLegalName?: (string | null) | undefined, consumerContactEmail?: (string | null) | undefined, organizationId?: number | undefined, invoiceProfileId?: number | undefined, subscriptionStartDate?: string | undefined, domainName?: (string | null) | undefined, consumerCountry?: (string | null) | undefined, consumerStreetAddress?: (string | null) | undefined, consumerCity?: (string | null) | undefined, consumerState?: (string | null) | undefined, consumerZipCode?: (string | null) | undefined, consumerPhoneNumber?: (string | null) | undefined, primaryAdminName?: (string | null) | undefined, primaryAdminUserName?: (string | null) | undefined}; export type CreateApiApiV1GoogleOrdersCheckoutArgs = {body: GoogleOrder}; export type CreateApiApiV1GoogleOrdersCheckoutOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v1/GoogleOrders/checkout */ export const createApiApiV1GoogleOrdersCheckout = async (args: CreateApiApiV1GoogleOrdersCheckoutArgs, options: CreateApiApiV1GoogleOrdersCheckoutOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/GoogleOrders/checkout${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 };