export type DeleteApiSetupV1LocationsIdGoogleServiceAccountArgs = {id: string}; export type DeleteApiSetupV1LocationsIdGoogleServiceAccountOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Google Cal Access * * DELETE /setup/v1/locations/{id}/google/service/account */ export const deleteApiSetupV1LocationsIdGoogleServiceAccount = async (args: DeleteApiSetupV1LocationsIdGoogleServiceAccountArgs, options?: DeleteApiSetupV1LocationsIdGoogleServiceAccountOptions) => { const {baseUrl = "https://sandbox-api.onsched.com", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/setup/v1/locations/${encodeURIComponent(String(args.id))}/google/service/account${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };