export type DeleteApiReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksArgs = {owner: string, repo: string, branch: string}; export type DeleteApiReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove status check protection * * DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks */ export const deleteApiReposOwnerRepoBranchesBranchProtectionRequiredStatusChecks = async (args: DeleteApiReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksArgs, options?: DeleteApiReposOwnerRepoBranchesBranchProtectionRequiredStatusChecksOptions) => { const {baseUrl = "https://api.github.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/repos/${encodeURIComponent(String(args.owner))}/${encodeURIComponent(String(args.repo))}/branches/${encodeURIComponent(String(args.branch))}/protection/required_status_checks${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 };