export type DeleteApiV1GameplaysIdArgs = {id: string, 'x-idempotency-key': string}; export type DeleteApiV1GameplaysIdOptions = {baseUrl: string, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /v1/gameplays/{id} */ export const deleteApiV1GameplaysId = async (args: DeleteApiV1GameplaysIdArgs, options: DeleteApiV1GameplaysIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['x-idempotency-key'] != null) headers.set("x-idempotency-key", String(args['x-idempotency-key'])) if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/gameplays/${encodeURIComponent(String(args.id))}${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 };