export type DeleteApiReposOwnerRepoBranchesBranchProtectionEnforceAdminsArgs = {owner: string, repo: string, branch: string}; export type DeleteApiReposOwnerRepoBranchesBranchProtectionEnforceAdminsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete admin branch protection * * DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins */ export const deleteApiReposOwnerRepoBranchesBranchProtectionEnforceAdmins = async (args: DeleteApiReposOwnerRepoBranchesBranchProtectionEnforceAdminsArgs, options?: DeleteApiReposOwnerRepoBranchesBranchProtectionEnforceAdminsOptions) => { const {baseUrl = "http://HOSTNAME/api/v3", 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/enforce_admins${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 };