export type DeleteApiPublicV1DocumentsIdRecipientsRecipientIdArgs = {id: string, recipient_id: string}; export type DeleteApiPublicV1DocumentsIdRecipientsRecipientIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Document Recipient * * DELETE /public/v1/documents/{id}/recipients/{recipient_id} * * Also accepts auth: oauth2 */ export const deleteApiPublicV1DocumentsIdRecipientsRecipientId = async (args: DeleteApiPublicV1DocumentsIdRecipientsRecipientIdArgs, options?: DeleteApiPublicV1DocumentsIdRecipientsRecipientIdOptions) => { const {baseUrl = "https://api.pandadoc.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/public/v1/documents/${encodeURIComponent(String(args.id))}/recipients/${encodeURIComponent(String(args.recipient_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 };