export type DeleteApiPublicV1DocumentsDocumentIdSectionsSectionIdArgs = {document_id: string, section_id: string}; export type DeleteApiPublicV1DocumentsDocumentIdSectionsSectionIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Document Section * * DELETE /public/v1/documents/{document_id}/sections/{section_id} * * Also accepts auth: oauth2 */ export const deleteApiPublicV1DocumentsDocumentIdSectionsSectionId = async (args: DeleteApiPublicV1DocumentsDocumentIdSectionsSectionIdArgs, options?: DeleteApiPublicV1DocumentsDocumentIdSectionsSectionIdOptions) => { 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.document_id))}/sections/${encodeURIComponent(String(args.section_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 };