export type DeleteApiV2ChangeRequestCommentsCommentIdArgs = {commentId: number}; export type DeleteApiV2ChangeRequestCommentsCommentIdOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete Comment * * DELETE /v2/change-request-comments/{commentId} */ export const deleteApiV2ChangeRequestCommentsCommentId = async (args: DeleteApiV2ChangeRequestCommentsCommentIdArgs, options?: DeleteApiV2ChangeRequestCommentsCommentIdOptions) => { const {baseUrl = "https://api.configcat.com", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/change-request-comments/${encodeURIComponent(String(args.commentId))}${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 };