// Package forgedashboard is a client for the forge-dashboard REST API
// (github.com/alrayyes/forge-dashboard).
//
// Authenticate with a personal API token, generated from the dashboard's
// own Settings page (POST /api/tokens) -- the alternative forge-dashboard's
// spec documents to its browser session cookie, and the one this SDK
// actually uses, since a headless client has no WebAuthn ceremony to run.
// Pass the token to New or set FORGE_DASHBOARD_TOKEN.
package forgedashboard
import (
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"time"
"github.com/alrayyes/forge-dashboard-sdk-go/internal/genclient"
)
// TokenEnvVar is the environment variable New falls back to when no
// token is passed explicitly via WithToken.
const TokenEnvVar = "FORGE_DASHBOARD_TOKEN"
// Client is a forge-dashboard API client. Construct one with New.
type Client struct {
*genclient.ClientWithResponses
}
type config struct {
token string
httpClient genclient.HttpRequestDoer
retry retryConfig
}
// Option configures a Client constructed by New.
type Option func(*config)
// WithToken sets the bearer token sent on every request, overriding
// FORGE_DASHBOARD_TOKEN.
func WithToken(token string) Option {
return func(c *config) { c.token = token }
}
// WithHTTPClient replaces the underlying HTTP client. The retry transport
// (WithRetry) wraps whatever Transport this client has set, so pass a
// client with a custom Transport already configured (proxies, mTLS, ...)
// rather than replacing RoundTrip yourself afterward.
func WithHTTPClient(hc genclient.HttpRequestDoer) Option {
return func(c *config) { c.httpClient = hc }
}
// WithRetry overrides the default retry policy. maxRetries is the number
// of additional attempts after the first; base is the starting backoff
// before jitter and any server-sent Retry-After.
func WithRetry(maxRetries int, base time.Duration) Option {
return func(c *config) { c.retry = retryConfig{maxRetries: maxRetries, base: base} }
}
// New builds a Client against baseURL (the forge-dashboard instance's own
// origin, e.g. "https://dashboard.example.com").
func New(baseURL string, opts ...Option) (*Client, error) {
cfg := config{
token: os.Getenv(TokenEnvVar),
retry: defaultRetryConfig,
}
for _, opt := range opts {
opt(&cfg)
}
base := cfg.httpClient
if base == nil {
base = &http.Client{}
}
httpClient, ok := base.(*http.Client)
if !ok {
// A caller-supplied HttpRequestDoer that isn't a *http.Client (a
// test double, usually) skips the retry transport -- there's no
// http.RoundTripper to wrap.
httpClient = nil
}
doer := base
if httpClient != nil {
wrapped := *httpClient
wrapped.Transport = &retryTransport{
next: transportOrDefault(httpClient.Transport),
config: cfg.retry,
}
doer = &wrapped
}
genOpts := []genclient.ClientOption{
genclient.WithHTTPClient(doer),
genclient.WithRequestEditorFn(func(_ context.Context, req *http.Request) error {
if cfg.token != "" {
req.Header.Set("Authorization", "Bearer "+cfg.token)
}
return nil
}),
}
gc, err := genclient.NewClientWithResponses(baseURL, genOpts...)
if err != nil {
return nil, fmt.Errorf("build forge-dashboard client: %w", err)
}
return &Client{ClientWithResponses: gc}, nil
}
func transportOrDefault(t http.RoundTripper) http.RoundTripper {
if t != nil {
return t
}
return http.DefaultTransport
}
// APIError is returned by DecodeError for any forge-dashboard response
// carrying an error body -- every 4xx/5xx in the spec shares the same
// {error} shape (components.schemas.Error).
type APIError struct {
StatusCode int
Message string
}
func (e *APIError) Error() string {
return fmt.Sprintf("forge-dashboard: %d: %s", e.StatusCode, e.Message)
}
// DecodeError builds an *APIError from a generated response's status and
// body, or returns nil when statusCode isn't an error. Every operation's
// generated response type carries these two fields under the same names
// (StatusCode via HTTPResponse, and Body), so this one helper covers all
// of them:
//
// resp, err := client.GetDashboardWithResponse(ctx, nil)
// if err != nil {
// return err // transport failure, already retried
// }
// if apiErr := forgedashboard.DecodeError(resp.HTTPResponse.StatusCode, resp.Body); apiErr != nil {
// return apiErr
// }
func DecodeError(statusCode int, body []byte) *APIError {
if statusCode < 400 {
return nil
}
var parsed struct {
Error string `json:"error"`
}
_ = json.Unmarshal(body, &parsed)
return &APIError{
StatusCode: statusCode,
Message: parsed.Error,
}
}
// Package genclient provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
package genclient
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"strings"
"time"
"github.com/oapi-codegen/runtime"
)
// Defines values for ActionErrorCode.
const (
ActionErrorCodeAlreadyClosed ActionErrorCode = "already_closed"
ActionErrorCodeAlreadyMerged ActionErrorCode = "already_merged"
ActionErrorCodeAlreadyUpToDate ActionErrorCode = "already_up_to_date"
ActionErrorCodeAutoMergeNotAllowed ActionErrorCode = "auto_merge_not_allowed"
ActionErrorCodeBehind ActionErrorCode = "behind"
ActionErrorCodeBlockedByProtection ActionErrorCode = "blocked_by_protection"
ActionErrorCodeChecksFailing ActionErrorCode = "checks_failing"
ActionErrorCodeChecksPending ActionErrorCode = "checks_pending"
ActionErrorCodeConflict ActionErrorCode = "conflict"
ActionErrorCodeForgeError ActionErrorCode = "forge_error"
ActionErrorCodeNotMergeable ActionErrorCode = "not_mergeable"
ActionErrorCodeNotOpen ActionErrorCode = "not_open"
ActionErrorCodeNotRateLimited ActionErrorCode = "not_rate_limited"
ActionErrorCodeNotReopenable ActionErrorCode = "not_reopenable"
ActionErrorCodePermission ActionErrorCode = "permission"
ActionErrorCodeRateLimited ActionErrorCode = "rate_limited"
ActionErrorCodeReadyToMerge ActionErrorCode = "ready_to_merge"
ActionErrorCodeUnknown ActionErrorCode = "unknown"
)
// Valid indicates whether the value is a known member of the ActionErrorCode enum.
func (e ActionErrorCode) Valid() bool {
switch e {
case ActionErrorCodeAlreadyClosed:
return true
case ActionErrorCodeAlreadyMerged:
return true
case ActionErrorCodeAlreadyUpToDate:
return true
case ActionErrorCodeAutoMergeNotAllowed:
return true
case ActionErrorCodeBehind:
return true
case ActionErrorCodeBlockedByProtection:
return true
case ActionErrorCodeChecksFailing:
return true
case ActionErrorCodeChecksPending:
return true
case ActionErrorCodeConflict:
return true
case ActionErrorCodeForgeError:
return true
case ActionErrorCodeNotMergeable:
return true
case ActionErrorCodeNotOpen:
return true
case ActionErrorCodeNotRateLimited:
return true
case ActionErrorCodeNotReopenable:
return true
case ActionErrorCodePermission:
return true
case ActionErrorCodeRateLimited:
return true
case ActionErrorCodeReadyToMerge:
return true
case ActionErrorCodeUnknown:
return true
default:
return false
}
}
// Defines values for AdvisoryReason.
const (
AdvisoryReasonFailed AdvisoryReason = "failed"
AdvisoryReasonNotEnabled AdvisoryReason = "not_enabled"
AdvisoryReasonRefused AdvisoryReason = "refused"
AdvisoryReasonSwitchedOff AdvisoryReason = "switched_off"
AdvisoryReasonThrottled AdvisoryReason = "throttled"
AdvisoryReasonTooMany AdvisoryReason = "too_many"
)
// Valid indicates whether the value is a known member of the AdvisoryReason enum.
func (e AdvisoryReason) Valid() bool {
switch e {
case AdvisoryReasonFailed:
return true
case AdvisoryReasonNotEnabled:
return true
case AdvisoryReasonRefused:
return true
case AdvisoryReasonSwitchedOff:
return true
case AdvisoryReasonThrottled:
return true
case AdvisoryReasonTooMany:
return true
default:
return false
}
}
// Defines values for AdvisorySeverity.
const (
Critical AdvisorySeverity = "critical"
High AdvisorySeverity = "high"
Low AdvisorySeverity = "low"
Medium AdvisorySeverity = "medium"
)
// Valid indicates whether the value is a known member of the AdvisorySeverity enum.
func (e AdvisorySeverity) Valid() bool {
switch e {
case Critical:
return true
case High:
return true
case Low:
return true
case Medium:
return true
default:
return false
}
}
// Defines values for AdvisoryState.
const (
AdvisoryStateKnown AdvisoryState = "known"
AdvisoryStateUnknown AdvisoryState = "unknown"
)
// Valid indicates whether the value is a known member of the AdvisoryState enum.
func (e AdvisoryState) Valid() bool {
switch e {
case AdvisoryStateKnown:
return true
case AdvisoryStateUnknown:
return true
default:
return false
}
}
// Defines values for AutoMergeStatusState.
const (
AutoMergeStatusStateStopped AutoMergeStatusState = "stopped"
AutoMergeStatusStateWaiting AutoMergeStatusState = "waiting"
)
// Valid indicates whether the value is a known member of the AutoMergeStatusState enum.
func (e AutoMergeStatusState) Valid() bool {
switch e {
case AutoMergeStatusStateStopped:
return true
case AutoMergeStatusStateWaiting:
return true
default:
return false
}
}
// Defines values for AutoUpdateSource.
const (
AutoUpdateSourcePullRequest AutoUpdateSource = "pullRequest"
AutoUpdateSourceRepo AutoUpdateSource = "repo"
)
// Valid indicates whether the value is a known member of the AutoUpdateSource enum.
func (e AutoUpdateSource) Valid() bool {
switch e {
case AutoUpdateSourcePullRequest:
return true
case AutoUpdateSourceRepo:
return true
default:
return false
}
}
// Defines values for AutoUpdateUnavailableCode.
const (
Draft AutoUpdateUnavailableCode = "draft"
ReleasePlease AutoUpdateUnavailableCode = "release_please"
)
// Valid indicates whether the value is a known member of the AutoUpdateUnavailableCode enum.
func (e AutoUpdateUnavailableCode) Valid() bool {
switch e {
case Draft:
return true
case ReleasePlease:
return true
default:
return false
}
}
// Defines values for BotRequestAction.
const (
BotRequestActionRebase BotRequestAction = "rebase"
BotRequestActionRecreate BotRequestAction = "recreate"
)
// Valid indicates whether the value is a known member of the BotRequestAction enum.
func (e BotRequestAction) Valid() bool {
switch e {
case BotRequestActionRebase:
return true
case BotRequestActionRecreate:
return true
default:
return false
}
}
// Defines values for BotRequestBot.
const (
Dependabot BotRequestBot = "dependabot"
Renovate BotRequestBot = "renovate"
)
// Valid indicates whether the value is a known member of the BotRequestBot enum.
func (e BotRequestBot) Valid() bool {
switch e {
case Dependabot:
return true
case Renovate:
return true
default:
return false
}
}
// Defines values for BotRequestPhase.
const (
BotRequestPhaseExpired BotRequestPhase = "expired"
BotRequestPhaseQueued BotRequestPhase = "queued"
BotRequestPhaseRebasing BotRequestPhase = "rebasing"
)
// Valid indicates whether the value is a known member of the BotRequestPhase enum.
func (e BotRequestPhase) Valid() bool {
switch e {
case BotRequestPhaseExpired:
return true
case BotRequestPhaseQueued:
return true
case BotRequestPhaseRebasing:
return true
default:
return false
}
}
// Defines values for BranchDeletionOutcome.
const (
BranchDeletionOutcomeDeleted BranchDeletionOutcome = "deleted"
BranchDeletionOutcomeFailed BranchDeletionOutcome = "failed"
BranchDeletionOutcomeSkipped BranchDeletionOutcome = "skipped"
)
// Valid indicates whether the value is a known member of the BranchDeletionOutcome enum.
func (e BranchDeletionOutcome) Valid() bool {
switch e {
case BranchDeletionOutcomeDeleted:
return true
case BranchDeletionOutcomeFailed:
return true
case BranchDeletionOutcomeSkipped:
return true
default:
return false
}
}
// Defines values for BranchDeletionReason.
const (
DefaultBranch BranchDeletionReason = "default_branch"
Fork BranchDeletionReason = "fork"
InUse BranchDeletionReason = "in_use"
Protected BranchDeletionReason = "protected"
Unsupported BranchDeletionReason = "unsupported"
)
// Valid indicates whether the value is a known member of the BranchDeletionReason enum.
func (e BranchDeletionReason) Valid() bool {
switch e {
case DefaultBranch:
return true
case Fork:
return true
case InUse:
return true
case Protected:
return true
case Unsupported:
return true
default:
return false
}
}
// Defines values for CIStatus.
const (
CIStatusFailure CIStatus = "failure"
CIStatusNone CIStatus = "none"
CIStatusPending CIStatus = "pending"
CIStatusSuccess CIStatus = "success"
)
// Valid indicates whether the value is a known member of the CIStatus enum.
func (e CIStatus) Valid() bool {
switch e {
case CIStatusFailure:
return true
case CIStatusNone:
return true
case CIStatusPending:
return true
case CIStatusSuccess:
return true
default:
return false
}
}
// Defines values for CheckStatus.
const (
CheckStatusCompleted CheckStatus = "completed"
CheckStatusInProgress CheckStatus = "in_progress"
CheckStatusQueued CheckStatus = "queued"
CheckStatusWaiting CheckStatus = "waiting"
)
// Valid indicates whether the value is a known member of the CheckStatus enum.
func (e CheckStatus) Valid() bool {
switch e {
case CheckStatusCompleted:
return true
case CheckStatusInProgress:
return true
case CheckStatusQueued:
return true
case CheckStatusWaiting:
return true
default:
return false
}
}
// Defines values for CheckSubjectKind.
const (
CheckSubjectKindMainBranch CheckSubjectKind = "main_branch"
CheckSubjectKindPullRequest CheckSubjectKind = "pull_request"
)
// Valid indicates whether the value is a known member of the CheckSubjectKind enum.
func (e CheckSubjectKind) Valid() bool {
switch e {
case CheckSubjectKindMainBranch:
return true
case CheckSubjectKindPullRequest:
return true
default:
return false
}
}
// Defines values for DetailsBodyFormat.
const (
DetailsBodyFormatMarkdown DetailsBodyFormat = "markdown"
)
// Valid indicates whether the value is a known member of the DetailsBodyFormat enum.
func (e DetailsBodyFormat) Valid() bool {
switch e {
case DetailsBodyFormatMarkdown:
return true
default:
return false
}
}
// Defines values for DetailsCommentFormat.
const (
DetailsCommentFormatMarkdown DetailsCommentFormat = "markdown"
)
// Valid indicates whether the value is a known member of the DetailsCommentFormat enum.
func (e DetailsCommentFormat) Valid() bool {
switch e {
case DetailsCommentFormatMarkdown:
return true
default:
return false
}
}
// Defines values for Forge.
const (
Forgejo Forge = "forgejo"
Github Forge = "github"
)
// Valid indicates whether the value is a known member of the Forge enum.
func (e Forge) Valid() bool {
switch e {
case Forgejo:
return true
case Github:
return true
default:
return false
}
}
// Defines values for ForgeErrorKind.
const (
ForgeErrorKindConflict ForgeErrorKind = "conflict"
ForgeErrorKindNotFound ForgeErrorKind = "not_found"
ForgeErrorKindRateLimited ForgeErrorKind = "rate_limited"
ForgeErrorKindUnauthorized ForgeErrorKind = "unauthorized"
ForgeErrorKindUnknown ForgeErrorKind = "unknown"
ForgeErrorKindUnreachable ForgeErrorKind = "unreachable"
)
// Valid indicates whether the value is a known member of the ForgeErrorKind enum.
func (e ForgeErrorKind) Valid() bool {
switch e {
case ForgeErrorKindConflict:
return true
case ForgeErrorKindNotFound:
return true
case ForgeErrorKindRateLimited:
return true
case ForgeErrorKindUnauthorized:
return true
case ForgeErrorKindUnknown:
return true
case ForgeErrorKindUnreachable:
return true
default:
return false
}
}
// Defines values for HealthStatus.
const (
HealthStatusOk HealthStatus = "ok"
)
// Valid indicates whether the value is a known member of the HealthStatus enum.
func (e HealthStatus) Valid() bool {
switch e {
case HealthStatusOk:
return true
default:
return false
}
}
// Defines values for IssueDetailsState.
const (
Closed IssueDetailsState = "closed"
Open IssueDetailsState = "open"
)
// Valid indicates whether the value is a known member of the IssueDetailsState enum.
func (e IssueDetailsState) Valid() bool {
switch e {
case Closed:
return true
case Open:
return true
default:
return false
}
}
// Defines values for MainBranchStatus.
const (
MainBranchStatusAwaitingApproval MainBranchStatus = "awaiting_approval"
MainBranchStatusCancelled MainBranchStatus = "cancelled"
MainBranchStatusFailed MainBranchStatus = "failed"
MainBranchStatusNone MainBranchStatus = "none"
MainBranchStatusPassed MainBranchStatus = "passed"
MainBranchStatusRunning MainBranchStatus = "running"
)
// Valid indicates whether the value is a known member of the MainBranchStatus enum.
func (e MainBranchStatus) Valid() bool {
switch e {
case MainBranchStatusAwaitingApproval:
return true
case MainBranchStatusCancelled:
return true
case MainBranchStatusFailed:
return true
case MainBranchStatusNone:
return true
case MainBranchStatusPassed:
return true
case MainBranchStatusRunning:
return true
default:
return false
}
}
// Defines values for MergeStatus.
const (
MergeStatusBlocked MergeStatus = "blocked"
MergeStatusConflicting MergeStatus = "conflicting"
MergeStatusMergeable MergeStatus = "mergeable"
MergeStatusUnknown MergeStatus = "unknown"
MergeStatusUnstable MergeStatus = "unstable"
)
// Valid indicates whether the value is a known member of the MergeStatus enum.
func (e MergeStatus) Valid() bool {
switch e {
case MergeStatusBlocked:
return true
case MergeStatusConflicting:
return true
case MergeStatusMergeable:
return true
case MergeStatusUnknown:
return true
case MergeStatusUnstable:
return true
default:
return false
}
}
// Defines values for PullRequestKind.
const (
Dependency PullRequestKind = "dependency"
Regular PullRequestKind = "regular"
Release PullRequestKind = "release"
)
// Valid indicates whether the value is a known member of the PullRequestKind enum.
func (e PullRequestKind) Valid() bool {
switch e {
case Dependency:
return true
case Regular:
return true
case Release:
return true
default:
return false
}
}
// Defines values for PullRequestDependabotActionRequestAction.
const (
PullRequestDependabotActionRequestActionRebase PullRequestDependabotActionRequestAction = "rebase"
PullRequestDependabotActionRequestActionRecreate PullRequestDependabotActionRequestAction = "recreate"
)
// Valid indicates whether the value is a known member of the PullRequestDependabotActionRequestAction enum.
func (e PullRequestDependabotActionRequestAction) Valid() bool {
switch e {
case PullRequestDependabotActionRequestActionRebase:
return true
case PullRequestDependabotActionRequestActionRecreate:
return true
default:
return false
}
}
// Defines values for QueuedActionAction.
const (
QueuedActionActionDependabotRebase QueuedActionAction = "dependabot_rebase"
QueuedActionActionRenovateRebase QueuedActionAction = "renovate_rebase"
QueuedActionActionUpdateBranch QueuedActionAction = "update_branch"
)
// Valid indicates whether the value is a known member of the QueuedActionAction enum.
func (e QueuedActionAction) Valid() bool {
switch e {
case QueuedActionActionDependabotRebase:
return true
case QueuedActionActionRenovateRebase:
return true
case QueuedActionActionUpdateBranch:
return true
default:
return false
}
}
// Defines values for QueuedActionStatus.
const (
QueuedActionStatusDone QueuedActionStatus = "done"
QueuedActionStatusFailed QueuedActionStatus = "failed"
QueuedActionStatusQueued QueuedActionStatus = "queued"
QueuedActionStatusSkipped QueuedActionStatus = "skipped"
)
// Valid indicates whether the value is a known member of the QueuedActionStatus enum.
func (e QueuedActionStatus) Valid() bool {
switch e {
case QueuedActionStatusDone:
return true
case QueuedActionStatusFailed:
return true
case QueuedActionStatusQueued:
return true
case QueuedActionStatusSkipped:
return true
default:
return false
}
}
// Defines values for QueuedActionRequestAction.
const (
QueuedActionRequestActionDependabotRebase QueuedActionRequestAction = "dependabot_rebase"
QueuedActionRequestActionRenovateRebase QueuedActionRequestAction = "renovate_rebase"
QueuedActionRequestActionUpdateBranch QueuedActionRequestAction = "update_branch"
)
// Valid indicates whether the value is a known member of the QueuedActionRequestAction enum.
func (e QueuedActionRequestAction) Valid() bool {
switch e {
case QueuedActionRequestActionDependabotRebase:
return true
case QueuedActionRequestActionRenovateRebase:
return true
case QueuedActionRequestActionUpdateBranch:
return true
default:
return false
}
}
// Defines values for ReadyStatus.
const (
ReadyStatusOk ReadyStatus = "ok"
)
// Valid indicates whether the value is a known member of the ReadyStatus enum.
func (e ReadyStatus) Valid() bool {
switch e {
case ReadyStatusOk:
return true
default:
return false
}
}
// Defines values for ReviewStateDecision.
const (
ReviewStateDecisionApproved ReviewStateDecision = "approved"
ReviewStateDecisionChangesRequested ReviewStateDecision = "changes_requested"
ReviewStateDecisionNone ReviewStateDecision = "none"
ReviewStateDecisionReviewRequired ReviewStateDecision = "review_required"
)
// Valid indicates whether the value is a known member of the ReviewStateDecision enum.
func (e ReviewStateDecision) Valid() bool {
switch e {
case ReviewStateDecisionApproved:
return true
case ReviewStateDecisionChangesRequested:
return true
case ReviewStateDecisionNone:
return true
case ReviewStateDecisionReviewRequired:
return true
default:
return false
}
}
// Defines values for RunEventKind.
const (
RunEventKindMainBranch RunEventKind = "main_branch"
RunEventKindPullRequest RunEventKind = "pull_request"
)
// Valid indicates whether the value is a known member of the RunEventKind enum.
func (e RunEventKind) Valid() bool {
switch e {
case RunEventKindMainBranch:
return true
case RunEventKindPullRequest:
return true
default:
return false
}
}
// Defines values for SettingsResponseTheme.
const (
SettingsResponseThemeDark SettingsResponseTheme = "dark"
SettingsResponseThemeEmpty SettingsResponseTheme = ""
SettingsResponseThemeLight SettingsResponseTheme = "light"
)
// Valid indicates whether the value is a known member of the SettingsResponseTheme enum.
func (e SettingsResponseTheme) Valid() bool {
switch e {
case SettingsResponseThemeDark:
return true
case SettingsResponseThemeEmpty:
return true
case SettingsResponseThemeLight:
return true
default:
return false
}
}
// Defines values for SettingsSummaryTheme.
const (
SettingsSummaryThemeDark SettingsSummaryTheme = "dark"
SettingsSummaryThemeEmpty SettingsSummaryTheme = ""
SettingsSummaryThemeLight SettingsSummaryTheme = "light"
)
// Valid indicates whether the value is a known member of the SettingsSummaryTheme enum.
func (e SettingsSummaryTheme) Valid() bool {
switch e {
case SettingsSummaryThemeDark:
return true
case SettingsSummaryThemeEmpty:
return true
case SettingsSummaryThemeLight:
return true
default:
return false
}
}
// Defines values for ThemeRequestTheme.
const (
ThemeRequestThemeDark ThemeRequestTheme = "dark"
ThemeRequestThemeEmpty ThemeRequestTheme = ""
ThemeRequestThemeLight ThemeRequestTheme = "light"
)
// Valid indicates whether the value is a known member of the ThemeRequestTheme enum.
func (e ThemeRequestTheme) Valid() bool {
switch e {
case ThemeRequestThemeDark:
return true
case ThemeRequestThemeEmpty:
return true
case ThemeRequestThemeLight:
return true
default:
return false
}
}
// Defines values for ThemeResponseTheme.
const (
ThemeResponseThemeDark ThemeResponseTheme = "dark"
ThemeResponseThemeEmpty ThemeResponseTheme = ""
ThemeResponseThemeLight ThemeResponseTheme = "light"
)
// Valid indicates whether the value is a known member of the ThemeResponseTheme enum.
func (e ThemeResponseTheme) Valid() bool {
switch e {
case ThemeResponseThemeDark:
return true
case ThemeResponseThemeEmpty:
return true
case ThemeResponseThemeLight:
return true
default:
return false
}
}
// Defines values for UpdateRequestPhase.
const (
UpdateRequestPhaseExpired UpdateRequestPhase = "expired"
UpdateRequestPhaseQueued UpdateRequestPhase = "queued"
)
// Valid indicates whether the value is a known member of the UpdateRequestPhase enum.
func (e UpdateRequestPhase) Valid() bool {
switch e {
case UpdateRequestPhaseExpired:
return true
case UpdateRequestPhaseQueued:
return true
default:
return false
}
}
// APIToken A personal API token's own metadata — never the token value
// itself, which only ever appears once, in
// APITokenCreateResponse's own response body at creation time.
type APIToken struct {
CreatedAt time.Time `json:"createdAt"`
// ExpiresAt When this token stops authenticating requests —
// always set, mandatory at creation, no "never expires"
// option. A token whose expiration has passed is rejected the
// same way an invalid one is.
ExpiresAt time.Time `json:"expiresAt"`
Id string `json:"id"`
// Label The name given at creation time, so a list of several is tellable apart.
Label string `json:"label"`
// LastUsedAt Omitted if this token has never authenticated a request yet.
LastUsedAt *time.Time `json:"lastUsedAt,omitempty"`
}
// APITokenCreateRequest defines model for APITokenCreateRequest.
type APITokenCreateRequest struct {
// ExpiresAt Must be in the future and no more than 366 days out (matching
// GitHub's own fine-grained-token maximum) — the
// Settings UI offers 7/30/60/90-day presets (30 pre-selected)
// or a custom date within that same cap, never an option for
// no expiration at all.
ExpiresAt time.Time `json:"expiresAt"`
Label string `json:"label"`
}
// APITokenCreateResponse The one and only response that ever carries the raw token value
// — shown to the user once, at creation time; only its hash is
// stored, so it can't be recovered from here again. Losing it
// means generating a new one.
type APITokenCreateResponse struct {
CreatedAt time.Time `json:"createdAt"`
ExpiresAt time.Time `json:"expiresAt"`
Id string `json:"id"`
Label string `json:"label"`
// Token The raw Bearer credential: `Authorization: Bearer <token>`.
Token string `json:"token"`
}
// ActionError The structured result of a refused pull request action (Merge, Close, Update branch, Enable auto-merge, Dependabot and Renovate rebase). `code` and `message` are what a client should act on and show.
type ActionError struct {
// Code Why the action was refused, from a re-read of the pull
// request's real state. `already_merged` and `already_closed`
// mean the dashboard's row was stale: the pull request has
// nothing left to merge.
//
// `not_reopenable` belongs to Reopen: the pull request is still
// closed and the forge won't reopen it, usually because its
// branch was deleted or rewritten after the close.
//
// `forge_error` means the forge failed on its own side (a 5xx):
// nothing is wrong with the request, so asking again may work.
// `upstreamStatus` and `requestId` then say what the forge
// answered with, for tracing a report. Update branch is tried a
// second time by the server before this is answered.
//
// `not_rate_limited` belongs to queueing an action: the forge
// isn't rate limited, so act directly. `not_open` is only an
// outcome of a queued action: the pull request was gone from the
// board when the reset came, merged or closed.
//
// Three codes belong to a few actions each: `already_up_to_date`
// (Update branch: nothing to bring in; Merge or Enable auto-merge
// on an empty pull request: nothing to merge),
// `auto_merge_not_allowed` (Enable auto-merge: the repo or pull
// request doesn't allow it) and `ready_to_merge` (Enable
// auto-merge: already clean, use Merge).
Code ActionErrorCode `json:"code"`
// Error The same string every Error carries. With `code: unknown` it
// is the same plain words as `message`, since the raw text
// (internal prefixes, API paths, URLs) goes to the server log.
// With any other code it is the forge's own text, for logs.
Error string `json:"error"`
// Message A short reason in plain words, safe to show a person, always.
// With `code: unknown` it is the forge's own sentence when that
// reads as one, "The forge didn't answer. Try again in a moment."
// when the forge was unreachable (including a 502, 503 or 504),
// and "The forge refused this action and gave no reason."
// otherwise. It never holds an internal prefix, an API path, a
// URL or JSON.
Message string `json:"message"`
// RequestId Only with `forge_error`, and only when the forge sent one (GitHub's `X-GitHub-Request-Id`). What the forge's support asks for.
RequestId *string `json:"requestId,omitempty"`
// ResetsAt Only with `rate_limited`, when the forge said so. When the budget comes back. On Forgejo it comes from the `Retry-After` header, in seconds or as a date.
ResetsAt *time.Time `json:"resetsAt,omitempty"`
// UpstreamStatus Only with `forge_error`. The HTTP status the forge answered with.
UpstreamStatus *int `json:"upstreamStatus,omitempty"`
}
// ActionErrorCode Why the action was refused, from a re-read of the pull
// request's real state. `already_merged` and `already_closed`
// mean the dashboard's row was stale: the pull request has
// nothing left to merge.
//
// `not_reopenable` belongs to Reopen: the pull request is still
// closed and the forge won't reopen it, usually because its
// branch was deleted or rewritten after the close.
//
// `forge_error` means the forge failed on its own side (a 5xx):
// nothing is wrong with the request, so asking again may work.
// `upstreamStatus` and `requestId` then say what the forge
// answered with, for tracing a report. Update branch is tried a
// second time by the server before this is answered.
//
// `not_rate_limited` belongs to queueing an action: the forge
// isn't rate limited, so act directly. `not_open` is only an
// outcome of a queued action: the pull request was gone from the
// board when the reset came, merged or closed.
//
// Three codes belong to a few actions each: `already_up_to_date`
// (Update branch: nothing to bring in; Merge or Enable auto-merge
// on an empty pull request: nothing to merge),
// `auto_merge_not_allowed` (Enable auto-merge: the repo or pull
// request doesn't allow it) and `ready_to_merge` (Enable
// auto-merge: already clean, use Merge).
type ActionErrorCode string
// Advisories The open dependency advisories on a repository's default branch, read
// from GitHub's Dependabot alerts, or for a Forgejo repository from the
// packages in its lockfiles matched against OSV, when the operator has
// switched that on. Absent from the row when no source reads them for its
// forge. A source that can't
// answer, such as alerts switched off or a token without the
// `security_events` scope, gives `state` "unknown", never a count of
// zero.
type Advisories struct {
// Count How many advisories are open. Only meaningful when `state` is "known".
Count int `json:"count"`
// Highest The worst severity among the open advisories. Absent when there are none.
Highest *AdvisorySeverity `json:"highest,omitempty"`
// Partial Only on a Forgejo repository whose `state` is "known": its lock
// files list packages the dashboard leaves out because they are not
// public (a private registry, a git or path source, a module on the
// forge's own host), so `count` covers only the rest. Read it as
// "at least this many", and a count of zero as "none found among
// what was checked", not "none". Absent when the answer covers every
// package the lock files list.
Partial *bool `json:"partial,omitempty"`
// Reason Why `state` is "unknown", when the dashboard can tell. Absent when
// the state is "known". "refused" is a 403: the credential lacks the
// Dependabot alerts permission. "switched_off" is a 404: alerts are off
// for the repository. "throttled" is a rate limit, which clears by
// itself. "failed" is any other error reading the alerts. "too_many" is
// a repository with more open alerts than one read pages through. On a
// Forgejo repository, "not_enabled" is the operator not having switched
// on lockfile checking (it is off by default, since it sends package
// names to a third party), absent when it has no lockfile the dashboard
// reads, and "failed" when one is too big or doesn't parse. A Forgejo
// repository whose advisories have not been read yet, because its first
// read is still running in the background, is "unknown" with no reason.
Reason *AdvisoryReason `json:"reason,omitempty"`
// State "known" is an answer the forge gave. "unknown" is no answer, and must
// never be shown as zero.
State AdvisoryState `json:"state"`
// Url Where to see the advisories on the forge. Absent when there are none or the state is unknown, and for Forgejo, which has no page for them.
Url *string `json:"url,omitempty"`
}
// AdvisoryCVSS defines model for AdvisoryCVSS.
type AdvisoryCVSS struct {
// Score The CVSS base score, 0 to 10.
Score float32 `json:"score"`
// Vector The CVSS vector string.
Vector *string `json:"vector,omitempty"`
}
// AdvisoryEPSS The Exploit Prediction Scoring System's reading, as GitHub sends it. Absent when GitHub sent none.
type AdvisoryEPSS struct {
// Percentage The probability of exploitation in the next 30 days, as a fraction from 0 to 1.
Percentage float32 `json:"percentage"`
// Percentile How the score ranks among all scored flaws, as a fraction from 0 to 1.
Percentile float32 `json:"percentile"`
}
// AdvisoryItem One open Dependabot alert with the fields GitHub's alert page shows.
type AdvisoryItem struct {
CveId *string `json:"cveId,omitempty"`
Cvss *AdvisoryCVSS `json:"cvss,omitempty"`
// Description The advisory's text, Markdown exactly as GitHub stores it. Render it with raw HTML disabled.
Description *string `json:"description,omitempty"`
// Ecosystem The package ecosystem, such as "npm" or "pip".
Ecosystem *string `json:"ecosystem,omitempty"`
// Epss The Exploit Prediction Scoring System's reading, as GitHub sends it. Absent when GitHub sent none.
Epss *AdvisoryEPSS `json:"epss,omitempty"`
GhsaId *string `json:"ghsaId,omitempty"`
// Id The advisory's own id in the database that states it. Set for Forgejo.
Id *string `json:"id,omitempty"`
// ManifestPath The file the dependency was detected in.
ManifestPath *string `json:"manifestPath,omitempty"`
// Number The alert's number on the forge. For Forgejo, the advisory's place in the list.
Number int `json:"number"`
OpenedAt *time.Time `json:"openedAt,omitempty"`
// Package The vulnerable dependency's name.
Package *string `json:"package,omitempty"`
// PatchedVersion The first version with the fix. Absent when there is none yet.
PatchedVersion *string `json:"patchedVersion,omitempty"`
// References Links the advisory cites. A client shows only http(s) ones.
References *[]string `json:"references,omitempty"`
// Relationship Whether the dependency is direct or transitive. Absent when GitHub didn't say.
Relationship *string `json:"relationship,omitempty"`
// Scope Whether the dependency is needed at runtime or only in development.
Scope *string `json:"scope,omitempty"`
// Severity The worst severity among the open advisories. Absent when there are none.
Severity *AdvisorySeverity `json:"severity,omitempty"`
// State The alert's state on the forge. Always "open" here.
State string `json:"state"`
// Summary The advisory's one-line title.
Summary string `json:"summary"`
// Url The alert's own page on the forge.
Url *string `json:"url,omitempty"`
// VulnerableVersions The affected version range, as GitHub writes it.
VulnerableVersions *string `json:"vulnerableVersions,omitempty"`
Weaknesses *[]AdvisoryWeakness `json:"weaknesses,omitempty"`
}
// AdvisoryList A repository's open dependency advisories in full.
type AdvisoryList struct {
// Advisories Empty when none are open and whenever `state` is "unknown". Highest severity first, then newest first.
Advisories []AdvisoryItem `json:"advisories"`
// Partial Set on a known Forgejo list that leaves out packages the dashboard may not send to OSV, because they may be private. Absent otherwise.
Partial *bool `json:"partial,omitempty"`
// Reason Why `state` is "unknown", when the dashboard can tell. Absent when
// the state is "known". "refused" is a 403: the credential lacks the
// Dependabot alerts permission. "switched_off" is a 404: alerts are off
// for the repository. "throttled" is a rate limit, which clears by
// itself. "failed" is any other error reading the alerts. "too_many" is
// a repository with more open alerts than one read pages through. On a
// Forgejo repository, "not_enabled" is the operator not having switched
// on lockfile checking (it is off by default, since it sends package
// names to a third party), absent when it has no lockfile the dashboard
// reads, and "failed" when one is too big or doesn't parse. A Forgejo
// repository whose advisories have not been read yet, because its first
// read is still running in the background, is "unknown" with no reason.
Reason *AdvisoryReason `json:"reason,omitempty"`
// State "known" is an answer the forge gave. "unknown" is no answer, and must
// never be shown as zero.
State AdvisoryState `json:"state"`
// Url The repository's advisories page on the forge. Absent when none are open or the state is unknown, and for Forgejo, which has no page for a whole repository.
Url *string `json:"url,omitempty"`
}
// AdvisoryReason Why `state` is "unknown", when the dashboard can tell. Absent when
// the state is "known". "refused" is a 403: the credential lacks the
// Dependabot alerts permission. "switched_off" is a 404: alerts are off
// for the repository. "throttled" is a rate limit, which clears by
// itself. "failed" is any other error reading the alerts. "too_many" is
// a repository with more open alerts than one read pages through. On a
// Forgejo repository, "not_enabled" is the operator not having switched
// on lockfile checking (it is off by default, since it sends package
// names to a third party), absent when it has no lockfile the dashboard
// reads, and "failed" when one is too big or doesn't parse. A Forgejo
// repository whose advisories have not been read yet, because its first
// read is still running in the background, is "unknown" with no reason.
type AdvisoryReason string
// AdvisorySeverity The worst severity among the open advisories. Absent when there are none.
type AdvisorySeverity string
// AdvisoryState "known" is an answer the forge gave. "unknown" is no answer, and must
// never be shown as zero.
type AdvisoryState string
// AdvisoryWeakness defines model for AdvisoryWeakness.
type AdvisoryWeakness struct {
// Id The CWE id, such as "CWE-295".
Id string `json:"id"`
Name *string `json:"name,omitempty"`
}
// AllowedAction defines model for AllowedAction.
type AllowedAction struct {
// Action One of the values below today, and the server may learn more.
// A client should treat a value it doesn't know as an action it
// can't offer, not as an error. Declared with `x-extensible-enum`
// so adding a value is a minor SDK release.
Action string `json:"action"`
// Blocked Present when the action is offered but can't be taken yet. Merge
// is blocked rather than hidden while waiting or fixing something can
// unlock it. An empty pull request, which nothing can unlock, has no
// `merge` entry at all: see `status`.
// A request that is already waiting is never listed blocked. While
// Renovate's rebase checkbox in the pull request description is
// ticked, whether from this app or on the forge, `renovate_rebase`
// is absent and `cancel_renovate_rebase` is listed instead. A
// Renovate rebase asked for through this app with no checkbox
// behind it, and a Dependabot rebase or recreate that is pending,
// list neither request nor cancel: Dependabot has no command to
// withdraw one. The request is offered again once the bot has
// acted or the request has expired.
Blocked *struct {
// Code The same codes as `ActionError.code`. The server may learn
// more, so a client should show `message` for a code it doesn't
// know. Declared with `x-extensible-enum`.
Code string `json:"code"`
// Message Plain words, safe to show a person.
Message string `json:"message"`
// Next What unlocks it, when something does.
Next *string `json:"next,omitempty"`
} `json:"blocked,omitempty"`
// Primary True on the one action a client draws as the pull request's main
// button, and absent on every other entry. At most one entry in the
// list has it, never a blocked one, and a pull request can have none.
// The server decides it, so a client renders it and holds no rule of
// its own; a client that doesn't know the field still gets the
// whole list. Which action it is:
// `close` for an empty pull request; `merge` when Merge is offered
// and not blocked, unless the CI is failing (Merge is then only open
// because the failing checks aren't required, and `status` explains
// it); `update_branch`, or `renovate_rebase` or `dependabot_rebase`
// for a bot pull request, when being behind the base branch is what
// holds Merge back. A bot pull request that is behind also has its
// rebase here whatever else holds Merge back (checks running or
// failing, auto-merge armed), unless it conflicts, is a draft, is
// stacked, or its workflow runs wait for approval. In that last
// case, for any author, whenever Merge is blocked or not yet known
// and the checks aren't running, Merge gives the approval as its
// reason. If the pull request is also behind (and not stacked, a
// draft or empty), `update_branch`, the bot rebases and
// `dependabot_recreate` are listed blocked with the same code and
// message and a `next` of their own, so none is primary and a client
// draws each locked with the reason. Every other state has
// none: checks running or failing on a pull request that is not a
// behind bot one, a conflict, a draft, a stack parent, or the
// forge's own block. `status` gives the reason there.
Primary *bool `json:"primary,omitempty"`
}
// AutoMergeStatus Where an armed pull request stands, so the row can say why
// auto-merge is waiting or stopped in words and not by colour. Present
// while auto-merge is armed on it: on Forgejo the signed-in user's
// intent held by this app, on GitHub the forge's own auto-merge.
// Also present for ten minutes after this app cancelled an armed
// auto-merge because the pull request went empty (its branch landed on
// the base some other way): `stopped`, code `already_up_to_date` and the
// message "Auto-merge was cancelled: there is nothing left to merge."
// Auto-merge is off by then, so this is the only place the reason lives.
type AutoMergeStatus struct {
// Code The same codes as `ActionError.code` (`checks_pending`,
// `checks_failing`, `conflict`, `stacked`, `permission`,
// `rate_limited`, `not_mergeable`). Omitted when the pull request
// is simply waiting for the next refresh to merge it.
Code *string `json:"code,omitempty"`
// Message Plain words, safe to show a person.
Message string `json:"message"`
// State `waiting` clears by itself: checks still running, a draft, a
// stack parent that hasn't merged, a rate limit. `stopped` needs the
// person: a failing check, a conflict, or a merge Forgejo refused
// (including a token without merge permission). A stopped pull
// request stays armed and merges once the cause is gone, or the
// person cancels.
State AutoMergeStatusState `json:"state"`
}
// AutoMergeStatusState `waiting` clears by itself: checks still running, a draft, a
// stack parent that hasn't merged, a rate limit. `stopped` needs the
// person: a failing check, a conflict, or a merge Forgejo refused
// (including a token without merge permission). A stopped pull
// request stays armed and merges once the cause is gone, or the
// person cancels.
type AutoMergeStatusState string
// AutoMergedPullRequest defines model for AutoMergedPullRequest.
type AutoMergedPullRequest struct {
Forge Forge `json:"forge"`
FullName string `json:"fullName"`
MergedAt time.Time `json:"mergedAt"`
// Message Ready to show: "Auto-merged owner/repo#N after checks passed".
Message string `json:"message"`
Number int `json:"number"`
}
// AutoUpdate Whether the dashboard brings this pull request's branch up to date by
// itself: the pull request's own choice when it has one
// (`POST /api/pull-requests/auto-update`), else its repo's
// auto-update setting. Always present.
type AutoUpdate struct {
// Enabled What the background pass does with this pull request. Always
// false when `unavailable` is set.
Enabled bool `json:"enabled"`
// Source `repo` when the pull request follows its repo's setting,
// `pullRequest` when the user chose for this one.
Source AutoUpdateSource `json:"source"`
// Unavailable Set when the pass skips this pull request however it is switched,
// so a client shows the reason instead of a switch that does
// nothing. Null otherwise.
Unavailable *AutoUpdateUnavailable `json:"unavailable"`
}
// AutoUpdateSource `repo` when the pull request follows its repo's setting,
// `pullRequest` when the user chose for this one.
type AutoUpdateSource string
// AutoUpdateUnavailable defines model for AutoUpdateUnavailable.
type AutoUpdateUnavailable struct {
Code AutoUpdateUnavailableCode `json:"code"`
// Reason A sentence a client can show as it is.
Reason string `json:"reason"`
}
// AutoUpdateUnavailableCode defines model for AutoUpdateUnavailable.Code.
type AutoUpdateUnavailableCode string
// BotRequest defines model for BotRequest.
type BotRequest struct {
// AcknowledgedAt When the server first saw Dependabot's thumbs-up on the
// `@dependabot rebase` comment, which is how Dependabot says it
// received the command. Absent until then, and always absent for
// Renovate and for `recreate`. A thumbs-up that arrives after the
// request expired moves it back to `queued`.
AcknowledgedAt *time.Time `json:"acknowledgedAt,omitempty"`
// Action `recreate` is Dependabot's only. Renovate's rebase label is
// reported as `rebase`.
Action BotRequestAction `json:"action"`
Bot BotRequestBot `json:"bot"`
// CommentUrl The command comment on GitHub, once the server has found it.
// Absent before that, and for Renovate.
CommentUrl *string `json:"commentUrl,omitempty"`
// ExpiresAt When the server stops waiting in the current phase: 10 minutes
// after the request while `queued` (10 minutes after
// `acknowledgedAt` once Dependabot has acknowledged), 2 minutes
// after the pickup while `rebasing`.
ExpiresAt time.Time `json:"expiresAt"`
// Phase `queued`: asked, and nothing seen yet. `rebasing`: the bot
// pushed (the head changed, or the pull request was behind and
// isn't), and CI hasn't restarted yet. `expired`: the bot didn't
// act within 10 minutes. An expired request stays until the pull
// request is gone, a new request replaces it, or an hour passes.
// A request is dropped once CI shows pending after the push, 2
// minutes into `rebasing`, or when the pull request is gone.
Phase BotRequestPhase `json:"phase"`
RequestedAt time.Time `json:"requestedAt"`
}
// BotRequestAction `recreate` is Dependabot's only. Renovate's rebase label is
// reported as `rebase`.
type BotRequestAction string
// BotRequestBot defines model for BotRequest.Bot.
type BotRequestBot string
// BotRequestPhase `queued`: asked, and nothing seen yet. `rebasing`: the bot
// pushed (the head changed, or the pull request was behind and
// isn't), and CI hasn't restarted yet. `expired`: the bot didn't
// act within 10 minutes. An expired request stays until the pull
// request is gone, a new request replaces it, or an hour passes.
// A request is dropped once CI shows pending after the push, 2
// minutes into `rebasing`, or when the pull request is gone.
type BotRequestPhase string
// BranchDeletion What happened to the source branch. A fact for the client to word,
// never a reason to treat the merge as failed.
type BranchDeletion struct {
// Outcome `deleted`: the branch is gone, including when the forge had
// already removed it. `skipped`: it was left alone on purpose,
// see `reason`. `failed`: the forge refused or couldn't be
// reached, and the branch may still exist.
Outcome BranchDeletionOutcome `json:"outcome"`
// Reason Why a `skipped` branch was left. `fork`: the branch lives in
// another repo. `default_branch`: it is the repo's default
// branch. `protected`: the forge protects it. `in_use`: another
// open pull request in the repo has it as its head or base, so
// deleting it would strand that pull request. `unsupported`: the
// forge's client can't delete branches. Absent unless `outcome`
// is `skipped`.
Reason *BranchDeletionReason `json:"reason,omitempty"`
}
// BranchDeletionOutcome `deleted`: the branch is gone, including when the forge had
// already removed it. `skipped`: it was left alone on purpose,
// see `reason`. `failed`: the forge refused or couldn't be
// reached, and the branch may still exist.
type BranchDeletionOutcome string
// BranchDeletionReason Why a `skipped` branch was left. `fork`: the branch lives in
// another repo. `default_branch`: it is the repo's default
// branch. `protected`: the forge protects it. `in_use`: another
// open pull request in the repo has it as its head or base, so
// deleting it would strand that pull request. `unsupported`: the
// forge's client can't delete branches. Absent unless `outcome`
// is `skipped`.
type BranchDeletionReason string
// CIStatus The combined result across every check reported against the pull
// request's head commit. "none" means neither forge reported any
// check at all, not that one failed.
type CIStatus string
// CancelRunRequest defines model for CancelRunRequest.
type CancelRunRequest struct {
Forge Forge `json:"forge"`
// FullName The repository, as "owner/repo".
FullName string `json:"fullName"`
// RunId The workflow run to cancel, from a check's `runId`.
RunId int `json:"runId"`
}
// Check One job/check run against a pull request's head commit.
type Check struct {
// CompletedAt When the forge says the job finished. Absent while it runs, and
// when the forge doesn't say.
CompletedAt *time.Time `json:"completedAt,omitempty"`
// Conclusion How a finished job ended, in the forge's own word. Sent only when
// `status` is "completed". It is not folded onto a fixed set: GitHub
// sends its check run conclusion as it is (`success`, `failure`,
// `neutral`, `cancelled`, `skipped`, `timed_out`, `action_required`,
// `stale`, `startup_failure`) and Forgejo sends the terminal status of
// the job (`success`, `failure`, `cancelled`, `skipped`). A legacy
// commit status, which has no conclusion, is sent as `success` or
// `failure`. A client decides what each word means and what to do
// with one it doesn't know.
//
// `action_required` means the job needs someone's approval, and `url`
// is where to give it. The page shows it as waiting for approval,
// the same as a held run whose `status` is "waiting".
//
//
// Examples: success, failure, cancelled, skipped, timed_out, neutral
Conclusion *CheckConclusion `json:"conclusion,omitempty"`
// Excerpt The tail of the failed job's log as plain text: the last lines,
// with per-line timestamps and colour codes removed, at most 2,000
// characters. Never markup, and a client must render it as text.
// Whatever the forge already masks stays masked. Absent when the
// log can't be read or has expired. GitHub fills it for at most
// the first five failed jobs of a list, in the list's order.
// Forgejo never fills it in a list, since that would read a log
// while the list is built: ask for it through
// GET /api/checks/log with `excerpt=true`. The whole output is read
// through GET /api/checks/log.
Excerpt *string `json:"excerpt,omitempty"`
// FailedStep The name of the step of a failed job that broke. Absent when
// the check isn't a job the token can read (a third-party check,
// a forge with no step data, a token without access).
FailedStep *string `json:"failedStep,omitempty"`
// JobId The Actions job (or check run) id to pass to GET /api/checks/log.
// Absent for a legacy commit status and for a workflow held for
// approval, which have no output to read.
JobId *int `json:"jobId,omitempty"`
Name string `json:"name"`
// Required Whether the base branch's protection makes this check block the
// merge (GitHub required status checks and rulesets, Forgejo
// `status_check_contexts`). Absent when the forge can't tell — a
// token that can't read protection, or a check that can't be
// mapped to a protection entry. Absent is not the same as false.
Required *bool `json:"required,omitempty"`
// RunAttempt Which attempt of its workflow run the job belongs to. Both
// forges keep a run's id when it is retried, and Forgejo keeps the
// job's id and page too, so this is what tells a retry's output
// from the first attempt's. On GitHub it is absent for a check that
// isn't an Actions job, and when neither the job's page address nor
// the lookup of the commit's runs gives one.
RunAttempt *int `json:"runAttempt,omitempty"`
// RunId The Actions workflow run this job belongs to, to pass to
// `POST /api/checks/cancel-run`. Present on every Actions job,
// finished or not; only a job that is queued or running has
// anything left to cancel, which a client reads from `status`. A
// third-party check and a legacy commit status have none.
//
// A Forgejo run whose jobs couldn't be read is listed as one check
// named for the run, with a `runId` and no `jobId`. A client treats
// a check with a `runId` and no `jobId` as the run itself, not as a
// job of it, and doesn't list its name among the run's jobs.
RunId *int `json:"runId,omitempty"`
// RunName The name of that workflow run, for a client to say which run a
// cancel stops. Present with `runId`; on GitHub it can be absent
// when the lookup of the commit's runs failed or didn't list the run.
RunName *string `json:"runName,omitempty"`
// RunNumber The forge's own number for that run, the one in the run's page
// address. It tells two runs of one workflow apart. Present with
// `runId` when the forge says it; on GitHub it can be absent when
// the lookup of the commit's runs failed or didn't list the run.
RunNumber *int `json:"runNumber,omitempty"`
// StartedAt When the forge says the job started. Absent until it has, and when
// the forge doesn't say. A client works out how long a job ran from
// this and `completedAt`.
StartedAt *time.Time `json:"startedAt,omitempty"`
// Status How far one job has got, as a fact. The page works out what to show
// from it and `conclusion`.
//
// "waiting" is a GitHub workflow run held until a maintainer approves
// it. It has no jobs yet, so it is not queued and has not failed; its
// `url` is the run's page, where the approve button is. A check run
// that finishes as `action_required` is the other shape of the same
// wait: it is "completed" with that conclusion. The page treats the
// two alike.
Status CheckStatus `json:"status"`
// Url That job's own page on the forge that ran it — never the pull request's own page.
Url string `json:"url"`
}
// CheckConclusion How a finished job ended, in the forge's own word. Sent only when
// `status` is "completed". It is not folded onto a fixed set: GitHub
// sends its check run conclusion as it is (`success`, `failure`,
// `neutral`, `cancelled`, `skipped`, `timed_out`, `action_required`,
// `stale`, `startup_failure`) and Forgejo sends the terminal status of
// the job (`success`, `failure`, `cancelled`, `skipped`). A legacy
// commit status, which has no conclusion, is sent as `success` or
// `failure`. A client decides what each word means and what to do
// with one it doesn't know.
//
// `action_required` means the job needs someone's approval, and `url`
// is where to give it. The page shows it as waiting for approval,
// the same as a held run whose `status` is "waiting".
//
// Examples: success, failure, cancelled, skipped, timed_out, neutral
type CheckConclusion = string
// CheckCounts How many checks are in each state, so a client can say how far a
// pipeline is without opening it. It is on every pull request and on
// every default branch, for a passed, a failed and a running pipeline
// alike. The server tallies them from what it already reads to work out
// the overall state, so they cost no request. Always present, all zero
// when there are no checks.
//
// `waiting` is a check that has not started: queued, or pending where the
// forge doesn't tell queued from running. A failed pipeline can still have
// checks running or waiting, and says so. A pull request's counts agree
// with its `ci`: one whose `ci` is `pending` has `failed` at 0, and one
// whose `ci` is `success` has nothing running, waiting or failed. Two
// kinds of run are therefore in none of the four, as long as something
// else explains the state. A run held for approval: on a pull request
// `awaitingWorkflowApproval` says that. A cancelled run: a push or a
// concurrency group superseded it, and the overall state does not read it
// as a failure while others still run. When cancelled runs (and, on a
// branch, held ones) are the only reason a pipeline reads as failed, they
// count as `failed` (a held run first, where both are there), so a failed
// pipeline always has a failed count on GitHub. A branch whose status is
// `cancelled` has `failed` at 0. A timed-out or stale check counts as `failed`, a skipped,
// neutral or bare completed one as `passed`, on Forgejo too.
//
// `skipped` is a newer field and says how many of the `passed` checks
// were skipped. It never exceeds `passed`: it is inside `passed`, not
// beside it, so `passed` still counts every check that needs nothing more
// and the four states still add up to the checks the pipeline lists. The
// server always sends it, which is why it is required; a client that may
// talk to an older server may read a missing one as zero. A neutral or bare
// completed check is passed without being skipped. A client that draws the
// two side by side must subtract `skipped` from `passed` for the passed figure, or a skipped check is
// counted twice, and a pipeline where every passed check was skipped can
// read as skipped.
//
// On GitHub the counts come from the same rollup as the overall state,
// for a pull request and a branch alike; on Forgejo a pull request counts
// the statuses of the combined commit status, which only say pending, and
// takes the running ones out of the pending count by reading the jobs of
// the commit's runs that are still going, and a default branch counts the
// jobs of the workflow runs of the newest commit that has one, where a
// running job is `running` and a queued or blocked one `waiting`. A run
// whose jobs can't be read counts as one check by its own status. Forgejo
// answers one page of those statuses, and when its total says there are
// more than the page holds a pull request's counts are all zero rather
// than an undercount. When GitHub's rollup of a pull request is of an
// earlier commit than the head (a push still being processed), the counts
// are zero too. GitHub's unauthenticated fallback has no such counts, so
// there they are all zero.
type CheckCounts struct {
Failed int `json:"failed"`
Passed int `json:"passed"`
Running int `json:"running"`
Skipped int `json:"skipped"`
Waiting int `json:"waiting"`
}
// CheckLog The output of one CI job.
type CheckLog struct {
// Text Plain text, never markup. A client must render it as text.
Text string `json:"text"`
// Truncated True when the start of the output was cut to fit the size cap.
Truncated bool `json:"truncated"`
}
// CheckStatus How far one job has got, as a fact. The page works out what to show
// from it and `conclusion`.
//
// "waiting" is a GitHub workflow run held until a maintainer approves
// it. It has no jobs yet, so it is not queued and has not failed; its
// `url` is the run's page, where the approve button is. A check run
// that finishes as `action_required` is the other shape of the same
// wait: it is "completed" with that conclusion. The page treats the
// two alike.
type CheckStatus string
// CheckSubject defines model for CheckSubject.
type CheckSubject struct {
Forge string `json:"forge"`
// FullName The repository, as `owner/repo`.
FullName string `json:"fullName"`
Kind CheckSubjectKind `json:"kind"`
// Number The pull request number. Required for `pull_request`.
Number *int `json:"number,omitempty"`
}
// CheckSubjectKind defines model for CheckSubject.Kind.
type CheckSubjectKind string
// ClosingIssue One issue a pull request will close when it merges.
type ClosingIssue struct {
Number int `json:"number"`
// PageUrl The address on this dashboard that opens the Issues page with this
// issue's pop-up open: `/issues.html?issue=` and
// `forge/owner/name/number`, on the pull request's own forge. A
// relative address. When the issue is closed, hidden by the user's
// settings or in a repo the dashboard does not track, the page opens
// no pop-up and shows a plain note over the list. The note has no
// forge link, since the dashboard knows nothing else about the issue.
//
//
// Examples: /issues.html?issue=github/alrayyes/hush-hush/12
PageUrl string `json:"pageUrl"`
// Repo The issue's repository as `owner/name`, which is not always the pull request's own.
Repo string `json:"repo"`
// Url The issue's page on its forge.
Url string `json:"url"`
}
// Credential A registered passkey's own metadata — never the
// credential itself, which never leaves the authenticator that
// created it; WebAuthn's whole design is that the server only ever
// sees a public key and signed assertions, not a secret to lose.
type Credential struct {
CreatedAt time.Time `json:"createdAt"`
// Id This passkey's own credential ID (base64url), distinct from the account's user ID.
Id string `json:"id"`
// Label The passkey's name, given at registration and changeable with `PATCH /api/auth/credentials/{id}`. Empty when it was never named; clients then fall back to `createdAt`.
Label string `json:"label"`
}
// Dashboard defines model for Dashboard.
type Dashboard struct {
// AutoMerged Pull requests this app auto-merged in the last ten minutes, newest
// first. They have already left `pullRequests`, so this is how a
// client shows "Auto-merged owner/repo#N after checks passed". Always
// present, empty when there are none. A client shows each one once,
// matched on `forge`, `fullName`, `number` and `mergedAt`.
AutoMerged []AutoMergedPullRequest `json:"autoMerged"`
// FirstRefreshDone False from process start until this viewer's first refresh has
// finished, whether it succeeded or failed; true from then on,
// including after later refreshes. Per viewer: another user's
// refresh does not flip it. A client shows a loading state instead
// of empty lists while it is false; a failed first refresh is
// reported through forge health, not by keeping this false. It is
// also true when the server started from the snapshot saved by its
// last run: those rows are on the page, and their forge reports
// `reachable: false` with `staleSince` until the first refresh
// succeeds. The same
// on `GET /api/dashboard`, the stream and the MCP `get_dashboard`
// output. Always present. A client of an older server that
// lacks it should treat a missing flag as true (loaded).
FirstRefreshDone bool `json:"firstRefreshDone"`
Forges []ForgeHealth `json:"forges"`
// GeneratedAt When this snapshot was refreshed, not when it was requested.
GeneratedAt time.Time `json:"generatedAt"`
// HiddenDrafts How many draft pull requests `pullRequests` leaves out. Always
// present, and `0` when the request set `includeDrafts=true`, so
// a client can render "N hidden" without a special case. Drafts
// in a repo the account ignores aren't counted, since none of
// that repo's pull requests show.
HiddenDrafts int `json:"hiddenDrafts"`
// HiddenPullRequests How many pull requests the user hid that are still open and not
// expired. Always present, so a client can render "Hidden (N)"
// without a special case. With `includeHidden=true` they are in
// `pullRequests`, marked `hidden`, and this still counts them.
HiddenPullRequests *int `json:"hiddenPullRequests,omitempty"`
Issues []Issue `json:"issues"`
// MainBranchPage What `GET /api/main-branches` answers, from the same snapshot and
// with the same ignore list, so the Main branches page redraws from
// the message every other page reads. It reads the endpoint itself only
// while the stream is down or just back.
// Always present.
MainBranchPage MainBranches `json:"mainBranchPage"`
// NavCounts The numbers behind the navigation badges, counted from what the
// board shows by default, so they match each page when it opens. Pull
// requests leave out ignored repos, draft pull requests and hidden pull
// requests whatever `includeDrafts` and `includeHidden` ask for, so the
// badge doesn't jump when a toggle flips. Pull requests are
// split by `kind`
// (release pull requests under `releases`, Dependabot and Renovate
// under `bots`, the rest under `pullRequests`). Always present, with
// zeros when there is nothing. A client hides a page's whole nav item at
// zero total, and a state's number at zero. Every page except Issues also
// carries `running` and `passed`. The Branches badge isn't here: a
// client counts the rows of `mainBranchPage`.
NavCounts NavCounts `json:"navCounts"`
// OpenIssueCount How many of `issues` are real work: all of them except the
// `housekeeping` ones. What the Issues badge shows.
OpenIssueCount int `json:"openIssueCount"`
PullRequests []PullRequest `json:"pullRequests"`
// QueuedActions The signed-in user's queued actions, waiting and finished in the
// last 24 hours (GET /api/queued-actions), so a client lists them in
// its Activity panel and learns an outcome from the stream it
// already reads. Always present, empty when there are none.
QueuedActions []QueuedAction `json:"queuedActions"`
// ReadIntervalSeconds How often, in seconds, a client should re-read GET
// /api/dashboard. The server's advice, so a client needs no
// interval of its own. The read is cheap and never calls a
// forge; this is not the backend's refresh schedule. It is
// shorter (2) until the viewer's first refresh has finished, so a
// page that is still loading picks the data up soon after it is
// ready, and the normal 30 from then on.
ReadIntervalSeconds int `json:"readIntervalSeconds"`
Repos []RepoStatus `json:"repos"`
// SettingsHiddenIssueCount How many open issues the user's own settings (`hideDependencyDashboard`
// and `ignoredTitles`) left out of `issues`, so a client can say
// "N hidden by your settings" and link to Settings; it cannot work
// that out, the issues are not sent. Always present once the
// server applies the settings; 0 when none are hidden.
SettingsHiddenIssueCount *int `json:"settingsHiddenIssueCount,omitempty"`
}
// DetailsBody A pull request's description, or the release notes of a release pull request.
type DetailsBody struct {
// Edited True when the forge says the text was edited after it was posted.
Edited bool `json:"edited"`
// Format How `text` is written. Only markdown today; a later format is additive.
Format DetailsBodyFormat `json:"format"`
// Reactions The two reactions the dialog shows, `+1` and `-1` on both forges.
Reactions Reactions `json:"reactions"`
// Text The text as the forge stores it, cut at 20,000 characters. Markdown,
// not converted or sanitised: render it with raw HTML disabled.
Text string `json:"text"`
// Truncated True when `text` was cut at 20,000 characters.
Truncated bool `json:"truncated"`
}
// DetailsBodyFormat How `text` is written. Only markdown today; a later format is additive.
type DetailsBodyFormat string
// DetailsComment One comment on the pull request's conversation.
type DetailsComment struct {
// Author Null for a deleted account; a client shows it as "ghost".
Author *Person `json:"author"`
CreatedAt time.Time `json:"createdAt"`
Edited bool `json:"edited"`
Format DetailsCommentFormat `json:"format"`
// Id The forge's own identifier for the comment.
Id string `json:"id"`
// Reactions The two reactions the dialog shows, `+1` and `-1` on both forges.
Reactions Reactions `json:"reactions"`
// Text Markdown, cut at 20,000 characters, not converted or sanitised.
Text string `json:"text"`
Truncated bool `json:"truncated"`
// UpdatedAt When the comment was last edited, or null if it never was.
UpdatedAt *time.Time `json:"updatedAt"`
}
// DetailsCommentFormat defines model for DetailsComment.Format.
type DetailsCommentFormat string
// Error defines model for Error.
type Error struct {
Error string `json:"error"`
// Field Present when the rejection is about one field of the request
// body (a settings save, for instance), named as it appears there,
// so a client can mark that input without parsing `error`.
Field *string `json:"field,omitempty"`
}
// FilterState The dashboard/Insights filter bar's own saved shape (and the
// Branches page's status, forge, advisories and search, in a `branches` group) —
// whatever the frontend's `$lib/filters` `loadState`/`saveState` already produce
// client-side (shared forge/repo/label/author/title/created/
// updated/groupBy, plus the two board-owned extras with no
// equivalent on the other entity type). `shared.label`,
// `shared.repo` (forge-qualified, `forge:owner/name`) and
// `shared.author` are each one lowercase value, or several separated
// by a newline: the filter matches an item with any of them, and a
// single value saved before they took several still reads as a list
// of one. At most 20 values and 1000 characters in each, with no
// control character other than the separator; a save over either is
// refused. This server stores and
// returns it verbatim, byte for byte, and apart from those limits never parses or
// validates its shape — the same "opaque blob, not this layer's
// concern" treatment WebAuthnCeremonyOptions above gets, so a
// client-side shape change here never needs a matching spec change.
type FilterState map[string]interface{}
// Forge defines model for Forge.
type Forge string
// ForgeApiBucket defines model for ForgeApiBucket.
type ForgeApiBucket struct {
// Credential The credential the requests were made with, as a label with no secret and no user id.
Credential string `json:"credential"`
Forge Forge `json:"forge"`
// Graphql GraphQL requests made.
Graphql int `json:"graphql"`
// GraphqlCost The `rateLimit.cost` points the GraphQL requests were charged.
GraphqlCost int `json:"graphqlCost"`
// Kind Why the requests were made. Open-ended, so a new kind is not a breaking change; today `full`, `scoped_webhook`, `ci_poll`, `auto_merge_poll`, `details`, `hook_maintenance`, `advisories`, `user_action` and `unknown`.
Kind string `json:"kind"`
// NotModified Requests answered `304 Not Modified`, which cost nothing.
NotModified int `json:"notModified"`
// Repo The repository as `owner/name`, or empty when the request touched no single repository. `other` collects the repositories past the cap on how many are counted separately.
Repo string `json:"repo"`
// Rest REST requests that were charged against the REST budget.
Rest int `json:"rest"`
}
// ForgeApiBudget defines model for ForgeApiBudget.
type ForgeApiBudget struct {
Forge Forge `json:"forge"`
// RateLimitGraphQL The forge's GraphQL budget as last reported; absent when it has none.
RateLimitGraphQL *RateLimit `json:"rateLimitGraphQL,omitempty"`
// RateLimitREST The forge's REST budget as last reported; absent when not reported.
RateLimitREST *RateLimit `json:"rateLimitREST,omitempty"`
}
// ForgeApiStats defines model for ForgeApiStats.
type ForgeApiStats struct {
// Buckets One row per forge, credential, kind and repository that made a request, ordered by forge, credential, kind and repo.
Buckets []ForgeApiBucket `json:"buckets"`
// Budgets The rate limits each forge last reported, one row per forge.
Budgets []ForgeApiBudget `json:"budgets"`
// Since When counting began, which is when the server last started.
Since time.Time `json:"since"`
}
// ForgeErrorKind Why a forge is unreachable, or why a write to it was rejected, as
// coarse as every forge this service talks to can agree on.
// "unauthorized" covers both a bad token and a forbidden request;
// "not_found" usually means a wrong instance URL. "conflict" is only
// ever returned from a pull-request write — the forge reports the PR
// itself isn't currently mergeable. "unknown" covers a signal this
// service doesn't recognize, rather than a guessed-at specific cause.
type ForgeErrorKind string
// ForgeHealth defines model for ForgeHealth.
type ForgeHealth struct {
// DependabotCommandsBlocked Why a "@dependabot" comment sent through this forge's credential would be refused. Dependabot only honours commands from a user with push access and ignores GitHub App accounts whatever permissions the App holds. Set only for GitHub when the connected credential is an App with no personal access token saved to send commands as. The Dependabot buttons lock with this text, auto-update-branch skips Dependabot pull requests, and the dependabot-action endpoint answers 409 with it. Omitted when commands work.
DependabotCommandsBlocked *string `json:"dependabotCommandsBlocked,omitempty"`
// Error A human-readable explanation of the last failure, if reachable is false. Mapped from errorKind, not the raw underlying error text. Omitted when reachable.
Error *string `json:"error,omitempty"`
// ErrorKind Why a forge is unreachable, or why a write to it was rejected, as
// coarse as every forge this service talks to can agree on.
// "unauthorized" covers both a bad token and a forbidden request;
// "not_found" usually means a wrong instance URL. "conflict" is only
// ever returned from a pull-request write — the forge reports the PR
// itself isn't currently mergeable. "unknown" covers a signal this
// service doesn't recognize, rather than a guessed-at specific cause.
ErrorKind *ForgeErrorKind `json:"errorKind,omitempty"`
Forge Forge `json:"forge"`
// RateLimitGraphQL GitHub's GraphQL budget — a completely separate 5000/hour allowance from rateLimitREST, populated from the rateLimit block GitHub embeds in every GraphQL response. Never set for a forge with no GraphQL API (Forgejo).
RateLimitGraphQL *RateLimit `json:"rateLimitGraphQL,omitempty"`
// RateLimitREST The forge's REST budget, from real X-RateLimit-* response headers. For GitHub, this is checkWebhooks and every write action (merge, update branch, comment, label) — a different 5000/hour allowance from rateLimitGraphQL, not a duplicate of it. Omitted on a poll that made no REST call at all (no webhook path configured). For Forgejo, or any forge reached through GenericSource, this is the only budget there is to report — GenericSource makes exclusively REST-style calls.
RateLimitREST *RateLimit `json:"rateLimitREST,omitempty"`
// Reachable Whether the last refresh attempt against this forge succeeded.
Reachable bool `json:"reachable"`
// RepoCount Repositories with write access this forge reported.
RepoCount int `json:"repoCount"`
// RerunChecksBlocked Why this forge can't rerun checks. Set only for a Forgejo whose version is 7 to 16, which has no API route for it. A version below 7 is left to the forge, because a Gitea numbers itself that way. The version is read in the background, read again after an hour while it blocks, and retried after a failed read or one that gives no number. A block that has gone stale is dropped when the read fails. Rerun failed checks is not offered for the forge, and the page shows this text where the button would be. Omitted when rerunning works or the version could not be read.
RerunChecksBlocked *string `json:"rerunChecksBlocked,omitempty"`
// StaleSince Present when the last refresh against this forge failed, or the
// forge has not been asked yet since the app started (see
// starting), and the pull requests, issues and repos in the
// response are the last good ones, fetched at this time, instead of
// none. Absent when the data
// is current, and for a forge that has never fetched successfully,
// which has nothing to show. A client can say "unreachable, showing
// data from 3 minutes ago".
StaleSince *time.Time `json:"staleSince,omitempty"`
// Starting True while the rows shown for this forge are the ones the last run
// saved and no refresh has asked the forge since the app started.
// The forge is then neither reachable nor in error (errorKind is
// absent); it has not been checked yet. The first refresh that
// reaches it replaces this entry. A client says "starting up,
// showing data from 3 minutes ago", and never "unreachable".
Starting *bool `json:"starting,omitempty"`
}
// Health defines model for Health.
type Health struct {
Status HealthStatus `json:"status"`
}
// HealthStatus defines model for Health.Status.
type HealthStatus string
// Issue defines model for Issue.
type Issue struct {
Author string `json:"author"`
// AuthorAvatarUrl The forge's own avatar URL for whoever filed the issue, passed through unchanged and never proxied. Empty when the forge supplies none, such as a deleted account.
AuthorAvatarUrl string `json:"authorAvatarUrl"`
// AuthorUrl The author's profile page on the forge, built by the server from the forge's own web address. Empty when there is nothing to link to, such as a deleted account.
AuthorUrl string `json:"authorUrl"`
CreatedAt time.Time `json:"createdAt"`
Forge Forge `json:"forge"`
// Housekeeping True for an issue a bot keeps open and rewrites, Renovate's
// "Dependency Dashboard", which is not work for a person. The
// server decides, so every client lists and counts the same
// issues. It stays in `issues`, and `openIssueCount` leaves it out,
// unless the user's `hideDependencyDashboard` setting is on: then
// the server leaves it out of `issues` as well.
Housekeeping bool `json:"housekeeping"`
Labels []Label `json:"labels"`
// LinkedPullRequests The open pull requests that will close the issue when they merge,
// the other side of a pull request's `closesIssues`, ordered by
// repository and number. Always present, and empty when there are
// none. The server joins the pull requests it already holds, so it
// costs the forge no request. It counts every open pull request the
// user could see, including a draft and one they hid, but not one in
// a repository whose pull requests they ignore. A pull request that
// merged or closed is gone from the list on the next refresh.
LinkedPullRequests []LinkedPullRequest `json:"linkedPullRequests"`
// MentionedByPullRequests The open pull requests that mention the issue without closing it,
// the other side of a pull request's `mentionsIssues`, ordered by
// repository and number and with the same entry as
// `linkedPullRequests`. A pull request that closes the issue is only
// in `linkedPullRequests`. Always present, and empty when there are
// none. The pull requests counted are the same as in `linkedPullRequests`.
MentionedByPullRequests []LinkedPullRequest `json:"mentionedByPullRequests"`
Number int `json:"number"`
// Repo Examples: alrayyes/hush-hush
Repo string `json:"repo"`
Title string `json:"title"`
UpdatedAt time.Time `json:"updatedAt"`
// Url The real issue URL on its own forge.
Url string `json:"url"`
}
// IssueActionRequest Which issue to act on.
type IssueActionRequest struct {
Forge Forge `json:"forge"`
// FullName "owner/repo", matching an Issue.repo from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching an Issue.number from GET /api/dashboard.
Number int `json:"number"`
}
// IssueCommentRequest Which issue to comment on, and what to say.
type IssueCommentRequest struct {
// Body The comment, as Markdown. Blank text is refused.
Body string `json:"body"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching an Issue.repo from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching an Issue.number from GET /api/dashboard.
Number int `json:"number"`
}
// IssueDetails What the issue dialog shows.
type IssueDetails struct {
// CommentCount How many comments the forge has on the issue.
CommentCount int `json:"commentCount"`
// Comments The conversation, oldest first, at most the first 50.
Comments []DetailsComment `json:"comments"`
// CommentsTruncated True when `commentCount` is more than the comments returned.
CommentsTruncated bool `json:"commentsTruncated"`
// Description A pull request's description, or the release notes of a release pull request.
Description DetailsBody `json:"description"`
// State Whether the forge has the issue open or closed right now. The
// dialog draws its status from this, so an issue closed or reopened
// while the dialog is open shows the change.
State IssueDetailsState `json:"state"`
}
// IssueDetailsState Whether the forge has the issue open or closed right now. The
// dialog draws its status from this, so an issue closed or reopened
// while the dialog is open shows the change.
type IssueDetailsState string
// Label defines model for Label.
type Label struct {
// Color The label's colour as a hex string with no leading "#",
// exactly as the forge reports it.
//
//
// Examples: d73a4a
Color string `json:"color"`
// Name Examples: kind/bug
Name string `json:"name"`
}
// LinkedPullRequest One open pull request that will close an issue when it merges.
type LinkedPullRequest struct {
// AwaitingWorkflowApproval The same flag as on the pull request itself: true when GitHub is
// holding a workflow run on the head commit until someone approves
// it. A client says "waiting for approval" rather than "check
// failed" while it is true. Always present; false on Forgejo.
AwaitingWorkflowApproval bool `json:"awaitingWorkflowApproval"`
// Checks How many checks are in each state, so a client can say how far a
// pipeline is without opening it. It is on every pull request and on
// every default branch, for a passed, a failed and a running pipeline
// alike. The server tallies them from what it already reads to work out
// the overall state, so they cost no request. Always present, all zero
// when there are no checks.
//
// `waiting` is a check that has not started: queued, or pending where the
// forge doesn't tell queued from running. A failed pipeline can still have
// checks running or waiting, and says so. A pull request's counts agree
// with its `ci`: one whose `ci` is `pending` has `failed` at 0, and one
// whose `ci` is `success` has nothing running, waiting or failed. Two
// kinds of run are therefore in none of the four, as long as something
// else explains the state. A run held for approval: on a pull request
// `awaitingWorkflowApproval` says that. A cancelled run: a push or a
// concurrency group superseded it, and the overall state does not read it
// as a failure while others still run. When cancelled runs (and, on a
// branch, held ones) are the only reason a pipeline reads as failed, they
// count as `failed` (a held run first, where both are there), so a failed
// pipeline always has a failed count on GitHub. A branch whose status is
// `cancelled` has `failed` at 0. A timed-out or stale check counts as `failed`, a skipped,
// neutral or bare completed one as `passed`, on Forgejo too.
//
// `skipped` is a newer field and says how many of the `passed` checks
// were skipped. It never exceeds `passed`: it is inside `passed`, not
// beside it, so `passed` still counts every check that needs nothing more
// and the four states still add up to the checks the pipeline lists. The
// server always sends it, which is why it is required; a client that may
// talk to an older server may read a missing one as zero. A neutral or bare
// completed check is passed without being skipped. A client that draws the
// two side by side must subtract `skipped` from `passed` for the passed figure, or a skipped check is
// counted twice, and a pipeline where every passed check was skipped can
// read as skipped.
//
// On GitHub the counts come from the same rollup as the overall state,
// for a pull request and a branch alike; on Forgejo a pull request counts
// the statuses of the combined commit status, which only say pending, and
// takes the running ones out of the pending count by reading the jobs of
// the commit's runs that are still going, and a default branch counts the
// jobs of the workflow runs of the newest commit that has one, where a
// running job is `running` and a queued or blocked one `waiting`. A run
// whose jobs can't be read counts as one check by its own status. Forgejo
// answers one page of those statuses, and when its total says there are
// more than the page holds a pull request's counts are all zero rather
// than an undercount. When GitHub's rollup of a pull request is of an
// earlier commit than the head (a push still being processed), the counts
// are zero too. GitHub's unauthenticated fallback has no such counts, so
// there they are all zero.
Checks CheckCounts `json:"checks"`
// Ci The combined result across every check reported against the pull
// request's head commit. "none" means neither forge reported any
// check at all, not that one failed.
Ci CIStatus `json:"ci"`
// Draft True while the pull request is a draft. Otherwise it is open.
Draft bool `json:"draft"`
Forge Forge `json:"forge"`
Number int `json:"number"`
// PageUrl The address on this dashboard that opens the page listing the pull
// request, with its pop-up open: `/pull-requests.html`, `/releases.html`
// or `/bots.html`, whichever page lists that kind of pull request, then
// `?pr=` and `forge/owner/name/number`. A relative address.
//
//
// Examples: /pull-requests.html?pr=github/alrayyes/hush-hush/12
PageUrl string `json:"pageUrl"`
// Repo The pull request's repository as `owner/name`, which is not always the issue's own.
Repo string `json:"repo"`
}
// MainBranch One tracked repository and the CI status of its default branch.
type MainBranch struct {
// Advisories The open dependency advisories on a repository's default branch, read
// from GitHub's Dependabot alerts, or for a Forgejo repository from the
// packages in its lockfiles matched against OSV, when the operator has
// switched that on. Absent from the row when no source reads them for its
// forge. A source that can't
// answer, such as alerts switched off or a token without the
// `security_events` scope, gives `state` "unknown", never a count of
// zero.
Advisories *Advisories `json:"advisories,omitempty"`
// Branch The repository's default branch. Empty for a repository the forge reports no default branch for.
Branch string `json:"branch"`
// Checks How many checks are in each state, so a client can say how far a
// pipeline is without opening it. It is on every pull request and on
// every default branch, for a passed, a failed and a running pipeline
// alike. The server tallies them from what it already reads to work out
// the overall state, so they cost no request. Always present, all zero
// when there are no checks.
//
// `waiting` is a check that has not started: queued, or pending where the
// forge doesn't tell queued from running. A failed pipeline can still have
// checks running or waiting, and says so. A pull request's counts agree
// with its `ci`: one whose `ci` is `pending` has `failed` at 0, and one
// whose `ci` is `success` has nothing running, waiting or failed. Two
// kinds of run are therefore in none of the four, as long as something
// else explains the state. A run held for approval: on a pull request
// `awaitingWorkflowApproval` says that. A cancelled run: a push or a
// concurrency group superseded it, and the overall state does not read it
// as a failure while others still run. When cancelled runs (and, on a
// branch, held ones) are the only reason a pipeline reads as failed, they
// count as `failed` (a held run first, where both are there), so a failed
// pipeline always has a failed count on GitHub. A branch whose status is
// `cancelled` has `failed` at 0. A timed-out or stale check counts as `failed`, a skipped,
// neutral or bare completed one as `passed`, on Forgejo too.
//
// `skipped` is a newer field and says how many of the `passed` checks
// were skipped. It never exceeds `passed`: it is inside `passed`, not
// beside it, so `passed` still counts every check that needs nothing more
// and the four states still add up to the checks the pipeline lists. The
// server always sends it, which is why it is required; a client that may
// talk to an older server may read a missing one as zero. A neutral or bare
// completed check is passed without being skipped. A client that draws the
// two side by side must subtract `skipped` from `passed` for the passed figure, or a skipped check is
// counted twice, and a pipeline where every passed check was skipped can
// read as skipped.
//
// On GitHub the counts come from the same rollup as the overall state,
// for a pull request and a branch alike; on Forgejo a pull request counts
// the statuses of the combined commit status, which only say pending, and
// takes the running ones out of the pending count by reading the jobs of
// the commit's runs that are still going, and a default branch counts the
// jobs of the workflow runs of the newest commit that has one, where a
// running job is `running` and a queued or blocked one `waiting`. A run
// whose jobs can't be read counts as one check by its own status. Forgejo
// answers one page of those statuses, and when its total says there are
// more than the page holds a pull request's counts are all zero rather
// than an undercount. When GitHub's rollup of a pull request is of an
// earlier commit than the head (a push still being processed), the counts
// are zero too. GitHub's unauthenticated fallback has no such counts, so
// there they are all zero.
Checks CheckCounts `json:"checks"`
// Commit The newest commit, or null when the forge reported none (an empty repository, or no run on Forgejo to name one from).
Commit *MainBranchCommit `json:"commit"`
// DurationSeconds How long the pipeline ran, from its first job starting to its last
// finishing. Null while it runs, or when the forge didn't say.
DurationSeconds *int `json:"durationSeconds"`
// FailingJobs The names of the failed jobs (GitHub checks, Forgejo Actions
// jobs), or of the failed workflow when its jobs couldn't be read.
// Always present and empty unless `status` is "failed".
FailingJobs []string `json:"failingJobs"`
// FinishedAt When the pipeline's last job finished. Null while it runs, or when the forge didn't say.
FinishedAt *time.Time `json:"finishedAt"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// LatestRelease The repository's latest published release, for a link to its
// notes. Null when the repository has none, when its only releases
// are drafts or pre-releases, and for every Forgejo repository,
// whose latest release is a separate read per repository that the
// refresh does not make.
LatestRelease *MainBranchRelease `json:"latestRelease"`
// RunUrl Where to see the run on the forge: the failed job's page for a
// failed pipeline, else the run's, else the commit's. Falls back to
// the repository's `url`.
RunUrl string `json:"runUrl"`
// StaleSince Set when this row is the last known one because its forge couldn't
// be read or its rate limit is spent: the time it was last fetched.
// Null otherwise. A client offers no write on a stale row.
StaleSince *time.Time `json:"staleSince"`
// Status The result of the latest pipeline on a default branch's newest
// commit, across all its workflows. "failed" when any job failed,
// "running" when none failed and some are still queued or running,
// "cancelled" when nothing failed and nothing is running but some run
// was cancelled (a newer push or a person stopped it, so nothing broke),
// "awaiting_approval" when GitHub holds the commit's workflow runs until
// a maintainer approves them (they create no check runs, so nothing
// runs), "passed" when all finished green, "none" when the commit has
// no pipeline at all (or the repository has no commit yet).
Status MainBranchStatus `json:"status"`
// Url The repository's own page on its forge.
Url string `json:"url"`
}
// MainBranchCommit The newest commit on the default branch.
type MainBranchCommit struct {
// Author The commit author's login where the forge knows it, else the name
// on the commit. Empty when the forge didn't say.
Author string `json:"author"`
// CommittedAt When the commit was made, or null when the forge didn't say.
CommittedAt *time.Time `json:"committedAt"`
// Sha The commit id, shortened to seven characters.
Sha string `json:"sha"`
// Subject The first line of the commit message.
Subject string `json:"subject"`
}
// MainBranchRelease A repository's latest published release.
type MainBranchRelease struct {
// Tag The release's tag, such as "v1.2.3".
Tag string `json:"tag"`
// Url The release's own page on its forge.
Url string `json:"url"`
}
// MainBranchRerunRequest Which repository's default branch to rerun the failed checks of.
type MainBranchRerunRequest struct {
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a MainBranch.fullName from GET /api/main-branches.
FullName string `json:"fullName"`
}
// MainBranchStatus The result of the latest pipeline on a default branch's newest
// commit, across all its workflows. "failed" when any job failed,
// "running" when none failed and some are still queued or running,
// "cancelled" when nothing failed and nothing is running but some run
// was cancelled (a newer push or a person stopped it, so nothing broke),
// "awaiting_approval" when GitHub holds the commit's workflow runs until
// a maintainer approves them (they create no check runs, so nothing
// runs), "passed" when all finished green, "none" when the commit has
// no pipeline at all (or the repository has no commit yet).
type MainBranchStatus string
// MainBranches Every default branch the page lists, in no particular order. There is
// no tally: a client counts the rows it holds, so the filter pills and
// the navigation badge always agree with the list.
type MainBranches struct {
Branches []MainBranch `json:"branches"`
// Forges Each forge's health as of the last refresh, the same as the dashboard's. A client uses it to hold back an action that a forge which can't be reached, or whose rate limit is spent, would probably refuse. The budget can run out between refreshes, so the forge still has the final say.
Forges []ForgeHealth `json:"forges"`
// GeneratedAt When the snapshot was refreshed, not when it was requested.
GeneratedAt time.Time `json:"generatedAt"`
}
// MentionedIssue One issue or pull request a pull request mentions without closing it.
// The number is an issue's or a pull request's, which the forge's address
// tells apart.
type MentionedIssue struct {
Number int `json:"number"`
// PageUrl The address on this dashboard that opens the Issues page with this
// issue's pop-up open, built the same way as the closing issue's. A
// relative address.
//
//
// Examples: /issues.html?issue=github/alrayyes/hush-hush/12
PageUrl string `json:"pageUrl"`
// Repo The repository as `owner/name`, which is not always the pull request's own.
Repo string `json:"repo"`
// Tracked True when the dashboard holds it as an open issue it shows, so
// `pageUrl` opens its pop-up. False for a pull request, a closed
// issue, an issue the user's settings hide and anything in a repo
// the dashboard does not track; a client then links to `url`.
Tracked bool `json:"tracked"`
// Url Its page on the forge, which a client links to when `tracked` is false.
Url string `json:"url"`
}
// MergeStatus A pull request's mergeable/blocked state, as coarse as every forge
// this service talks to can agree on. "blocked" covers anything
// stopping a merge that isn't confirmed to be a real conflict —
// including Forgejo's own mergeable flag reporting false, since its
// server computes that asynchronously and can report it stale.
// "unstable" is GitHub's UNSTABLE: the pull request can be merged, but
// a check that branch protection doesn't require is failing or still
// running. Merge stays available.
// "unknown" covers both a forge that hasn't determined this yet and
// this service being unable to determine it.
type MergeStatus string
// NavCounts The numbers behind the navigation badges, counted from what the
// board shows by default, so they match each page when it opens. Pull
// requests leave out ignored repos, draft pull requests and hidden pull
// requests whatever `includeDrafts` and `includeHidden` ask for, so the
// badge doesn't jump when a toggle flips. Pull requests are
// split by `kind`
// (release pull requests under `releases`, Dependabot and Renovate
// under `bots`, the rest under `pullRequests`). Always present, with
// zeros when there is nothing. A client hides a page's whole nav item at
// zero total, and a state's number at zero. Every page except Issues also
// carries `running` and `passed`. The Branches badge isn't here: a
// client counts the rows of `mainBranchPage`.
type NavCounts struct {
// Bots A pull request page's numbers. `running`, `failed` and
// `passed` count the pull requests whose CI is pending, failing and
// succeeded. A pull request with no checks counts in `total` only, so
// the four numbers need not add up. All four are always present.
Bots NavPullRequestCount `json:"bots"`
Issues NavIssueCount `json:"issues"`
// PullRequests A pull request page's numbers. `running`, `failed` and
// `passed` count the pull requests whose CI is pending, failing and
// succeeded. A pull request with no checks counts in `total` only, so
// the four numbers need not add up. All four are always present.
PullRequests NavPullRequestCount `json:"pullRequests"`
// Releases A pull request page's numbers. `running`, `failed` and
// `passed` count the pull requests whose CI is pending, failing and
// succeeded. A pull request with no checks counts in `total` only, so
// the four numbers need not add up. All four are always present.
Releases NavPullRequestCount `json:"releases"`
}
// NavIssueCount defines model for NavIssueCount.
type NavIssueCount struct {
// Total How many open issues are real work, the same number as
// `openIssueCount`. Issues have no failing state, so there is no
// `failed`.
Total int `json:"total"`
}
// NavPullRequestCount A pull request page's numbers. `running`, `failed` and
// `passed` count the pull requests whose CI is pending, failing and
// succeeded. A pull request with no checks counts in `total` only, so
// the four numbers need not add up. All four are always present.
type NavPullRequestCount struct {
// Failed How many of them have failing CI. A pull request whose only
// failure is workflow runs held until someone approves them
// (`awaitingWorkflowApproval`) is counted in `total` and not here,
// as nothing failed; one with a job that really failed beside a
// held run still counts.
Failed int `json:"failed"`
// Passed How many of them have CI that succeeded.
Passed int `json:"passed"`
// Running How many of them have CI that is still pending.
Running int `json:"running"`
// Total How many pull requests the page lists.
Total int `json:"total"`
}
// Person Who wrote a description or a comment.
type Person struct {
// AvatarUrl The forge's own avatar URL, passed through unchanged and never proxied.
AvatarUrl string `json:"avatarUrl"`
Login string `json:"login"`
// Url The person's profile page on the forge, built by the server from the web address of an item the board already holds for that forge. Empty when the board holds none yet, so a client shows the name alone.
Url string `json:"url"`
}
// PresenceAnswer defines model for PresenceAnswer.
type PresenceAnswer struct {
// HeartbeatSeconds How often a visible tab reports itself visible again.
HeartbeatSeconds int `json:"heartbeatSeconds"`
// IdleAfterSeconds How long a visible tab may go without input before it reports
// `visible: false`. 0 means the server's idle mode is off and the
// page never needs to.
IdleAfterSeconds int `json:"idleAfterSeconds"`
}
// PresenceReport defines model for PresenceReport.
type PresenceReport struct {
// ViewerId Names one browser tab, chosen by the page when it loads. Not a
// user id and not stored beyond the tab's heartbeats.
//
//
// Examples: 3f1c9a52-7d2e-4a6b-9f10-5b8e2c7d1a44
ViewerId string `json:"viewerId"`
// Visible True while the tab is visible and has had input recently. False
// once it is hidden or the person has stopped using it.
Visible bool `json:"visible"`
}
// PullRequest defines model for PullRequest.
type PullRequest struct {
// AllowedActions The actions this pull request offers, worked out on the server
// from its own fields, so a client needs no copy of the rules. An
// action that doesn't apply (Update branch on a pull request that
// isn't behind, a Dependabot command on a Renovate pull request)
// is absent, not listed as blocked. Always present; `close` is
// always in it. Live state is the client's: a rate-limited or
// unreachable forge, a missing token and an action already in
// flight can still stop an offered action.
AllowedActions []AllowedAction `json:"allowedActions"`
Author string `json:"author"`
// AuthorAvatarUrl The forge's own avatar URL for the author, passed through unchanged and never proxied. Empty when the forge supplies none, such as a deleted account.
AuthorAvatarUrl string `json:"authorAvatarUrl"`
// AuthorUrl The author's profile page on the forge, built by the server from the forge's own web address, so a client needs no rule per forge. A GitHub bot links to its app page. Empty when there is nothing to link to, such as a deleted account.
AuthorUrl string `json:"authorUrl"`
// AutoMerge Where an armed pull request stands, so the row can say why
// auto-merge is waiting or stopped in words and not by colour. Present
// while auto-merge is armed on it: on Forgejo the signed-in user's
// intent held by this app, on GitHub the forge's own auto-merge.
// Also present for ten minutes after this app cancelled an armed
// auto-merge because the pull request went empty (its branch landed on
// the base some other way): `stopped`, code `already_up_to_date` and the
// message "Auto-merge was cancelled: there is nothing left to merge."
// Auto-merge is off by then, so this is the only place the reason lives.
AutoMerge *AutoMergeStatus `json:"autoMerge,omitempty"`
// AutoMergeAllowed Whether GitHub will accept an "Enable auto-merge" request for
// this pull request from the signed-in viewer, read from the
// GraphQL `PullRequest.viewerCanEnableAutoMerge` field. GitHub
// decides this per viewer and per pull request: auto-merge needs
// something on the base branch to wait for (required checks or
// reviews from a branch protection rule or ruleset), so a stacked
// pull request on an unprotected base reports false even when the
// repository allows auto-merge. Omitted when unknown (the
// unauthenticated REST fallback, and Forgejo), never false in
// that case, so clients keep today's behaviour.
AutoMergeAllowed *bool `json:"autoMergeAllowed,omitempty"`
// AutoMergeEnabled Whether auto-merge is currently scheduled on this pull request.
// On Forgejo it is true when the signed-in user armed it in this
// app, which holds the intent itself, or when a merge is scheduled
// on Forgejo (read from the issue timeline's `pull_scheduled_merge`
// and `pull_cancel_scheduled_merge` events, for open non-draft pull
// requests, a bounded number per refresh). It is false once the
// timeline shows no schedule. Omitted when it hasn't been read yet
// or the read failed, since this service then doesn't know.
AutoMergeEnabled *bool `json:"autoMergeEnabled,omitempty"`
// AutoMergeHeldBy Who holds the auto-merge, so a client can word it right. Present
// only when `autoMergeEnabled` is true. `dashboard` means this app
// holds a stored intent and performs the merge itself (Forgejo).
// `forge` means the merge is scheduled on the forge: Forgejo's own
// scheduled merge, or GitHub's auto-merge. When both exist on
// Forgejo it is `dashboard`, since this app's loop merges and
// Cancel clears both. Omitted means unknown: a client must not
// guess it from other fields, and should treat a value it doesn't
// know like an omitted one.
AutoMergeHeldBy *string `json:"autoMergeHeldBy,omitempty"`
// AutoUpdate Whether the dashboard brings this pull request's branch up to date by
// itself: the pull request's own choice when it has one
// (`POST /api/pull-requests/auto-update`), else its repo's
// auto-update setting. Always present.
AutoUpdate AutoUpdate `json:"autoUpdate"`
// AwaitingWorkflowApproval True when GitHub is holding a workflow run on the head commit
// until someone approves it: its rollup counts a check run
// as ACTION_REQUIRED. Those runs also keep `ci` at failure when
// nothing else is running, so a client reads this to say "waiting
// for approval" rather than "check failed". It can be true while
// `ci` is pending (other runs are going) or failing for another
// reason too. Always present; false on Forgejo, which has no
// such state.
AwaitingWorkflowApproval bool `json:"awaitingWorkflowApproval"`
// BaseBranch The branch the pull request targets. Empty when the forge didn't
// say.
BaseBranch string `json:"baseBranch"`
// Behind Whether this pull request's base branch has moved since its
// merge-base was computed. Deliberately its own field rather
// than a mergeStatus value: on Forgejo a pull request can be
// both mergeable and behind at once (its mergeable flag doesn't
// get recomputed just because the base moved), so folding this
// into mergeStatus would force picking one and losing the
// other.
Behind bool `json:"behind"`
// BotRequest A Dependabot or Renovate rebase asked for through this app and not
// settled yet, or null. The server keeps it, so a reload during the
// wait still shows it, and moves it along on every snapshot that
// came from a fetch started after the request. Held in memory per
// account: a server restart forgets it.
BotRequest *BotRequest `json:"botRequest,omitempty"`
// Checks How many checks are in each state, so a client can say how far a
// pipeline is without opening it. It is on every pull request and on
// every default branch, for a passed, a failed and a running pipeline
// alike. The server tallies them from what it already reads to work out
// the overall state, so they cost no request. Always present, all zero
// when there are no checks.
//
// `waiting` is a check that has not started: queued, or pending where the
// forge doesn't tell queued from running. A failed pipeline can still have
// checks running or waiting, and says so. A pull request's counts agree
// with its `ci`: one whose `ci` is `pending` has `failed` at 0, and one
// whose `ci` is `success` has nothing running, waiting or failed. Two
// kinds of run are therefore in none of the four, as long as something
// else explains the state. A run held for approval: on a pull request
// `awaitingWorkflowApproval` says that. A cancelled run: a push or a
// concurrency group superseded it, and the overall state does not read it
// as a failure while others still run. When cancelled runs (and, on a
// branch, held ones) are the only reason a pipeline reads as failed, they
// count as `failed` (a held run first, where both are there), so a failed
// pipeline always has a failed count on GitHub. A branch whose status is
// `cancelled` has `failed` at 0. A timed-out or stale check counts as `failed`, a skipped,
// neutral or bare completed one as `passed`, on Forgejo too.
//
// `skipped` is a newer field and says how many of the `passed` checks
// were skipped. It never exceeds `passed`: it is inside `passed`, not
// beside it, so `passed` still counts every check that needs nothing more
// and the four states still add up to the checks the pipeline lists. The
// server always sends it, which is why it is required; a client that may
// talk to an older server may read a missing one as zero. A neutral or bare
// completed check is passed without being skipped. A client that draws the
// two side by side must subtract `skipped` from `passed` for the passed figure, or a skipped check is
// counted twice, and a pipeline where every passed check was skipped can
// read as skipped.
//
// On GitHub the counts come from the same rollup as the overall state,
// for a pull request and a branch alike; on Forgejo a pull request counts
// the statuses of the combined commit status, which only say pending, and
// takes the running ones out of the pending count by reading the jobs of
// the commit's runs that are still going, and a default branch counts the
// jobs of the workflow runs of the newest commit that has one, where a
// running job is `running` and a queued or blocked one `waiting`. A run
// whose jobs can't be read counts as one check by its own status. Forgejo
// answers one page of those statuses, and when its total says there are
// more than the page holds a pull request's counts are all zero rather
// than an undercount. When GitHub's rollup of a pull request is of an
// earlier commit than the head (a push still being processed), the counts
// are zero too. GitHub's unauthenticated fallback has no such counts, so
// there they are all zero.
Checks CheckCounts `json:"checks"`
// Ci The combined result across every check reported against the pull
// request's head commit. "none" means neither forge reported any
// check at all, not that one failed.
Ci CIStatus `json:"ci"`
// ClosesIssues The issues the pull request will close when it merges. Always
// present, and empty when there are none. On GitHub it is the
// forge's own list of closing references, read in the pull request
// query; GitHub's unauthenticated fallback (no token) has no such
// field, so it lists none. Forgejo has none either, so the server
// reads the closing keywords (close, closes, closed, fix, fixes,
// fixed, resolve, resolves, resolved) in the description the way
// Forgejo does: a keyword, an optional colon, one space, then `#NUMBER`
// or `owner/repo#NUMBER`, and each keyword covers the one reference
// right after it. Code, HTML comments and a number that runs into
// letters count for nothing. The `owner/repo#NUMBER` form follows
// Forgejo's source and has not been tried on a live instance. Only a
// pull request aimed at its repo's default branch closes anything,
// so one aimed elsewhere always lists none.
ClosesIssues []ClosingIssue `json:"closesIssues"`
// ConversationComments How many ordinary comments the pull request's conversation has,
// apart from `reviewComments`. A review's own body is not a comment.
// Always present, and 0 when there are none. On GitHub it comes from
// the pull request query, on Forgejo from the pull request itself, so
// neither costs a request.
ConversationComments int `json:"conversationComments"`
CreatedAt time.Time `json:"createdAt"`
// CrossRepository True when the head branch lives in another repository (a fork).
// A fork pull request is never part of a stack.
CrossRepository bool `json:"crossRepository"`
Draft bool `json:"draft"`
// Empty Whether merging this pull request would produce an empty
// commit — its content already landed on the base branch some
// other way. False whenever this service can't tell (the
// unauthenticated GitHub REST fallback, or a Forgejo instance
// old enough not to report additions/deletions/changed_files on
// its list endpoint), never a false positive: a pull request
// this never confirms empty just renders as it always has.
Empty bool `json:"empty"`
// FailingCi True when CI is failing and not only because a workflow run is
// held for approval: what the Failing CI quick filter lists, and
// what the menu pill's Failed number counts. Always present.
FailingCi bool `json:"failingCi"`
Forge Forge `json:"forge"`
// HeadBranch The branch the pull request comes from. Empty when the forge
// didn't say.
HeadBranch string `json:"headBranch"`
// HeadSha The commit the pull request's head branch points at. A bot's
// rebase moves it, which shows the bot acted even when the pull
// request is still reported behind, or wasn't behind to begin
// with. Empty when the forge didn't say. Always present.
HeadSha string `json:"headSha"`
// Hidden True on a pull request the user hid. Only present when the request
// set `includeHidden=true`: without it a hidden pull request isn't
// in the list at all.
Hidden *bool `json:"hidden,omitempty"`
// HiddenUntil When a hide for a number of days ends. Absent for a pull request
// hidden until it is restored, and for one that isn't hidden.
HiddenUntil *time.Time `json:"hiddenUntil,omitempty"`
// Kind What sort of pull request this is, decided by the server so no
// client keeps its own copy of the rule. `release`: release-please's,
// by its `autorelease:` label (a person opens these, so the label is
// the main signal, and it wins over any bot author), or, when the
// label is missing because release-please failed before applying it,
// by its head branch: `release-please--branches--<base branch>`
// (with `--components--<name>` after it for a repo that releases
// several components) in the same repository and aimed at that base
// branch. A fork's pull request is never a release. `dependency`:
// opened by Dependabot or Renovate, in either spelling of the login
// (the bare slug GraphQL gives, or REST's `[bot]` form), on either
// forge. `regular`: everything else. Always present.
Kind PullRequestKind `json:"kind"`
Labels []Label `json:"labels"`
// MentionsIssues The issues and pull requests the title or description mentions
// without closing them, in order of first appearance and without
// repeats, at most 20. Always present, and empty when there are none.
// A mention is what GitHub and Forgejo both link: `#NUMBER`,
// `owner/repo#NUMBER`, or the address of an issue or pull request
// page on the forge, and on GitHub also `GH-NUMBER`. It has to stand
// alone: `abc#1`, `` and `#1abc` are not mentions, while emphasis
// and table markup around it (`**#1**`, `_#1_`, `|#1|`) is fine. Code,
// HTML comments and the text of a link, Markdown or HTML anchor,
// count for nothing, and a link counts only by its target, when that
// is a page on the forge. Only the first 64 KiB of the description is
// read, cut at a space (a Unicode space too; with none, at the last
// comma or semicolon outside brackets; an anchor still open within 1 KiB of the cut
// loses the text after its tag), and the first 100 references in it. A reference
// in a quotation still counts, and the pull request's own number
// does not. What the pull request actually
// closes is left out, even when the text also mentions it, and the
// cap applies after that. Which references close depends on the
// branch the pull request aims at, so a closing keyword on a pull
// request that does not target the default branch is a mention. Only
// the description closes, so a keyword in the title is a mention.
// Comments, reviews and commit messages are not read. The server
// reads the text on both forges, with or without a GitHub token, so a
// client needs no rule of its own.
MentionsIssues []MentionedIssue `json:"mentionsIssues"`
// MergeStatus A pull request's mergeable/blocked state, as coarse as every forge
// this service talks to can agree on. "blocked" covers anything
// stopping a merge that isn't confirmed to be a real conflict —
// including Forgejo's own mergeable flag reporting false, since its
// server computes that asynchronously and can report it stale.
// "unstable" is GitHub's UNSTABLE: the pull request can be merged, but
// a check that branch protection doesn't require is failing or still
// running. Merge stays available.
// "unknown" covers both a forge that hasn't determined this yet and
// this service being unable to determine it.
MergeStatus MergeStatus `json:"mergeStatus"`
// NeedsReview True when a review is outstanding: the forge requires one, or a
// reviewer was asked and hasn't answered, and the pull request
// isn't a draft. Unreviewed with nobody asked, approved, changes
// requested and an unknown review state are all false. Always
// present.
NeedsReview bool `json:"needsReview"`
Number int `json:"number"`
// Queued A safe action this user queued on this pull request that is still
// waiting for its forge's rate limit to reset, or null. The row can
// say "Update branch queued for 14:32" from `runAt` and offer
// Cancel with `id`. A final outcome is not here: it is in the
// dashboard's `queuedActions`.
Queued *QueuedAction `json:"queued,omitempty"`
// ReadyToMerge True when the pull request is mergeable, its CI is green and it
// isn't a draft: what the Ready quick filter lists. Always
// present. A pull request with no checks isn't ready.
ReadyToMerge bool `json:"readyToMerge"`
// Repo Owner-qualified repository name.
//
// Examples: alrayyes/hush-hush
Repo string `json:"repo"`
// RequestedReviewerLogins The logins of the users asked to review this pull request, on
// both forges. A team request has no login and is left out.
// Always present, and empty when nobody was asked. Costs no
// extra request: GitHub returns it with the reviewRequests count
// already queried, Forgejo with the pull request itself.
RequestedReviewerLogins []string `json:"requestedReviewerLogins"`
// Review Where a pull request stands on code review. The whole object is
// omitted when the owning forge couldn't report it (a Forgejo
// reviews call that failed, a draft Forgejo pull request this
// service doesn't spend a call on), so a missing "review" means
// "unknown" and never "nobody reviewed it."
//
// GitHub: read from fields on the existing GraphQL query
// (reviewDecision, reviewRequests, latestReviews), so it adds no
// per-pull-request requests. Forgejo: requestedReviewers comes free
// on the pull request list, but approvals and the decision need one
// reviews call per open, non-draft pull request, cached until that
// pull request's updatedAt changes.
Review *ReviewState `json:"review,omitempty"`
// ReviewComments How many review comments the pull request has, the ones on a
// line of code. Ordinary conversation comments are counted apart,
// in `conversationComments`. Always present, and 0 when
// there are none or the forge can't say (a Forgejo draft or failed
// reviews call, GitHub's unauthenticated fallback). On GitHub it is read from
// the review threads in the pull request query, first 30 threads; on Forgejo it is the sum
// of each review's comment count, from the reviews call that already
// feeds `review`, so a draft (which makes no such call) reports 0.
ReviewComments int `json:"reviewComments"`
// ReviewRequestedFromMe True when this open, non-draft pull request asks the signed-in
// user to review it, matched without regard to case against the
// username saved in Settings for its forge. False when no
// username is saved for that forge. Always present.
ReviewRequestedFromMe bool `json:"reviewRequestedFromMe"`
// Stack Where this pull request sits in a stack of pull requests, or
// null when it is in none. A stack is worked out on the server:
// pull request B is stacked on A when B's base branch is A's head
// branch, in the same repository on the same forge, and neither is
// a fork. A branch with several open pull requests takes the one
// with the lowest number as parent, and a loop of branches is
// treated as no stack. The snapshot holds open pull requests
// only, so a base branch that no open pull request owns (a parent
// that already merged and was not retargeted) is not flagged.
Stack *StackPosition `json:"stack"`
// StackChildren The numbers of the open pull requests stacked directly on this
// one. Always a list, empty when none.
StackChildren []int `json:"stackChildren"`
// StackedOn The open pull request this one is stacked on, or null when its
// base is not another open pull request's head.
StackedOn *StackRef `json:"stackedOn"`
// Status The one reason this pull request is waiting on something or can't
// be merged, for a fixed place on its row: a check still
// running, a conflict, a draft, a parent it is stacked on, or, for
// an empty pull request, that there is nothing to merge. `code`,
// `message` and `next` are the same as on `allowedActions[].blocked`,
// and for a pull request that waiting or fixing can unlock they
// repeat Merge's blocked reason. An empty pull request offers no
// `merge` (only `close`), so this is where its reason lives. Null
// when nothing holds the pull request back. Always present.
Status *PullRequestStatus `json:"status"`
Title string `json:"title"`
// UnresolvedThreads How many review threads are still open, or null when the forge
// can't say. GitHub reports it from its review threads, except in the
// unauthenticated fallback, which has none. Forgejo reports no
// resolved state on a review without a call per review, so it is null
// there and a client shows the comment count without an open state.
UnresolvedThreads *int `json:"unresolvedThreads"`
// UpdateRequest An Update branch the forge accepted and that no snapshot has shown
// landing yet, or null. The server keeps it, so a reload during the
// wait still shows it. It is dropped once a snapshot from a fetch
// started after the request shows the pull request no longer
// behind, or when the pull request is gone. Held in memory per
// account: a server restart forgets it.
UpdateRequest *UpdateRequest `json:"updateRequest,omitempty"`
UpdatedAt time.Time `json:"updatedAt"`
// Url The real pull request URL on its own forge.
Url string `json:"url"`
}
// PullRequestKind What sort of pull request this is, decided by the server so no
// client keeps its own copy of the rule. `release`: release-please's,
// by its `autorelease:` label (a person opens these, so the label is
// the main signal, and it wins over any bot author), or, when the
// label is missing because release-please failed before applying it,
// by its head branch: `release-please--branches--<base branch>`
// (with `--components--<name>` after it for a repo that releases
// several components) in the same repository and aimed at that base
// branch. A fork's pull request is never a release. `dependency`:
// opened by Dependabot or Renovate, in either spelling of the login
// (the bare slug GraphQL gives, or REST's `[bot]` form), on either
// forge. `regular`: everything else. Always present.
type PullRequestKind string
// PullRequestActionRequest Which pull request to act on.
type PullRequestActionRequest struct {
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `json:"number"`
}
// PullRequestAutoUpdateRequest Which pull request, and whether the dashboard should update its
// branch automatically.
type PullRequestAutoUpdateRequest struct {
// Enabled `true` to update this pull request automatically, `false` to
// leave it alone, whatever its repo says. `null` or absent
// returns it to its repo's setting.
Enabled *bool `json:"enabled,omitempty"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `json:"number"`
}
// PullRequestDependabotActionRequest Which pull request to act on, and which of Dependabot's own comment commands to send.
type PullRequestDependabotActionRequest struct {
// Action Which Dependabot comment command to post — "@dependabot rebase" or "@dependabot recreate".
Action PullRequestDependabotActionRequestAction `json:"action"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `json:"number"`
}
// PullRequestDependabotActionRequestAction Which Dependabot comment command to post — "@dependabot rebase" or "@dependabot recreate".
type PullRequestDependabotActionRequestAction string
// PullRequestDetails What the pull request dialog shows.
type PullRequestDetails struct {
// CommentCount How many comments the forge has on the pull request.
CommentCount int `json:"commentCount"`
// Comments The conversation, oldest first, at most the first 50.
Comments []DetailsComment `json:"comments"`
// CommentsTruncated True when `commentCount` is more than the comments returned.
CommentsTruncated bool `json:"commentsTruncated"`
// Description A pull request's description, or the release notes of a release pull request.
Description DetailsBody `json:"description"`
// ReleaseNotes For a release pull request, the release notes it will publish (a
// release-please pull request's description is its changelog). Null
// for any other pull request, and for a release pull request this
// app can't identify. Never an empty string.
ReleaseNotes *DetailsBody `json:"releaseNotes"`
}
// PullRequestHideRequest Which pull request to hide, and for how long. Without `days` it stays
// hidden until it is restored.
type PullRequestHideRequest struct {
// Days Hide for this many days, then show it again on its own.
Days *int `json:"days,omitempty"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `json:"number"`
}
// PullRequestMergeRequest Which pull request to merge, and whether to delete its source branch afterwards.
type PullRequestMergeRequest struct {
// DeleteBranch Delete the source branch once the merge has landed.
DeleteBranch *bool `json:"deleteBranch,omitempty"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `json:"number"`
}
// PullRequestMergeResult What a merge that asked for `deleteBranch` did besides merging.
type PullRequestMergeResult struct {
// BranchDeletion What happened to the source branch. A fact for the client to word,
// never a reason to treat the merge as failed.
BranchDeletion BranchDeletion `json:"branchDeletion"`
}
// PullRequestStatus Why a pull request is waiting on something or can't be merged, in one
// place for a client to show. Same fields as
// `AllowedAction.blocked`, plus `action`.
type PullRequestStatus struct {
// Action The `allowedActions[].action` that clears this status, set only
// when `code` is `behind`: `update_branch`, or the bot's own rebase
// on a Dependabot or Renovate pull request. A client draws that
// action's button inside the status line and nowhere else on the
// row. Absent when no action clears it (a conflict, a check still
// running, a draft) and when the rebase is already requested, so
// it is not offered. When set it is the entry marked
// `primary`. The reverse doesn't hold: a behind bot pull request
// that waits on checks has a primary rebase and no `action` here.
Action *string `json:"action,omitempty"`
// Code The same codes as `AllowedAction.blocked.code`. The server may
// learn more, so a client should show `message` for a code it
// doesn't know. Declared with `x-extensible-enum`.
Code string `json:"code"`
// Message Plain words, safe to show a person.
Message string `json:"message"`
// Next What unlocks it or what to do about it, when there is something.
Next *string `json:"next,omitempty"`
}
// QueuedAction A safe action queued to run when a rate-limited forge resets. A
// client shows a `queued` one as "Update branch queued for 14:32"
// with Cancel, and a final one in its Activity list.
type QueuedAction struct {
Action QueuedActionAction `json:"action"`
// Code Only on `skipped` and `failed`. A value of ActionError.code,
// for example `already_merged`, `already_closed`, `not_open`,
// `already_up_to_date`, `conflict`, `already_requested`,
// `permission`.
Code *string `json:"code,omitempty"`
CreatedAt time.Time `json:"createdAt"`
// FinishedAt Only on a final status.
FinishedAt *time.Time `json:"finishedAt,omitempty"`
Forge Forge `json:"forge"`
// FullName "owner/repo".
FullName string `json:"fullName"`
// Id Opaque. What DELETE /api/queued-actions/{id} takes.
Id string `json:"id"`
// Message Only on `skipped` and `failed`. Plain words safe to show a person.
Message *string `json:"message,omitempty"`
Number int `json:"number"`
// RunAt When the forge's budget comes back, which is when the server
// looks again. If the budget is spent again by then, it moves to
// the new reset instead of failing.
RunAt time.Time `json:"runAt"`
// Status `queued`: waiting for the reset. `done`: the action ran.
// `skipped`: the server re-read the pull request at the reset and
// it no longer needed the action, so nothing was done; `code` and
// `message` say why ("Already merged"). `failed`: the action ran
// and the forge refused, with the structured `code` and `message`
// an immediate action would have answered.
Status QueuedActionStatus `json:"status"`
}
// QueuedActionAction defines model for QueuedAction.Action.
type QueuedActionAction string
// QueuedActionStatus `queued`: waiting for the reset. `done`: the action ran.
// `skipped`: the server re-read the pull request at the reset and
// it no longer needed the action, so nothing was done; `code` and
// `message` say why ("Already merged"). `failed`: the action ran
// and the forge refused, with the structured `code` and `message`
// an immediate action would have answered.
type QueuedActionStatus string
// QueuedActionRequest Which safe action to queue, on which pull request.
type QueuedActionRequest struct {
// Action The `AllowedAction.action` to run at the reset. Only these
// three are queueable; Merge, Close and the rest answer 400.
Action QueuedActionRequestAction `json:"action"`
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `json:"number"`
}
// QueuedActionRequestAction The `AllowedAction.action` to run at the reset. Only these
// three are queueable; Merge, Close and the rest answer 400.
type QueuedActionRequestAction string
// RateLimit One of a forge API's own request budgets for the credential the last refresh used — see ForgeHealth.rateLimitGraphQL/rateLimitREST for which budget this is and when each is (or isn't) reported.
type RateLimit struct {
// Cost The point price the most recent call was actually charged — GraphQL-specific, since a REST request has no separate cost concept beyond the flat one-request-one-point REST's own budget already counts. Omitted for a REST-sourced RateLimit.
Cost *int `json:"cost,omitempty"`
// Limit Requests allowed per window.
Limit int `json:"limit"`
// Remaining Requests left in the current window.
Remaining int `json:"remaining"`
// ResetsAt When the window resets and remaining goes back to limit.
ResetsAt time.Time `json:"resetsAt"`
}
// Reaction defines model for Reaction.
type Reaction struct {
// Count How many people gave this reaction.
Count int `json:"count"`
// Logins The first few of them, at most 10. `count` is the full number.
Logins []string `json:"logins"`
}
// Reactions The two reactions the dialog shows, `+1` and `-1` on both forges.
type Reactions struct {
ThumbsDown Reaction `json:"thumbsDown"`
ThumbsUp Reaction `json:"thumbsUp"`
}
// Ready defines model for Ready.
type Ready struct {
// Goroutines Goroutines the process holds right now.
Goroutines int `json:"goroutines"`
Status ReadyStatus `json:"status"`
// Threads OS threads the process holds right now, read from
// `/proc/self/status`. Left out where that can't be read.
Threads *int `json:"threads,omitempty"`
}
// ReadyStatus defines model for Ready.Status.
type ReadyStatus string
// RegistrationStatus defines model for RegistrationStatus.
type RegistrationStatus struct {
// Open True only when the instance has zero registered users.
Open bool `json:"open"`
}
// ReleaseDetails What the release dialog shows for a published release.
type ReleaseDetails struct {
// Name The release's title. Empty when the forge has none, and then the tag is the title.
Name string `json:"name"`
// Notes A pull request's description, or the release notes of a release pull request.
Notes DetailsBody `json:"notes"`
// PublishedAt When it was published, RFC 3339. Always set, since a release with no publish date is a 404 instead.
PublishedAt string `json:"publishedAt"`
Tag string `json:"tag"`
// Url The release's page on the forge.
Url string `json:"url"`
}
// RenameCredentialRequest defines model for RenameCredentialRequest.
type RenameCredentialRequest struct {
// Label The new name. Trimmed first; blank is refused.
Label string `json:"label"`
}
// RepoIgnoreRequest Which repo to ignore, and in which scope(s). At least one
// of prs/issues must be true — a request with both false is
// rejected with 400 rather than silently doing nothing; use POST
// /api/repos/unignore to clear both at once instead.
type RepoIgnoreRequest struct {
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
// Issues Whether to ignore this repo's issues.
Issues bool `json:"issues"`
// Prs Whether to ignore this repo's pull requests.
Prs bool `json:"prs"`
}
// RepoStatus One tracked repository, whether or not it currently has anything
// open — repoCount alone can't name it, and it wouldn't otherwise
// appear anywhere pullRequests/issues don't already mention it.
type RepoStatus struct {
// AutoUpdateBranch Whether the signed-in user has turned on automatic branch
// updates for this repo — any of its pull requests the
// background refresh finds behind its base branch gets updated
// the same way a manual "Update branch" click would. A
// Dependabot pull request gets its own rebase comment instead,
// and a Renovate one its own rebase label, mirroring their
// manual action buttons. A release-please pull request is
// always skipped by this background pass, so no unattended write
// lands on a release branch. The dashboard's manual "Update
// branch" button is still offered on it, since release-please
// has no rebase action of its own.
AutoUpdateBranch bool `json:"autoUpdateBranch"`
// CanManageWebhooks Whether the signed-in user's own permission on this repo is
// enough to list/create its webhooks — GitHub requires admin
// specifically (write/maintain can push but still 404 on the
// hooks endpoint, by GitHub's own design); Forgejo's equivalent
// is its own admin permission flag. Always false for a repo
// reached through an unauthenticated, username-only listing.
// A point-in-time snapshot: a permission change since the last
// refresh can still make a following ensure-webhook call fail
// despite this having said true. For a GitHub App connection
// there is no user role to read, so this is true when listing
// the repo's webhooks worked on the last refresh.
CanManageWebhooks bool `json:"canManageWebhooks"`
// FailingForGood Present and true when failingSince is older than the cutoff the
// refresh schedule uses for a repository that keeps failing, a
// fixed multiple of the refresh interval. Retrying has not helped
// by then. The server works this out when it builds the response,
// so a client shows it without doing the arithmetic, and a
// repository crosses the cutoff in what the client sees at the
// next refresh. Absent otherwise.
FailingForGood *bool `json:"failingForGood,omitempty"`
// FailingSince Present when the last fetch of this repository failed, and the
// time of the first failure in the run it is still part of. Its
// pull requests and issues are then the last good ones. Absent
// when the repository is fetching fine. It is not saved, so it
// restarts from the first failure after a restart.
FailingSince *time.Time `json:"failingSince,omitempty"`
Forge Forge `json:"forge"`
// FullName Examples: alrayyes/forge-dashboard
FullName string `json:"fullName"`
// HasWebhook Whether this app has ever recorded a signature-verified
// webhook delivery for this repo. Passive: it reflects a real
// delivery having arrived, not whether a webhook object exists
// on the forge — a correctly configured webhook that just
// hasn't fired yet still reads false here, the same as a
// misconfigured one would.
HasWebhook bool `json:"hasWebhook"`
// Ignored Whether the signed-in user has ignored this repo in either
// scope below — true whenever ignoredPRs or
// ignoredIssues is true. The repo itself still appears here
// with accurate hasWebhook/canManageWebhooks regardless.
Ignored bool `json:"ignored"`
// IgnoredIssues Whether the signed-in user has ignored this repo's issues
// specifically — its issues entries are excluded from
// this same response and from Insights.
IgnoredIssues bool `json:"ignoredIssues"`
// IgnoredPRs Whether the signed-in user has ignored this repo's pull
// requests specifically — its pullRequests entries are
// excluded from this same response and from Insights.
IgnoredPRs bool `json:"ignoredPRs"`
// LogoUrl The repository's own logo, only when it has one: a GitHub
// repository's custom social preview image, or a Forgejo
// repository's own avatar. Absent otherwise, and never the
// generated social card GitHub shows for a repository with none,
// nor the owner's avatar. Always an https URL, passed through
// unchanged and never proxied: on GitHub exactly
// repository-images.githubusercontent.com, on Forgejo the
// instance's own host. A GitHub custom image is a wide banner,
// not a square logo.
// Absent for a repository reached through an unauthenticated,
// username-only listing, since that listing carries no image.
//
//
// Examples: https://repository-images.githubusercontent.com/123/abc
LogoUrl *string `json:"logoUrl,omitempty"`
// RebaseBots Whether the signed-in user has turned on rebasing bot pull
// requests for this repo. A behind Dependabot or Renovate pull
// request gets the bot's own rebase, whatever the repo's
// automatic branch update setting says. Human, draft and
// release-please pull requests are not covered.
RebaseBots bool `json:"rebaseBots"`
// Url The repo's own page on its forge, for linking out.
//
// Examples: https://github.com/alrayyes/forge-dashboard
Url string `json:"url"`
// WebhookLockedByConnection Present and true when canManageWebhooks is false because the
// connection itself can't manage webhooks on this repo (GitHub
// refused the hooks listing: a GitHub App without the Webhooks
// permission, or a repo outside its installation; Forgejo sent no
// permissions object for the repo), rather than the signed-in
// user's role. A failed or rate-limited listing doesn't
// set it. Absent otherwise.
WebhookLockedByConnection *bool `json:"webhookLockedByConnection,omitempty"`
// WebhookNeedsToken Present and true when canManageWebhooks is false because no
// token is saved for the forge. The repos then came from a
// username-only listing, which the forge answers as an anonymous
// caller, so the permissions it reports say nothing about the
// signed-in user's role. Saving a token with the webhook scope in
// Settings is the fix. Absent when a token is saved, whatever
// role it holds. Set today for Forgejo only.
WebhookNeedsToken *bool `json:"webhookNeedsToken,omitempty"`
}
// ReviewState Where a pull request stands on code review. The whole object is
// omitted when the owning forge couldn't report it (a Forgejo
// reviews call that failed, a draft Forgejo pull request this
// service doesn't spend a call on), so a missing "review" means
// "unknown" and never "nobody reviewed it."
//
// GitHub: read from fields on the existing GraphQL query
// (reviewDecision, reviewRequests, latestReviews), so it adds no
// per-pull-request requests. Forgejo: requestedReviewers comes free
// on the pull request list, but approvals and the decision need one
// reviews call per open, non-draft pull request, cached until that
// pull request's updatedAt changes.
type ReviewState struct {
// Approvals Reviewers whose latest review is an approval. GitHub counts
// at most the 10 most recent reviewers.
Approvals int `json:"approvals"`
// Decision "approved" and "changes_requested" mean what they say.
// "review_required" means a review is still outstanding: GitHub
// says so itself when branch protection requires one, and on
// Forgejo it means reviewers are requested and nobody has
// approved. "none" means no review activity and nothing
// required or requested.
Decision ReviewStateDecision `json:"decision"`
// RequestedReviewers Users and teams still asked to review.
RequestedReviewers int `json:"requestedReviewers"`
}
// ReviewStateDecision "approved" and "changes_requested" mean what they say.
// "review_required" means a review is still outstanding: GitHub
// says so itself when branch protection requires one, and on
// Forgejo it means reviewers are requested and nobody has
// approved. "none" means no review activity and nothing
// required or requested.
type ReviewStateDecision string
// RunEvent The `data` of a `run` event on the dashboard stream: the jobs of
// one workflow run attempt of one subject, or one check that belongs
// to no run. A later event with the same `key` replaces the earlier
// one. An event with no `key` and no `checks` says the subject has
// none. An event with `error` set stands in for the whole listing.
type RunEvent struct {
// Checks Absent when `gone` or `error` is set.
Checks *[]Check `json:"checks,omitempty"`
// CompletedAt When the forge says the run attempt finished. Absent until it
// has. GitHub gives no finish time for a run, so it is always
// absent there; the page can take the latest job's
// `completedAt`.
CompletedAt *time.Time `json:"completedAt,omitempty"`
// Conclusion How the run attempt ended, in the forge's own word, once its
// `status` is "completed". It can differ from its jobs: a run
// can fail while one of its jobs passed. Absent whenever
// `status` is.
Conclusion *CheckConclusion `json:"conclusion,omitempty"`
Error *string `json:"error,omitempty"`
// Final Set on the last event of a listing, so a client can draw
// once the whole listing has arrived.
Final *bool `json:"final,omitempty"`
Forge string `json:"forge"`
// FullName The repository, as `owner/repo`.
FullName string `json:"fullName"`
// Gone The unit named by `key` is no longer listed; drop it.
Gone *bool `json:"gone,omitempty"`
// Key Names the unit this event replaces: `run/<runId>/<attempt>`
// for a run attempt, `job/<url>|<name>` for a check with no
// run. Absent when the subject has no checks or on an error.
Key *string `json:"key,omitempty"`
Kind RunEventKind `json:"kind"`
// Number The pull request number. Required for `pull_request`.
Number *int `json:"number,omitempty"`
// RunAttempt Absent when the check has no run or the forge doesn't
// number attempts.
RunAttempt *int64 `json:"runAttempt,omitempty"`
// RunId Absent for a check with no run.
RunId *int64 `json:"runId,omitempty"`
// StartedAt When the forge says the run attempt started. Absent until it
// has, and when the forge doesn't say.
StartedAt *time.Time `json:"startedAt,omitempty"`
// Status How far the run attempt itself has got, as the forge reports
// it. Forgejo's own status words fold onto the four values
// (running is `in_progress`; waiting, blocked and unknown are
// `queued`); a GitHub status other than these four (requested,
// pending) is `queued`. Absent for a check with no run (a
// legacy commit status, a third-party check run, a GitHub
// check run whose run the forge's lists don't hold) and for a
// run the forge gave no status.
Status *CheckStatus `json:"status,omitempty"`
}
// RunEventKind defines model for RunEvent.Kind.
type RunEventKind string
// SessionUser defines model for SessionUser.
type SessionUser struct {
DisplayName string `json:"displayName"`
Username string `json:"username"`
}
// SettingsRequest Replaces the signed-in user's saved GitHub/Forgejo configuration.
// A blank `githubToken` or `forgejoToken` keeps whatever token is
// already saved for that forge rather than clearing it — this is
// the only way to update the username fields without having to
// resubmit a token you don't want to re-paste. githubAppInstallationId
// is different: a plain replace like githubUsername, not coalesced —
// 0 or omitted really does disconnect the App. Rejected (400) if
// the server has no GitHub App configured (see
// SettingsResponse.githubAppConfigured). Theme isn't settable
// here at all — see PUT /api/settings/theme.
type SettingsRequest struct {
ForgejoToken *string `json:"forgejoToken,omitempty"`
// ForgejoUrl Required, once the save is merged with what is already stored,
// whenever a Forgejo token or username is set. That depends on
// stored state, so a schema alone can't express it: a save that
// breaks it is a 400 naming `forgejoUrl`.
//
// Must be a plain `http://` or `https://` base URL with a host,
// optionally with a path prefix. One that carries a username,
// password, query string or fragment, or has another scheme, is a
// 400 naming `forgejoUrl`, and nothing is saved. The error never
// repeats the URL.
ForgejoUrl *string `json:"forgejoUrl,omitempty"`
ForgejoUsername *string `json:"forgejoUsername,omitempty"`
// GithubAppInstallationId 0 means none. A negative or non-integer value is a 400 naming
// this field, as is any value on a server with no GitHub App
// configured.
GithubAppInstallationId *int64 `json:"githubAppInstallationId,omitempty"`
GithubToken *string `json:"githubToken,omitempty"`
GithubUsername *string `json:"githubUsername,omitempty"`
// HideDependencyDashboard Replaces the saved choice; omitted means false, like
// `renovateAuthors`, so a form sends it on every save. See
// SettingsResponse.hideDependencyDashboard.
HideDependencyDashboard *bool `json:"hideDependencyDashboard,omitempty"`
// IgnoredTitles Replaces the saved list; omitted or empty clears it. Entries are
// trimmed; blanks and repeats (ignoring case) are dropped. Each
// must compile as a Go RE2 regular expression: one that does not
// is a 400 naming `ignoredTitles` and the entry, with the reason in
// plain words ("ignoredTitles entry 2, "(": missing closing )"),
// and nothing is saved. More than 20 entries, or an entry over 200
// characters, is a 400 too. See SettingsResponse.ignoredTitles.
IgnoredTitles *[]string `json:"ignoredTitles,omitempty"`
// RenovateAuthors Replaces the saved list. Entries are trimmed; blanks and
// repeats (ignoring case) are dropped. Omitted or empty clears it.
RenovateAuthors *[]string `json:"renovateAuthors,omitempty"`
RenovateRebaseLabel *string `json:"renovateRebaseLabel,omitempty"`
}
// SettingsResponse The signed-in user's own GitHub/Forgejo configuration. Never
// includes a forge token's value — only whether one is currently
// saved, so the UI can show a "Configured" badge without the secret
// ever reaching the browser. webhookToken/webhookSecret are the
// exception: they're ours to hand back in the clear, since the user
// has to paste them into the forge's own webhook setup.
type SettingsResponse struct {
// ForgejoTokenSet Whether a Forgejo token is currently saved.
ForgejoTokenSet bool `json:"forgejoTokenSet"`
// ForgejoUrl Always without a username, password, query string or fragment,
// even if the stored value predates those being refused.
ForgejoUrl string `json:"forgejoUrl"`
// ForgejoUsername Used as a token-free public-repos fallback when no Forgejo token is set.
ForgejoUsername string `json:"forgejoUsername"`
// GithubAppConfigured Whether this server has a GitHub App configured at all
// (server-wide GITHUB_APP_ID/GITHUB_APP_PRIVATE_KEY_BASE64 —
// not a saved setting). The Settings page uses this to
// explain why githubAppInstallationId can't be saved when
// it's false.
GithubAppConfigured bool `json:"githubAppConfigured"`
// GithubAppInstallationId The installation ID of the alrayyes-automation GitHub App
// this user has connected, or 0 if none. Not a
// secret — it's an opaque integer GitHub already shows the
// user on its own installation settings page — so, unlike
// githubTokenSet, this round-trips as a plain value. Takes
// precedence over a saved githubToken whenever both are set
// and the server has an App configured (see
// githubAppConfigured).
GithubAppInstallationId int64 `json:"githubAppInstallationId"`
// GithubTokenSet Whether a GitHub token is currently saved.
GithubTokenSet bool `json:"githubTokenSet"`
// GithubUsername Used as a token-free public-repos fallback when no GitHub token is set.
GithubUsername string `json:"githubUsername"`
// HideDependencyDashboard Whether the user hides the bot-kept "Dependency Dashboard" issue
// everywhere: the server leaves a `housekeeping` issue out of the
// `issues` of GET /api/dashboard and its stream, and out of every
// count and total built from them (`navCounts`, Insights). Always
// present once the server applies it.
HideDependencyDashboard *bool `json:"hideDependencyDashboard,omitempty"`
// IgnoredTitleCounts Per pattern in `ignoredTitles`, same order and same length: how
// many of the viewer's currently open issues that pattern matches
// on its own. An issue two patterns match counts for both, so the
// entries can sum to more than `settingsHiddenIssueCount`. Every
// entry is null while the count is unknown (the viewer's first
// refresh has not finished, see `firstRefreshDone` on the
// dashboard snapshot, or there is no snapshot), never a made-up 0.
// Only this viewer's issues are counted. On GET and on the PUT
// response alike: a PUT returns the counts for the list it just
// saved, worked out from the issues the viewer had before the save.
IgnoredTitleCounts []*int `json:"ignoredTitleCounts"`
// IgnoredTitles Patterns for issue titles to leave out, in the server's own
// regular expression syntax (Go RE2: no lookahead and no
// backreferences). A pattern matches anywhere in the title and
// ignores case; an issue matching any one is left out of `issues`
// and of every count and total built from them, the same as
// `hideDependencyDashboard`. Always present once the server
// applies it. Empty means none.
IgnoredTitles *[]string `json:"ignoredTitles,omitempty"`
// RenovateAuthors The logins that are Renovate on the user's forges. On GitHub the
// App's own `renovate` and `renovate[bot]` are always recognised.
// A Forgejo or GitLab instance has no App: Renovate runs there as
// an ordinary account with whatever name the instance gave it, so
// the user lists it here. A pull request by one of these gets
// Renovate's own rebase, not Update branch, and is a `dependency`.
// Matched case-insensitively. Empty means only the GitHub slugs.
RenovateAuthors []string `json:"renovateAuthors"`
// RenovateRebaseLabel The label Renovate's own rebase/retry trigger listens for on
// a repo (Renovate's own `rebaseLabel` config option — genuinely
// per-repo configurable, so this is a user-set override rather
// than a hardcoded constant). Empty means Renovate's own
// documented default, `rebase`.
RenovateRebaseLabel string `json:"renovateRebaseLabel"`
// Theme The signed-in user's own theme preference. Empty
// means "system" — follow the browser's prefers-color-scheme
// rather than a saved choice. Set only from Settings; every
// other page reads it via the lightweight
// GET /api/settings/theme instead of this endpoint.
Theme SettingsResponseTheme `json:"theme"`
// Timezone The signed-in user's own time zone as an IANA name such as
// `Europe/Amsterdam`. Empty means the browser's own zone. Set only
// from Settings (PUT /api/settings/timezone); every other page reads
// it via GET /api/settings/timezone.
Timezone *string `json:"timezone,omitempty"`
// WebhookSecret Pasted into the forge's own webhook "Secret" field, used to
// verify the signature header on incoming webhook deliveries
// (`X-Hub-Signature-256` on GitHub, `X-Forgejo-Signature` on
// Forgejo). Never appears in the webhook URL itself.
WebhookSecret string `json:"webhookSecret"`
// WebhookToken Identifies this user in a webhook URL
// (`/api/webhooks/{provider}/{webhookToken}`). Generated on
// first visit to Settings and stable after that.
WebhookToken string `json:"webhookToken"`
}
// SettingsResponseTheme The signed-in user's own theme preference. Empty
// means "system" — follow the browser's prefers-color-scheme
// rather than a saved choice. Set only from Settings; every
// other page reads it via the lightweight
// GET /api/settings/theme instead of this endpoint.
type SettingsResponseTheme string
// SettingsSummary The signed-in user's settings as `GET /api/settings/summary` and the
// `get_settings` MCP tool return them: every field of
// SettingsResponse except `webhookToken` and `webhookSecret`, which are
// never part of it, plus `webhookConfigured`. No forge token appears,
// only whether one is set. Field meanings are those of the same-named
// SettingsResponse properties.
type SettingsSummary struct {
ForgejoTokenSet bool `json:"forgejoTokenSet"`
ForgejoUrl string `json:"forgejoUrl"`
ForgejoUsername string `json:"forgejoUsername"`
GithubAppConfigured bool `json:"githubAppConfigured"`
GithubAppInstallationId int64 `json:"githubAppInstallationId"`
GithubTokenSet bool `json:"githubTokenSet"`
GithubUsername string `json:"githubUsername"`
HideDependencyDashboard bool `json:"hideDependencyDashboard"`
IgnoredTitleCounts []*int `json:"ignoredTitleCounts"`
IgnoredTitles []string `json:"ignoredTitles"`
RenovateAuthors []string `json:"renovateAuthors"`
RenovateRebaseLabel string `json:"renovateRebaseLabel"`
Theme SettingsSummaryTheme `json:"theme"`
Timezone string `json:"timezone"`
// WebhookConfigured Whether this user's webhook token and secret exist. They are
// created the first time the Settings page reads
// `GET /api/settings`, never by this read, so this is false for a
// user who has not opened Settings yet.
WebhookConfigured bool `json:"webhookConfigured"`
}
// SettingsSummaryTheme defines model for SettingsSummary.Theme.
type SettingsSummaryTheme string
// StackPosition defines model for StackPosition.
type StackPosition struct {
// Position 1 for the pull request at the bottom of the stack (the one
// targeting a branch no open pull request owns), 2 for one
// stacked directly on it, and so on.
Position int `json:"position"`
// Size How many open pull requests the stack holds.
Size int `json:"size"`
}
// StackRef defines model for StackRef.
type StackRef struct {
Number int `json:"number"`
Url string `json:"url"`
}
// StreamWatchRequest defines model for StreamWatchRequest.
type StreamWatchRequest struct {
// Refresh List every subject again, including the ones already watched.
// A client sends it after an action that changes the jobs.
Refresh *bool `json:"refresh,omitempty"`
// StreamId The `sid` the stream was opened with.
StreamId string `json:"streamId"`
Subjects []CheckSubject `json:"subjects"`
}
// ThemeRequest See PUT /api/settings/theme's own description.
type ThemeRequest struct {
Theme ThemeRequestTheme `json:"theme"`
}
// ThemeRequestTheme defines model for ThemeRequest.Theme.
type ThemeRequestTheme string
// ThemeResponse See GET /api/settings/theme's own description.
type ThemeResponse struct {
Theme ThemeResponseTheme `json:"theme"`
}
// ThemeResponseTheme defines model for ThemeResponse.Theme.
type ThemeResponseTheme string
// TimezoneRequest See PUT /api/settings/timezone's own description.
type TimezoneRequest struct {
// Timezone An IANA zone name, or empty for the browser's own. `Local` is refused.
Timezone string `json:"timezone"`
}
// TimezoneResponse See GET /api/settings/timezone's own description.
type TimezoneResponse struct {
// Timezone An IANA zone name such as `Europe/Amsterdam`, or empty for the browser's own.
//
// Examples: Europe/Amsterdam
Timezone string `json:"timezone"`
}
// UpdateRequest defines model for UpdateRequest.
type UpdateRequest struct {
// ExpiresAt When the server stops waiting in the current phase: 5 minutes
// after the request while `queued`.
ExpiresAt time.Time `json:"expiresAt"`
// Phase `queued`: accepted, and the pull request is still behind.
// `expired`: still behind after 5 minutes. An expired request stays
// until the pull request is gone, a new request replaces it, or an
// hour passes.
Phase UpdateRequestPhase `json:"phase"`
RequestedAt time.Time `json:"requestedAt"`
}
// UpdateRequestPhase `queued`: accepted, and the pull request is still behind.
// `expired`: still behind after 5 minutes. An expired request stays
// until the pull request is gone, a new request replaces it, or an
// hour passes.
type UpdateRequestPhase string
// Version defines model for Version.
type Version struct {
// Version The release tag this binary was built from, with no leading
// "v" — or "dev" for a build outside the release pipeline.
//
//
// Examples: 0.12.1, dev
Version string `json:"version"`
}
// WebAuthnCeremonyOptions The WebAuthn specification's own JSON shape for
// `PublicKeyCredentialCreationOptions`/`PublicKeyCredentialRequestOptions`
// (the begin responses) and `PublicKeyCredential`
// (the finish request bodies) — passed through to and from the
// browser's own `navigator.credentials` API untouched, so this
// contract intentionally doesn't re-model WebAuthn's own schema.
type WebAuthnCeremonyOptions map[string]interface{}
// WebhookEnsureRequest Which repo to create or fix up a webhook on.
type WebhookEnsureRequest struct {
Forge Forge `json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `json:"fullName"`
}
// HeaderBackgroundRead Examples: true
type HeaderBackgroundRead = string
// PathTokenID defines model for PathTokenID.
type PathTokenID = string
// PathWebhookToken defines model for PathWebhookToken.
type PathWebhookToken = string
// QueryIncludeDrafts defines model for QueryIncludeDrafts.
type QueryIncludeDrafts = bool
// QueryIncludeHidden defines model for QueryIncludeHidden.
type QueryIncludeHidden = bool
// AuthRateLimited defines model for AuthRateLimited.
type AuthRateLimited = Error
// FinishAddCredentialParams defines parameters for FinishAddCredential.
type FinishAddCredentialParams struct {
// Label A name the user recognizes, e.g. "MacBook" or "YubiKey",
// prompted for at registration time, never derived
// from the authenticator itself. Trimmed first, then must be 1 to
// 64 characters, the same rule as renaming a passkey.
Label string `form:"label" json:"label"`
}
// GetCheckLogParams defines parameters for GetCheckLog.
type GetCheckLogParams struct {
Forge Forge `form:"forge" json:"forge"`
// FullName "owner/repo" of the repository the check ran in.
FullName string `form:"fullName" json:"fullName"`
// JobId Matching a Check.jobId.
JobId int `form:"jobId" json:"jobId"`
// Excerpt True to answer the job's excerpt (the last lines, at most 2,000
// characters) instead of its output. Forgejo only; any other forge
// answers 400.
Excerpt *bool `form:"excerpt,omitempty" json:"excerpt,omitempty"`
}
// GetDashboardParams defines parameters for GetDashboard.
type GetDashboardParams struct {
// IncludeDrafts Whether draft pull requests are in `pullRequests`. Defaults to
// `false`: nothing can be merged, auto-merged or updated on a draft,
// so a draft is left out and counted in the response's `hiddenDrafts`
// instead. The stream and the refresh endpoint take the same
// parameter, so every snapshot a client receives follows one rule.
IncludeDrafts *QueryIncludeDrafts `form:"includeDrafts,omitempty" json:"includeDrafts,omitempty"`
// IncludeHidden Whether pull requests the user hid (`POST /api/pull-requests/hide`)
// are in `pullRequests`, marked `hidden: true`. Defaults to `false`: a
// hidden pull request is left out and counted in the response's
// `hiddenPullRequests`. A client lists the hidden ones, to offer a
// Restore, by asking with `true`. The stream and the refresh endpoint
// take the same parameter.
IncludeHidden *QueryIncludeHidden `form:"includeHidden,omitempty" json:"includeHidden,omitempty"`
// XBackgroundRead Any value says the read is the page's own timed refresh of its data,
// not something a person asked for. Such a read does not count as use
// of the dashboard, so a tab nobody is looking at cannot keep the
// scheduled refresh running by polling.
XBackgroundRead *HeaderBackgroundRead `json:"X-Background-Read,omitempty"`
}
// RefreshDashboardParams defines parameters for RefreshDashboard.
type RefreshDashboardParams struct {
// IncludeDrafts Whether draft pull requests are in `pullRequests`. Defaults to
// `false`: nothing can be merged, auto-merged or updated on a draft,
// so a draft is left out and counted in the response's `hiddenDrafts`
// instead. The stream and the refresh endpoint take the same
// parameter, so every snapshot a client receives follows one rule.
IncludeDrafts *QueryIncludeDrafts `form:"includeDrafts,omitempty" json:"includeDrafts,omitempty"`
// IncludeHidden Whether pull requests the user hid (`POST /api/pull-requests/hide`)
// are in `pullRequests`, marked `hidden: true`. Defaults to `false`: a
// hidden pull request is left out and counted in the response's
// `hiddenPullRequests`. A client lists the hidden ones, to offer a
// Restore, by asking with `true`. The stream and the refresh endpoint
// take the same parameter.
IncludeHidden *QueryIncludeHidden `form:"includeHidden,omitempty" json:"includeHidden,omitempty"`
}
// StreamDashboardParams defines parameters for StreamDashboard.
type StreamDashboardParams struct {
// IncludeDrafts Whether draft pull requests are in `pullRequests`. Defaults to
// `false`: nothing can be merged, auto-merged or updated on a draft,
// so a draft is left out and counted in the response's `hiddenDrafts`
// instead. The stream and the refresh endpoint take the same
// parameter, so every snapshot a client receives follows one rule.
IncludeDrafts *QueryIncludeDrafts `form:"includeDrafts,omitempty" json:"includeDrafts,omitempty"`
// IncludeHidden Whether pull requests the user hid (`POST /api/pull-requests/hide`)
// are in `pullRequests`, marked `hidden: true`. Defaults to `false`: a
// hidden pull request is left out and counted in the response's
// `hiddenPullRequests`. A client lists the hidden ones, to offer a
// Restore, by asking with `true`. The stream and the refresh endpoint
// take the same parameter.
IncludeHidden *QueryIncludeHidden `form:"includeHidden,omitempty" json:"includeHidden,omitempty"`
// Sid A random id the client makes up for this connection, 8 to 64
// letters, digits and dashes. It names the stream for the watch
// call. Anything else is ignored and the stream watches nothing.
Sid *string `form:"sid,omitempty" json:"sid,omitempty"`
}
// GetIssueDetailsParams defines parameters for GetIssueDetails.
type GetIssueDetailsParams struct {
Forge Forge `form:"forge" json:"forge"`
// FullName "owner/repo", matching an Issue.repo from GET /api/dashboard.
FullName string `form:"fullName" json:"fullName"`
// Number Matching an Issue.number from GET /api/dashboard.
Number int `form:"number" json:"number"`
}
// ListAdvisoriesParams defines parameters for ListAdvisories.
type ListAdvisoriesParams struct {
Forge Forge `form:"forge" json:"forge"`
// FullName "owner/repo", matching a MainBranch.fullName from GET /api/main-branches.
FullName string `form:"fullName" json:"fullName"`
}
// GetPullRequestDetailsParams defines parameters for GetPullRequestDetails.
type GetPullRequestDetailsParams struct {
Forge Forge `form:"forge" json:"forge"`
// FullName "owner/repo", matching a Repo.fullName from GET /api/dashboard.
FullName string `form:"fullName" json:"fullName"`
// Number Matching a PullRequest.number from GET /api/dashboard.
Number int `form:"number" json:"number"`
}
// GetReleaseDetailsParams defines parameters for GetReleaseDetails.
type GetReleaseDetailsParams struct {
Forge Forge `form:"forge" json:"forge"`
// FullName "owner/repo", matching a MainBranch.fullName from GET /api/main-branches.
FullName string `form:"fullName" json:"fullName"`
// Tag Matching a MainBranchRelease.tag from GET /api/main-branches.
Tag string `form:"tag" json:"tag"`
}
// ReceiveForgejoWebhookJSONBody defines parameters for ReceiveForgejoWebhook.
type ReceiveForgejoWebhookJSONBody = map[string]interface{}
// ReceiveGitHubWebhookJSONBody defines parameters for ReceiveGitHubWebhook.
type ReceiveGitHubWebhookJSONBody = map[string]interface{}
// FinishAddCredentialJSONRequestBody defines body for FinishAddCredential for application/json ContentType.
type FinishAddCredentialJSONRequestBody = WebAuthnCeremonyOptions
// RenameCredentialJSONRequestBody defines body for RenameCredential for application/json ContentType.
type RenameCredentialJSONRequestBody = RenameCredentialRequest
// FinishLoginJSONRequestBody defines body for FinishLogin for application/json ContentType.
type FinishLoginJSONRequestBody = WebAuthnCeremonyOptions
// FinishRegistrationJSONRequestBody defines body for FinishRegistration for application/json ContentType.
type FinishRegistrationJSONRequestBody = WebAuthnCeremonyOptions
// CancelWorkflowRunJSONRequestBody defines body for CancelWorkflowRun for application/json ContentType.
type CancelWorkflowRunJSONRequestBody = CancelRunRequest
// WatchDashboardStreamChecksJSONRequestBody defines body for WatchDashboardStreamChecks for application/json ContentType.
type WatchDashboardStreamChecksJSONRequestBody = StreamWatchRequest
// CloseIssueJSONRequestBody defines body for CloseIssue for application/json ContentType.
type CloseIssueJSONRequestBody = IssueActionRequest
// CommentOnIssueJSONRequestBody defines body for CommentOnIssue for application/json ContentType.
type CommentOnIssueJSONRequestBody = IssueCommentRequest
// ReopenIssueJSONRequestBody defines body for ReopenIssue for application/json ContentType.
type ReopenIssueJSONRequestBody = IssueActionRequest
// RerunMainBranchChecksJSONRequestBody defines body for RerunMainBranchChecks for application/json ContentType.
type RerunMainBranchChecksJSONRequestBody = MainBranchRerunRequest
// ReportDashboardPresenceJSONRequestBody defines body for ReportDashboardPresence for application/json ContentType.
type ReportDashboardPresenceJSONRequestBody = PresenceReport
// EnablePullRequestAutoMergeJSONRequestBody defines body for EnablePullRequestAutoMerge for application/json ContentType.
type EnablePullRequestAutoMergeJSONRequestBody = PullRequestActionRequest
// CancelPullRequestAutoMergeJSONRequestBody defines body for CancelPullRequestAutoMerge for application/json ContentType.
type CancelPullRequestAutoMergeJSONRequestBody = PullRequestActionRequest
// SetPullRequestAutoUpdateJSONRequestBody defines body for SetPullRequestAutoUpdate for application/json ContentType.
type SetPullRequestAutoUpdateJSONRequestBody = PullRequestAutoUpdateRequest
// ClosePullRequestJSONRequestBody defines body for ClosePullRequest for application/json ContentType.
type ClosePullRequestJSONRequestBody = PullRequestActionRequest
// PostPullRequestDependabotActionJSONRequestBody defines body for PostPullRequestDependabotAction for application/json ContentType.
type PostPullRequestDependabotActionJSONRequestBody = PullRequestDependabotActionRequest
// HidePullRequestJSONRequestBody defines body for HidePullRequest for application/json ContentType.
type HidePullRequestJSONRequestBody = PullRequestHideRequest
// MergePullRequestJSONRequestBody defines body for MergePullRequest for application/json ContentType.
type MergePullRequestJSONRequestBody = PullRequestMergeRequest
// PostPullRequestRenovateRebaseJSONRequestBody defines body for PostPullRequestRenovateRebase for application/json ContentType.
type PostPullRequestRenovateRebaseJSONRequestBody = PullRequestActionRequest
// CancelPullRequestRenovateRebaseJSONRequestBody defines body for CancelPullRequestRenovateRebase for application/json ContentType.
type CancelPullRequestRenovateRebaseJSONRequestBody = PullRequestActionRequest
// ReopenPullRequestJSONRequestBody defines body for ReopenPullRequest for application/json ContentType.
type ReopenPullRequestJSONRequestBody = PullRequestActionRequest
// RerunPullRequestChecksJSONRequestBody defines body for RerunPullRequestChecks for application/json ContentType.
type RerunPullRequestChecksJSONRequestBody = PullRequestActionRequest
// UnhidePullRequestJSONRequestBody defines body for UnhidePullRequest for application/json ContentType.
type UnhidePullRequestJSONRequestBody = PullRequestActionRequest
// UpdatePullRequestBranchJSONRequestBody defines body for UpdatePullRequestBranch for application/json ContentType.
type UpdatePullRequestBranchJSONRequestBody = PullRequestActionRequest
// QueueActionJSONRequestBody defines body for QueueAction for application/json ContentType.
type QueueActionJSONRequestBody = QueuedActionRequest
// DisableAutoUpdateBranchJSONRequestBody defines body for DisableAutoUpdateBranch for application/json ContentType.
type DisableAutoUpdateBranchJSONRequestBody = WebhookEnsureRequest
// EnableAutoUpdateBranchJSONRequestBody defines body for EnableAutoUpdateBranch for application/json ContentType.
type EnableAutoUpdateBranchJSONRequestBody = WebhookEnsureRequest
// IgnoreRepoJSONRequestBody defines body for IgnoreRepo for application/json ContentType.
type IgnoreRepoJSONRequestBody = RepoIgnoreRequest
// DisableRebaseBotsJSONRequestBody defines body for DisableRebaseBots for application/json ContentType.
type DisableRebaseBotsJSONRequestBody = WebhookEnsureRequest
// EnableRebaseBotsJSONRequestBody defines body for EnableRebaseBots for application/json ContentType.
type EnableRebaseBotsJSONRequestBody = WebhookEnsureRequest
// UnignoreRepoJSONRequestBody defines body for UnignoreRepo for application/json ContentType.
type UnignoreRepoJSONRequestBody = WebhookEnsureRequest
// PutSettingsJSONRequestBody defines body for PutSettings for application/json ContentType.
type PutSettingsJSONRequestBody = SettingsRequest
// SetFilterStateJSONRequestBody defines body for SetFilterState for application/json ContentType.
type SetFilterStateJSONRequestBody = FilterState
// SetThemeJSONRequestBody defines body for SetTheme for application/json ContentType.
type SetThemeJSONRequestBody = ThemeRequest
// SetTimezoneJSONRequestBody defines body for SetTimezone for application/json ContentType.
type SetTimezoneJSONRequestBody = TimezoneRequest
// CreateAPITokenJSONRequestBody defines body for CreateAPIToken for application/json ContentType.
type CreateAPITokenJSONRequestBody = APITokenCreateRequest
// EnsureWebhookJSONRequestBody defines body for EnsureWebhook for application/json ContentType.
type EnsureWebhookJSONRequestBody = WebhookEnsureRequest
// ReceiveForgejoWebhookJSONRequestBody defines body for ReceiveForgejoWebhook for application/json ContentType.
type ReceiveForgejoWebhookJSONRequestBody = ReceiveForgejoWebhookJSONBody
// ReceiveGitHubWebhookJSONRequestBody defines body for ReceiveGitHubWebhook for application/json ContentType.
type ReceiveGitHubWebhookJSONRequestBody = ReceiveGitHubWebhookJSONBody
// RequestEditorFn is the function signature for the RequestEditor callback function
type RequestEditorFn func(ctx context.Context, req *http.Request) error
// Doer performs HTTP requests.
//
// The standard http.Client implements this interface.
type HttpRequestDoer interface {
Do(req *http.Request) (*http.Response, error)
}
// Client which conforms to the OpenAPI3 specification for this service.
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
// ClientOption allows setting custom parameters during construction
type ClientOption func(*Client) error
// Creates a new Client, with reasonable defaults
func NewClient(server string, opts ...ClientOption) (*Client, error) {
// create a client with sane default values
client := Client{
Server: server,
}
// mutate client and add all optional params
for _, o := range opts {
if err := o(&client); err != nil {
return nil, err
}
}
// ensure the server URL always has a trailing slash
if !strings.HasSuffix(client.Server, "/") {
client.Server += "/"
}
// create httpClient, if not already present
if client.Client == nil {
client.Client = &http.Client{}
}
return &client, nil
}
// WithHTTPClient allows overriding the default Doer, which is
// automatically created using http.Client. This is useful for tests.
func WithHTTPClient(doer HttpRequestDoer) ClientOption {
return func(c *Client) error {
c.Client = doer
return nil
}
}
// WithRequestEditorFn allows setting up a callback function, which will be
// called right before sending the request. This can be used to mutate the request.
func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
return func(c *Client) error {
c.RequestEditors = append(c.RequestEditors, fn)
return nil
}
}
// The interface specification for the client above.
type ClientInterface interface {
// ListCredentials List the signed-in user's own passkeys
//
// Every passkey on the account, oldest first — not just the
// one used to establish the current session.
//
// Corresponds with GET /api/auth/credentials (the `ListCredentials` operationId).
ListCredentials(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// BeginAddCredential Start a ceremony to add another passkey to the signed-in account
//
// The authenticated counterpart to POST /api/auth/register/begin —
// that one only ever works for a brand-new, credential-less
// account; this is how an already-registered user adds a second
// (or third...) passkey, e.g. a laptop and a security key. Like the
// first registration it requires a resident key.
//
// Corresponds with POST /api/auth/credentials/begin (the `BeginAddCredential` operationId).
BeginAddCredential(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishAddCredentialWithBody Complete an add-credential ceremony
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
FinishAddCredentialWithBody(ctx context.Context, params *FinishAddCredentialParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishAddCredential Complete an add-credential ceremony
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
FinishAddCredential(ctx context.Context, params *FinishAddCredentialParams, body FinishAddCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteCredential Remove one of the signed-in user's own passkeys
//
// Refused on the account's last remaining passkey — this
// app is WebAuthn-only with no password fallback, so deleting it
// would lock the account out entirely.
//
// Corresponds with DELETE /api/auth/credentials/{id} (the `DeleteCredential` operationId).
DeleteCredential(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// RenameCredentialWithBody Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
RenameCredentialWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// RenameCredential Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
RenameCredential(ctx context.Context, id string, body RenameCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// BeginLogin Start a passkey login ceremony
//
// An instance has one user, so there is nothing to name and the request
// carries no body. The options name no passkey and no user, so the
// browser offers whichever discoverable passkey it holds for the site
// and nothing about the account is revealed to a visitor.
//
// Corresponds with POST /api/auth/login/begin (the `BeginLogin` operationId).
BeginLogin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishLoginWithBody Complete a passkey login ceremony
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
FinishLoginWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishLogin Complete a passkey login ceremony
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
FinishLogin(ctx context.Context, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// Logout End the current session
//
// Corresponds with POST /api/auth/logout (the `Logout` operationId).
Logout(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// BeginRegistration Start a passkey registration ceremony
//
// An instance has one user. The first registration on a fresh
// instance (see GET /api/auth/registration-status) creates that
// user and the server names it, so the request carries no body. The
// options require a resident key, so the passkey can be found at
// sign-in without being named. Once any account holds a passkey, this
// answers 403.
//
// Corresponds with POST /api/auth/register/begin (the `BeginRegistration` operationId).
BeginRegistration(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishRegistrationWithBody Complete a passkey registration ceremony
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
FinishRegistrationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishRegistration Complete a passkey registration ceremony
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
FinishRegistration(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetRegistrationStatus Whether self-registration is open
//
// Unauthenticated — a visitor deciding whether to show the login
// page's own "Register a new passkey instead" button has no session
// yet by definition. `open` is true only on a fresh instance with
// zero registered users; once any account holds a passkey,
// registration is closed for good. More passkeys for that account are
// added from Settings.
//
// Corresponds with GET /api/auth/registration-status (the `GetRegistrationStatus` operationId).
GetRegistrationStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetSession Who, if anyone, the current session cookie belongs to
//
// Corresponds with GET /api/auth/session (the `GetSession` operationId).
GetSession(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelWorkflowRunWithBody Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
CancelWorkflowRunWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelWorkflowRun Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
CancelWorkflowRun(ctx context.Context, body CancelWorkflowRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetCheckLog Read the output of one CI job, on demand
//
// The output behind a `Check` that carries a `jobId`, as plain text: colour
// codes and carriage returns removed, never markup, so a client must render
// it as text. Whatever the forge already masks stays masked. Only the last
// 256 KiB are returned; `truncated` says the start was cut.
//
// Only for a repository the dashboard tracks for you; any other answers 404
// without asking the forge.
//
// Fetched live on every call and never as part of a snapshot, since a log
// can be large and most are never opened. GitHub reads the job's log
// through its REST API (one request, then a short-lived download). Forgejo
// reads it through the job logs endpoint of its Actions API.
//
// A forge can refuse: the token may not read logs, the log may have
// expired, or the check may not be an Actions job at all. Those answer 403
// or 404 with a sentence a person can read.
//
// With `excerpt=true` the answer is the failed job's excerpt instead: `text`
// holds the last lines of the log with per-line timestamps and colour codes
// removed, at most 2,000 characters, and `truncated` is always false (an
// excerpt is a fixed-size tail, not a cut of what was asked for). Only
// Forgejo serves it; GitHub fills a check's `excerpt` itself when the
// checks are listed. A job whose log is gone or empty answers 200 with
// empty `text`, so a client can show the check without it. A job's excerpt
// is read once and kept once it finished, so asking again costs no
// request to the forge. A client asks for the few failed jobs it is about
// to show (the panel asks for the newest five), not for every job of a
// list.
//
// Corresponds with GET /api/checks/log (the `GetCheckLog` operationId).
GetCheckLog(ctx context.Context, params *GetCheckLogParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetDashboard The aggregated view
//
// Returns the most recently fetched snapshot. The backend refreshes
// this on its own schedule in the background; this endpoint never
// blocks on a live call to either forge, so it answers instantly even
// when a forge is slow or unreachable.
//
// Always the signed-in user's own dashboard.
//
// Draft pull requests are left out unless `includeDrafts=true`, and
// `hiddenDrafts` counts only the drafts in repos the user hasn't
// ignored, the same repos whose other pull requests show.
//
// Corresponds with GET /api/dashboard (the `GetDashboard` operationId).
GetDashboard(ctx context.Context, params *GetDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// RefreshDashboard Trigger an immediate refresh of the signed-in user's own dashboard
//
// Blocks until an immediate, out-of-band refresh of the signed-in
// user's own dashboard completes, then returns the resulting
// snapshot — for retrying right away after a forge was only
// briefly unreachable, instead of waiting for the next scheduled
// background refresh.
//
// The server holds a five-second cooldown, so this can't
// be used to hammer a forge's API budget. A call inside that
// window does not fetch: it answers 200 with the current snapshot
// and a `Retry-After` header carrying the seconds left. Never a
// 429, because the page calls this straight after a merge, close
// or branch update to show the result, and a refusal there would
// leave the row stale. Only a call that actually fetched answers
// without the header.
//
// The same goes for a call made while the first refresh since the
// server started is still running: it answers at once with the
// current snapshot and `Retry-After`, instead of waiting for that
// refresh to finish.
//
// Corresponds with POST /api/dashboard/refresh (the `RefreshDashboard` operationId).
RefreshDashboard(ctx context.Context, params *RefreshDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// StreamDashboard Server-Sent Events stream of the signed-in user's own dashboard
//
// Pushes a fresh snapshot every time this user's background
// refresh produces one — most notably right after a verified
// webhook delivery (see the webhooks tag) triggers an immediate
// one, which is what turns that into a live update instead of
// something only the next scheduled refresh picks up.
//
// The frontend's own 30-second poll against GET /api/dashboard
// keeps running unconditionally, connected or not — a browser or
// proxy that can't hold an SSE connection open just never
// benefits from this, rather than the dashboard going stale
// silently.
//
// `includeDrafts` is read once, when the connection opens, and
// applies to every event on it. A client that changes its mind
// reconnects with the new value.
//
// A client that passes `sid` can also follow the job lists of the
// pull requests and default branches it has open, through
// `POST /api/dashboard/stream/watch`. Each list arrives as named
// `run` events on this stream, one for each workflow run attempt, so a
// client that only listens for default messages never sees one. A
// reconnect reuses the same `sid` with nothing watched, so the client
// sends its watch again.
//
// Corresponds with GET /api/dashboard/stream (the `StreamDashboard` operationId).
StreamDashboard(ctx context.Context, params *StreamDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// WatchDashboardStreamChecksWithBody Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
WatchDashboardStreamChecksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// WatchDashboardStreamChecks Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
WatchDashboardStreamChecks(ctx context.Context, body WatchDashboardStreamChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CloseIssueWithBody Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
CloseIssueWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CloseIssue Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
CloseIssue(ctx context.Context, body CloseIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CommentOnIssueWithBody Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
CommentOnIssueWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CommentOnIssue Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
CommentOnIssue(ctx context.Context, body CommentOnIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetIssueDetails Read an issue's description, comments and reactions, on demand
//
// What the issue dialog shows: the description, the conversation in
// order, and the thumbs up and thumbs down reactions on each with who
// gave them. The same shape and rules as GET /api/pull-requests/details
// without the release notes, which only a pull request has. Fetched live
// on every call, never as part of GET /api/dashboard's snapshot.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// issue, one for its comments, one for the description's reactions and
// one for each comment's reactions (up to 50), so the reaction calls run
// at most eight at a time and stop at the first rate limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so a
// client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged and
// never proxied.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. An issue that doesn't exist is a 404, and a forge that
// can't be read is an error, never an empty thread.
//
// Corresponds with GET /api/issues/details (the `GetIssueDetails` operationId).
GetIssueDetails(ctx context.Context, params *GetIssueDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReopenIssueWithBody Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
ReopenIssueWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReopenIssue Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
ReopenIssue(ctx context.Context, body ReopenIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetMainBranches The CI status of every tracked repository's default branch
//
// One row per tracked repository, showing the latest pipeline on its
// default branch: failed, passed, running or none. A repository
// ignored for pull requests is left out, as on the pull requests page.
// Every other row is returned, whatever its status, and no tally comes
// with them, so a client filters, sorts and counts locally and its pill
// counts always match what each pill lists. Rows come in no particular
// order: the client orders them.
//
// Served from the snapshot the background refresh already holds, so it
// never calls a forge. On GitHub the branch's check status rides the
// repository query the refresh already makes (no extra request); on
// Forgejo the refresh lists the Actions runs of the default branch, once
// per repository.
//
// A forge that can't be reached keeps its last known rows, each marked
// `staleSince`, the same carry-over `forges[].staleSince`
// on GET /api/dashboard reports. A forge whose rate-limit budget is
// spent is skipped until it resets and its rows are kept the same way.
// Only the signed-in user's own repositories.
//
// A repository with no default branch yet (empty) or no pipeline has
// status `none`. Unauthenticated GitHub access (a username with no
// token) has no rows: its budget is too small to spend on this.
//
// Corresponds with GET /api/main-branches (the `GetMainBranches` operationId).
GetMainBranches(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListAdvisories List a repository's open dependency advisories in full, on demand
//
// What the advisories dialog on the Main branches page shows for one
// repository: each open Dependabot alert with the fields GitHub's own
// alert page shows. The list and the detail view are the same answer, so
// opening one advisory costs no second call. Fetched live on every call,
// never as part of GET /api/main-branches' snapshot, so a repository
// nobody opens costs no budget.
//
// Sorted by severity, highest first, then newest first. GitHub reads them
// through the Dependabot alerts of the repository. A Forgejo repository
// reads its lock files again and matches them against OSV, so it costs the
// same as one refresh of that repository and works only while OSV
// advisories are switched on; each advisory is then one distinct
// advisory, with `number` its place in the list, `openedAt` the day OSV
// published it and `url` its page on OSV.
//
// A forge that can't say is a 200 with `state` "unknown", an empty list
// and the `reason`, the same words as the row's own `advisories`: alerts
// switched off, a credential without the Dependabot alerts permission, a
// rate limit, any other failure, or a repository with more open alerts
// than one read pages through. For Forgejo: advisories not switched on
// (`not_enabled`), OSV unreachable or a lock file that can't be read
// (`failed`), too much to read (`too_many`), or no lock file found (no
// `reason`). An empty `known` list means nothing is open.
//
// `description` is Markdown exactly as GitHub stores it, so a client must
// render it with raw HTML disabled. A field GitHub didn't send is left
// out. A Forgejo advisory leaves out what OSV does not state: `epss`,
// `relationship`, `scope` and `vulnerableVersions`.
//
// The same answer is the `get_repository_advisories` tool, over MCP and
// WebMCP.
//
// Corresponds with GET /api/main-branches/advisories (the `ListAdvisories` operationId).
ListAdvisories(ctx context.Context, params *ListAdvisoriesParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// RerunMainBranchChecksWithBody Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
RerunMainBranchChecksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// RerunMainBranchChecks Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
RerunMainBranchChecks(ctx context.Context, body RerunMainBranchChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReportDashboardPresenceWithBody Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
ReportDashboardPresenceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReportDashboardPresence Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
ReportDashboardPresence(ctx context.Context, body ReportDashboardPresenceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnablePullRequestAutoMergeWithBody Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
EnablePullRequestAutoMergeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnablePullRequestAutoMerge Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
EnablePullRequestAutoMerge(ctx context.Context, body EnablePullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelPullRequestAutoMergeWithBody Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
CancelPullRequestAutoMergeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelPullRequestAutoMerge Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
CancelPullRequestAutoMerge(ctx context.Context, body CancelPullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetPullRequestAutoUpdateWithBody Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
SetPullRequestAutoUpdateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetPullRequestAutoUpdate Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
SetPullRequestAutoUpdate(ctx context.Context, body SetPullRequestAutoUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ClosePullRequestWithBody Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
ClosePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ClosePullRequest Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
ClosePullRequest(ctx context.Context, body ClosePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPullRequestDependabotActionWithBody Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
PostPullRequestDependabotActionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPullRequestDependabotAction Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
PostPullRequestDependabotAction(ctx context.Context, body PostPullRequestDependabotActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetPullRequestDetails Read a pull request's description, comments and reactions, on demand
//
// What the pull request dialog shows: the description, the
// conversation in order, the thumbs up and thumbs down reactions on each
// with who gave them, and, for a release pull request, the release
// notes. Fetched live on every call, never as part of GET
// /api/dashboard's snapshot: comments and reactions for every row would
// spend the forge's budget on rows nobody opens.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// pull request, one for its comments, one for the description's
// reactions and one for each comment's reactions (up to 50), so the
// reaction calls run at most eight at a time and stop at the first rate
// limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so
// a client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged
// and never proxied; this app sets no Content-Security-Policy today, so
// the browser loads it directly. A future policy's `img-src` has to
// allow avatars.githubusercontent.com, repository-images.githubusercontent.com
// (a GitHub repository's logo, see `logoUrl` on a repo in GET
// /api/dashboard) and the Forgejo host.
//
// A forge that can't be read is an error, never an empty thread.
//
// Corresponds with GET /api/pull-requests/details (the `GetPullRequestDetails` operationId).
GetPullRequestDetails(ctx context.Context, params *GetPullRequestDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// HidePullRequestWithBody Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
HidePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// HidePullRequest Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
HidePullRequest(ctx context.Context, body HidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// MergePullRequestWithBody Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
MergePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// MergePullRequest Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
MergePullRequest(ctx context.Context, body MergePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPullRequestRenovateRebaseWithBody Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
PostPullRequestRenovateRebaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PostPullRequestRenovateRebase Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
PostPullRequestRenovateRebase(ctx context.Context, body PostPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelPullRequestRenovateRebaseWithBody Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
CancelPullRequestRenovateRebaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelPullRequestRenovateRebase Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
CancelPullRequestRenovateRebase(ctx context.Context, body CancelPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReopenPullRequestWithBody Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
ReopenPullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReopenPullRequest Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
ReopenPullRequest(ctx context.Context, body ReopenPullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RerunPullRequestChecksWithBody Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
RerunPullRequestChecksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// RerunPullRequestChecks Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
RerunPullRequestChecks(ctx context.Context, body RerunPullRequestChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// UnhidePullRequestWithBody Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
UnhidePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// UnhidePullRequest Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
UnhidePullRequest(ctx context.Context, body UnhidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdatePullRequestBranchWithBody Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
UpdatePullRequestBranchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdatePullRequestBranch Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
UpdatePullRequestBranch(ctx context.Context, body UpdatePullRequestBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListQueuedActions List the signed-in user's queued actions, waiting and recently finished
//
// Every action the user queued to run when a rate-limited forge
// resets, oldest first: the ones still `queued`, and the
// final ones (`done`, `skipped`, `failed`) kept for 24 hours so a
// client can show the outcome in its Activity list. The same list
// rides along on GET /api/dashboard as `queuedActions`.
//
// Corresponds with GET /api/queued-actions (the `ListQueuedActions` operationId).
ListQueuedActions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueueActionWithBody Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
QueueActionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueueAction Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
QueueAction(ctx context.Context, body QueueActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelQueuedAction Cancel a queued action, or clear a finished one from the list
//
// A queued action that has not run is removed and nothing runs. A
// finished one is cleared from the list. An id that isn't the
// signed-in user's answers 404, the same as one that doesn't exist.
//
// Corresponds with DELETE /api/queued-actions/{id} (the `CancelQueuedAction` operationId).
CancelQueuedAction(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetReleaseDetails Read a published release's title and notes, on demand
//
// What the release dialog on the Main branches page shows for a
// repository's latest published release: its title, when it was
// published, its notes and the thumbs reactions on them. Fetched live on
// every call, never as part of GET /api/main-branches' snapshot, so a
// release nobody opens costs no budget.
//
// GitHub answers with one GraphQL query. Only GitHub rows carry a latest
// release today, so a Forgejo repository is a 400.
//
// The notes are Markdown exactly as the forge stores them (`format` is
// always `markdown`). The server neither converts nor sanitises them, so
// a client must render them with raw HTML disabled. They are cut at
// 20,000 characters (`truncated`), and a reaction names at most its
// first 10 people while `count` is the full number.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. A tag that has no published release is a 404, and so is a draft,
// a pre-release or a release with no publish date.
//
// Corresponds with GET /api/releases/details (the `GetReleaseDetails` operationId).
GetReleaseDetails(ctx context.Context, params *GetReleaseDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// DisableAutoUpdateBranchWithBody Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
DisableAutoUpdateBranchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// DisableAutoUpdateBranch Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
DisableAutoUpdateBranch(ctx context.Context, body DisableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnableAutoUpdateBranchWithBody Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
EnableAutoUpdateBranchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnableAutoUpdateBranch Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
EnableAutoUpdateBranch(ctx context.Context, body EnableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// IgnoreRepoWithBody Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
IgnoreRepoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// IgnoreRepo Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
IgnoreRepo(ctx context.Context, body IgnoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DisableRebaseBotsWithBody Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
DisableRebaseBotsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// DisableRebaseBots Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
DisableRebaseBots(ctx context.Context, body DisableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnableRebaseBotsWithBody Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
EnableRebaseBotsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnableRebaseBots Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
EnableRebaseBots(ctx context.Context, body EnableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// UnignoreRepoWithBody Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
UnignoreRepoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// UnignoreRepo Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
UnignoreRepo(ctx context.Context, body UnignoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetSettings The signed-in user's own forge configuration
//
// Forge tokens are never returned, only whether one is set. The
// webhook token and secret are returned, since the user pastes them
// into the forge's webhook setup, and a first read creates them. For
// a read that creates nothing and omits both, see
// `GET /api/settings/summary`.
//
// Corresponds with GET /api/settings (the `GetSettings` operationId).
GetSettings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutSettingsWithBody Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
PutSettingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PutSettings Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
PutSettings(ctx context.Context, body PutSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetFilterState The signed-in user's own saved dashboard/Insights filter state
//
// A lightweight read of one opaque blob, deliberately not
// GET /api/settings itself for the same reason GET /api/settings/theme
// isn't either: this loads on every dashboard/Insights visit and
// shouldn't provision webhook credentials as a side effect.
// `{}` for a user who's never saved any filters yet, not a 404.
// These are the web UI's own state: a signed-in browser session only,
// and a personal API token is refused with 403.
//
// Corresponds with GET /api/settings/filter-state (the `GetFilterState` operationId).
GetFilterState(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetFilterStateWithBody Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
SetFilterStateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetFilterState Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
SetFilterState(ctx context.Context, body SetFilterStateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetSettingsSummary The signed-in user's settings, read without side effects
//
// The same data as `GET /api/settings`, minus the webhook token and
// secret, plus `webhookConfigured`. It never provisions webhook
// credentials: for a user who has none yet it answers
// `webhookConfigured: false` and creates nothing. Forge tokens are
// never returned, only whether one is set. It returns exactly what
// the `get_settings` MCP tool returns.
//
// Corresponds with GET /api/settings/summary (the `GetSettingsSummary` operationId).
GetSettingsSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTheme The signed-in user's own saved theme preference
//
// A lightweight, side-effect-free read of one field — theme — for
// every page to check on load. Deliberately not
// GET /api/settings itself: that handler also provisions webhook
// credentials on first call (EnsureWebhookCredentials), which
// every page loading shouldn't trigger for a user who's never
// opened Settings at all.
//
// Corresponds with GET /api/settings/theme (the `GetTheme` operationId).
GetTheme(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetThemeWithBody Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
SetThemeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetTheme Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
SetTheme(ctx context.Context, body SetThemeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetTimezone The signed-in user's own saved time zone
//
// A lightweight, side-effect-free read of one field, for every page to
// check on load so it can show times in the user's zone. Deliberately
// not GET /api/settings, for the reason GET /api/settings/theme isn't.
// Empty means "use the browser's own zone".
//
// Corresponds with GET /api/settings/timezone (the `GetTimezone` operationId).
GetTimezone(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetTimezoneWithBody Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
SetTimezoneWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetTimezone Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
SetTimezone(ctx context.Context, body SetTimezoneJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetForgeApiStats How many forge API calls the dashboard has spent, and on what
//
// Counts the forge requests made since the server started, so a change
// to what the dashboard refreshes can be shown to have saved budget, and
// a rate-limit incident traced to the refresh that caused it. One bucket
// per forge, credential, refresh `kind` and repository, each with the
// REST calls made, the GraphQL calls made, the GraphQL `rateLimit.cost`
// they were charged, and the requests answered `304 Not Modified`. A 304
// is not charged against the REST budget, so it is counted on its own and
// not as a REST call.
//
// `kind` says why the request was made: `full` (a whole-account
// refresh), `scoped_webhook` (one repository, after a webhook),
// `ci_poll` (one repository, waiting on a running check),
// `auto_merge_poll` (one repository, waiting on an armed auto-merge),
// `details` (a dialog or check list opened), `hook_maintenance`
// (checking, adding or upgrading webhooks), `advisories` (reading a
// repository's open Dependabot alerts, or a Forgejo repository's lockfiles), `user_action` (a button
// pressed, a queued action, or something the dashboard does for you such
// as auto-merge) and `unknown` (a request nobody tagged, which is a bug
// to report). A request that names no repository, such as listing an
// account's repositories, has an empty `repo`.
//
// The counters live in memory and start from zero on every start;
// `since` says when counting began. `credential` names the connected
// account or App installation by a label that carries no secret and no
// user id (`app:<installation id>`, `token:<short hash>`,
// `public:<username>`). Only the buckets of the caller's own
// credentials are returned. They are matched to the credentials
// the caller has saved, and a GitHub App installation id is a number the
// caller types in, so until the dashboard has one user, someone who saves
// another account's installation id sees that installation's counts. `budgets` are the rate limits each forge last
// reported, the same figures as `forges` on GET /api/dashboard.
//
// Corresponds with GET /api/stats/forge-api (the `GetForgeApiStats` operationId).
GetForgeApiStats(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListAPITokens List the signed-in user's own personal API tokens
//
// Metadata only, per APIToken's own description — a raw value never reappears once created.
//
// Corresponds with GET /api/tokens (the `ListAPITokens` operationId).
ListAPITokens(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateAPITokenWithBody Generate a new personal API token
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
CreateAPITokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateAPIToken Generate a new personal API token
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
CreateAPIToken(ctx context.Context, body CreateAPITokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteAPIToken Revoke a personal API token
//
// Stops the token authenticating immediately. Idempotent — deleting
// an id that's already gone (or never belonged to the signed-in
// user) still answers 204, the same as any other delete-by-id
// endpoint here, so a double-click or a retried request isn't an
// error.
//
// Corresponds with DELETE /api/tokens/{id} (the `DeleteAPIToken` operationId).
DeleteAPIToken(ctx context.Context, id PathTokenID, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetVersion The running server's own version
//
// The tag goreleaser stamped the running binary with ("dev" for a
// build outside the release pipeline). Public and unauthenticated —
// every page, including the pre-login screen, links to the matching
// GitHub release from its footer so a person can tell what's
// actually deployed without shelling into the box.
//
// Corresponds with GET /api/version (the `GetVersion` operationId).
GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnsureWebhookWithBody Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
EnsureWebhookWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// EnsureWebhook Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
EnsureWebhook(ctx context.Context, body EnsureWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReceiveForgejoWebhookWithBody Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
ReceiveForgejoWebhookWithBody(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReceiveForgejoWebhook Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
ReceiveForgejoWebhook(ctx context.Context, webhookToken PathWebhookToken, body ReceiveForgejoWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReceiveGitHubWebhookWithBody Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
ReceiveGitHubWebhookWithBody(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReceiveGitHubWebhook Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
ReceiveGitHubWebhook(ctx context.Context, webhookToken PathWebhookToken, body ReceiveGitHubWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// Health Liveness
//
// Answers 200 once the server has started. Doesn't reflect whether
// either forge is reachable — see forges[].reachable on the dashboard
// response for that.
//
// Corresponds with GET /healthz (the `Health` operationId).
Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// Ready Readiness
//
// Answers 200 once the server can actually serve: the database answers
// a ping with its schema in place, and the first dashboard refresh has
// completed, or 30 seconds have passed since it started. The wait is
// bounded because how fast a forge answers is how fresh the data is,
// not whether the server can serve: a slow or unreachable forge must not
// keep the container unready. A refresh that finished with a forge
// unreachable counts, and a forge going unreachable afterwards never
// turns this into a 503. See forges[].reachable on the dashboard
// response for that. Before any account has signed in there is no
// refresh to wait for, so only the database is checked.
//
// The database ping gets 2 seconds, less than the HEALTHCHECK's own 5,
// so a database that doesn't answer turns into a 503 instead of a hung
// probe. The ping's result, pass or fail, is reused for about 3
// seconds, so probes arriving every second don't each reach the
// database. On SIGTERM this answers 503 ("shutting down") at once, and
// the server waits a drain period (`SHUTDOWN_DRAIN`, default 5 seconds)
// before it stops accepting connections, so a router that polls this
// path stops sending traffic first.
//
// The container's HEALTHCHECK probes this path (`/healthz` stays the
// cheap liveness answer), so Docker's single health state and Compose's
// `depends_on: condition: service_healthy` mean "ready", not just
// "started".
//
// Corresponds with GET /readyz (the `Ready` operationId).
Ready(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}
// ListCredentials List the signed-in user's own passkeys
//
// Every passkey on the account, oldest first — not just the
// one used to establish the current session.
//
// Corresponds with GET /api/auth/credentials (the `ListCredentials` operationId).
func (c *Client) ListCredentials(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListCredentialsRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// BeginAddCredential Start a ceremony to add another passkey to the signed-in account
//
// The authenticated counterpart to POST /api/auth/register/begin —
// that one only ever works for a brand-new, credential-less
// account; this is how an already-registered user adds a second
// (or third...) passkey, e.g. a laptop and a security key. Like the
// first registration it requires a resident key.
//
// Corresponds with POST /api/auth/credentials/begin (the `BeginAddCredential` operationId).
func (c *Client) BeginAddCredential(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewBeginAddCredentialRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// FinishAddCredentialWithBody Complete an add-credential ceremony
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
func (c *Client) FinishAddCredentialWithBody(ctx context.Context, params *FinishAddCredentialParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFinishAddCredentialRequestWithBody(c.Server, params, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// FinishAddCredential Complete an add-credential ceremony
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
func (c *Client) FinishAddCredential(ctx context.Context, params *FinishAddCredentialParams, body FinishAddCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFinishAddCredentialRequest(c.Server, params, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// DeleteCredential Remove one of the signed-in user's own passkeys
//
// Refused on the account's last remaining passkey — this
// app is WebAuthn-only with no password fallback, so deleting it
// would lock the account out entirely.
//
// Corresponds with DELETE /api/auth/credentials/{id} (the `DeleteCredential` operationId).
func (c *Client) DeleteCredential(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteCredentialRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RenameCredentialWithBody Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
func (c *Client) RenameCredentialWithBody(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRenameCredentialRequestWithBody(c.Server, id, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RenameCredential Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
func (c *Client) RenameCredential(ctx context.Context, id string, body RenameCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRenameCredentialRequest(c.Server, id, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// BeginLogin Start a passkey login ceremony
//
// An instance has one user, so there is nothing to name and the request
// carries no body. The options name no passkey and no user, so the
// browser offers whichever discoverable passkey it holds for the site
// and nothing about the account is revealed to a visitor.
//
// Corresponds with POST /api/auth/login/begin (the `BeginLogin` operationId).
func (c *Client) BeginLogin(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewBeginLoginRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// FinishLoginWithBody Complete a passkey login ceremony
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
func (c *Client) FinishLoginWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFinishLoginRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// FinishLogin Complete a passkey login ceremony
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
func (c *Client) FinishLogin(ctx context.Context, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFinishLoginRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// Logout End the current session
//
// Corresponds with POST /api/auth/logout (the `Logout` operationId).
func (c *Client) Logout(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewLogoutRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// BeginRegistration Start a passkey registration ceremony
//
// An instance has one user. The first registration on a fresh
// instance (see GET /api/auth/registration-status) creates that
// user and the server names it, so the request carries no body. The
// options require a resident key, so the passkey can be found at
// sign-in without being named. Once any account holds a passkey, this
// answers 403.
//
// Corresponds with POST /api/auth/register/begin (the `BeginRegistration` operationId).
func (c *Client) BeginRegistration(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewBeginRegistrationRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// FinishRegistrationWithBody Complete a passkey registration ceremony
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
func (c *Client) FinishRegistrationWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFinishRegistrationRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// FinishRegistration Complete a passkey registration ceremony
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
func (c *Client) FinishRegistration(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewFinishRegistrationRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetRegistrationStatus Whether self-registration is open
//
// Unauthenticated — a visitor deciding whether to show the login
// page's own "Register a new passkey instead" button has no session
// yet by definition. `open` is true only on a fresh instance with
// zero registered users; once any account holds a passkey,
// registration is closed for good. More passkeys for that account are
// added from Settings.
//
// Corresponds with GET /api/auth/registration-status (the `GetRegistrationStatus` operationId).
func (c *Client) GetRegistrationStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetRegistrationStatusRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetSession Who, if anyone, the current session cookie belongs to
//
// Corresponds with GET /api/auth/session (the `GetSession` operationId).
func (c *Client) GetSession(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetSessionRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelWorkflowRunWithBody Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
func (c *Client) CancelWorkflowRunWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelWorkflowRunRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelWorkflowRun Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
func (c *Client) CancelWorkflowRun(ctx context.Context, body CancelWorkflowRunJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelWorkflowRunRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetCheckLog Read the output of one CI job, on demand
//
// The output behind a `Check` that carries a `jobId`, as plain text: colour
// codes and carriage returns removed, never markup, so a client must render
// it as text. Whatever the forge already masks stays masked. Only the last
// 256 KiB are returned; `truncated` says the start was cut.
//
// Only for a repository the dashboard tracks for you; any other answers 404
// without asking the forge.
//
// Fetched live on every call and never as part of a snapshot, since a log
// can be large and most are never opened. GitHub reads the job's log
// through its REST API (one request, then a short-lived download). Forgejo
// reads it through the job logs endpoint of its Actions API.
//
// A forge can refuse: the token may not read logs, the log may have
// expired, or the check may not be an Actions job at all. Those answer 403
// or 404 with a sentence a person can read.
//
// With `excerpt=true` the answer is the failed job's excerpt instead: `text`
// holds the last lines of the log with per-line timestamps and colour codes
// removed, at most 2,000 characters, and `truncated` is always false (an
// excerpt is a fixed-size tail, not a cut of what was asked for). Only
// Forgejo serves it; GitHub fills a check's `excerpt` itself when the
// checks are listed. A job whose log is gone or empty answers 200 with
// empty `text`, so a client can show the check without it. A job's excerpt
// is read once and kept once it finished, so asking again costs no
// request to the forge. A client asks for the few failed jobs it is about
// to show (the panel asks for the newest five), not for every job of a
// list.
//
// Corresponds with GET /api/checks/log (the `GetCheckLog` operationId).
func (c *Client) GetCheckLog(ctx context.Context, params *GetCheckLogParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetCheckLogRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetDashboard The aggregated view
//
// Returns the most recently fetched snapshot. The backend refreshes
// this on its own schedule in the background; this endpoint never
// blocks on a live call to either forge, so it answers instantly even
// when a forge is slow or unreachable.
//
// Always the signed-in user's own dashboard.
//
// Draft pull requests are left out unless `includeDrafts=true`, and
// `hiddenDrafts` counts only the drafts in repos the user hasn't
// ignored, the same repos whose other pull requests show.
//
// Corresponds with GET /api/dashboard (the `GetDashboard` operationId).
func (c *Client) GetDashboard(ctx context.Context, params *GetDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetDashboardRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RefreshDashboard Trigger an immediate refresh of the signed-in user's own dashboard
//
// Blocks until an immediate, out-of-band refresh of the signed-in
// user's own dashboard completes, then returns the resulting
// snapshot — for retrying right away after a forge was only
// briefly unreachable, instead of waiting for the next scheduled
// background refresh.
//
// The server holds a five-second cooldown, so this can't
// be used to hammer a forge's API budget. A call inside that
// window does not fetch: it answers 200 with the current snapshot
// and a `Retry-After` header carrying the seconds left. Never a
// 429, because the page calls this straight after a merge, close
// or branch update to show the result, and a refusal there would
// leave the row stale. Only a call that actually fetched answers
// without the header.
//
// The same goes for a call made while the first refresh since the
// server started is still running: it answers at once with the
// current snapshot and `Retry-After`, instead of waiting for that
// refresh to finish.
//
// Corresponds with POST /api/dashboard/refresh (the `RefreshDashboard` operationId).
func (c *Client) RefreshDashboard(ctx context.Context, params *RefreshDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRefreshDashboardRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// StreamDashboard Server-Sent Events stream of the signed-in user's own dashboard
//
// Pushes a fresh snapshot every time this user's background
// refresh produces one — most notably right after a verified
// webhook delivery (see the webhooks tag) triggers an immediate
// one, which is what turns that into a live update instead of
// something only the next scheduled refresh picks up.
//
// The frontend's own 30-second poll against GET /api/dashboard
// keeps running unconditionally, connected or not — a browser or
// proxy that can't hold an SSE connection open just never
// benefits from this, rather than the dashboard going stale
// silently.
//
// `includeDrafts` is read once, when the connection opens, and
// applies to every event on it. A client that changes its mind
// reconnects with the new value.
//
// A client that passes `sid` can also follow the job lists of the
// pull requests and default branches it has open, through
// `POST /api/dashboard/stream/watch`. Each list arrives as named
// `run` events on this stream, one for each workflow run attempt, so a
// client that only listens for default messages never sees one. A
// reconnect reuses the same `sid` with nothing watched, so the client
// sends its watch again.
//
// Corresponds with GET /api/dashboard/stream (the `StreamDashboard` operationId).
func (c *Client) StreamDashboard(ctx context.Context, params *StreamDashboardParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewStreamDashboardRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// WatchDashboardStreamChecksWithBody Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
func (c *Client) WatchDashboardStreamChecksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewWatchDashboardStreamChecksRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// WatchDashboardStreamChecks Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
func (c *Client) WatchDashboardStreamChecks(ctx context.Context, body WatchDashboardStreamChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewWatchDashboardStreamChecksRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CloseIssueWithBody Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
func (c *Client) CloseIssueWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCloseIssueRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CloseIssue Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
func (c *Client) CloseIssue(ctx context.Context, body CloseIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCloseIssueRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CommentOnIssueWithBody Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
func (c *Client) CommentOnIssueWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCommentOnIssueRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CommentOnIssue Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
func (c *Client) CommentOnIssue(ctx context.Context, body CommentOnIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCommentOnIssueRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetIssueDetails Read an issue's description, comments and reactions, on demand
//
// What the issue dialog shows: the description, the conversation in
// order, and the thumbs up and thumbs down reactions on each with who
// gave them. The same shape and rules as GET /api/pull-requests/details
// without the release notes, which only a pull request has. Fetched live
// on every call, never as part of GET /api/dashboard's snapshot.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// issue, one for its comments, one for the description's reactions and
// one for each comment's reactions (up to 50), so the reaction calls run
// at most eight at a time and stop at the first rate limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so a
// client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged and
// never proxied.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. An issue that doesn't exist is a 404, and a forge that
// can't be read is an error, never an empty thread.
//
// Corresponds with GET /api/issues/details (the `GetIssueDetails` operationId).
func (c *Client) GetIssueDetails(ctx context.Context, params *GetIssueDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetIssueDetailsRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReopenIssueWithBody Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
func (c *Client) ReopenIssueWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReopenIssueRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReopenIssue Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
func (c *Client) ReopenIssue(ctx context.Context, body ReopenIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReopenIssueRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetMainBranches The CI status of every tracked repository's default branch
//
// One row per tracked repository, showing the latest pipeline on its
// default branch: failed, passed, running or none. A repository
// ignored for pull requests is left out, as on the pull requests page.
// Every other row is returned, whatever its status, and no tally comes
// with them, so a client filters, sorts and counts locally and its pill
// counts always match what each pill lists. Rows come in no particular
// order: the client orders them.
//
// Served from the snapshot the background refresh already holds, so it
// never calls a forge. On GitHub the branch's check status rides the
// repository query the refresh already makes (no extra request); on
// Forgejo the refresh lists the Actions runs of the default branch, once
// per repository.
//
// A forge that can't be reached keeps its last known rows, each marked
// `staleSince`, the same carry-over `forges[].staleSince`
// on GET /api/dashboard reports. A forge whose rate-limit budget is
// spent is skipped until it resets and its rows are kept the same way.
// Only the signed-in user's own repositories.
//
// A repository with no default branch yet (empty) or no pipeline has
// status `none`. Unauthenticated GitHub access (a username with no
// token) has no rows: its budget is too small to spend on this.
//
// Corresponds with GET /api/main-branches (the `GetMainBranches` operationId).
func (c *Client) GetMainBranches(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetMainBranchesRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ListAdvisories List a repository's open dependency advisories in full, on demand
//
// What the advisories dialog on the Main branches page shows for one
// repository: each open Dependabot alert with the fields GitHub's own
// alert page shows. The list and the detail view are the same answer, so
// opening one advisory costs no second call. Fetched live on every call,
// never as part of GET /api/main-branches' snapshot, so a repository
// nobody opens costs no budget.
//
// Sorted by severity, highest first, then newest first. GitHub reads them
// through the Dependabot alerts of the repository. A Forgejo repository
// reads its lock files again and matches them against OSV, so it costs the
// same as one refresh of that repository and works only while OSV
// advisories are switched on; each advisory is then one distinct
// advisory, with `number` its place in the list, `openedAt` the day OSV
// published it and `url` its page on OSV.
//
// A forge that can't say is a 200 with `state` "unknown", an empty list
// and the `reason`, the same words as the row's own `advisories`: alerts
// switched off, a credential without the Dependabot alerts permission, a
// rate limit, any other failure, or a repository with more open alerts
// than one read pages through. For Forgejo: advisories not switched on
// (`not_enabled`), OSV unreachable or a lock file that can't be read
// (`failed`), too much to read (`too_many`), or no lock file found (no
// `reason`). An empty `known` list means nothing is open.
//
// `description` is Markdown exactly as GitHub stores it, so a client must
// render it with raw HTML disabled. A field GitHub didn't send is left
// out. A Forgejo advisory leaves out what OSV does not state: `epss`,
// `relationship`, `scope` and `vulnerableVersions`.
//
// The same answer is the `get_repository_advisories` tool, over MCP and
// WebMCP.
//
// Corresponds with GET /api/main-branches/advisories (the `ListAdvisories` operationId).
func (c *Client) ListAdvisories(ctx context.Context, params *ListAdvisoriesParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListAdvisoriesRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RerunMainBranchChecksWithBody Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
func (c *Client) RerunMainBranchChecksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRerunMainBranchChecksRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RerunMainBranchChecks Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
func (c *Client) RerunMainBranchChecks(ctx context.Context, body RerunMainBranchChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRerunMainBranchChecksRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReportDashboardPresenceWithBody Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
func (c *Client) ReportDashboardPresenceWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReportDashboardPresenceRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReportDashboardPresence Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
func (c *Client) ReportDashboardPresence(ctx context.Context, body ReportDashboardPresenceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReportDashboardPresenceRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnablePullRequestAutoMergeWithBody Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
func (c *Client) EnablePullRequestAutoMergeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnablePullRequestAutoMergeRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnablePullRequestAutoMerge Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
func (c *Client) EnablePullRequestAutoMerge(ctx context.Context, body EnablePullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnablePullRequestAutoMergeRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelPullRequestAutoMergeWithBody Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
func (c *Client) CancelPullRequestAutoMergeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelPullRequestAutoMergeRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelPullRequestAutoMerge Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
func (c *Client) CancelPullRequestAutoMerge(ctx context.Context, body CancelPullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelPullRequestAutoMergeRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetPullRequestAutoUpdateWithBody Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
func (c *Client) SetPullRequestAutoUpdateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetPullRequestAutoUpdateRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetPullRequestAutoUpdate Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
func (c *Client) SetPullRequestAutoUpdate(ctx context.Context, body SetPullRequestAutoUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetPullRequestAutoUpdateRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ClosePullRequestWithBody Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
func (c *Client) ClosePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewClosePullRequestRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ClosePullRequest Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
func (c *Client) ClosePullRequest(ctx context.Context, body ClosePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewClosePullRequestRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// PostPullRequestDependabotActionWithBody Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
func (c *Client) PostPullRequestDependabotActionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostPullRequestDependabotActionRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// PostPullRequestDependabotAction Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
func (c *Client) PostPullRequestDependabotAction(ctx context.Context, body PostPullRequestDependabotActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostPullRequestDependabotActionRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetPullRequestDetails Read a pull request's description, comments and reactions, on demand
//
// What the pull request dialog shows: the description, the
// conversation in order, the thumbs up and thumbs down reactions on each
// with who gave them, and, for a release pull request, the release
// notes. Fetched live on every call, never as part of GET
// /api/dashboard's snapshot: comments and reactions for every row would
// spend the forge's budget on rows nobody opens.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// pull request, one for its comments, one for the description's
// reactions and one for each comment's reactions (up to 50), so the
// reaction calls run at most eight at a time and stop at the first rate
// limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so
// a client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged
// and never proxied; this app sets no Content-Security-Policy today, so
// the browser loads it directly. A future policy's `img-src` has to
// allow avatars.githubusercontent.com, repository-images.githubusercontent.com
// (a GitHub repository's logo, see `logoUrl` on a repo in GET
// /api/dashboard) and the Forgejo host.
//
// A forge that can't be read is an error, never an empty thread.
//
// Corresponds with GET /api/pull-requests/details (the `GetPullRequestDetails` operationId).
func (c *Client) GetPullRequestDetails(ctx context.Context, params *GetPullRequestDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetPullRequestDetailsRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// HidePullRequestWithBody Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
func (c *Client) HidePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewHidePullRequestRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// HidePullRequest Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
func (c *Client) HidePullRequest(ctx context.Context, body HidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewHidePullRequestRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// MergePullRequestWithBody Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
func (c *Client) MergePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewMergePullRequestRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// MergePullRequest Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
func (c *Client) MergePullRequest(ctx context.Context, body MergePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewMergePullRequestRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// PostPullRequestRenovateRebaseWithBody Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
func (c *Client) PostPullRequestRenovateRebaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostPullRequestRenovateRebaseRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// PostPullRequestRenovateRebase Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
func (c *Client) PostPullRequestRenovateRebase(ctx context.Context, body PostPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPostPullRequestRenovateRebaseRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelPullRequestRenovateRebaseWithBody Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
func (c *Client) CancelPullRequestRenovateRebaseWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelPullRequestRenovateRebaseRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelPullRequestRenovateRebase Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
func (c *Client) CancelPullRequestRenovateRebase(ctx context.Context, body CancelPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelPullRequestRenovateRebaseRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReopenPullRequestWithBody Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
func (c *Client) ReopenPullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReopenPullRequestRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReopenPullRequest Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
func (c *Client) ReopenPullRequest(ctx context.Context, body ReopenPullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReopenPullRequestRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RerunPullRequestChecksWithBody Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
func (c *Client) RerunPullRequestChecksWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRerunPullRequestChecksRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// RerunPullRequestChecks Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
func (c *Client) RerunPullRequestChecks(ctx context.Context, body RerunPullRequestChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewRerunPullRequestChecksRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// UnhidePullRequestWithBody Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
func (c *Client) UnhidePullRequestWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUnhidePullRequestRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// UnhidePullRequest Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
func (c *Client) UnhidePullRequest(ctx context.Context, body UnhidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUnhidePullRequestRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// UpdatePullRequestBranchWithBody Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
func (c *Client) UpdatePullRequestBranchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdatePullRequestBranchRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// UpdatePullRequestBranch Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
func (c *Client) UpdatePullRequestBranch(ctx context.Context, body UpdatePullRequestBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUpdatePullRequestBranchRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ListQueuedActions List the signed-in user's queued actions, waiting and recently finished
//
// Every action the user queued to run when a rate-limited forge
// resets, oldest first: the ones still `queued`, and the
// final ones (`done`, `skipped`, `failed`) kept for 24 hours so a
// client can show the outcome in its Activity list. The same list
// rides along on GET /api/dashboard as `queuedActions`.
//
// Corresponds with GET /api/queued-actions (the `ListQueuedActions` operationId).
func (c *Client) ListQueuedActions(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListQueuedActionsRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// QueueActionWithBody Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
func (c *Client) QueueActionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewQueueActionRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// QueueAction Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
func (c *Client) QueueAction(ctx context.Context, body QueueActionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewQueueActionRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CancelQueuedAction Cancel a queued action, or clear a finished one from the list
//
// A queued action that has not run is removed and nothing runs. A
// finished one is cleared from the list. An id that isn't the
// signed-in user's answers 404, the same as one that doesn't exist.
//
// Corresponds with DELETE /api/queued-actions/{id} (the `CancelQueuedAction` operationId).
func (c *Client) CancelQueuedAction(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCancelQueuedActionRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetReleaseDetails Read a published release's title and notes, on demand
//
// What the release dialog on the Main branches page shows for a
// repository's latest published release: its title, when it was
// published, its notes and the thumbs reactions on them. Fetched live on
// every call, never as part of GET /api/main-branches' snapshot, so a
// release nobody opens costs no budget.
//
// GitHub answers with one GraphQL query. Only GitHub rows carry a latest
// release today, so a Forgejo repository is a 400.
//
// The notes are Markdown exactly as the forge stores them (`format` is
// always `markdown`). The server neither converts nor sanitises them, so
// a client must render them with raw HTML disabled. They are cut at
// 20,000 characters (`truncated`), and a reaction names at most its
// first 10 people while `count` is the full number.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. A tag that has no published release is a 404, and so is a draft,
// a pre-release or a release with no publish date.
//
// Corresponds with GET /api/releases/details (the `GetReleaseDetails` operationId).
func (c *Client) GetReleaseDetails(ctx context.Context, params *GetReleaseDetailsParams, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetReleaseDetailsRequest(c.Server, params)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// DisableAutoUpdateBranchWithBody Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
func (c *Client) DisableAutoUpdateBranchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDisableAutoUpdateBranchRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// DisableAutoUpdateBranch Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
func (c *Client) DisableAutoUpdateBranch(ctx context.Context, body DisableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDisableAutoUpdateBranchRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnableAutoUpdateBranchWithBody Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
func (c *Client) EnableAutoUpdateBranchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnableAutoUpdateBranchRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnableAutoUpdateBranch Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
func (c *Client) EnableAutoUpdateBranch(ctx context.Context, body EnableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnableAutoUpdateBranchRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// IgnoreRepoWithBody Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
func (c *Client) IgnoreRepoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewIgnoreRepoRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// IgnoreRepo Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
func (c *Client) IgnoreRepo(ctx context.Context, body IgnoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewIgnoreRepoRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// DisableRebaseBotsWithBody Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
func (c *Client) DisableRebaseBotsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDisableRebaseBotsRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// DisableRebaseBots Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
func (c *Client) DisableRebaseBots(ctx context.Context, body DisableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDisableRebaseBotsRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnableRebaseBotsWithBody Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
func (c *Client) EnableRebaseBotsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnableRebaseBotsRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnableRebaseBots Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
func (c *Client) EnableRebaseBots(ctx context.Context, body EnableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnableRebaseBotsRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// UnignoreRepoWithBody Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
func (c *Client) UnignoreRepoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUnignoreRepoRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// UnignoreRepo Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
func (c *Client) UnignoreRepo(ctx context.Context, body UnignoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewUnignoreRepoRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetSettings The signed-in user's own forge configuration
//
// Forge tokens are never returned, only whether one is set. The
// webhook token and secret are returned, since the user pastes them
// into the forge's webhook setup, and a first read creates them. For
// a read that creates nothing and omits both, see
// `GET /api/settings/summary`.
//
// Corresponds with GET /api/settings (the `GetSettings` operationId).
func (c *Client) GetSettings(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetSettingsRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// PutSettingsWithBody Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
func (c *Client) PutSettingsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPutSettingsRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// PutSettings Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
func (c *Client) PutSettings(ctx context.Context, body PutSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewPutSettingsRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetFilterState The signed-in user's own saved dashboard/Insights filter state
//
// A lightweight read of one opaque blob, deliberately not
// GET /api/settings itself for the same reason GET /api/settings/theme
// isn't either: this loads on every dashboard/Insights visit and
// shouldn't provision webhook credentials as a side effect.
// `{}` for a user who's never saved any filters yet, not a 404.
// These are the web UI's own state: a signed-in browser session only,
// and a personal API token is refused with 403.
//
// Corresponds with GET /api/settings/filter-state (the `GetFilterState` operationId).
func (c *Client) GetFilterState(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetFilterStateRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetFilterStateWithBody Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
func (c *Client) SetFilterStateWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetFilterStateRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetFilterState Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
func (c *Client) SetFilterState(ctx context.Context, body SetFilterStateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetFilterStateRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetSettingsSummary The signed-in user's settings, read without side effects
//
// The same data as `GET /api/settings`, minus the webhook token and
// secret, plus `webhookConfigured`. It never provisions webhook
// credentials: for a user who has none yet it answers
// `webhookConfigured: false` and creates nothing. Forge tokens are
// never returned, only whether one is set. It returns exactly what
// the `get_settings` MCP tool returns.
//
// Corresponds with GET /api/settings/summary (the `GetSettingsSummary` operationId).
func (c *Client) GetSettingsSummary(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetSettingsSummaryRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetTheme The signed-in user's own saved theme preference
//
// A lightweight, side-effect-free read of one field — theme — for
// every page to check on load. Deliberately not
// GET /api/settings itself: that handler also provisions webhook
// credentials on first call (EnsureWebhookCredentials), which
// every page loading shouldn't trigger for a user who's never
// opened Settings at all.
//
// Corresponds with GET /api/settings/theme (the `GetTheme` operationId).
func (c *Client) GetTheme(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetThemeRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetThemeWithBody Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
func (c *Client) SetThemeWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetThemeRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetTheme Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
func (c *Client) SetTheme(ctx context.Context, body SetThemeJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetThemeRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetTimezone The signed-in user's own saved time zone
//
// A lightweight, side-effect-free read of one field, for every page to
// check on load so it can show times in the user's zone. Deliberately
// not GET /api/settings, for the reason GET /api/settings/theme isn't.
// Empty means "use the browser's own zone".
//
// Corresponds with GET /api/settings/timezone (the `GetTimezone` operationId).
func (c *Client) GetTimezone(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetTimezoneRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetTimezoneWithBody Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
func (c *Client) SetTimezoneWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetTimezoneRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// SetTimezone Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
func (c *Client) SetTimezone(ctx context.Context, body SetTimezoneJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewSetTimezoneRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetForgeApiStats How many forge API calls the dashboard has spent, and on what
//
// Counts the forge requests made since the server started, so a change
// to what the dashboard refreshes can be shown to have saved budget, and
// a rate-limit incident traced to the refresh that caused it. One bucket
// per forge, credential, refresh `kind` and repository, each with the
// REST calls made, the GraphQL calls made, the GraphQL `rateLimit.cost`
// they were charged, and the requests answered `304 Not Modified`. A 304
// is not charged against the REST budget, so it is counted on its own and
// not as a REST call.
//
// `kind` says why the request was made: `full` (a whole-account
// refresh), `scoped_webhook` (one repository, after a webhook),
// `ci_poll` (one repository, waiting on a running check),
// `auto_merge_poll` (one repository, waiting on an armed auto-merge),
// `details` (a dialog or check list opened), `hook_maintenance`
// (checking, adding or upgrading webhooks), `advisories` (reading a
// repository's open Dependabot alerts, or a Forgejo repository's lockfiles), `user_action` (a button
// pressed, a queued action, or something the dashboard does for you such
// as auto-merge) and `unknown` (a request nobody tagged, which is a bug
// to report). A request that names no repository, such as listing an
// account's repositories, has an empty `repo`.
//
// The counters live in memory and start from zero on every start;
// `since` says when counting began. `credential` names the connected
// account or App installation by a label that carries no secret and no
// user id (`app:<installation id>`, `token:<short hash>`,
// `public:<username>`). Only the buckets of the caller's own
// credentials are returned. They are matched to the credentials
// the caller has saved, and a GitHub App installation id is a number the
// caller types in, so until the dashboard has one user, someone who saves
// another account's installation id sees that installation's counts. `budgets` are the rate limits each forge last
// reported, the same figures as `forges` on GET /api/dashboard.
//
// Corresponds with GET /api/stats/forge-api (the `GetForgeApiStats` operationId).
func (c *Client) GetForgeApiStats(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetForgeApiStatsRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ListAPITokens List the signed-in user's own personal API tokens
//
// Metadata only, per APIToken's own description — a raw value never reappears once created.
//
// Corresponds with GET /api/tokens (the `ListAPITokens` operationId).
func (c *Client) ListAPITokens(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewListAPITokensRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CreateAPITokenWithBody Generate a new personal API token
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
func (c *Client) CreateAPITokenWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateAPITokenRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// CreateAPIToken Generate a new personal API token
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
func (c *Client) CreateAPIToken(ctx context.Context, body CreateAPITokenJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewCreateAPITokenRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// DeleteAPIToken Revoke a personal API token
//
// Stops the token authenticating immediately. Idempotent — deleting
// an id that's already gone (or never belonged to the signed-in
// user) still answers 204, the same as any other delete-by-id
// endpoint here, so a double-click or a retried request isn't an
// error.
//
// Corresponds with DELETE /api/tokens/{id} (the `DeleteAPIToken` operationId).
func (c *Client) DeleteAPIToken(ctx context.Context, id PathTokenID, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewDeleteAPITokenRequest(c.Server, id)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// GetVersion The running server's own version
//
// The tag goreleaser stamped the running binary with ("dev" for a
// build outside the release pipeline). Public and unauthenticated —
// every page, including the pre-login screen, links to the matching
// GitHub release from its footer so a person can tell what's
// actually deployed without shelling into the box.
//
// Corresponds with GET /api/version (the `GetVersion` operationId).
func (c *Client) GetVersion(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewGetVersionRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnsureWebhookWithBody Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
func (c *Client) EnsureWebhookWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnsureWebhookRequestWithBody(c.Server, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// EnsureWebhook Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
func (c *Client) EnsureWebhook(ctx context.Context, body EnsureWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewEnsureWebhookRequest(c.Server, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReceiveForgejoWebhookWithBody Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
func (c *Client) ReceiveForgejoWebhookWithBody(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReceiveForgejoWebhookRequestWithBody(c.Server, webhookToken, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReceiveForgejoWebhook Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
func (c *Client) ReceiveForgejoWebhook(ctx context.Context, webhookToken PathWebhookToken, body ReceiveForgejoWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReceiveForgejoWebhookRequest(c.Server, webhookToken, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReceiveGitHubWebhookWithBody Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
func (c *Client) ReceiveGitHubWebhookWithBody(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReceiveGitHubWebhookRequestWithBody(c.Server, webhookToken, contentType, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// ReceiveGitHubWebhook Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
func (c *Client) ReceiveGitHubWebhook(ctx context.Context, webhookToken PathWebhookToken, body ReceiveGitHubWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReceiveGitHubWebhookRequest(c.Server, webhookToken, body)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// Health Liveness
//
// Answers 200 once the server has started. Doesn't reflect whether
// either forge is reachable — see forges[].reachable on the dashboard
// response for that.
//
// Corresponds with GET /healthz (the `Health` operationId).
func (c *Client) Health(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewHealthRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// Ready Readiness
//
// Answers 200 once the server can actually serve: the database answers
// a ping with its schema in place, and the first dashboard refresh has
// completed, or 30 seconds have passed since it started. The wait is
// bounded because how fast a forge answers is how fresh the data is,
// not whether the server can serve: a slow or unreachable forge must not
// keep the container unready. A refresh that finished with a forge
// unreachable counts, and a forge going unreachable afterwards never
// turns this into a 503. See forges[].reachable on the dashboard
// response for that. Before any account has signed in there is no
// refresh to wait for, so only the database is checked.
//
// The database ping gets 2 seconds, less than the HEALTHCHECK's own 5,
// so a database that doesn't answer turns into a 503 instead of a hung
// probe. The ping's result, pass or fail, is reused for about 3
// seconds, so probes arriving every second don't each reach the
// database. On SIGTERM this answers 503 ("shutting down") at once, and
// the server waits a drain period (`SHUTDOWN_DRAIN`, default 5 seconds)
// before it stops accepting connections, so a router that polls this
// path stops sending traffic first.
//
// The container's HEALTHCHECK probes this path (`/healthz` stays the
// cheap liveness answer), so Docker's single health state and Compose's
// `depends_on: condition: service_healthy` mean "ready", not just
// "started".
//
// Corresponds with GET /readyz (the `Ready` operationId).
func (c *Client) Ready(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) {
req, err := NewReadyRequest(c.Server)
if err != nil {
return nil, err
}
req = req.WithContext(ctx)
if err := c.applyEditors(ctx, req, reqEditors); err != nil {
return nil, err
}
return c.Client.Do(req)
}
// NewListCredentialsRequest constructs an http.Request for the ListCredentials method
func NewListCredentialsRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/credentials")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewBeginAddCredentialRequest constructs an http.Request for the BeginAddCredential method
func NewBeginAddCredentialRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/credentials/begin")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewFinishAddCredentialRequest calls the generic FinishAddCredential builder with application/json body
func NewFinishAddCredentialRequest(server string, params *FinishAddCredentialParams, body FinishAddCredentialJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewFinishAddCredentialRequestWithBody(server, params, "application/json", bodyReader)
}
// NewFinishAddCredentialRequestWithBody constructs an http.Request for the FinishAddCredential method, with any body, and a specified content type
func NewFinishAddCredentialRequestWithBody(server string, params *FinishAddCredentialParams, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/credentials/finish")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "label", params.Label, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDeleteCredentialRequest constructs an http.Request for the DeleteCredential method
func NewDeleteCredentialRequest(server string, id string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/credentials/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewRenameCredentialRequest calls the generic RenameCredential builder with application/json body
func NewRenameCredentialRequest(server string, id string, body RenameCredentialJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewRenameCredentialRequestWithBody(server, id, "application/json", bodyReader)
}
// NewRenameCredentialRequestWithBody constructs an http.Request for the RenameCredential method, with any body, and a specified content type
func NewRenameCredentialRequestWithBody(server string, id string, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/credentials/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewBeginLoginRequest constructs an http.Request for the BeginLogin method
func NewBeginLoginRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/login/begin")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewFinishLoginRequest calls the generic FinishLogin builder with application/json body
func NewFinishLoginRequest(server string, body FinishLoginJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewFinishLoginRequestWithBody(server, "application/json", bodyReader)
}
// NewFinishLoginRequestWithBody constructs an http.Request for the FinishLogin method, with any body, and a specified content type
func NewFinishLoginRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/login/finish")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewLogoutRequest constructs an http.Request for the Logout method
func NewLogoutRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/logout")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewBeginRegistrationRequest constructs an http.Request for the BeginRegistration method
func NewBeginRegistrationRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/register/begin")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewFinishRegistrationRequest calls the generic FinishRegistration builder with application/json body
func NewFinishRegistrationRequest(server string, body FinishRegistrationJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewFinishRegistrationRequestWithBody(server, "application/json", bodyReader)
}
// NewFinishRegistrationRequestWithBody constructs an http.Request for the FinishRegistration method, with any body, and a specified content type
func NewFinishRegistrationRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/register/finish")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetRegistrationStatusRequest constructs an http.Request for the GetRegistrationStatus method
func NewGetRegistrationStatusRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/registration-status")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetSessionRequest constructs an http.Request for the GetSession method
func NewGetSessionRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/auth/session")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewCancelWorkflowRunRequest calls the generic CancelWorkflowRun builder with application/json body
func NewCancelWorkflowRunRequest(server string, body CancelWorkflowRunJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCancelWorkflowRunRequestWithBody(server, "application/json", bodyReader)
}
// NewCancelWorkflowRunRequestWithBody constructs an http.Request for the CancelWorkflowRun method, with any body, and a specified content type
func NewCancelWorkflowRunRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/checks/cancel-run")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetCheckLogRequest constructs an http.Request for the GetCheckLog method
func NewGetCheckLogRequest(server string, params *GetCheckLogParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/checks/log")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "forge", params.Forge, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "fullName", params.FullName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "jobId", params.JobId, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if params.Excerpt != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "excerpt", *params.Excerpt, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetDashboardRequest constructs an http.Request for the GetDashboard method
func NewGetDashboardRequest(server string, params *GetDashboardParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/dashboard")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if params.IncludeDrafts != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeDrafts", *params.IncludeDrafts, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if params.IncludeHidden != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeHidden", *params.IncludeHidden, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
if params != nil {
if params.XBackgroundRead != nil {
var headerParam0 string
headerParam0, err = runtime.StyleParamWithOptions("simple", false, "X-Background-Read", *params.XBackgroundRead, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationHeader, Type: "string", Format: ""})
if err != nil {
return nil, err
}
req.Header.Set("X-Background-Read", headerParam0)
}
}
return req, nil
}
// NewRefreshDashboardRequest constructs an http.Request for the RefreshDashboard method
func NewRefreshDashboardRequest(server string, params *RefreshDashboardParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/dashboard/refresh")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if params.IncludeDrafts != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeDrafts", *params.IncludeDrafts, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if params.IncludeHidden != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeHidden", *params.IncludeHidden, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewStreamDashboardRequest constructs an http.Request for the StreamDashboard method
func NewStreamDashboardRequest(server string, params *StreamDashboardParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/dashboard/stream")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if params.IncludeDrafts != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeDrafts", *params.IncludeDrafts, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if params.IncludeHidden != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "includeHidden", *params.IncludeHidden, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "boolean", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if params.Sid != nil {
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "sid", *params.Sid, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewWatchDashboardStreamChecksRequest calls the generic WatchDashboardStreamChecks builder with application/json body
func NewWatchDashboardStreamChecksRequest(server string, body WatchDashboardStreamChecksJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewWatchDashboardStreamChecksRequestWithBody(server, "application/json", bodyReader)
}
// NewWatchDashboardStreamChecksRequestWithBody constructs an http.Request for the WatchDashboardStreamChecks method, with any body, and a specified content type
func NewWatchDashboardStreamChecksRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/dashboard/stream/watch")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewCloseIssueRequest calls the generic CloseIssue builder with application/json body
func NewCloseIssueRequest(server string, body CloseIssueJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCloseIssueRequestWithBody(server, "application/json", bodyReader)
}
// NewCloseIssueRequestWithBody constructs an http.Request for the CloseIssue method, with any body, and a specified content type
func NewCloseIssueRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/issues/close")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewCommentOnIssueRequest calls the generic CommentOnIssue builder with application/json body
func NewCommentOnIssueRequest(server string, body CommentOnIssueJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCommentOnIssueRequestWithBody(server, "application/json", bodyReader)
}
// NewCommentOnIssueRequestWithBody constructs an http.Request for the CommentOnIssue method, with any body, and a specified content type
func NewCommentOnIssueRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/issues/comment")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetIssueDetailsRequest constructs an http.Request for the GetIssueDetails method
func NewGetIssueDetailsRequest(server string, params *GetIssueDetailsParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/issues/details")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "forge", params.Forge, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "fullName", params.FullName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "number", params.Number, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewReopenIssueRequest calls the generic ReopenIssue builder with application/json body
func NewReopenIssueRequest(server string, body ReopenIssueJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewReopenIssueRequestWithBody(server, "application/json", bodyReader)
}
// NewReopenIssueRequestWithBody constructs an http.Request for the ReopenIssue method, with any body, and a specified content type
func NewReopenIssueRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/issues/reopen")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetMainBranchesRequest constructs an http.Request for the GetMainBranches method
func NewGetMainBranchesRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/main-branches")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewListAdvisoriesRequest constructs an http.Request for the ListAdvisories method
func NewListAdvisoriesRequest(server string, params *ListAdvisoriesParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/main-branches/advisories")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "forge", params.Forge, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "fullName", params.FullName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewRerunMainBranchChecksRequest calls the generic RerunMainBranchChecks builder with application/json body
func NewRerunMainBranchChecksRequest(server string, body RerunMainBranchChecksJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewRerunMainBranchChecksRequestWithBody(server, "application/json", bodyReader)
}
// NewRerunMainBranchChecksRequestWithBody constructs an http.Request for the RerunMainBranchChecks method, with any body, and a specified content type
func NewRerunMainBranchChecksRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/main-branches/rerun-checks")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewReportDashboardPresenceRequest calls the generic ReportDashboardPresence builder with application/json body
func NewReportDashboardPresenceRequest(server string, body ReportDashboardPresenceJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewReportDashboardPresenceRequestWithBody(server, "application/json", bodyReader)
}
// NewReportDashboardPresenceRequestWithBody constructs an http.Request for the ReportDashboardPresence method, with any body, and a specified content type
func NewReportDashboardPresenceRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/presence")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewEnablePullRequestAutoMergeRequest calls the generic EnablePullRequestAutoMerge builder with application/json body
func NewEnablePullRequestAutoMergeRequest(server string, body EnablePullRequestAutoMergeJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewEnablePullRequestAutoMergeRequestWithBody(server, "application/json", bodyReader)
}
// NewEnablePullRequestAutoMergeRequestWithBody constructs an http.Request for the EnablePullRequestAutoMerge method, with any body, and a specified content type
func NewEnablePullRequestAutoMergeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/auto-merge")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewCancelPullRequestAutoMergeRequest calls the generic CancelPullRequestAutoMerge builder with application/json body
func NewCancelPullRequestAutoMergeRequest(server string, body CancelPullRequestAutoMergeJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCancelPullRequestAutoMergeRequestWithBody(server, "application/json", bodyReader)
}
// NewCancelPullRequestAutoMergeRequestWithBody constructs an http.Request for the CancelPullRequestAutoMerge method, with any body, and a specified content type
func NewCancelPullRequestAutoMergeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/auto-merge/cancel")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewSetPullRequestAutoUpdateRequest calls the generic SetPullRequestAutoUpdate builder with application/json body
func NewSetPullRequestAutoUpdateRequest(server string, body SetPullRequestAutoUpdateJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewSetPullRequestAutoUpdateRequestWithBody(server, "application/json", bodyReader)
}
// NewSetPullRequestAutoUpdateRequestWithBody constructs an http.Request for the SetPullRequestAutoUpdate method, with any body, and a specified content type
func NewSetPullRequestAutoUpdateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/auto-update")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewClosePullRequestRequest calls the generic ClosePullRequest builder with application/json body
func NewClosePullRequestRequest(server string, body ClosePullRequestJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewClosePullRequestRequestWithBody(server, "application/json", bodyReader)
}
// NewClosePullRequestRequestWithBody constructs an http.Request for the ClosePullRequest method, with any body, and a specified content type
func NewClosePullRequestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/close")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewPostPullRequestDependabotActionRequest calls the generic PostPullRequestDependabotAction builder with application/json body
func NewPostPullRequestDependabotActionRequest(server string, body PostPullRequestDependabotActionJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPostPullRequestDependabotActionRequestWithBody(server, "application/json", bodyReader)
}
// NewPostPullRequestDependabotActionRequestWithBody constructs an http.Request for the PostPullRequestDependabotAction method, with any body, and a specified content type
func NewPostPullRequestDependabotActionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/dependabot-action")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetPullRequestDetailsRequest constructs an http.Request for the GetPullRequestDetails method
func NewGetPullRequestDetailsRequest(server string, params *GetPullRequestDetailsParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/details")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "forge", params.Forge, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "fullName", params.FullName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "number", params.Number, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewHidePullRequestRequest calls the generic HidePullRequest builder with application/json body
func NewHidePullRequestRequest(server string, body HidePullRequestJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewHidePullRequestRequestWithBody(server, "application/json", bodyReader)
}
// NewHidePullRequestRequestWithBody constructs an http.Request for the HidePullRequest method, with any body, and a specified content type
func NewHidePullRequestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/hide")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewMergePullRequestRequest calls the generic MergePullRequest builder with application/json body
func NewMergePullRequestRequest(server string, body MergePullRequestJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewMergePullRequestRequestWithBody(server, "application/json", bodyReader)
}
// NewMergePullRequestRequestWithBody constructs an http.Request for the MergePullRequest method, with any body, and a specified content type
func NewMergePullRequestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/merge")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewPostPullRequestRenovateRebaseRequest calls the generic PostPullRequestRenovateRebase builder with application/json body
func NewPostPullRequestRenovateRebaseRequest(server string, body PostPullRequestRenovateRebaseJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPostPullRequestRenovateRebaseRequestWithBody(server, "application/json", bodyReader)
}
// NewPostPullRequestRenovateRebaseRequestWithBody constructs an http.Request for the PostPullRequestRenovateRebase method, with any body, and a specified content type
func NewPostPullRequestRenovateRebaseRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/renovate-rebase")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewCancelPullRequestRenovateRebaseRequest calls the generic CancelPullRequestRenovateRebase builder with application/json body
func NewCancelPullRequestRenovateRebaseRequest(server string, body CancelPullRequestRenovateRebaseJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCancelPullRequestRenovateRebaseRequestWithBody(server, "application/json", bodyReader)
}
// NewCancelPullRequestRenovateRebaseRequestWithBody constructs an http.Request for the CancelPullRequestRenovateRebase method, with any body, and a specified content type
func NewCancelPullRequestRenovateRebaseRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/renovate-rebase/cancel")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewReopenPullRequestRequest calls the generic ReopenPullRequest builder with application/json body
func NewReopenPullRequestRequest(server string, body ReopenPullRequestJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewReopenPullRequestRequestWithBody(server, "application/json", bodyReader)
}
// NewReopenPullRequestRequestWithBody constructs an http.Request for the ReopenPullRequest method, with any body, and a specified content type
func NewReopenPullRequestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/reopen")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewRerunPullRequestChecksRequest calls the generic RerunPullRequestChecks builder with application/json body
func NewRerunPullRequestChecksRequest(server string, body RerunPullRequestChecksJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewRerunPullRequestChecksRequestWithBody(server, "application/json", bodyReader)
}
// NewRerunPullRequestChecksRequestWithBody constructs an http.Request for the RerunPullRequestChecks method, with any body, and a specified content type
func NewRerunPullRequestChecksRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/rerun-checks")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewUnhidePullRequestRequest calls the generic UnhidePullRequest builder with application/json body
func NewUnhidePullRequestRequest(server string, body UnhidePullRequestJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewUnhidePullRequestRequestWithBody(server, "application/json", bodyReader)
}
// NewUnhidePullRequestRequestWithBody constructs an http.Request for the UnhidePullRequest method, with any body, and a specified content type
func NewUnhidePullRequestRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/unhide")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewUpdatePullRequestBranchRequest calls the generic UpdatePullRequestBranch builder with application/json body
func NewUpdatePullRequestBranchRequest(server string, body UpdatePullRequestBranchJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewUpdatePullRequestBranchRequestWithBody(server, "application/json", bodyReader)
}
// NewUpdatePullRequestBranchRequestWithBody constructs an http.Request for the UpdatePullRequestBranch method, with any body, and a specified content type
func NewUpdatePullRequestBranchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/pull-requests/update-branch")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewListQueuedActionsRequest constructs an http.Request for the ListQueuedActions method
func NewListQueuedActionsRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/queued-actions")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewQueueActionRequest calls the generic QueueAction builder with application/json body
func NewQueueActionRequest(server string, body QueueActionJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewQueueActionRequestWithBody(server, "application/json", bodyReader)
}
// NewQueueActionRequestWithBody constructs an http.Request for the QueueAction method, with any body, and a specified content type
func NewQueueActionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/queued-actions")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewCancelQueuedActionRequest constructs an http.Request for the CancelQueuedAction method
func NewCancelQueuedActionRequest(server string, id string) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/queued-actions/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetReleaseDetailsRequest constructs an http.Request for the GetReleaseDetails method
func NewGetReleaseDetailsRequest(server string, params *GetReleaseDetailsParams) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/releases/details")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
if params != nil {
// queryValues collects non-styled parameters (passthrough, JSON)
// that are safe to round-trip through url.Values.Encode().
queryValues := queryURL.Query()
// rawQueryFragments collects pre-encoded query fragments from
// styled parameters, preserving literal commas as delimiters
// per the OpenAPI spec (e.g. "color=blue,black,brown").
var rawQueryFragments []string
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "forge", params.Forge, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "fullName", params.FullName, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if queryFrag, err := runtime.StyleParamWithOptions("form", true, "tag", params.Tag, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil {
return nil, err
} else {
for _, qp := range strings.Split(queryFrag, "&") {
rawQueryFragments = append(rawQueryFragments, qp)
}
}
if encoded := queryValues.Encode(); encoded != "" {
rawQueryFragments = append(rawQueryFragments, encoded)
}
queryURL.RawQuery = strings.Join(rawQueryFragments, "&")
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewDisableAutoUpdateBranchRequest calls the generic DisableAutoUpdateBranch builder with application/json body
func NewDisableAutoUpdateBranchRequest(server string, body DisableAutoUpdateBranchJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewDisableAutoUpdateBranchRequestWithBody(server, "application/json", bodyReader)
}
// NewDisableAutoUpdateBranchRequestWithBody constructs an http.Request for the DisableAutoUpdateBranch method, with any body, and a specified content type
func NewDisableAutoUpdateBranchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/repos/auto-update-branch/disable")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewEnableAutoUpdateBranchRequest calls the generic EnableAutoUpdateBranch builder with application/json body
func NewEnableAutoUpdateBranchRequest(server string, body EnableAutoUpdateBranchJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewEnableAutoUpdateBranchRequestWithBody(server, "application/json", bodyReader)
}
// NewEnableAutoUpdateBranchRequestWithBody constructs an http.Request for the EnableAutoUpdateBranch method, with any body, and a specified content type
func NewEnableAutoUpdateBranchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/repos/auto-update-branch/enable")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewIgnoreRepoRequest calls the generic IgnoreRepo builder with application/json body
func NewIgnoreRepoRequest(server string, body IgnoreRepoJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewIgnoreRepoRequestWithBody(server, "application/json", bodyReader)
}
// NewIgnoreRepoRequestWithBody constructs an http.Request for the IgnoreRepo method, with any body, and a specified content type
func NewIgnoreRepoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/repos/ignore")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDisableRebaseBotsRequest calls the generic DisableRebaseBots builder with application/json body
func NewDisableRebaseBotsRequest(server string, body DisableRebaseBotsJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewDisableRebaseBotsRequestWithBody(server, "application/json", bodyReader)
}
// NewDisableRebaseBotsRequestWithBody constructs an http.Request for the DisableRebaseBots method, with any body, and a specified content type
func NewDisableRebaseBotsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/repos/rebase-bots/disable")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewEnableRebaseBotsRequest calls the generic EnableRebaseBots builder with application/json body
func NewEnableRebaseBotsRequest(server string, body EnableRebaseBotsJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewEnableRebaseBotsRequestWithBody(server, "application/json", bodyReader)
}
// NewEnableRebaseBotsRequestWithBody constructs an http.Request for the EnableRebaseBots method, with any body, and a specified content type
func NewEnableRebaseBotsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/repos/rebase-bots/enable")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewUnignoreRepoRequest calls the generic UnignoreRepo builder with application/json body
func NewUnignoreRepoRequest(server string, body UnignoreRepoJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewUnignoreRepoRequestWithBody(server, "application/json", bodyReader)
}
// NewUnignoreRepoRequestWithBody constructs an http.Request for the UnignoreRepo method, with any body, and a specified content type
func NewUnignoreRepoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/repos/unignore")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetSettingsRequest constructs an http.Request for the GetSettings method
func NewGetSettingsRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewPutSettingsRequest calls the generic PutSettings builder with application/json body
func NewPutSettingsRequest(server string, body PutSettingsJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewPutSettingsRequestWithBody(server, "application/json", bodyReader)
}
// NewPutSettingsRequestWithBody constructs an http.Request for the PutSettings method, with any body, and a specified content type
func NewPutSettingsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPut, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetFilterStateRequest constructs an http.Request for the GetFilterState method
func NewGetFilterStateRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/filter-state")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewSetFilterStateRequest calls the generic SetFilterState builder with application/json body
func NewSetFilterStateRequest(server string, body SetFilterStateJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewSetFilterStateRequestWithBody(server, "application/json", bodyReader)
}
// NewSetFilterStateRequestWithBody constructs an http.Request for the SetFilterState method, with any body, and a specified content type
func NewSetFilterStateRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/filter-state")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPut, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetSettingsSummaryRequest constructs an http.Request for the GetSettingsSummary method
func NewGetSettingsSummaryRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/summary")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetThemeRequest constructs an http.Request for the GetTheme method
func NewGetThemeRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/theme")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewSetThemeRequest calls the generic SetTheme builder with application/json body
func NewSetThemeRequest(server string, body SetThemeJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewSetThemeRequestWithBody(server, "application/json", bodyReader)
}
// NewSetThemeRequestWithBody constructs an http.Request for the SetTheme method, with any body, and a specified content type
func NewSetThemeRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/theme")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPut, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetTimezoneRequest constructs an http.Request for the GetTimezone method
func NewGetTimezoneRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/timezone")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewSetTimezoneRequest calls the generic SetTimezone builder with application/json body
func NewSetTimezoneRequest(server string, body SetTimezoneJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewSetTimezoneRequestWithBody(server, "application/json", bodyReader)
}
// NewSetTimezoneRequestWithBody constructs an http.Request for the SetTimezone method, with any body, and a specified content type
func NewSetTimezoneRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/settings/timezone")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPut, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewGetForgeApiStatsRequest constructs an http.Request for the GetForgeApiStats method
func NewGetForgeApiStatsRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/stats/forge-api")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewListAPITokensRequest constructs an http.Request for the ListAPITokens method
func NewListAPITokensRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/tokens")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewCreateAPITokenRequest calls the generic CreateAPIToken builder with application/json body
func NewCreateAPITokenRequest(server string, body CreateAPITokenJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewCreateAPITokenRequestWithBody(server, "application/json", bodyReader)
}
// NewCreateAPITokenRequestWithBody constructs an http.Request for the CreateAPIToken method, with any body, and a specified content type
func NewCreateAPITokenRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/tokens")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewDeleteAPITokenRequest constructs an http.Request for the DeleteAPIToken method
func NewDeleteAPITokenRequest(server string, id PathTokenID) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/tokens/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewGetVersionRequest constructs an http.Request for the GetVersion method
func NewGetVersionRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/version")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewEnsureWebhookRequest calls the generic EnsureWebhook builder with application/json body
func NewEnsureWebhookRequest(server string, body EnsureWebhookJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewEnsureWebhookRequestWithBody(server, "application/json", bodyReader)
}
// NewEnsureWebhookRequestWithBody constructs an http.Request for the EnsureWebhook method, with any body, and a specified content type
func NewEnsureWebhookRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/webhooks/ensure")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewReceiveForgejoWebhookRequest calls the generic ReceiveForgejoWebhook builder with application/json body
func NewReceiveForgejoWebhookRequest(server string, webhookToken PathWebhookToken, body ReceiveForgejoWebhookJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewReceiveForgejoWebhookRequestWithBody(server, webhookToken, "application/json", bodyReader)
}
// NewReceiveForgejoWebhookRequestWithBody constructs an http.Request for the ReceiveForgejoWebhook method, with any body, and a specified content type
func NewReceiveForgejoWebhookRequestWithBody(server string, webhookToken PathWebhookToken, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithOptions("simple", false, "webhookToken", webhookToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/webhooks/forgejo/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewReceiveGitHubWebhookRequest calls the generic ReceiveGitHubWebhook builder with application/json body
func NewReceiveGitHubWebhookRequest(server string, webhookToken PathWebhookToken, body ReceiveGitHubWebhookJSONRequestBody) (*http.Request, error) {
var bodyReader io.Reader
buf, err := json.Marshal(body)
if err != nil {
return nil, err
}
bodyReader = bytes.NewReader(buf)
return NewReceiveGitHubWebhookRequestWithBody(server, webhookToken, "application/json", bodyReader)
}
// NewReceiveGitHubWebhookRequestWithBody constructs an http.Request for the ReceiveGitHubWebhook method, with any body, and a specified content type
func NewReceiveGitHubWebhookRequestWithBody(server string, webhookToken PathWebhookToken, contentType string, body io.Reader) (*http.Request, error) {
var err error
var pathParam0 string
pathParam0, err = runtime.StyleParamWithOptions("simple", false, "webhookToken", webhookToken, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""})
if err != nil {
return nil, err
}
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/api/webhooks/github/%s", pathParam0)
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodPost, queryURL.String(), body)
if err != nil {
return nil, err
}
req.Header.Add("Content-Type", contentType)
return req, nil
}
// NewHealthRequest constructs an http.Request for the Health method
func NewHealthRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/healthz")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
// NewReadyRequest constructs an http.Request for the Ready method
func NewReadyRequest(server string) (*http.Request, error) {
var err error
serverURL, err := url.Parse(server)
if err != nil {
return nil, err
}
operationPath := fmt.Sprintf("/readyz")
if operationPath[0] == '/' {
operationPath = "." + operationPath
}
queryURL, err := serverURL.Parse(operationPath)
if err != nil {
return nil, err
}
req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil)
if err != nil {
return nil, err
}
return req, nil
}
func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
for _, r := range c.RequestEditors {
if err := r(ctx, req); err != nil {
return err
}
}
for _, r := range additionalEditors {
if err := r(ctx, req); err != nil {
return err
}
}
return nil
}
// ClientWithResponses builds on ClientInterface to offer response payloads
type ClientWithResponses struct {
ClientInterface
}
// NewClientWithResponses creates a new ClientWithResponses, which wraps
// Client with return type handling
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
client, err := NewClient(server, opts...)
if err != nil {
return nil, err
}
return &ClientWithResponses{client}, nil
}
// WithBaseURL overrides the baseURL.
func WithBaseURL(baseURL string) ClientOption {
return func(c *Client) error {
newBaseURL, err := url.Parse(baseURL)
if err != nil {
return err
}
c.Server = newBaseURL.String()
return nil
}
}
// ClientWithResponsesInterface is the interface specification for the client with responses above.
type ClientWithResponsesInterface interface {
// ListCredentialsWithResponse List the signed-in user's own passkeys
//
// Every passkey on the account, oldest first — not just the
// one used to establish the current session.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/auth/credentials (the `ListCredentials` operationId).
ListCredentialsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListCredentialsResponse, error)
// BeginAddCredentialWithResponse Start a ceremony to add another passkey to the signed-in account
//
// The authenticated counterpart to POST /api/auth/register/begin —
// that one only ever works for a brand-new, credential-less
// account; this is how an already-registered user adds a second
// (or third...) passkey, e.g. a laptop and a security key. Like the
// first registration it requires a resident key.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/credentials/begin (the `BeginAddCredential` operationId).
BeginAddCredentialWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*BeginAddCredentialResponse, error)
// FinishAddCredentialWithBodyWithResponse Complete an add-credential ceremony
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
FinishAddCredentialWithBodyWithResponse(ctx context.Context, params *FinishAddCredentialParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishAddCredentialResponse, error)
// FinishAddCredentialWithResponse Complete an add-credential ceremony
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
FinishAddCredentialWithResponse(ctx context.Context, params *FinishAddCredentialParams, body FinishAddCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishAddCredentialResponse, error)
// DeleteCredentialWithResponse Remove one of the signed-in user's own passkeys
//
// Refused on the account's last remaining passkey — this
// app is WebAuthn-only with no password fallback, so deleting it
// would lock the account out entirely.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/auth/credentials/{id} (the `DeleteCredential` operationId).
DeleteCredentialWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteCredentialResponse, error)
// RenameCredentialWithBodyWithResponse Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
RenameCredentialWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameCredentialResponse, error)
// RenameCredentialWithResponse Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
RenameCredentialWithResponse(ctx context.Context, id string, body RenameCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameCredentialResponse, error)
// BeginLoginWithResponse Start a passkey login ceremony
//
// An instance has one user, so there is nothing to name and the request
// carries no body. The options name no passkey and no user, so the
// browser offers whichever discoverable passkey it holds for the site
// and nothing about the account is revealed to a visitor.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/login/begin (the `BeginLogin` operationId).
BeginLoginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*BeginLoginResponse, error)
// FinishLoginWithBodyWithResponse Complete a passkey login ceremony
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
FinishLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error)
// FinishLoginWithResponse Complete a passkey login ceremony
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
FinishLoginWithResponse(ctx context.Context, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error)
// LogoutWithResponse End the current session
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/logout (the `Logout` operationId).
LogoutWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*LogoutResponse, error)
// BeginRegistrationWithResponse Start a passkey registration ceremony
//
// An instance has one user. The first registration on a fresh
// instance (see GET /api/auth/registration-status) creates that
// user and the server names it, so the request carries no body. The
// options require a resident key, so the passkey can be found at
// sign-in without being named. Once any account holds a passkey, this
// answers 403.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/register/begin (the `BeginRegistration` operationId).
BeginRegistrationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*BeginRegistrationResponse, error)
// FinishRegistrationWithBodyWithResponse Complete a passkey registration ceremony
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
FinishRegistrationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error)
// FinishRegistrationWithResponse Complete a passkey registration ceremony
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
FinishRegistrationWithResponse(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error)
// GetRegistrationStatusWithResponse Whether self-registration is open
//
// Unauthenticated — a visitor deciding whether to show the login
// page's own "Register a new passkey instead" button has no session
// yet by definition. `open` is true only on a fresh instance with
// zero registered users; once any account holds a passkey,
// registration is closed for good. More passkeys for that account are
// added from Settings.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/auth/registration-status (the `GetRegistrationStatus` operationId).
GetRegistrationStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRegistrationStatusResponse, error)
// GetSessionWithResponse Who, if anyone, the current session cookie belongs to
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/auth/session (the `GetSession` operationId).
GetSessionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSessionResponse, error)
// CancelWorkflowRunWithBodyWithResponse Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
CancelWorkflowRunWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelWorkflowRunResponse, error)
// CancelWorkflowRunWithResponse Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
CancelWorkflowRunWithResponse(ctx context.Context, body CancelWorkflowRunJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelWorkflowRunResponse, error)
// GetCheckLogWithResponse Read the output of one CI job, on demand
//
// The output behind a `Check` that carries a `jobId`, as plain text: colour
// codes and carriage returns removed, never markup, so a client must render
// it as text. Whatever the forge already masks stays masked. Only the last
// 256 KiB are returned; `truncated` says the start was cut.
//
// Only for a repository the dashboard tracks for you; any other answers 404
// without asking the forge.
//
// Fetched live on every call and never as part of a snapshot, since a log
// can be large and most are never opened. GitHub reads the job's log
// through its REST API (one request, then a short-lived download). Forgejo
// reads it through the job logs endpoint of its Actions API.
//
// A forge can refuse: the token may not read logs, the log may have
// expired, or the check may not be an Actions job at all. Those answer 403
// or 404 with a sentence a person can read.
//
// With `excerpt=true` the answer is the failed job's excerpt instead: `text`
// holds the last lines of the log with per-line timestamps and colour codes
// removed, at most 2,000 characters, and `truncated` is always false (an
// excerpt is a fixed-size tail, not a cut of what was asked for). Only
// Forgejo serves it; GitHub fills a check's `excerpt` itself when the
// checks are listed. A job whose log is gone or empty answers 200 with
// empty `text`, so a client can show the check without it. A job's excerpt
// is read once and kept once it finished, so asking again costs no
// request to the forge. A client asks for the few failed jobs it is about
// to show (the panel asks for the newest five), not for every job of a
// list.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/checks/log (the `GetCheckLog` operationId).
GetCheckLogWithResponse(ctx context.Context, params *GetCheckLogParams, reqEditors ...RequestEditorFn) (*GetCheckLogResponse, error)
// GetDashboardWithResponse The aggregated view
//
// Returns the most recently fetched snapshot. The backend refreshes
// this on its own schedule in the background; this endpoint never
// blocks on a live call to either forge, so it answers instantly even
// when a forge is slow or unreachable.
//
// Always the signed-in user's own dashboard.
//
// Draft pull requests are left out unless `includeDrafts=true`, and
// `hiddenDrafts` counts only the drafts in repos the user hasn't
// ignored, the same repos whose other pull requests show.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/dashboard (the `GetDashboard` operationId).
GetDashboardWithResponse(ctx context.Context, params *GetDashboardParams, reqEditors ...RequestEditorFn) (*GetDashboardResponse, error)
// RefreshDashboardWithResponse Trigger an immediate refresh of the signed-in user's own dashboard
//
// Blocks until an immediate, out-of-band refresh of the signed-in
// user's own dashboard completes, then returns the resulting
// snapshot — for retrying right away after a forge was only
// briefly unreachable, instead of waiting for the next scheduled
// background refresh.
//
// The server holds a five-second cooldown, so this can't
// be used to hammer a forge's API budget. A call inside that
// window does not fetch: it answers 200 with the current snapshot
// and a `Retry-After` header carrying the seconds left. Never a
// 429, because the page calls this straight after a merge, close
// or branch update to show the result, and a refusal there would
// leave the row stale. Only a call that actually fetched answers
// without the header.
//
// The same goes for a call made while the first refresh since the
// server started is still running: it answers at once with the
// current snapshot and `Retry-After`, instead of waiting for that
// refresh to finish.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/dashboard/refresh (the `RefreshDashboard` operationId).
RefreshDashboardWithResponse(ctx context.Context, params *RefreshDashboardParams, reqEditors ...RequestEditorFn) (*RefreshDashboardResponse, error)
// StreamDashboardWithResponse Server-Sent Events stream of the signed-in user's own dashboard
//
// Pushes a fresh snapshot every time this user's background
// refresh produces one — most notably right after a verified
// webhook delivery (see the webhooks tag) triggers an immediate
// one, which is what turns that into a live update instead of
// something only the next scheduled refresh picks up.
//
// The frontend's own 30-second poll against GET /api/dashboard
// keeps running unconditionally, connected or not — a browser or
// proxy that can't hold an SSE connection open just never
// benefits from this, rather than the dashboard going stale
// silently.
//
// `includeDrafts` is read once, when the connection opens, and
// applies to every event on it. A client that changes its mind
// reconnects with the new value.
//
// A client that passes `sid` can also follow the job lists of the
// pull requests and default branches it has open, through
// `POST /api/dashboard/stream/watch`. Each list arrives as named
// `run` events on this stream, one for each workflow run attempt, so a
// client that only listens for default messages never sees one. A
// reconnect reuses the same `sid` with nothing watched, so the client
// sends its watch again.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/dashboard/stream (the `StreamDashboard` operationId).
StreamDashboardWithResponse(ctx context.Context, params *StreamDashboardParams, reqEditors ...RequestEditorFn) (*StreamDashboardResponse, error)
// WatchDashboardStreamChecksWithBodyWithResponse Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
WatchDashboardStreamChecksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WatchDashboardStreamChecksResponse, error)
// WatchDashboardStreamChecksWithResponse Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
WatchDashboardStreamChecksWithResponse(ctx context.Context, body WatchDashboardStreamChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*WatchDashboardStreamChecksResponse, error)
// CloseIssueWithBodyWithResponse Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
CloseIssueWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CloseIssueResponse, error)
// CloseIssueWithResponse Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
CloseIssueWithResponse(ctx context.Context, body CloseIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*CloseIssueResponse, error)
// CommentOnIssueWithBodyWithResponse Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
CommentOnIssueWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CommentOnIssueResponse, error)
// CommentOnIssueWithResponse Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
CommentOnIssueWithResponse(ctx context.Context, body CommentOnIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*CommentOnIssueResponse, error)
// GetIssueDetailsWithResponse Read an issue's description, comments and reactions, on demand
//
// What the issue dialog shows: the description, the conversation in
// order, and the thumbs up and thumbs down reactions on each with who
// gave them. The same shape and rules as GET /api/pull-requests/details
// without the release notes, which only a pull request has. Fetched live
// on every call, never as part of GET /api/dashboard's snapshot.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// issue, one for its comments, one for the description's reactions and
// one for each comment's reactions (up to 50), so the reaction calls run
// at most eight at a time and stop at the first rate limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so a
// client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged and
// never proxied.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. An issue that doesn't exist is a 404, and a forge that
// can't be read is an error, never an empty thread.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/issues/details (the `GetIssueDetails` operationId).
GetIssueDetailsWithResponse(ctx context.Context, params *GetIssueDetailsParams, reqEditors ...RequestEditorFn) (*GetIssueDetailsResponse, error)
// ReopenIssueWithBodyWithResponse Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
ReopenIssueWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReopenIssueResponse, error)
// ReopenIssueWithResponse Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
ReopenIssueWithResponse(ctx context.Context, body ReopenIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*ReopenIssueResponse, error)
// GetMainBranchesWithResponse The CI status of every tracked repository's default branch
//
// One row per tracked repository, showing the latest pipeline on its
// default branch: failed, passed, running or none. A repository
// ignored for pull requests is left out, as on the pull requests page.
// Every other row is returned, whatever its status, and no tally comes
// with them, so a client filters, sorts and counts locally and its pill
// counts always match what each pill lists. Rows come in no particular
// order: the client orders them.
//
// Served from the snapshot the background refresh already holds, so it
// never calls a forge. On GitHub the branch's check status rides the
// repository query the refresh already makes (no extra request); on
// Forgejo the refresh lists the Actions runs of the default branch, once
// per repository.
//
// A forge that can't be reached keeps its last known rows, each marked
// `staleSince`, the same carry-over `forges[].staleSince`
// on GET /api/dashboard reports. A forge whose rate-limit budget is
// spent is skipped until it resets and its rows are kept the same way.
// Only the signed-in user's own repositories.
//
// A repository with no default branch yet (empty) or no pipeline has
// status `none`. Unauthenticated GitHub access (a username with no
// token) has no rows: its budget is too small to spend on this.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/main-branches (the `GetMainBranches` operationId).
GetMainBranchesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMainBranchesResponse, error)
// ListAdvisoriesWithResponse List a repository's open dependency advisories in full, on demand
//
// What the advisories dialog on the Main branches page shows for one
// repository: each open Dependabot alert with the fields GitHub's own
// alert page shows. The list and the detail view are the same answer, so
// opening one advisory costs no second call. Fetched live on every call,
// never as part of GET /api/main-branches' snapshot, so a repository
// nobody opens costs no budget.
//
// Sorted by severity, highest first, then newest first. GitHub reads them
// through the Dependabot alerts of the repository. A Forgejo repository
// reads its lock files again and matches them against OSV, so it costs the
// same as one refresh of that repository and works only while OSV
// advisories are switched on; each advisory is then one distinct
// advisory, with `number` its place in the list, `openedAt` the day OSV
// published it and `url` its page on OSV.
//
// A forge that can't say is a 200 with `state` "unknown", an empty list
// and the `reason`, the same words as the row's own `advisories`: alerts
// switched off, a credential without the Dependabot alerts permission, a
// rate limit, any other failure, or a repository with more open alerts
// than one read pages through. For Forgejo: advisories not switched on
// (`not_enabled`), OSV unreachable or a lock file that can't be read
// (`failed`), too much to read (`too_many`), or no lock file found (no
// `reason`). An empty `known` list means nothing is open.
//
// `description` is Markdown exactly as GitHub stores it, so a client must
// render it with raw HTML disabled. A field GitHub didn't send is left
// out. A Forgejo advisory leaves out what OSV does not state: `epss`,
// `relationship`, `scope` and `vulnerableVersions`.
//
// The same answer is the `get_repository_advisories` tool, over MCP and
// WebMCP.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/main-branches/advisories (the `ListAdvisories` operationId).
ListAdvisoriesWithResponse(ctx context.Context, params *ListAdvisoriesParams, reqEditors ...RequestEditorFn) (*ListAdvisoriesResponse, error)
// RerunMainBranchChecksWithBodyWithResponse Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
RerunMainBranchChecksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RerunMainBranchChecksResponse, error)
// RerunMainBranchChecksWithResponse Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
RerunMainBranchChecksWithResponse(ctx context.Context, body RerunMainBranchChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*RerunMainBranchChecksResponse, error)
// ReportDashboardPresenceWithBodyWithResponse Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
ReportDashboardPresenceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReportDashboardPresenceResponse, error)
// ReportDashboardPresenceWithResponse Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
ReportDashboardPresenceWithResponse(ctx context.Context, body ReportDashboardPresenceJSONRequestBody, reqEditors ...RequestEditorFn) (*ReportDashboardPresenceResponse, error)
// EnablePullRequestAutoMergeWithBodyWithResponse Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
EnablePullRequestAutoMergeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnablePullRequestAutoMergeResponse, error)
// EnablePullRequestAutoMergeWithResponse Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
EnablePullRequestAutoMergeWithResponse(ctx context.Context, body EnablePullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*EnablePullRequestAutoMergeResponse, error)
// CancelPullRequestAutoMergeWithBodyWithResponse Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
CancelPullRequestAutoMergeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelPullRequestAutoMergeResponse, error)
// CancelPullRequestAutoMergeWithResponse Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
CancelPullRequestAutoMergeWithResponse(ctx context.Context, body CancelPullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelPullRequestAutoMergeResponse, error)
// SetPullRequestAutoUpdateWithBodyWithResponse Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
SetPullRequestAutoUpdateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetPullRequestAutoUpdateResponse, error)
// SetPullRequestAutoUpdateWithResponse Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
SetPullRequestAutoUpdateWithResponse(ctx context.Context, body SetPullRequestAutoUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*SetPullRequestAutoUpdateResponse, error)
// ClosePullRequestWithBodyWithResponse Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
ClosePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ClosePullRequestResponse, error)
// ClosePullRequestWithResponse Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
ClosePullRequestWithResponse(ctx context.Context, body ClosePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*ClosePullRequestResponse, error)
// PostPullRequestDependabotActionWithBodyWithResponse Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
PostPullRequestDependabotActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPullRequestDependabotActionResponse, error)
// PostPullRequestDependabotActionWithResponse Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
PostPullRequestDependabotActionWithResponse(ctx context.Context, body PostPullRequestDependabotActionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPullRequestDependabotActionResponse, error)
// GetPullRequestDetailsWithResponse Read a pull request's description, comments and reactions, on demand
//
// What the pull request dialog shows: the description, the
// conversation in order, the thumbs up and thumbs down reactions on each
// with who gave them, and, for a release pull request, the release
// notes. Fetched live on every call, never as part of GET
// /api/dashboard's snapshot: comments and reactions for every row would
// spend the forge's budget on rows nobody opens.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// pull request, one for its comments, one for the description's
// reactions and one for each comment's reactions (up to 50), so the
// reaction calls run at most eight at a time and stop at the first rate
// limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so
// a client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged
// and never proxied; this app sets no Content-Security-Policy today, so
// the browser loads it directly. A future policy's `img-src` has to
// allow avatars.githubusercontent.com, repository-images.githubusercontent.com
// (a GitHub repository's logo, see `logoUrl` on a repo in GET
// /api/dashboard) and the Forgejo host.
//
// A forge that can't be read is an error, never an empty thread.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/pull-requests/details (the `GetPullRequestDetails` operationId).
GetPullRequestDetailsWithResponse(ctx context.Context, params *GetPullRequestDetailsParams, reqEditors ...RequestEditorFn) (*GetPullRequestDetailsResponse, error)
// HidePullRequestWithBodyWithResponse Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
HidePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HidePullRequestResponse, error)
// HidePullRequestWithResponse Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
HidePullRequestWithResponse(ctx context.Context, body HidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*HidePullRequestResponse, error)
// MergePullRequestWithBodyWithResponse Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
MergePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MergePullRequestResponse, error)
// MergePullRequestWithResponse Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
MergePullRequestWithResponse(ctx context.Context, body MergePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*MergePullRequestResponse, error)
// PostPullRequestRenovateRebaseWithBodyWithResponse Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
PostPullRequestRenovateRebaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPullRequestRenovateRebaseResponse, error)
// PostPullRequestRenovateRebaseWithResponse Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
PostPullRequestRenovateRebaseWithResponse(ctx context.Context, body PostPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPullRequestRenovateRebaseResponse, error)
// CancelPullRequestRenovateRebaseWithBodyWithResponse Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
CancelPullRequestRenovateRebaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelPullRequestRenovateRebaseResponse, error)
// CancelPullRequestRenovateRebaseWithResponse Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
CancelPullRequestRenovateRebaseWithResponse(ctx context.Context, body CancelPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelPullRequestRenovateRebaseResponse, error)
// ReopenPullRequestWithBodyWithResponse Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
ReopenPullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReopenPullRequestResponse, error)
// ReopenPullRequestWithResponse Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
ReopenPullRequestWithResponse(ctx context.Context, body ReopenPullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*ReopenPullRequestResponse, error)
// RerunPullRequestChecksWithBodyWithResponse Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
RerunPullRequestChecksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RerunPullRequestChecksResponse, error)
// RerunPullRequestChecksWithResponse Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
RerunPullRequestChecksWithResponse(ctx context.Context, body RerunPullRequestChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*RerunPullRequestChecksResponse, error)
// UnhidePullRequestWithBodyWithResponse Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
UnhidePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnhidePullRequestResponse, error)
// UnhidePullRequestWithResponse Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
UnhidePullRequestWithResponse(ctx context.Context, body UnhidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*UnhidePullRequestResponse, error)
// UpdatePullRequestBranchWithBodyWithResponse Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
UpdatePullRequestBranchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePullRequestBranchResponse, error)
// UpdatePullRequestBranchWithResponse Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
UpdatePullRequestBranchWithResponse(ctx context.Context, body UpdatePullRequestBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePullRequestBranchResponse, error)
// ListQueuedActionsWithResponse List the signed-in user's queued actions, waiting and recently finished
//
// Every action the user queued to run when a rate-limited forge
// resets, oldest first: the ones still `queued`, and the
// final ones (`done`, `skipped`, `failed`) kept for 24 hours so a
// client can show the outcome in its Activity list. The same list
// rides along on GET /api/dashboard as `queuedActions`.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/queued-actions (the `ListQueuedActions` operationId).
ListQueuedActionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListQueuedActionsResponse, error)
// QueueActionWithBodyWithResponse Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
QueueActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueueActionResponse, error)
// QueueActionWithResponse Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
QueueActionWithResponse(ctx context.Context, body QueueActionJSONRequestBody, reqEditors ...RequestEditorFn) (*QueueActionResponse, error)
// CancelQueuedActionWithResponse Cancel a queued action, or clear a finished one from the list
//
// A queued action that has not run is removed and nothing runs. A
// finished one is cleared from the list. An id that isn't the
// signed-in user's answers 404, the same as one that doesn't exist.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/queued-actions/{id} (the `CancelQueuedAction` operationId).
CancelQueuedActionWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*CancelQueuedActionResponse, error)
// GetReleaseDetailsWithResponse Read a published release's title and notes, on demand
//
// What the release dialog on the Main branches page shows for a
// repository's latest published release: its title, when it was
// published, its notes and the thumbs reactions on them. Fetched live on
// every call, never as part of GET /api/main-branches' snapshot, so a
// release nobody opens costs no budget.
//
// GitHub answers with one GraphQL query. Only GitHub rows carry a latest
// release today, so a Forgejo repository is a 400.
//
// The notes are Markdown exactly as the forge stores them (`format` is
// always `markdown`). The server neither converts nor sanitises them, so
// a client must render them with raw HTML disabled. They are cut at
// 20,000 characters (`truncated`), and a reaction names at most its
// first 10 people while `count` is the full number.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. A tag that has no published release is a 404, and so is a draft,
// a pre-release or a release with no publish date.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/releases/details (the `GetReleaseDetails` operationId).
GetReleaseDetailsWithResponse(ctx context.Context, params *GetReleaseDetailsParams, reqEditors ...RequestEditorFn) (*GetReleaseDetailsResponse, error)
// DisableAutoUpdateBranchWithBodyWithResponse Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
DisableAutoUpdateBranchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DisableAutoUpdateBranchResponse, error)
// DisableAutoUpdateBranchWithResponse Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
DisableAutoUpdateBranchWithResponse(ctx context.Context, body DisableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*DisableAutoUpdateBranchResponse, error)
// EnableAutoUpdateBranchWithBodyWithResponse Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
EnableAutoUpdateBranchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnableAutoUpdateBranchResponse, error)
// EnableAutoUpdateBranchWithResponse Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
EnableAutoUpdateBranchWithResponse(ctx context.Context, body EnableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*EnableAutoUpdateBranchResponse, error)
// IgnoreRepoWithBodyWithResponse Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
IgnoreRepoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IgnoreRepoResponse, error)
// IgnoreRepoWithResponse Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
IgnoreRepoWithResponse(ctx context.Context, body IgnoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*IgnoreRepoResponse, error)
// DisableRebaseBotsWithBodyWithResponse Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
DisableRebaseBotsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DisableRebaseBotsResponse, error)
// DisableRebaseBotsWithResponse Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
DisableRebaseBotsWithResponse(ctx context.Context, body DisableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*DisableRebaseBotsResponse, error)
// EnableRebaseBotsWithBodyWithResponse Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
EnableRebaseBotsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnableRebaseBotsResponse, error)
// EnableRebaseBotsWithResponse Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
EnableRebaseBotsWithResponse(ctx context.Context, body EnableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*EnableRebaseBotsResponse, error)
// UnignoreRepoWithBodyWithResponse Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
UnignoreRepoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnignoreRepoResponse, error)
// UnignoreRepoWithResponse Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
UnignoreRepoWithResponse(ctx context.Context, body UnignoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*UnignoreRepoResponse, error)
// GetSettingsWithResponse The signed-in user's own forge configuration
//
// Forge tokens are never returned, only whether one is set. The
// webhook token and secret are returned, since the user pastes them
// into the forge's webhook setup, and a first read creates them. For
// a read that creates nothing and omits both, see
// `GET /api/settings/summary`.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings (the `GetSettings` operationId).
GetSettingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSettingsResponse, error)
// PutSettingsWithBodyWithResponse Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
PutSettingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSettingsResponse, error)
// PutSettingsWithResponse Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
PutSettingsWithResponse(ctx context.Context, body PutSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSettingsResponse, error)
// GetFilterStateWithResponse The signed-in user's own saved dashboard/Insights filter state
//
// A lightweight read of one opaque blob, deliberately not
// GET /api/settings itself for the same reason GET /api/settings/theme
// isn't either: this loads on every dashboard/Insights visit and
// shouldn't provision webhook credentials as a side effect.
// `{}` for a user who's never saved any filters yet, not a 404.
// These are the web UI's own state: a signed-in browser session only,
// and a personal API token is refused with 403.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/filter-state (the `GetFilterState` operationId).
GetFilterStateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFilterStateResponse, error)
// SetFilterStateWithBodyWithResponse Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
SetFilterStateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetFilterStateResponse, error)
// SetFilterStateWithResponse Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
SetFilterStateWithResponse(ctx context.Context, body SetFilterStateJSONRequestBody, reqEditors ...RequestEditorFn) (*SetFilterStateResponse, error)
// GetSettingsSummaryWithResponse The signed-in user's settings, read without side effects
//
// The same data as `GET /api/settings`, minus the webhook token and
// secret, plus `webhookConfigured`. It never provisions webhook
// credentials: for a user who has none yet it answers
// `webhookConfigured: false` and creates nothing. Forge tokens are
// never returned, only whether one is set. It returns exactly what
// the `get_settings` MCP tool returns.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/summary (the `GetSettingsSummary` operationId).
GetSettingsSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSettingsSummaryResponse, error)
// GetThemeWithResponse The signed-in user's own saved theme preference
//
// A lightweight, side-effect-free read of one field — theme — for
// every page to check on load. Deliberately not
// GET /api/settings itself: that handler also provisions webhook
// credentials on first call (EnsureWebhookCredentials), which
// every page loading shouldn't trigger for a user who's never
// opened Settings at all.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/theme (the `GetTheme` operationId).
GetThemeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetThemeResponse, error)
// SetThemeWithBodyWithResponse Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
SetThemeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetThemeResponse, error)
// SetThemeWithResponse Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
SetThemeWithResponse(ctx context.Context, body SetThemeJSONRequestBody, reqEditors ...RequestEditorFn) (*SetThemeResponse, error)
// GetTimezoneWithResponse The signed-in user's own saved time zone
//
// A lightweight, side-effect-free read of one field, for every page to
// check on load so it can show times in the user's zone. Deliberately
// not GET /api/settings, for the reason GET /api/settings/theme isn't.
// Empty means "use the browser's own zone".
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/timezone (the `GetTimezone` operationId).
GetTimezoneWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTimezoneResponse, error)
// SetTimezoneWithBodyWithResponse Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
SetTimezoneWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetTimezoneResponse, error)
// SetTimezoneWithResponse Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
SetTimezoneWithResponse(ctx context.Context, body SetTimezoneJSONRequestBody, reqEditors ...RequestEditorFn) (*SetTimezoneResponse, error)
// GetForgeApiStatsWithResponse How many forge API calls the dashboard has spent, and on what
//
// Counts the forge requests made since the server started, so a change
// to what the dashboard refreshes can be shown to have saved budget, and
// a rate-limit incident traced to the refresh that caused it. One bucket
// per forge, credential, refresh `kind` and repository, each with the
// REST calls made, the GraphQL calls made, the GraphQL `rateLimit.cost`
// they were charged, and the requests answered `304 Not Modified`. A 304
// is not charged against the REST budget, so it is counted on its own and
// not as a REST call.
//
// `kind` says why the request was made: `full` (a whole-account
// refresh), `scoped_webhook` (one repository, after a webhook),
// `ci_poll` (one repository, waiting on a running check),
// `auto_merge_poll` (one repository, waiting on an armed auto-merge),
// `details` (a dialog or check list opened), `hook_maintenance`
// (checking, adding or upgrading webhooks), `advisories` (reading a
// repository's open Dependabot alerts, or a Forgejo repository's lockfiles), `user_action` (a button
// pressed, a queued action, or something the dashboard does for you such
// as auto-merge) and `unknown` (a request nobody tagged, which is a bug
// to report). A request that names no repository, such as listing an
// account's repositories, has an empty `repo`.
//
// The counters live in memory and start from zero on every start;
// `since` says when counting began. `credential` names the connected
// account or App installation by a label that carries no secret and no
// user id (`app:<installation id>`, `token:<short hash>`,
// `public:<username>`). Only the buckets of the caller's own
// credentials are returned. They are matched to the credentials
// the caller has saved, and a GitHub App installation id is a number the
// caller types in, so until the dashboard has one user, someone who saves
// another account's installation id sees that installation's counts. `budgets` are the rate limits each forge last
// reported, the same figures as `forges` on GET /api/dashboard.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/stats/forge-api (the `GetForgeApiStats` operationId).
GetForgeApiStatsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetForgeApiStatsResponse, error)
// ListAPITokensWithResponse List the signed-in user's own personal API tokens
//
// Metadata only, per APIToken's own description — a raw value never reappears once created.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/tokens (the `ListAPITokens` operationId).
ListAPITokensWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAPITokensResponse, error)
// CreateAPITokenWithBodyWithResponse Generate a new personal API token
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
CreateAPITokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAPITokenResponse, error)
// CreateAPITokenWithResponse Generate a new personal API token
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
CreateAPITokenWithResponse(ctx context.Context, body CreateAPITokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAPITokenResponse, error)
// DeleteAPITokenWithResponse Revoke a personal API token
//
// Stops the token authenticating immediately. Idempotent — deleting
// an id that's already gone (or never belonged to the signed-in
// user) still answers 204, the same as any other delete-by-id
// endpoint here, so a double-click or a retried request isn't an
// error.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/tokens/{id} (the `DeleteAPIToken` operationId).
DeleteAPITokenWithResponse(ctx context.Context, id PathTokenID, reqEditors ...RequestEditorFn) (*DeleteAPITokenResponse, error)
// GetVersionWithResponse The running server's own version
//
// The tag goreleaser stamped the running binary with ("dev" for a
// build outside the release pipeline). Public and unauthenticated —
// every page, including the pre-login screen, links to the matching
// GitHub release from its footer so a person can tell what's
// actually deployed without shelling into the box.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/version (the `GetVersion` operationId).
GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error)
// EnsureWebhookWithBodyWithResponse Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
EnsureWebhookWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnsureWebhookResponse, error)
// EnsureWebhookWithResponse Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
EnsureWebhookWithResponse(ctx context.Context, body EnsureWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*EnsureWebhookResponse, error)
// ReceiveForgejoWebhookWithBodyWithResponse Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
ReceiveForgejoWebhookWithBodyWithResponse(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReceiveForgejoWebhookResponse, error)
// ReceiveForgejoWebhookWithResponse Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
ReceiveForgejoWebhookWithResponse(ctx context.Context, webhookToken PathWebhookToken, body ReceiveForgejoWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*ReceiveForgejoWebhookResponse, error)
// ReceiveGitHubWebhookWithBodyWithResponse Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
ReceiveGitHubWebhookWithBodyWithResponse(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReceiveGitHubWebhookResponse, error)
// ReceiveGitHubWebhookWithResponse Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
ReceiveGitHubWebhookWithResponse(ctx context.Context, webhookToken PathWebhookToken, body ReceiveGitHubWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*ReceiveGitHubWebhookResponse, error)
// HealthWithResponse Liveness
//
// Answers 200 once the server has started. Doesn't reflect whether
// either forge is reachable — see forges[].reachable on the dashboard
// response for that.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /healthz (the `Health` operationId).
HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error)
// ReadyWithResponse Readiness
//
// Answers 200 once the server can actually serve: the database answers
// a ping with its schema in place, and the first dashboard refresh has
// completed, or 30 seconds have passed since it started. The wait is
// bounded because how fast a forge answers is how fresh the data is,
// not whether the server can serve: a slow or unreachable forge must not
// keep the container unready. A refresh that finished with a forge
// unreachable counts, and a forge going unreachable afterwards never
// turns this into a 503. See forges[].reachable on the dashboard
// response for that. Before any account has signed in there is no
// refresh to wait for, so only the database is checked.
//
// The database ping gets 2 seconds, less than the HEALTHCHECK's own 5,
// so a database that doesn't answer turns into a 503 instead of a hung
// probe. The ping's result, pass or fail, is reused for about 3
// seconds, so probes arriving every second don't each reach the
// database. On SIGTERM this answers 503 ("shutting down") at once, and
// the server waits a drain period (`SHUTDOWN_DRAIN`, default 5 seconds)
// before it stops accepting connections, so a router that polls this
// path stops sending traffic first.
//
// The container's HEALTHCHECK probes this path (`/healthz` stays the
// cheap liveness answer), so Docker's single health state and Compose's
// `depends_on: condition: service_healthy` mean "ready", not just
// "started".
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /readyz (the `Ready` operationId).
ReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReadyResponse, error)
}
type ListCredentialsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]Credential
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r ListCredentialsResponse) GetJSON200() *[]Credential {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ListCredentialsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r ListCredentialsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ListCredentialsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListCredentialsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ListCredentialsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type BeginAddCredentialResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *WebAuthnCeremonyOptions
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r BeginAddCredentialResponse) GetJSON200() *WebAuthnCeremonyOptions {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r BeginAddCredentialResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r BeginAddCredentialResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r BeginAddCredentialResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r BeginAddCredentialResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r BeginAddCredentialResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type FinishAddCredentialResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON201 the response for an HTTP 201 `application/json` response
JSON201 *Credential
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON201 returns the response for an HTTP 201 `application/json` response
func (r FinishAddCredentialResponse) GetJSON201() *Credential {
return r.JSON201
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r FinishAddCredentialResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r FinishAddCredentialResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r FinishAddCredentialResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r FinishAddCredentialResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r FinishAddCredentialResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r FinishAddCredentialResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type DeleteCredentialResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r DeleteCredentialResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r DeleteCredentialResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r DeleteCredentialResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r DeleteCredentialResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteCredentialResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r DeleteCredentialResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type RenameCredentialResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Credential
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r RenameCredentialResponse) GetJSON200() *Credential {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r RenameCredentialResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r RenameCredentialResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r RenameCredentialResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r RenameCredentialResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r RenameCredentialResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r RenameCredentialResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r RenameCredentialResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
// BeginLoginResponse429Headers the declared response headers of an HTTP 429 response for BeginLogin
type BeginLoginResponse429Headers struct {
RetryAfter *int
}
type BeginLoginResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *WebAuthnCeremonyOptions
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *AuthRateLimited
// Headers429 the parsed response headers for an HTTP 429 response
Headers429 *BeginLoginResponse429Headers
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r BeginLoginResponse) GetJSON200() *WebAuthnCeremonyOptions {
return r.JSON200
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r BeginLoginResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r BeginLoginResponse) GetJSON429() *AuthRateLimited {
return r.JSON429
}
// GetBody returns the raw response body bytes
func (r BeginLoginResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r BeginLoginResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r BeginLoginResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r BeginLoginResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
// FinishLoginResponse429Headers the declared response headers of an HTTP 429 response for FinishLogin
type FinishLoginResponse429Headers struct {
RetryAfter *int
}
type FinishLoginResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *SessionUser
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *AuthRateLimited
// Headers429 the parsed response headers for an HTTP 429 response
Headers429 *FinishLoginResponse429Headers
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r FinishLoginResponse) GetJSON200() *SessionUser {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r FinishLoginResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r FinishLoginResponse) GetJSON429() *AuthRateLimited {
return r.JSON429
}
// GetBody returns the raw response body bytes
func (r FinishLoginResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r FinishLoginResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r FinishLoginResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r FinishLoginResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type LogoutResponse struct {
Body []byte
HTTPResponse *http.Response
}
// GetBody returns the raw response body bytes
func (r LogoutResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r LogoutResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r LogoutResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r LogoutResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
// BeginRegistrationResponse429Headers the declared response headers of an HTTP 429 response for BeginRegistration
type BeginRegistrationResponse429Headers struct {
RetryAfter *int
}
type BeginRegistrationResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *WebAuthnCeremonyOptions
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *AuthRateLimited
// Headers429 the parsed response headers for an HTTP 429 response
Headers429 *BeginRegistrationResponse429Headers
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r BeginRegistrationResponse) GetJSON200() *WebAuthnCeremonyOptions {
return r.JSON200
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r BeginRegistrationResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r BeginRegistrationResponse) GetJSON429() *AuthRateLimited {
return r.JSON429
}
// GetBody returns the raw response body bytes
func (r BeginRegistrationResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r BeginRegistrationResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r BeginRegistrationResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r BeginRegistrationResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
// FinishRegistrationResponse429Headers the declared response headers of an HTTP 429 response for FinishRegistration
type FinishRegistrationResponse429Headers struct {
RetryAfter *int
}
type FinishRegistrationResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *SessionUser
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *AuthRateLimited
// Headers429 the parsed response headers for an HTTP 429 response
Headers429 *FinishRegistrationResponse429Headers
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r FinishRegistrationResponse) GetJSON200() *SessionUser {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r FinishRegistrationResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r FinishRegistrationResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r FinishRegistrationResponse) GetJSON429() *AuthRateLimited {
return r.JSON429
}
// GetBody returns the raw response body bytes
func (r FinishRegistrationResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r FinishRegistrationResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r FinishRegistrationResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r FinishRegistrationResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetRegistrationStatusResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *RegistrationStatus
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetRegistrationStatusResponse) GetJSON200() *RegistrationStatus {
return r.JSON200
}
// GetBody returns the raw response body bytes
func (r GetRegistrationStatusResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetRegistrationStatusResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetRegistrationStatusResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetRegistrationStatusResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetSessionResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *SessionUser
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetSessionResponse) GetJSON200() *SessionUser {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetSessionResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetSessionResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetSessionResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetSessionResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetSessionResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CancelWorkflowRunResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r CancelWorkflowRunResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r CancelWorkflowRunResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CancelWorkflowRunResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CancelWorkflowRunResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CancelWorkflowRunResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetCheckLogResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *CheckLog
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
// JSON503 the response for an HTTP 503 `application/json` response
JSON503 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetCheckLogResponse) GetJSON200() *CheckLog {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r GetCheckLogResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetCheckLogResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r GetCheckLogResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r GetCheckLogResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r GetCheckLogResponse) GetJSON429() *Error {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r GetCheckLogResponse) GetJSON502() *Error {
return r.JSON502
}
// GetJSON503 returns the response for an HTTP 503 `application/json` response
func (r GetCheckLogResponse) GetJSON503() *Error {
return r.JSON503
}
// GetBody returns the raw response body bytes
func (r GetCheckLogResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetCheckLogResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetCheckLogResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetCheckLogResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetDashboardResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Dashboard
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetDashboardResponse) GetJSON200() *Dashboard {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetDashboardResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetDashboardResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetDashboardResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetDashboardResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetDashboardResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
// RefreshDashboardResponse200Headers the declared response headers of an HTTP 200 response for RefreshDashboard
type RefreshDashboardResponse200Headers struct {
RetryAfter *int
}
type RefreshDashboardResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Dashboard
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// Headers200 the parsed response headers for an HTTP 200 response
Headers200 *RefreshDashboardResponse200Headers
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r RefreshDashboardResponse) GetJSON200() *Dashboard {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r RefreshDashboardResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r RefreshDashboardResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r RefreshDashboardResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r RefreshDashboardResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r RefreshDashboardResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r RefreshDashboardResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type StreamDashboardResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r StreamDashboardResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r StreamDashboardResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r StreamDashboardResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r StreamDashboardResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r StreamDashboardResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r StreamDashboardResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type WatchDashboardStreamChecksResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r WatchDashboardStreamChecksResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r WatchDashboardStreamChecksResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r WatchDashboardStreamChecksResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r WatchDashboardStreamChecksResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r WatchDashboardStreamChecksResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r WatchDashboardStreamChecksResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r WatchDashboardStreamChecksResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CloseIssueResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r CloseIssueResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CloseIssueResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r CloseIssueResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r CloseIssueResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r CloseIssueResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r CloseIssueResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r CloseIssueResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CloseIssueResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CloseIssueResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CloseIssueResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CommentOnIssueResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r CommentOnIssueResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CommentOnIssueResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r CommentOnIssueResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r CommentOnIssueResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r CommentOnIssueResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r CommentOnIssueResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r CommentOnIssueResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CommentOnIssueResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CommentOnIssueResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CommentOnIssueResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetIssueDetailsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *IssueDetails
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetIssueDetailsResponse) GetJSON200() *IssueDetails {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r GetIssueDetailsResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetIssueDetailsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r GetIssueDetailsResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r GetIssueDetailsResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r GetIssueDetailsResponse) GetJSON429() *Error {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r GetIssueDetailsResponse) GetJSON502() *Error {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r GetIssueDetailsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetIssueDetailsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetIssueDetailsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetIssueDetailsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ReopenIssueResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r ReopenIssueResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ReopenIssueResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r ReopenIssueResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r ReopenIssueResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r ReopenIssueResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r ReopenIssueResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r ReopenIssueResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ReopenIssueResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ReopenIssueResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ReopenIssueResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetMainBranchesResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *MainBranches
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetMainBranchesResponse) GetJSON200() *MainBranches {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetMainBranchesResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetMainBranchesResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetMainBranchesResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetMainBranchesResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetMainBranchesResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ListAdvisoriesResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *AdvisoryList
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r ListAdvisoriesResponse) GetJSON200() *AdvisoryList {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r ListAdvisoriesResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ListAdvisoriesResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r ListAdvisoriesResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r ListAdvisoriesResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r ListAdvisoriesResponse) GetJSON429() *Error {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r ListAdvisoriesResponse) GetJSON502() *Error {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r ListAdvisoriesResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ListAdvisoriesResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListAdvisoriesResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ListAdvisoriesResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type RerunMainBranchChecksResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r RerunMainBranchChecksResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r RerunMainBranchChecksResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r RerunMainBranchChecksResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r RerunMainBranchChecksResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r RerunMainBranchChecksResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ReportDashboardPresenceResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PresenceAnswer
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r ReportDashboardPresenceResponse) GetJSON200() *PresenceAnswer {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r ReportDashboardPresenceResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ReportDashboardPresenceResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r ReportDashboardPresenceResponse) GetJSON403() *Error {
return r.JSON403
}
// GetBody returns the raw response body bytes
func (r ReportDashboardPresenceResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ReportDashboardPresenceResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ReportDashboardPresenceResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ReportDashboardPresenceResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type EnablePullRequestAutoMergeResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r EnablePullRequestAutoMergeResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r EnablePullRequestAutoMergeResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r EnablePullRequestAutoMergeResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r EnablePullRequestAutoMergeResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r EnablePullRequestAutoMergeResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r EnablePullRequestAutoMergeResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r EnablePullRequestAutoMergeResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r EnablePullRequestAutoMergeResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r EnablePullRequestAutoMergeResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r EnablePullRequestAutoMergeResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CancelPullRequestAutoMergeResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r CancelPullRequestAutoMergeResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CancelPullRequestAutoMergeResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r CancelPullRequestAutoMergeResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r CancelPullRequestAutoMergeResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r CancelPullRequestAutoMergeResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CancelPullRequestAutoMergeResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CancelPullRequestAutoMergeResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CancelPullRequestAutoMergeResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type SetPullRequestAutoUpdateResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r SetPullRequestAutoUpdateResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r SetPullRequestAutoUpdateResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r SetPullRequestAutoUpdateResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r SetPullRequestAutoUpdateResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r SetPullRequestAutoUpdateResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r SetPullRequestAutoUpdateResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r SetPullRequestAutoUpdateResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ClosePullRequestResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r ClosePullRequestResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ClosePullRequestResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r ClosePullRequestResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r ClosePullRequestResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r ClosePullRequestResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r ClosePullRequestResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r ClosePullRequestResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ClosePullRequestResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ClosePullRequestResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ClosePullRequestResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type PostPullRequestDependabotActionResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r PostPullRequestDependabotActionResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r PostPullRequestDependabotActionResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r PostPullRequestDependabotActionResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PostPullRequestDependabotActionResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r PostPullRequestDependabotActionResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetPullRequestDetailsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PullRequestDetails
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON200() *PullRequestDetails {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON429() *Error {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r GetPullRequestDetailsResponse) GetJSON502() *Error {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r GetPullRequestDetailsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetPullRequestDetailsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetPullRequestDetailsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetPullRequestDetailsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type HidePullRequestResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r HidePullRequestResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r HidePullRequestResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r HidePullRequestResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r HidePullRequestResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r HidePullRequestResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r HidePullRequestResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type MergePullRequestResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PullRequestMergeResult
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r MergePullRequestResponse) GetJSON200() *PullRequestMergeResult {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r MergePullRequestResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r MergePullRequestResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r MergePullRequestResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r MergePullRequestResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r MergePullRequestResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r MergePullRequestResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r MergePullRequestResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r MergePullRequestResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r MergePullRequestResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r MergePullRequestResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r MergePullRequestResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type PostPullRequestRenovateRebaseResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r PostPullRequestRenovateRebaseResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r PostPullRequestRenovateRebaseResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r PostPullRequestRenovateRebaseResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PostPullRequestRenovateRebaseResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r PostPullRequestRenovateRebaseResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CancelPullRequestRenovateRebaseResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r CancelPullRequestRenovateRebaseResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r CancelPullRequestRenovateRebaseResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CancelPullRequestRenovateRebaseResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CancelPullRequestRenovateRebaseResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CancelPullRequestRenovateRebaseResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ReopenPullRequestResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r ReopenPullRequestResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ReopenPullRequestResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r ReopenPullRequestResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r ReopenPullRequestResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r ReopenPullRequestResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r ReopenPullRequestResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r ReopenPullRequestResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r ReopenPullRequestResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ReopenPullRequestResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ReopenPullRequestResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ReopenPullRequestResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type RerunPullRequestChecksResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r RerunPullRequestChecksResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r RerunPullRequestChecksResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r RerunPullRequestChecksResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r RerunPullRequestChecksResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r RerunPullRequestChecksResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type UnhidePullRequestResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r UnhidePullRequestResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r UnhidePullRequestResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r UnhidePullRequestResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r UnhidePullRequestResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r UnhidePullRequestResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r UnhidePullRequestResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type UpdatePullRequestBranchResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r UpdatePullRequestBranchResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r UpdatePullRequestBranchResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r UpdatePullRequestBranchResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r UpdatePullRequestBranchResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r UpdatePullRequestBranchResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ListQueuedActionsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]QueuedAction
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r ListQueuedActionsResponse) GetJSON200() *[]QueuedAction {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ListQueuedActionsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r ListQueuedActionsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ListQueuedActionsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListQueuedActionsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ListQueuedActionsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type QueueActionResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *QueuedAction
// JSON201 the response for an HTTP 201 `application/json` response
JSON201 *QueuedAction
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *ActionError
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r QueueActionResponse) GetJSON200() *QueuedAction {
return r.JSON200
}
// GetJSON201 returns the response for an HTTP 201 `application/json` response
func (r QueueActionResponse) GetJSON201() *QueuedAction {
return r.JSON201
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r QueueActionResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r QueueActionResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r QueueActionResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON409 returns the response for an HTTP 409 `application/json` response
func (r QueueActionResponse) GetJSON409() *ActionError {
return r.JSON409
}
// GetBody returns the raw response body bytes
func (r QueueActionResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r QueueActionResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r QueueActionResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r QueueActionResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CancelQueuedActionResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CancelQueuedActionResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r CancelQueuedActionResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r CancelQueuedActionResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CancelQueuedActionResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CancelQueuedActionResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CancelQueuedActionResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetReleaseDetailsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *ReleaseDetails
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON200() *ReleaseDetails {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON403() *Error {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON404() *Error {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON429() *Error {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r GetReleaseDetailsResponse) GetJSON502() *Error {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r GetReleaseDetailsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetReleaseDetailsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetReleaseDetailsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetReleaseDetailsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type DisableAutoUpdateBranchResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r DisableAutoUpdateBranchResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r DisableAutoUpdateBranchResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r DisableAutoUpdateBranchResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r DisableAutoUpdateBranchResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DisableAutoUpdateBranchResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r DisableAutoUpdateBranchResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type EnableAutoUpdateBranchResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r EnableAutoUpdateBranchResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r EnableAutoUpdateBranchResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r EnableAutoUpdateBranchResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r EnableAutoUpdateBranchResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r EnableAutoUpdateBranchResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r EnableAutoUpdateBranchResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type IgnoreRepoResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r IgnoreRepoResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r IgnoreRepoResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r IgnoreRepoResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r IgnoreRepoResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r IgnoreRepoResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r IgnoreRepoResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type DisableRebaseBotsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r DisableRebaseBotsResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r DisableRebaseBotsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r DisableRebaseBotsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r DisableRebaseBotsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DisableRebaseBotsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r DisableRebaseBotsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type EnableRebaseBotsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r EnableRebaseBotsResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r EnableRebaseBotsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r EnableRebaseBotsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r EnableRebaseBotsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r EnableRebaseBotsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r EnableRebaseBotsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type UnignoreRepoResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r UnignoreRepoResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r UnignoreRepoResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r UnignoreRepoResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r UnignoreRepoResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r UnignoreRepoResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r UnignoreRepoResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetSettingsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *SettingsResponse
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetSettingsResponse) GetJSON200() *SettingsResponse {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetSettingsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetSettingsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetSettingsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetSettingsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetSettingsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type PutSettingsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *SettingsResponse
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r PutSettingsResponse) GetJSON200() *SettingsResponse {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r PutSettingsResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r PutSettingsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r PutSettingsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r PutSettingsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r PutSettingsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r PutSettingsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetFilterStateResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *FilterState
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetFilterStateResponse) GetJSON200() *FilterState {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetFilterStateResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r GetFilterStateResponse) GetJSON403() *Error {
return r.JSON403
}
// GetBody returns the raw response body bytes
func (r GetFilterStateResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetFilterStateResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetFilterStateResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetFilterStateResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type SetFilterStateResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r SetFilterStateResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r SetFilterStateResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r SetFilterStateResponse) GetJSON403() *Error {
return r.JSON403
}
// GetBody returns the raw response body bytes
func (r SetFilterStateResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r SetFilterStateResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r SetFilterStateResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r SetFilterStateResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetSettingsSummaryResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *SettingsSummary
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetSettingsSummaryResponse) GetJSON200() *SettingsSummary {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetSettingsSummaryResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetSettingsSummaryResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetSettingsSummaryResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetSettingsSummaryResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetSettingsSummaryResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetThemeResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *ThemeResponse
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetThemeResponse) GetJSON200() *ThemeResponse {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetThemeResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetThemeResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetThemeResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetThemeResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetThemeResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type SetThemeResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *ThemeResponse
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r SetThemeResponse) GetJSON200() *ThemeResponse {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r SetThemeResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r SetThemeResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r SetThemeResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r SetThemeResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r SetThemeResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r SetThemeResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetTimezoneResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *TimezoneResponse
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetTimezoneResponse) GetJSON200() *TimezoneResponse {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetTimezoneResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetTimezoneResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetTimezoneResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetTimezoneResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetTimezoneResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type SetTimezoneResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *TimezoneResponse
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r SetTimezoneResponse) GetJSON200() *TimezoneResponse {
return r.JSON200
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r SetTimezoneResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r SetTimezoneResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r SetTimezoneResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r SetTimezoneResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r SetTimezoneResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r SetTimezoneResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetForgeApiStatsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *ForgeApiStats
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetForgeApiStatsResponse) GetJSON200() *ForgeApiStats {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r GetForgeApiStatsResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r GetForgeApiStatsResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetForgeApiStatsResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetForgeApiStatsResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetForgeApiStatsResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ListAPITokensResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]APIToken
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r ListAPITokensResponse) GetJSON200() *[]APIToken {
return r.JSON200
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ListAPITokensResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r ListAPITokensResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ListAPITokensResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ListAPITokensResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ListAPITokensResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type CreateAPITokenResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON201 the response for an HTTP 201 `application/json` response
JSON201 *APITokenCreateResponse
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON201 returns the response for an HTTP 201 `application/json` response
func (r CreateAPITokenResponse) GetJSON201() *APITokenCreateResponse {
return r.JSON201
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r CreateAPITokenResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r CreateAPITokenResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r CreateAPITokenResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r CreateAPITokenResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r CreateAPITokenResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r CreateAPITokenResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type DeleteAPITokenResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r DeleteAPITokenResponse) GetJSON401() *Error {
return r.JSON401
}
// GetBody returns the raw response body bytes
func (r DeleteAPITokenResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r DeleteAPITokenResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r DeleteAPITokenResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r DeleteAPITokenResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type GetVersionResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Version
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r GetVersionResponse) GetJSON200() *Version {
return r.JSON200
}
// GetBody returns the raw response body bytes
func (r GetVersionResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r GetVersionResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r GetVersionResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r GetVersionResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type EnsureWebhookResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *ActionError
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ActionError
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *ActionError
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *ActionError
}
// GetJSON400 returns the response for an HTTP 400 `application/json` response
func (r EnsureWebhookResponse) GetJSON400() *Error {
return r.JSON400
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r EnsureWebhookResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON403 returns the response for an HTTP 403 `application/json` response
func (r EnsureWebhookResponse) GetJSON403() *ActionError {
return r.JSON403
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r EnsureWebhookResponse) GetJSON404() *ActionError {
return r.JSON404
}
// GetJSON429 returns the response for an HTTP 429 `application/json` response
func (r EnsureWebhookResponse) GetJSON429() *ActionError {
return r.JSON429
}
// GetJSON502 returns the response for an HTTP 502 `application/json` response
func (r EnsureWebhookResponse) GetJSON502() *ActionError {
return r.JSON502
}
// GetBody returns the raw response body bytes
func (r EnsureWebhookResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r EnsureWebhookResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r EnsureWebhookResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r EnsureWebhookResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ReceiveForgejoWebhookResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ReceiveForgejoWebhookResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r ReceiveForgejoWebhookResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r ReceiveForgejoWebhookResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ReceiveForgejoWebhookResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ReceiveForgejoWebhookResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ReceiveForgejoWebhookResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ReceiveGitHubWebhookResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON401 the response for an HTTP 401 `application/json` response
JSON401 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
}
// GetJSON401 returns the response for an HTTP 401 `application/json` response
func (r ReceiveGitHubWebhookResponse) GetJSON401() *Error {
return r.JSON401
}
// GetJSON404 returns the response for an HTTP 404 `application/json` response
func (r ReceiveGitHubWebhookResponse) GetJSON404() *Error {
return r.JSON404
}
// GetBody returns the raw response body bytes
func (r ReceiveGitHubWebhookResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ReceiveGitHubWebhookResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ReceiveGitHubWebhookResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ReceiveGitHubWebhookResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type HealthResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Health
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r HealthResponse) GetJSON200() *Health {
return r.JSON200
}
// GetBody returns the raw response body bytes
func (r HealthResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r HealthResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r HealthResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r HealthResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
type ReadyResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Ready
// JSON503 the response for an HTTP 503 `application/json` response
JSON503 *Error
}
// GetJSON200 returns the response for an HTTP 200 `application/json` response
func (r ReadyResponse) GetJSON200() *Ready {
return r.JSON200
}
// GetJSON503 returns the response for an HTTP 503 `application/json` response
func (r ReadyResponse) GetJSON503() *Error {
return r.JSON503
}
// GetBody returns the raw response body bytes
func (r ReadyResponse) GetBody() []byte {
return r.Body
}
// Status returns HTTPResponse.Status
func (r ReadyResponse) Status() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Status
}
return http.StatusText(0)
}
// StatusCode returns HTTPResponse.StatusCode
func (r ReadyResponse) StatusCode() int {
if r.HTTPResponse != nil {
return r.HTTPResponse.StatusCode
}
return 0
}
// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (r ReadyResponse) ContentType() string {
if r.HTTPResponse != nil {
return r.HTTPResponse.Header.Get("Content-Type")
}
return ""
}
// ListCredentialsWithResponse List the signed-in user's own passkeys
//
// Every passkey on the account, oldest first — not just the
// one used to establish the current session.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/auth/credentials (the `ListCredentials` operationId).
func (c *ClientWithResponses) ListCredentialsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListCredentialsResponse, error) {
rsp, err := c.ListCredentials(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseListCredentialsResponse(rsp)
}
// BeginAddCredentialWithResponse Start a ceremony to add another passkey to the signed-in account
//
// The authenticated counterpart to POST /api/auth/register/begin —
// that one only ever works for a brand-new, credential-less
// account; this is how an already-registered user adds a second
// (or third...) passkey, e.g. a laptop and a security key. Like the
// first registration it requires a resident key.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/credentials/begin (the `BeginAddCredential` operationId).
func (c *ClientWithResponses) BeginAddCredentialWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*BeginAddCredentialResponse, error) {
rsp, err := c.BeginAddCredential(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseBeginAddCredentialResponse(rsp)
}
// FinishAddCredentialWithBodyWithResponse Complete an add-credential ceremony
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
func (c *ClientWithResponses) FinishAddCredentialWithBodyWithResponse(ctx context.Context, params *FinishAddCredentialParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishAddCredentialResponse, error) {
rsp, err := c.FinishAddCredentialWithBody(ctx, params, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseFinishAddCredentialResponse(rsp)
}
// FinishAddCredentialWithResponse Complete an add-credential ceremony
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/credentials/finish (the `FinishAddCredential` operationId).
func (c *ClientWithResponses) FinishAddCredentialWithResponse(ctx context.Context, params *FinishAddCredentialParams, body FinishAddCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishAddCredentialResponse, error) {
rsp, err := c.FinishAddCredential(ctx, params, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseFinishAddCredentialResponse(rsp)
}
// DeleteCredentialWithResponse Remove one of the signed-in user's own passkeys
//
// Refused on the account's last remaining passkey — this
// app is WebAuthn-only with no password fallback, so deleting it
// would lock the account out entirely.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/auth/credentials/{id} (the `DeleteCredential` operationId).
func (c *ClientWithResponses) DeleteCredentialWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*DeleteCredentialResponse, error) {
rsp, err := c.DeleteCredential(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteCredentialResponse(rsp)
}
// RenameCredentialWithBodyWithResponse Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
func (c *ClientWithResponses) RenameCredentialWithBodyWithResponse(ctx context.Context, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RenameCredentialResponse, error) {
rsp, err := c.RenameCredentialWithBody(ctx, id, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseRenameCredentialResponse(rsp)
}
// RenameCredentialWithResponse Rename one of the signed-in user's own passkeys
//
// Changes the name a passkey is listed under, so several can be told
// apart (a password manager and a security key, say). The name is
// trimmed first, then must be 1 to 64 characters. It is a plain label:
// clients show it as text, never as markup. Only the name changes;
// which passkeys can sign in does not.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PATCH /api/auth/credentials/{id} (the `RenameCredential` operationId).
func (c *ClientWithResponses) RenameCredentialWithResponse(ctx context.Context, id string, body RenameCredentialJSONRequestBody, reqEditors ...RequestEditorFn) (*RenameCredentialResponse, error) {
rsp, err := c.RenameCredential(ctx, id, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseRenameCredentialResponse(rsp)
}
// BeginLoginWithResponse Start a passkey login ceremony
//
// An instance has one user, so there is nothing to name and the request
// carries no body. The options name no passkey and no user, so the
// browser offers whichever discoverable passkey it holds for the site
// and nothing about the account is revealed to a visitor.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/login/begin (the `BeginLogin` operationId).
func (c *ClientWithResponses) BeginLoginWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*BeginLoginResponse, error) {
rsp, err := c.BeginLogin(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseBeginLoginResponse(rsp)
}
// FinishLoginWithBodyWithResponse Complete a passkey login ceremony
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
func (c *ClientWithResponses) FinishLoginWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error) {
rsp, err := c.FinishLoginWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseFinishLoginResponse(rsp)
}
// FinishLoginWithResponse Complete a passkey login ceremony
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/login/finish (the `FinishLogin` operationId).
func (c *ClientWithResponses) FinishLoginWithResponse(ctx context.Context, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error) {
rsp, err := c.FinishLogin(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseFinishLoginResponse(rsp)
}
// LogoutWithResponse End the current session
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/logout (the `Logout` operationId).
func (c *ClientWithResponses) LogoutWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*LogoutResponse, error) {
rsp, err := c.Logout(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseLogoutResponse(rsp)
}
// BeginRegistrationWithResponse Start a passkey registration ceremony
//
// An instance has one user. The first registration on a fresh
// instance (see GET /api/auth/registration-status) creates that
// user and the server names it, so the request carries no body. The
// options require a resident key, so the passkey can be found at
// sign-in without being named. Once any account holds a passkey, this
// answers 403.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/register/begin (the `BeginRegistration` operationId).
func (c *ClientWithResponses) BeginRegistrationWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*BeginRegistrationResponse, error) {
rsp, err := c.BeginRegistration(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseBeginRegistrationResponse(rsp)
}
// FinishRegistrationWithBodyWithResponse Complete a passkey registration ceremony
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
func (c *ClientWithResponses) FinishRegistrationWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error) {
rsp, err := c.FinishRegistrationWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseFinishRegistrationResponse(rsp)
}
// FinishRegistrationWithResponse Complete a passkey registration ceremony
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/auth/register/finish (the `FinishRegistration` operationId).
func (c *ClientWithResponses) FinishRegistrationWithResponse(ctx context.Context, body FinishRegistrationJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishRegistrationResponse, error) {
rsp, err := c.FinishRegistration(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseFinishRegistrationResponse(rsp)
}
// GetRegistrationStatusWithResponse Whether self-registration is open
//
// Unauthenticated — a visitor deciding whether to show the login
// page's own "Register a new passkey instead" button has no session
// yet by definition. `open` is true only on a fresh instance with
// zero registered users; once any account holds a passkey,
// registration is closed for good. More passkeys for that account are
// added from Settings.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/auth/registration-status (the `GetRegistrationStatus` operationId).
func (c *ClientWithResponses) GetRegistrationStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetRegistrationStatusResponse, error) {
rsp, err := c.GetRegistrationStatus(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetRegistrationStatusResponse(rsp)
}
// GetSessionWithResponse Who, if anyone, the current session cookie belongs to
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/auth/session (the `GetSession` operationId).
func (c *ClientWithResponses) GetSessionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSessionResponse, error) {
rsp, err := c.GetSession(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetSessionResponse(rsp)
}
// CancelWorkflowRunWithBodyWithResponse Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
func (c *ClientWithResponses) CancelWorkflowRunWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelWorkflowRunResponse, error) {
rsp, err := c.CancelWorkflowRunWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelWorkflowRunResponse(rsp)
}
// CancelWorkflowRunWithResponse Cancel one running or queued Actions workflow run, on the signed-in user's behalf
//
// Asks the forge to cancel a whole workflow run: every job of it stops,
// because neither GitHub nor Forgejo can stop one job of a running
// workflow. A client takes `runId` from a check in a `run` event on
// GET /api/dashboard/stream, from a job that is still queued or running.
// A check with no `runId` (a third-party check, a legacy commit status,
// an external CI) belongs to no Actions run and can't be cancelled
// here.
//
// It answers once the forge has accepted the cancel, not when the run
// has stopped, so a client shows the run as cancelling and lets the next
// snapshot carry the result. A pull request offers it as a `cancel_run`
// entry in `allowedActions` while any of its checks is running or
// waiting, even when another check has already failed. The list can't
// tell an Actions check from an external CI, so a pull request whose
// only running check is an external one (on Forgejo, a pending commit
// status too) still offers it, and the checks list then has no `runId`
// to send.
//
// It is never queued for a rate-limit reset. After the reset the run may
// be a different one, started by a newer push, and a cancel can't be
// undone. A rate limit arrives as a 429 and the person decides again.
//
// Refusals are an `ActionError` (see Merge) and carry the forge's own
// plain-words `message`: the token may not write to Actions, the run
// already finished, or a Forgejo instance too old to have the route.
// An old Forgejo answers the missing route with a 404, which looks the
// same as a run that is gone, so it is reported as that and doesn't
// stop the dialog offering the action.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/checks/cancel-run (the `CancelWorkflowRun` operationId).
func (c *ClientWithResponses) CancelWorkflowRunWithResponse(ctx context.Context, body CancelWorkflowRunJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelWorkflowRunResponse, error) {
rsp, err := c.CancelWorkflowRun(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelWorkflowRunResponse(rsp)
}
// GetCheckLogWithResponse Read the output of one CI job, on demand
//
// The output behind a `Check` that carries a `jobId`, as plain text: colour
// codes and carriage returns removed, never markup, so a client must render
// it as text. Whatever the forge already masks stays masked. Only the last
// 256 KiB are returned; `truncated` says the start was cut.
//
// Only for a repository the dashboard tracks for you; any other answers 404
// without asking the forge.
//
// Fetched live on every call and never as part of a snapshot, since a log
// can be large and most are never opened. GitHub reads the job's log
// through its REST API (one request, then a short-lived download). Forgejo
// reads it through the job logs endpoint of its Actions API.
//
// A forge can refuse: the token may not read logs, the log may have
// expired, or the check may not be an Actions job at all. Those answer 403
// or 404 with a sentence a person can read.
//
// With `excerpt=true` the answer is the failed job's excerpt instead: `text`
// holds the last lines of the log with per-line timestamps and colour codes
// removed, at most 2,000 characters, and `truncated` is always false (an
// excerpt is a fixed-size tail, not a cut of what was asked for). Only
// Forgejo serves it; GitHub fills a check's `excerpt` itself when the
// checks are listed. A job whose log is gone or empty answers 200 with
// empty `text`, so a client can show the check without it. A job's excerpt
// is read once and kept once it finished, so asking again costs no
// request to the forge. A client asks for the few failed jobs it is about
// to show (the panel asks for the newest five), not for every job of a
// list.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/checks/log (the `GetCheckLog` operationId).
func (c *ClientWithResponses) GetCheckLogWithResponse(ctx context.Context, params *GetCheckLogParams, reqEditors ...RequestEditorFn) (*GetCheckLogResponse, error) {
rsp, err := c.GetCheckLog(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetCheckLogResponse(rsp)
}
// GetDashboardWithResponse The aggregated view
//
// Returns the most recently fetched snapshot. The backend refreshes
// this on its own schedule in the background; this endpoint never
// blocks on a live call to either forge, so it answers instantly even
// when a forge is slow or unreachable.
//
// Always the signed-in user's own dashboard.
//
// Draft pull requests are left out unless `includeDrafts=true`, and
// `hiddenDrafts` counts only the drafts in repos the user hasn't
// ignored, the same repos whose other pull requests show.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/dashboard (the `GetDashboard` operationId).
func (c *ClientWithResponses) GetDashboardWithResponse(ctx context.Context, params *GetDashboardParams, reqEditors ...RequestEditorFn) (*GetDashboardResponse, error) {
rsp, err := c.GetDashboard(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetDashboardResponse(rsp)
}
// RefreshDashboardWithResponse Trigger an immediate refresh of the signed-in user's own dashboard
//
// Blocks until an immediate, out-of-band refresh of the signed-in
// user's own dashboard completes, then returns the resulting
// snapshot — for retrying right away after a forge was only
// briefly unreachable, instead of waiting for the next scheduled
// background refresh.
//
// The server holds a five-second cooldown, so this can't
// be used to hammer a forge's API budget. A call inside that
// window does not fetch: it answers 200 with the current snapshot
// and a `Retry-After` header carrying the seconds left. Never a
// 429, because the page calls this straight after a merge, close
// or branch update to show the result, and a refusal there would
// leave the row stale. Only a call that actually fetched answers
// without the header.
//
// The same goes for a call made while the first refresh since the
// server started is still running: it answers at once with the
// current snapshot and `Retry-After`, instead of waiting for that
// refresh to finish.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/dashboard/refresh (the `RefreshDashboard` operationId).
func (c *ClientWithResponses) RefreshDashboardWithResponse(ctx context.Context, params *RefreshDashboardParams, reqEditors ...RequestEditorFn) (*RefreshDashboardResponse, error) {
rsp, err := c.RefreshDashboard(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseRefreshDashboardResponse(rsp)
}
// StreamDashboardWithResponse Server-Sent Events stream of the signed-in user's own dashboard
//
// Pushes a fresh snapshot every time this user's background
// refresh produces one — most notably right after a verified
// webhook delivery (see the webhooks tag) triggers an immediate
// one, which is what turns that into a live update instead of
// something only the next scheduled refresh picks up.
//
// The frontend's own 30-second poll against GET /api/dashboard
// keeps running unconditionally, connected or not — a browser or
// proxy that can't hold an SSE connection open just never
// benefits from this, rather than the dashboard going stale
// silently.
//
// `includeDrafts` is read once, when the connection opens, and
// applies to every event on it. A client that changes its mind
// reconnects with the new value.
//
// A client that passes `sid` can also follow the job lists of the
// pull requests and default branches it has open, through
// `POST /api/dashboard/stream/watch`. Each list arrives as named
// `run` events on this stream, one for each workflow run attempt, so a
// client that only listens for default messages never sees one. A
// reconnect reuses the same `sid` with nothing watched, so the client
// sends its watch again.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/dashboard/stream (the `StreamDashboard` operationId).
func (c *ClientWithResponses) StreamDashboardWithResponse(ctx context.Context, params *StreamDashboardParams, reqEditors ...RequestEditorFn) (*StreamDashboardResponse, error) {
rsp, err := c.StreamDashboard(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseStreamDashboardResponse(rsp)
}
// WatchDashboardStreamChecksWithBodyWithResponse Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
func (c *ClientWithResponses) WatchDashboardStreamChecksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WatchDashboardStreamChecksResponse, error) {
rsp, err := c.WatchDashboardStreamChecksWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseWatchDashboardStreamChecksResponse(rsp)
}
// WatchDashboardStreamChecksWithResponse Choose which job lists a dashboard stream sends
//
// Replaces the set of pull requests and default branches whose job
// lists the stream named by `streamId` sends as `run` events.
// The server lists a subject when it is newly watched, when its row
// in a new snapshot changed (CI state, check counts, or a branch's
// run), and when `refresh` is true. Nothing else costs a forge
// request. A failed listing is sent as an event with `error` set,
// and every snapshot after it tries again, changed or not, until a
// listing works.
//
// A listing is one event for each workflow run attempt the subject
// holds, then one with `gone` set for each run attempt the last
// listing sent and this one lacks. The last event of a listing has
// `final` set. A rerun keeps its run id and takes a new attempt, so
// its event carries a new `key` and the first attempt's key comes
// back as gone. The event is the JSON of the `RunEvent` schema.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/dashboard/stream/watch (the `WatchDashboardStreamChecks` operationId).
func (c *ClientWithResponses) WatchDashboardStreamChecksWithResponse(ctx context.Context, body WatchDashboardStreamChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*WatchDashboardStreamChecksResponse, error) {
rsp, err := c.WatchDashboardStreamChecks(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseWatchDashboardStreamChecksResponse(rsp)
}
// CloseIssueWithBodyWithResponse Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
func (c *ClientWithResponses) CloseIssueWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CloseIssueResponse, error) {
rsp, err := c.CloseIssueWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCloseIssueResponse(rsp)
}
// CloseIssueWithResponse Close one issue, on the signed-in user's behalf
//
// Closes the named issue. The Issues page's dialog offers it, on its own
// or after posting a comment with `POST /api/issues/comment`. Closing an
// issue that is already closed is not refused: both forges treat it as
// done, so the call succeeds and there is no `already_closed` answer.
//
// A refusal is an `ActionError` classified from the forge's own answer:
// `permission`, `rate_limited`, `forge_error`, or `unknown` with a
// plain-words `message`. An issue has no allowed-actions list and no
// re-read, unlike a pull request.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/close (the `CloseIssue` operationId).
func (c *ClientWithResponses) CloseIssueWithResponse(ctx context.Context, body CloseIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*CloseIssueResponse, error) {
rsp, err := c.CloseIssue(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCloseIssueResponse(rsp)
}
// CommentOnIssueWithBodyWithResponse Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
func (c *ClientWithResponses) CommentOnIssueWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CommentOnIssueResponse, error) {
rsp, err := c.CommentOnIssueWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCommentOnIssueResponse(rsp)
}
// CommentOnIssueWithResponse Post a comment on one issue, on the signed-in user's behalf
//
// Posts `body` as a comment on the named issue. The dialog's "Close with
// a comment" calls this first and Close second, so when the second call
// fails the page knows the comment is already there and offers only the
// close again. On GitHub, with the App as the credential and a personal
// token saved beside it, the comment is posted as that person.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/comment (the `CommentOnIssue` operationId).
func (c *ClientWithResponses) CommentOnIssueWithResponse(ctx context.Context, body CommentOnIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*CommentOnIssueResponse, error) {
rsp, err := c.CommentOnIssue(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCommentOnIssueResponse(rsp)
}
// GetIssueDetailsWithResponse Read an issue's description, comments and reactions, on demand
//
// What the issue dialog shows: the description, the conversation in
// order, and the thumbs up and thumbs down reactions on each with who
// gave them. The same shape and rules as GET /api/pull-requests/details
// without the release notes, which only a pull request has. Fetched live
// on every call, never as part of GET /api/dashboard's snapshot.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// issue, one for its comments, one for the description's reactions and
// one for each comment's reactions (up to 50), so the reaction calls run
// at most eight at a time and stop at the first rate limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so a
// client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged and
// never proxied.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. An issue that doesn't exist is a 404, and a forge that
// can't be read is an error, never an empty thread.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/issues/details (the `GetIssueDetails` operationId).
func (c *ClientWithResponses) GetIssueDetailsWithResponse(ctx context.Context, params *GetIssueDetailsParams, reqEditors ...RequestEditorFn) (*GetIssueDetailsResponse, error) {
rsp, err := c.GetIssueDetails(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetIssueDetailsResponse(rsp)
}
// ReopenIssueWithBodyWithResponse Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
func (c *ClientWithResponses) ReopenIssueWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReopenIssueResponse, error) {
rsp, err := c.ReopenIssueWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReopenIssueResponse(rsp)
}
// ReopenIssueWithResponse Reopen one issue that was closed, on the signed-in user's behalf
//
// Reopens the named issue: the undo the dialog offers right after a
// close. Reopening one that is already open is not refused.
//
// A refusal is an `ActionError`, classified as for Close.
//
// Closing, reopening and commenting change the issue, so they need write
// access to issues, which reading does not: a GitHub token's Issues
// permission (or the App's) set to Read and write, or a Forgejo token's
// `write:issue` scope. Without it the forge answers 403 and this
// endpoint answers an `ActionError` with `code` `permission`, whose
// `message` names what to add.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/issues/reopen (the `ReopenIssue` operationId).
func (c *ClientWithResponses) ReopenIssueWithResponse(ctx context.Context, body ReopenIssueJSONRequestBody, reqEditors ...RequestEditorFn) (*ReopenIssueResponse, error) {
rsp, err := c.ReopenIssue(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReopenIssueResponse(rsp)
}
// GetMainBranchesWithResponse The CI status of every tracked repository's default branch
//
// One row per tracked repository, showing the latest pipeline on its
// default branch: failed, passed, running or none. A repository
// ignored for pull requests is left out, as on the pull requests page.
// Every other row is returned, whatever its status, and no tally comes
// with them, so a client filters, sorts and counts locally and its pill
// counts always match what each pill lists. Rows come in no particular
// order: the client orders them.
//
// Served from the snapshot the background refresh already holds, so it
// never calls a forge. On GitHub the branch's check status rides the
// repository query the refresh already makes (no extra request); on
// Forgejo the refresh lists the Actions runs of the default branch, once
// per repository.
//
// A forge that can't be reached keeps its last known rows, each marked
// `staleSince`, the same carry-over `forges[].staleSince`
// on GET /api/dashboard reports. A forge whose rate-limit budget is
// spent is skipped until it resets and its rows are kept the same way.
// Only the signed-in user's own repositories.
//
// A repository with no default branch yet (empty) or no pipeline has
// status `none`. Unauthenticated GitHub access (a username with no
// token) has no rows: its budget is too small to spend on this.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/main-branches (the `GetMainBranches` operationId).
func (c *ClientWithResponses) GetMainBranchesWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetMainBranchesResponse, error) {
rsp, err := c.GetMainBranches(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetMainBranchesResponse(rsp)
}
// ListAdvisoriesWithResponse List a repository's open dependency advisories in full, on demand
//
// What the advisories dialog on the Main branches page shows for one
// repository: each open Dependabot alert with the fields GitHub's own
// alert page shows. The list and the detail view are the same answer, so
// opening one advisory costs no second call. Fetched live on every call,
// never as part of GET /api/main-branches' snapshot, so a repository
// nobody opens costs no budget.
//
// Sorted by severity, highest first, then newest first. GitHub reads them
// through the Dependabot alerts of the repository. A Forgejo repository
// reads its lock files again and matches them against OSV, so it costs the
// same as one refresh of that repository and works only while OSV
// advisories are switched on; each advisory is then one distinct
// advisory, with `number` its place in the list, `openedAt` the day OSV
// published it and `url` its page on OSV.
//
// A forge that can't say is a 200 with `state` "unknown", an empty list
// and the `reason`, the same words as the row's own `advisories`: alerts
// switched off, a credential without the Dependabot alerts permission, a
// rate limit, any other failure, or a repository with more open alerts
// than one read pages through. For Forgejo: advisories not switched on
// (`not_enabled`), OSV unreachable or a lock file that can't be read
// (`failed`), too much to read (`too_many`), or no lock file found (no
// `reason`). An empty `known` list means nothing is open.
//
// `description` is Markdown exactly as GitHub stores it, so a client must
// render it with raw HTML disabled. A field GitHub didn't send is left
// out. A Forgejo advisory leaves out what OSV does not state: `epss`,
// `relationship`, `scope` and `vulnerableVersions`.
//
// The same answer is the `get_repository_advisories` tool, over MCP and
// WebMCP.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/main-branches/advisories (the `ListAdvisories` operationId).
func (c *ClientWithResponses) ListAdvisoriesWithResponse(ctx context.Context, params *ListAdvisoriesParams, reqEditors ...RequestEditorFn) (*ListAdvisoriesResponse, error) {
rsp, err := c.ListAdvisories(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseListAdvisoriesResponse(rsp)
}
// RerunMainBranchChecksWithBodyWithResponse Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
func (c *ClientWithResponses) RerunMainBranchChecksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RerunMainBranchChecksResponse, error) {
rsp, err := c.RerunMainBranchChecksWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseRerunMainBranchChecksResponse(rsp)
}
// RerunMainBranchChecksWithResponse Rerun only the failed jobs of a repository's default-branch pipeline, on the signed-in user's behalf
//
// The branch twin of POST /api/pull-requests/rerun-checks. Asks the forge
// to rerun the failed jobs of the Actions workflow runs on the commit
// the branch's job list shows, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the result.
//
// A Main branches row offers it when its `status` is `failed`. A failed
// check that isn't an Actions job (a third-party check, a legacy status,
// an external CI) can't be rerun here and is skipped. Refusals are an
// `ActionError`; a 409 means the branch has no failed job to rerun, or
// that the forge is a Forgejo older than version 17, which has no rerun
// route (`ForgeHealth.rerunChecksBlocked` says so beforehand). On
// Forgejo the version is checked before the runs are looked up, as for a
// pull request, and a refusal that comes after some jobs restarted ends
// with which jobs restarted and which did not.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/main-branches/rerun-checks (the `RerunMainBranchChecks` operationId).
func (c *ClientWithResponses) RerunMainBranchChecksWithResponse(ctx context.Context, body RerunMainBranchChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*RerunMainBranchChecksResponse, error) {
rsp, err := c.RerunMainBranchChecks(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseRerunMainBranchChecksResponse(rsp)
}
// ReportDashboardPresenceWithBodyWithResponse Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
func (c *ClientWithResponses) ReportDashboardPresenceWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReportDashboardPresenceResponse, error) {
rsp, err := c.ReportDashboardPresenceWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReportDashboardPresenceResponse(rsp)
}
// ReportDashboardPresenceWithResponse Say whether a browser tab of the dashboard is being looked at
//
// The page calls this when its tab becomes visible or hidden
// (`document.visibilityState`), when the person stops or resumes
// using it, and on a slow heartbeat while it is visible. While at
// least one tab is visible, has had input recently and keeps sending
// heartbeats, the dashboard counts as in use and the scheduled
// background refresh keeps running. When every tab has said it is
// hidden, or has stopped sending heartbeats for three heartbeat
// periods (a closed laptop, a crashed browser), the dashboard counts
// as unused and, after the idle period, the scheduled refresh rests
// (see `IDLE_AFTER`). A tab that becomes visible after the refresh
// rested makes it run once.
//
// This call is the only way the server learns whether a tab is
// looked at. An open live stream says nothing about it, and neither
// does a read carrying `X-Background-Read`. The call itself is not a
// request that counts as use; only a visible report is.
//
// A browser session only: a personal API token is refused with 403,
// so a script cannot hold the refresh active.
//
// The answer carries the two timings the page follows, so neither
// is hard-coded in the browser.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/presence (the `ReportDashboardPresence` operationId).
func (c *ClientWithResponses) ReportDashboardPresenceWithResponse(ctx context.Context, body ReportDashboardPresenceJSONRequestBody, reqEditors ...RequestEditorFn) (*ReportDashboardPresenceResponse, error) {
rsp, err := c.ReportDashboardPresence(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReportDashboardPresenceResponse(rsp)
}
// EnablePullRequestAutoMergeWithBodyWithResponse Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
func (c *ClientWithResponses) EnablePullRequestAutoMergeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnablePullRequestAutoMergeResponse, error) {
rsp, err := c.EnablePullRequestAutoMergeWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnablePullRequestAutoMergeResponse(rsp)
}
// EnablePullRequestAutoMergeWithResponse Arm auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: this app keeps the intent itself and merges the pull
// request from its background pass once its checks pass (Forgejo's
// own scheduled merge has no way to read its state back). Nothing is
// sent to the forge now. The intent is stored per signed-in user and
// pull request, and the pull request then reports
// `autoMergeEnabled: true` and offers `cancel_auto_merge`. A repeat
// call is a 204. Only a pull request the user armed here is ever
// merged this way.
//
// GitHub: enables the named pull request's own
// auto-merge via GitHub's `enablePullRequestAutoMerge` GraphQL
// mutation — REST has no equivalent endpoint. Unlike Merge, that
// mutation asks for an explicit merge method rather than picking
// the repo's own default itself, so this looks the repo's allowed
// methods up first and picks one with the same merge > squash >
// rebase precedence Merge already uses, skipping merge when the
// default branch requires linear history; no override is exposed
// here either. The pull request stays open and unmerged until the
// forge's own required checks pass on their own.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// When the pull request is on the signed-in user's board and its
// `allowedActions` has no `auto_merge` entry, this server answers 409
// itself and never asks the forge: `auto_merge_not_allowed`,
// `already_up_to_date`, `conflict`, `stacked` or `ready_to_merge` for
// the reasons the board already knows, and `not_mergeable` for
// auto-merge already on or a forge that has none.
// `auto_merge_not_allowed` means the repo doesn't allow auto-merge
// (or not for this pull request); `ready_to_merge` means it is
// already clean, so there is nothing to wait for and Merge is the
// action; `checks_pending` means a non-required check is still
// running, so trying again later can work.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge (the `EnablePullRequestAutoMerge` operationId).
func (c *ClientWithResponses) EnablePullRequestAutoMergeWithResponse(ctx context.Context, body EnablePullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*EnablePullRequestAutoMergeResponse, error) {
rsp, err := c.EnablePullRequestAutoMerge(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnablePullRequestAutoMergeResponse(rsp)
}
// CancelPullRequestAutoMergeWithBodyWithResponse Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
func (c *ClientWithResponses) CancelPullRequestAutoMergeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelPullRequestAutoMergeResponse, error) {
rsp, err := c.CancelPullRequestAutoMergeWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelPullRequestAutoMergeResponse(rsp)
}
// CancelPullRequestAutoMergeWithResponse Cancel auto-merge on a pull request, on the signed-in user's behalf
//
// Forgejo: removes the intent stored by `POST /api/pull-requests/auto-merge`,
// so the background pass never merges the pull request. Nothing is sent
// to the forge. Idempotent: a pull request with no intent is a 204 too.
//
// GitHub: turns the pull request's own auto-merge off with GitHub's
// `disablePullRequestAutoMerge` GraphQL mutation. Only a pull request
// whose `allowedActions` has a `cancel_auto_merge` entry; otherwise this
// server answers 409 itself and never asks GitHub. A refusal from
// GitHub is an `ActionError`, as for arming.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-merge/cancel (the `CancelPullRequestAutoMerge` operationId).
func (c *ClientWithResponses) CancelPullRequestAutoMergeWithResponse(ctx context.Context, body CancelPullRequestAutoMergeJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelPullRequestAutoMergeResponse, error) {
rsp, err := c.CancelPullRequestAutoMerge(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelPullRequestAutoMergeResponse(rsp)
}
// SetPullRequestAutoUpdateWithBodyWithResponse Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
func (c *ClientWithResponses) SetPullRequestAutoUpdateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetPullRequestAutoUpdateResponse, error) {
rsp, err := c.SetPullRequestAutoUpdateWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetPullRequestAutoUpdateResponse(rsp)
}
// SetPullRequestAutoUpdateWithResponse Turn the automatic branch update on or off for one pull request
//
// A pure local write: nothing is sent to the forge. The choice is kept
// only while it differs from the repo's auto-update setting
// (`/api/repos/auto-update-branch/enable`), so a choice that matches
// the repo is dropped and the pull request follows the repo again, and
// a later change to the repo's setting reaches it. With `enabled`
// `null` or absent the pull request goes back to its repo's setting.
// Idempotent. A draft and a release-please pull request are never
// updated automatically, whatever is chosen: `autoUpdate.unavailable`
// in GET /api/dashboard says so. The server forgets the choice once
// the pull request is no longer open, its repo is no longer tracked, or
// the repo's setting changes to match it. A pull request the dashboard
// doesn't hold is a 404.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/auto-update (the `SetPullRequestAutoUpdate` operationId).
func (c *ClientWithResponses) SetPullRequestAutoUpdateWithResponse(ctx context.Context, body SetPullRequestAutoUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*SetPullRequestAutoUpdateResponse, error) {
rsp, err := c.SetPullRequestAutoUpdate(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetPullRequestAutoUpdateResponse(rsp)
}
// ClosePullRequestWithBodyWithResponse Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
func (c *ClientWithResponses) ClosePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ClosePullRequestResponse, error) {
rsp, err := c.ClosePullRequestWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseClosePullRequestResponse(rsp)
}
// ClosePullRequestWithResponse Close one pull request without merging it, on the signed-in user's behalf
//
// Closes the named pull request — for one that turns out not to
// need merging at all (a duplicate, or one whose content already
// landed another way), not a substitute for Merge.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// Closing a merged pull request is `already_merged`. Closing one
// that is already closed on Forgejo is not refused, because Forgejo
// treats it as done, so that call succeeds and there is no
// `already_closed` answer for it.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/close (the `ClosePullRequest` operationId).
func (c *ClientWithResponses) ClosePullRequestWithResponse(ctx context.Context, body ClosePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*ClosePullRequestResponse, error) {
rsp, err := c.ClosePullRequest(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseClosePullRequestResponse(rsp)
}
// PostPullRequestDependabotActionWithBodyWithResponse Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
func (c *ClientWithResponses) PostPullRequestDependabotActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPullRequestDependabotActionResponse, error) {
rsp, err := c.PostPullRequestDependabotActionWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostPullRequestDependabotActionResponse(rsp)
}
// PostPullRequestDependabotActionWithResponse Post one of Dependabot's own documented PR-comment commands on a pull request, on the signed-in user's behalf
//
// Posts exactly `@dependabot rebase` or `@dependabot recreate` as a
// comment on the named pull request — Dependabot's own documented
// comment-command interface, not a generic "post any comment"
// endpoint; `action` is validated server-side to one of the two
// values below and nothing else is ever sent. GitHub only —
// Dependabot doesn't run on Forgejo.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// A connected App with no personal token saved is `permission`, with
// the reason in `message`; nothing is posted.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/dependabot-action (the `PostPullRequestDependabotAction` operationId).
func (c *ClientWithResponses) PostPullRequestDependabotActionWithResponse(ctx context.Context, body PostPullRequestDependabotActionJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPullRequestDependabotActionResponse, error) {
rsp, err := c.PostPullRequestDependabotAction(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostPullRequestDependabotActionResponse(rsp)
}
// GetPullRequestDetailsWithResponse Read a pull request's description, comments and reactions, on demand
//
// What the pull request dialog shows: the description, the
// conversation in order, the thumbs up and thumbs down reactions on each
// with who gave them, and, for a release pull request, the release
// notes. Fetched live on every call, never as part of GET
// /api/dashboard's snapshot: comments and reactions for every row would
// spend the forge's budget on rows nobody opens.
//
// GitHub answers with one GraphQL query. Forgejo costs one call for the
// pull request, one for its comments, one for the description's
// reactions and one for each comment's reactions (up to 50), so the
// reaction calls run at most eight at a time and stop at the first rate
// limit.
//
// Every text is Markdown exactly as the forge stores it (`format` is
// always `markdown`). The server neither converts nor sanitises it, so
// a client must render it with raw HTML disabled. Each text is cut at
// 20,000 characters (`truncated`), the conversation keeps its first 50
// comments (`commentsTruncated`, with the full `commentCount`), and a
// reaction names at most its first 10 people while `count` is the full
// number. An avatar is the forge's own URL, passed through unchanged
// and never proxied; this app sets no Content-Security-Policy today, so
// the browser loads it directly. A future policy's `img-src` has to
// allow avatars.githubusercontent.com, repository-images.githubusercontent.com
// (a GitHub repository's logo, see `logoUrl` on a repo in GET
// /api/dashboard) and the Forgejo host.
//
// A forge that can't be read is an error, never an empty thread.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/pull-requests/details (the `GetPullRequestDetails` operationId).
func (c *ClientWithResponses) GetPullRequestDetailsWithResponse(ctx context.Context, params *GetPullRequestDetailsParams, reqEditors ...RequestEditorFn) (*GetPullRequestDetailsResponse, error) {
rsp, err := c.GetPullRequestDetails(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetPullRequestDetailsResponse(rsp)
}
// HidePullRequestWithBodyWithResponse Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
func (c *ClientWithResponses) HidePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*HidePullRequestResponse, error) {
rsp, err := c.HidePullRequestWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseHidePullRequestResponse(rsp)
}
// HidePullRequestWithResponse Hide one pull request from the signed-in user's dashboard
//
// Reversible, not destructive, like ignoring a repo: nothing is sent to
// the forge. A hidden pull request leaves `pullRequests` in
// GET /api/dashboard and everything counted from it, and is counted in
// `hiddenPullRequests` instead. It stays listed for
// `includeHidden=true`, marked `hidden`, so a client can offer a Restore.
//
// With `days`, the hide ends by itself that many days from now. Without
// it the pull request stays hidden until `POST /api/pull-requests/unhide`.
// A repeat call replaces the earlier choice (hide until restored, then
// hide for 7 days, ends with the 7 days). The server forgets the record
// once the pull request is no longer open, so the list never grows
// without end. The pull request need not be on the board yet: hiding
// one the user can't see is still a 204.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/hide (the `HidePullRequest` operationId).
func (c *ClientWithResponses) HidePullRequestWithResponse(ctx context.Context, body HidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*HidePullRequestResponse, error) {
rsp, err := c.HidePullRequest(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseHidePullRequestResponse(rsp)
}
// MergePullRequestWithBodyWithResponse Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
func (c *ClientWithResponses) MergePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MergePullRequestResponse, error) {
rsp, err := c.MergePullRequestWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseMergePullRequestResponse(rsp)
}
// MergePullRequestWithResponse Merge one pull request, on the signed-in user's behalf
//
// Merges the named pull request using its repo's own configured
// default merge method — GitHub is asked to pick its own repo
// default, except that a base branch requiring linear history gets
// squash or rebase, never a merge commit; Forgejo's API has no such default built in, so this
// looks up the repo's configured default merge style first and
// passes that explicitly. Neither takes a method override here;
// picking one is out of scope for this endpoint.
//
// When the forge refuses the merge, the server re-reads the pull
// request's real current state and answers an `ActionError`: a `code`
// from a fixed set plus a short `message` safe to show a person, so
// every client gets the same reason without parsing forge text. A
// pull request that is already merged or closed answers
// `already_merged` / `already_closed`. If the re-read itself fails,
// the original forge error is returned with `code: unknown`.
//
// An empty pull request, whose branch is already on the target, has no
// `merge` in `allowedActions`. A Merge posted for one anyway
// gets 409 `already_up_to_date` from this server, which never asks the
// forge.
//
// `deleteBranch: true` also asks for the pull request's source branch
// to be deleted once the merge has landed. The merge never depends on
// it: a branch that can't or shouldn't be deleted leaves the merge
// done and is reported in `branchDeletion`. Without `deleteBranch`
// the answer is a bare 204 and the branch is left alone.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/merge (the `MergePullRequest` operationId).
func (c *ClientWithResponses) MergePullRequestWithResponse(ctx context.Context, body MergePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*MergePullRequestResponse, error) {
rsp, err := c.MergePullRequest(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseMergePullRequestResponse(rsp)
}
// PostPullRequestRenovateRebaseWithBodyWithResponse Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
func (c *ClientWithResponses) PostPullRequestRenovateRebaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostPullRequestRenovateRebaseResponse, error) {
rsp, err := c.PostPullRequestRenovateRebaseWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostPullRequestRenovateRebaseResponse(rsp)
}
// PostPullRequestRenovateRebaseWithResponse Trigger Renovate's own rebase/retry on a pull request, on the signed-in user's behalf
//
// Ticks the `rebase-check` checkbox in the named pull request's
// body (`- [ ] <!-- rebase-check -->...` becomes `- [x] ...`, and
// nothing else in the body changes) — Renovate's own documented
// rebase/retry trigger, which every Renovate pull request carries
// and which needs no setup. Renovate doesn't read comments as
// commands. When the body has no such checkbox, falls back to
// adding the signed-in user's own configured Renovate rebase label
// (Settings' "Renovate rebase label" field, defaulting to
// Renovate's own `rebase` if left blank). Works on both GitHub
// and Forgejo, unlike the Dependabot actions, since Renovate runs
// on both.
//
// A checkbox that is already ticked is not edited again: the
// answer is a 409 `ActionError` with `code: already_requested`.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase (the `PostPullRequestRenovateRebase` operationId).
func (c *ClientWithResponses) PostPullRequestRenovateRebaseWithResponse(ctx context.Context, body PostPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*PostPullRequestRenovateRebaseResponse, error) {
rsp, err := c.PostPullRequestRenovateRebase(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePostPullRequestRenovateRebaseResponse(rsp)
}
// CancelPullRequestRenovateRebaseWithBodyWithResponse Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
func (c *ClientWithResponses) CancelPullRequestRenovateRebaseWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CancelPullRequestRenovateRebaseResponse, error) {
rsp, err := c.CancelPullRequestRenovateRebaseWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelPullRequestRenovateRebaseResponse(rsp)
}
// CancelPullRequestRenovateRebaseWithResponse Withdraw a requested Renovate rebase on a pull request, on the signed-in user's behalf
//
// Unticks the `rebase-check` checkbox in the named pull request's
// body (`- [x] <!-- rebase-check -->...` becomes `- [ ] ...`, and
// nothing else in the body changes), which takes back the rebase
// that ticking it asked for. Renovate looks at the box on its next
// run, so a rebase it has already started is not stopped. The
// pull request offers it as a `cancel_renovate_rebase` entry in
// `allowedActions`, which it does while the box is ticked. A request
// made with the rebase label has no checkbox, so it has no cancel.
//
// Cancelling is idempotent: a box that is already unticked is left
// alone and the answer is still 204. The pending `botRequest` of that
// rebase, if this app recorded one, is dropped from the next snapshot.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/renovate-rebase/cancel (the `CancelPullRequestRenovateRebase` operationId).
func (c *ClientWithResponses) CancelPullRequestRenovateRebaseWithResponse(ctx context.Context, body CancelPullRequestRenovateRebaseJSONRequestBody, reqEditors ...RequestEditorFn) (*CancelPullRequestRenovateRebaseResponse, error) {
rsp, err := c.CancelPullRequestRenovateRebase(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelPullRequestRenovateRebaseResponse(rsp)
}
// ReopenPullRequestWithBodyWithResponse Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
func (c *ClientWithResponses) ReopenPullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReopenPullRequestResponse, error) {
rsp, err := c.ReopenPullRequestWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReopenPullRequestResponse(rsp)
}
// ReopenPullRequestWithResponse Reopen one pull request that was closed without merging, on the signed-in user's behalf
//
// Reopens the named pull request: the undo for Close, offered in the
// pull request's dialog right after a close. It does not offer a
// reopen for a merged pull request, because the forge doesn't allow
// one.
//
// A closed pull request is not on the board, so no `allowedActions`
// entry says in advance whether the forge will accept this. The call
// is made and the forge decides. When it refuses, the server re-reads
// the pull request and answers an `ActionError` (see Merge):
// `already_merged` when it was merged in the meantime, and
// `not_reopenable` when it is still closed and the forge won't
// reopen it, usually because its branch was deleted or rewritten
// after the close. Both are a 409 with a plain-words `message` that
// says what to do next.
//
// On success the pull request is listed on the board again from the
// next refresh.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/reopen (the `ReopenPullRequest` operationId).
func (c *ClientWithResponses) ReopenPullRequestWithResponse(ctx context.Context, body ReopenPullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*ReopenPullRequestResponse, error) {
rsp, err := c.ReopenPullRequest(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReopenPullRequestResponse(rsp)
}
// RerunPullRequestChecksWithBodyWithResponse Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
func (c *ClientWithResponses) RerunPullRequestChecksWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RerunPullRequestChecksResponse, error) {
rsp, err := c.RerunPullRequestChecksWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseRerunPullRequestChecksResponse(rsp)
}
// RerunPullRequestChecksWithResponse Rerun only the failed jobs of one pull request's checks, on the signed-in user's behalf
//
// Asks the forge to rerun the failed jobs of the Actions workflow
// runs on the pull request's head commit, and nothing that passed. It
// answers once the forge has queued them, not when they finish, so a
// client shows a queued state and lets the next refresh carry the
// result.
//
// A pull request offers it as a `rerun_checks` entry in
// `allowedActions`, on GitHub and Forgejo, when its CI is failing. A
// Forgejo commit status doesn't say which workflow run it came from, so
// Forgejo's runs are found by the head commit instead. A failed check
// that isn't an Actions job (a third-party check, a legacy status, an
// external CI) can't be rerun here and is skipped. On Forgejo the
// jobs of each failed run are listed and each failed job is rerun
// by itself; Forgejo restarts the jobs that need it, so a job that
// passed but waits on a failed one goes again too. Forgejo
// gained the rerun routes in version 17; an older instance answers 409
// with a plain sentence and sends no rerun request to the forge (the
// version is checked before the pull request or its runs are looked up),
// and says so up front in `ForgeHealth.rerunChecksBlocked`.
// `rerun_checks` still appears in `allowedActions` for such a Forgejo: a
// caller learns of the block from that health entry or from the 409. The
// block is per forge kind, so with an old and a new Forgejo side by side
// the 409 answers a click on the old one.
//
// Refusals are an `ActionError` (see Merge). `not_mergeable` with a 409
// means the pull request has no failed check to rerun. Anything the
// forge refuses (the token may not write to Actions, the run is too
// old or already running) arrives with its own plain-words `message`.
// Jobs are rerun one request at a time, so a refusal can come after
// earlier jobs restarted; the `message` then ends with which jobs
// restarted and which did not. A job whose request got no clear answer
// (a timeout, a reset, a cancelled wait, a 502, 503 or 504) is named as
// one that may have restarted, as are the other failed jobs of its run,
// whichever job it was. Only a request that provably never reached the
// forge (a refused connection, a name that doesn't resolve, a rejected
// certificate) counts as not restarted. The message leaves out "Try
// again in a moment" only when a job may have restarted. When the
// version could not be read the forge decides, and a 404 from it reads
// "The forge couldn't find that run, job or pull request. It may not
// support rerunning checks from here, or the token can't see this
// repository." That sentence names no forge or version, because a 404
// can mean either.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/rerun-checks (the `RerunPullRequestChecks` operationId).
func (c *ClientWithResponses) RerunPullRequestChecksWithResponse(ctx context.Context, body RerunPullRequestChecksJSONRequestBody, reqEditors ...RequestEditorFn) (*RerunPullRequestChecksResponse, error) {
rsp, err := c.RerunPullRequestChecks(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseRerunPullRequestChecksResponse(rsp)
}
// UnhidePullRequestWithBodyWithResponse Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
func (c *ClientWithResponses) UnhidePullRequestWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnhidePullRequestResponse, error) {
rsp, err := c.UnhidePullRequestWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUnhidePullRequestResponse(rsp)
}
// UnhidePullRequestWithResponse Bring a hidden pull request back onto the signed-in user's dashboard
//
// The reverse of POST /api/pull-requests/hide. Idempotent: restoring a
// pull request that isn't hidden is a 204 too.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/unhide (the `UnhidePullRequest` operationId).
func (c *ClientWithResponses) UnhidePullRequestWithResponse(ctx context.Context, body UnhidePullRequestJSONRequestBody, reqEditors ...RequestEditorFn) (*UnhidePullRequestResponse, error) {
rsp, err := c.UnhidePullRequest(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUnhidePullRequestResponse(rsp)
}
// UpdatePullRequestBranchWithBodyWithResponse Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
func (c *ClientWithResponses) UpdatePullRequestBranchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdatePullRequestBranchResponse, error) {
rsp, err := c.UpdatePullRequestBranchWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUpdatePullRequestBranchResponse(rsp)
}
// UpdatePullRequestBranchWithResponse Bring one pull request's branch up to date with its base, on the signed-in user's behalf
//
// Merges the named pull request's base branch into its own head
// branch. GitHub can schedule this as a background job rather than
// finishing it inline — a 202 here means exactly that, not a
// failure; a follow-up refresh a moment later reflects the result.
// Forgejo's equivalent is always synchronous, so it only ever
// answers 204.
//
// When the forge refuses, the server re-reads the pull request and
// answers an `ActionError` (see Merge): `already_merged` or
// `already_closed` when the row was stale, otherwise a `code` and a
// plain-words `message` safe to show a person.
// `conflict` means the branches can't be merged cleanly;
// `already_up_to_date` means there was nothing to bring in.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/pull-requests/update-branch (the `UpdatePullRequestBranch` operationId).
func (c *ClientWithResponses) UpdatePullRequestBranchWithResponse(ctx context.Context, body UpdatePullRequestBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdatePullRequestBranchResponse, error) {
rsp, err := c.UpdatePullRequestBranch(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUpdatePullRequestBranchResponse(rsp)
}
// ListQueuedActionsWithResponse List the signed-in user's queued actions, waiting and recently finished
//
// Every action the user queued to run when a rate-limited forge
// resets, oldest first: the ones still `queued`, and the
// final ones (`done`, `skipped`, `failed`) kept for 24 hours so a
// client can show the outcome in its Activity list. The same list
// rides along on GET /api/dashboard as `queuedActions`.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/queued-actions (the `ListQueuedActions` operationId).
func (c *ClientWithResponses) ListQueuedActionsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListQueuedActionsResponse, error) {
rsp, err := c.ListQueuedActions(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseListQueuedActionsResponse(rsp)
}
// QueueActionWithBodyWithResponse Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
func (c *ClientWithResponses) QueueActionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueueActionResponse, error) {
rsp, err := c.QueueActionWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseQueueActionResponse(rsp)
}
// QueueActionWithResponse Queue a safe action to run when a rate-limited forge resets
//
// Stores the intent server-side. When the forge's budget comes back
// the server reads the pull request again and runs the action only
// if it still applies; otherwise it records why it did nothing. It
// survives a page reload and a server restart.
//
// Only safe, idempotent actions can be queued: `update_branch`,
// `dependabot_rebase` and `renovate_rebase`. Merge and Close are not
// queueable and answer 400: they would act unattended on a pull
// request whose checks or commits may have changed. To merge once
// the limit lifts, use the forge's own auto-merge.
//
// The forge must be rate limited right now (a spent budget in
// `forges[].rateLimitRest` or `rateLimitGraphql` whose `resetsAt` is
// ahead), otherwise there is nothing to wait for and the action
// should be taken directly: 409 `not_rate_limited`. The pull request
// must be on the signed-in user's board and offer the action
// (`allowedActions`) and be behind its base branch, with the same
// 409 codes the direct action answers. The queued item runs with
// the user's own saved credentials for that forge, never anyone
// else's. Queueing the same action on the same pull request twice
// returns the first item with 200.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/queued-actions (the `QueueAction` operationId).
func (c *ClientWithResponses) QueueActionWithResponse(ctx context.Context, body QueueActionJSONRequestBody, reqEditors ...RequestEditorFn) (*QueueActionResponse, error) {
rsp, err := c.QueueAction(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseQueueActionResponse(rsp)
}
// CancelQueuedActionWithResponse Cancel a queued action, or clear a finished one from the list
//
// A queued action that has not run is removed and nothing runs. A
// finished one is cleared from the list. An id that isn't the
// signed-in user's answers 404, the same as one that doesn't exist.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/queued-actions/{id} (the `CancelQueuedAction` operationId).
func (c *ClientWithResponses) CancelQueuedActionWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*CancelQueuedActionResponse, error) {
rsp, err := c.CancelQueuedAction(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseCancelQueuedActionResponse(rsp)
}
// GetReleaseDetailsWithResponse Read a published release's title and notes, on demand
//
// What the release dialog on the Main branches page shows for a
// repository's latest published release: its title, when it was
// published, its notes and the thumbs reactions on them. Fetched live on
// every call, never as part of GET /api/main-branches' snapshot, so a
// release nobody opens costs no budget.
//
// GitHub answers with one GraphQL query. Only GitHub rows carry a latest
// release today, so a Forgejo repository is a 400.
//
// The notes are Markdown exactly as the forge stores them (`format` is
// always `markdown`). The server neither converts nor sanitises them, so
// a client must render them with raw HTML disabled. They are cut at
// 20,000 characters (`truncated`), and a reaction names at most its
// first 10 people while `count` is the full number.
//
// The error answers are those of GET /api/pull-requests/details, with
// the same codes. A tag that has no published release is a 404, and so is a draft,
// a pre-release or a release with no publish date.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/releases/details (the `GetReleaseDetails` operationId).
func (c *ClientWithResponses) GetReleaseDetailsWithResponse(ctx context.Context, params *GetReleaseDetailsParams, reqEditors ...RequestEditorFn) (*GetReleaseDetailsResponse, error) {
rsp, err := c.GetReleaseDetails(ctx, params, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetReleaseDetailsResponse(rsp)
}
// DisableAutoUpdateBranchWithBodyWithResponse Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
func (c *ClientWithResponses) DisableAutoUpdateBranchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DisableAutoUpdateBranchResponse, error) {
rsp, err := c.DisableAutoUpdateBranchWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseDisableAutoUpdateBranchResponse(rsp)
}
// DisableAutoUpdateBranchWithResponse Turn off automatic branch updates for one tracked repo
//
// The reverse of POST /api/repos/auto-update-branch/enable.
// Idempotent: disabling a repo that was never enabled is a no-op,
// not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/disable (the `DisableAutoUpdateBranch` operationId).
func (c *ClientWithResponses) DisableAutoUpdateBranchWithResponse(ctx context.Context, body DisableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*DisableAutoUpdateBranchResponse, error) {
rsp, err := c.DisableAutoUpdateBranch(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseDisableAutoUpdateBranchResponse(rsp)
}
// EnableAutoUpdateBranchWithBodyWithResponse Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
func (c *ClientWithResponses) EnableAutoUpdateBranchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnableAutoUpdateBranchResponse, error) {
rsp, err := c.EnableAutoUpdateBranchWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnableAutoUpdateBranchResponse(rsp)
}
// EnableAutoUpdateBranchWithResponse Turn on automatic branch updates for one tracked repo
//
// Any of this repo's pull requests the background refresh finds
// behind its base branch gets updated automatically from then on, the same as clicking
// "Update branch" would, except that a Dependabot pull request gets
// its rebase comment and a Renovate one its rebase label instead, and
// a release-please pull request is skipped. Idempotent: enabling an already-enabled repo
// is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/auto-update-branch/enable (the `EnableAutoUpdateBranch` operationId).
func (c *ClientWithResponses) EnableAutoUpdateBranchWithResponse(ctx context.Context, body EnableAutoUpdateBranchJSONRequestBody, reqEditors ...RequestEditorFn) (*EnableAutoUpdateBranchResponse, error) {
rsp, err := c.EnableAutoUpdateBranch(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnableAutoUpdateBranchResponse(rsp)
}
// IgnoreRepoWithBodyWithResponse Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
func (c *ClientWithResponses) IgnoreRepoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*IgnoreRepoResponse, error) {
rsp, err := c.IgnoreRepoWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseIgnoreRepoResponse(rsp)
}
// IgnoreRepoWithResponse Hide one tracked repo's pull requests, issues, or both from the dashboard and Insights
//
// Reversible, not destructive: the repo itself keeps
// appearing in GET /api/dashboard's `repos` array with accurate
// webhook-coverage status, and keeps being fetched and counted —
// only the pullRequests and/or issues entries the request scopes
// stop appearing there and on Insights. A repeat call
// replaces the previously saved scope rather than merging with it
// (ignoring PRs only, then issues only, ends with only issues
// ignored) — idempotent for an identical repeat, not additive
// across different scopes.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/ignore (the `IgnoreRepo` operationId).
func (c *ClientWithResponses) IgnoreRepoWithResponse(ctx context.Context, body IgnoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*IgnoreRepoResponse, error) {
rsp, err := c.IgnoreRepo(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseIgnoreRepoResponse(rsp)
}
// DisableRebaseBotsWithBodyWithResponse Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
func (c *ClientWithResponses) DisableRebaseBotsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*DisableRebaseBotsResponse, error) {
rsp, err := c.DisableRebaseBotsWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseDisableRebaseBotsResponse(rsp)
}
// DisableRebaseBotsWithResponse Stop rebasing Dependabot and Renovate pull requests for one tracked repo
//
// The reverse of POST /api/repos/rebase-bots/enable. Idempotent:
// disabling a repo that was never enabled is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/disable (the `DisableRebaseBots` operationId).
func (c *ClientWithResponses) DisableRebaseBotsWithResponse(ctx context.Context, body DisableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*DisableRebaseBotsResponse, error) {
rsp, err := c.DisableRebaseBots(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseDisableRebaseBotsResponse(rsp)
}
// EnableRebaseBotsWithBodyWithResponse Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
func (c *ClientWithResponses) EnableRebaseBotsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnableRebaseBotsResponse, error) {
rsp, err := c.EnableRebaseBotsWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnableRebaseBotsResponse(rsp)
}
// EnableRebaseBotsWithResponse Rebase Dependabot and Renovate pull requests for one tracked repo
//
// A Dependabot or Renovate pull request of this repo that the
// background refresh finds behind its base branch gets the bot's own
// rebase from then on: Dependabot's rebase comment, or Renovate's
// rebase label. It is never given a generic branch update or a pushed
// commit. Human, draft and release-please pull requests are not
// touched, and a choice made on one pull request still wins. Works
// with or without automatic branch updates on the repo. Idempotent:
// enabling an already-enabled repo is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/rebase-bots/enable (the `EnableRebaseBots` operationId).
func (c *ClientWithResponses) EnableRebaseBotsWithResponse(ctx context.Context, body EnableRebaseBotsJSONRequestBody, reqEditors ...RequestEditorFn) (*EnableRebaseBotsResponse, error) {
rsp, err := c.EnableRebaseBots(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnableRebaseBotsResponse(rsp)
}
// UnignoreRepoWithBodyWithResponse Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
func (c *ClientWithResponses) UnignoreRepoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UnignoreRepoResponse, error) {
rsp, err := c.UnignoreRepoWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUnignoreRepoResponse(rsp)
}
// UnignoreRepoWithResponse Stop ignoring one tracked repo
//
// The reverse of POST /api/repos/ignore. Idempotent: un-ignoring a
// repo that was never ignored is a no-op, not an error.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/repos/unignore (the `UnignoreRepo` operationId).
func (c *ClientWithResponses) UnignoreRepoWithResponse(ctx context.Context, body UnignoreRepoJSONRequestBody, reqEditors ...RequestEditorFn) (*UnignoreRepoResponse, error) {
rsp, err := c.UnignoreRepo(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseUnignoreRepoResponse(rsp)
}
// GetSettingsWithResponse The signed-in user's own forge configuration
//
// Forge tokens are never returned, only whether one is set. The
// webhook token and secret are returned, since the user pastes them
// into the forge's webhook setup, and a first read creates them. For
// a read that creates nothing and omits both, see
// `GET /api/settings/summary`.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings (the `GetSettings` operationId).
func (c *ClientWithResponses) GetSettingsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSettingsResponse, error) {
rsp, err := c.GetSettings(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetSettingsResponse(rsp)
}
// PutSettingsWithBodyWithResponse Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
func (c *ClientWithResponses) PutSettingsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutSettingsResponse, error) {
rsp, err := c.PutSettingsWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePutSettingsResponse(rsp)
}
// PutSettingsWithResponse Save the signed-in user's forge configuration
//
// Replaces every field except a blank token, which means "keep
// whatever's already saved" rather than "clear it" — the only
// sensible behavior for a field the browser is never shown the
// current value of. Saving triggers that user's dashboard to start
// refreshing from the new configuration.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings (the `PutSettings` operationId).
func (c *ClientWithResponses) PutSettingsWithResponse(ctx context.Context, body PutSettingsJSONRequestBody, reqEditors ...RequestEditorFn) (*PutSettingsResponse, error) {
rsp, err := c.PutSettings(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParsePutSettingsResponse(rsp)
}
// GetFilterStateWithResponse The signed-in user's own saved dashboard/Insights filter state
//
// A lightweight read of one opaque blob, deliberately not
// GET /api/settings itself for the same reason GET /api/settings/theme
// isn't either: this loads on every dashboard/Insights visit and
// shouldn't provision webhook credentials as a side effect.
// `{}` for a user who's never saved any filters yet, not a 404.
// These are the web UI's own state: a signed-in browser session only,
// and a personal API token is refused with 403.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/filter-state (the `GetFilterState` operationId).
func (c *ClientWithResponses) GetFilterStateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetFilterStateResponse, error) {
rsp, err := c.GetFilterState(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetFilterStateResponse(rsp)
}
// SetFilterStateWithBodyWithResponse Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
func (c *ClientWithResponses) SetFilterStateWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetFilterStateResponse, error) {
rsp, err := c.SetFilterStateWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetFilterStateResponse(rsp)
}
// SetFilterStateWithResponse Save the signed-in user's own dashboard/Insights filter state
//
// A dedicated, lightweight save separate from the main
// PUT /api/settings — filters change on nearly every click, a
// mismatch for that endpoint's "always a full form submit"
// convention. The body replaces the saved state entirely,
// the same "always a full submit, just of a much smaller and
// much more frequent thing" shape as the main settings PUT, not a
// partial patch. Filters.js's own client-side code decides when
// to call this: immediately for a discrete control, debounced
// while the user is still typing in the free-text Title filter.
// A signed-in browser session only: a personal API token is refused
// with 403, so a script or agent can't change the filters the user
// sees. Each save is logged with the user agent.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/filter-state (the `SetFilterState` operationId).
func (c *ClientWithResponses) SetFilterStateWithResponse(ctx context.Context, body SetFilterStateJSONRequestBody, reqEditors ...RequestEditorFn) (*SetFilterStateResponse, error) {
rsp, err := c.SetFilterState(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetFilterStateResponse(rsp)
}
// GetSettingsSummaryWithResponse The signed-in user's settings, read without side effects
//
// The same data as `GET /api/settings`, minus the webhook token and
// secret, plus `webhookConfigured`. It never provisions webhook
// credentials: for a user who has none yet it answers
// `webhookConfigured: false` and creates nothing. Forge tokens are
// never returned, only whether one is set. It returns exactly what
// the `get_settings` MCP tool returns.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/summary (the `GetSettingsSummary` operationId).
func (c *ClientWithResponses) GetSettingsSummaryWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetSettingsSummaryResponse, error) {
rsp, err := c.GetSettingsSummary(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetSettingsSummaryResponse(rsp)
}
// GetThemeWithResponse The signed-in user's own saved theme preference
//
// A lightweight, side-effect-free read of one field — theme — for
// every page to check on load. Deliberately not
// GET /api/settings itself: that handler also provisions webhook
// credentials on first call (EnsureWebhookCredentials), which
// every page loading shouldn't trigger for a user who's never
// opened Settings at all.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/theme (the `GetTheme` operationId).
func (c *ClientWithResponses) GetThemeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetThemeResponse, error) {
rsp, err := c.GetTheme(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetThemeResponse(rsp)
}
// SetThemeWithBodyWithResponse Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
func (c *ClientWithResponses) SetThemeWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetThemeResponse, error) {
rsp, err := c.SetThemeWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetThemeResponse(rsp)
}
// SetThemeWithResponse Save the signed-in user's own theme preference
//
// A dedicated, instant save — deliberately not routed
// through the main PUT /api/settings, whose every other field is
// a plain replace rather than a per-field merge: a request
// carrying only theme through that handler would blank every
// other saved setting. Picking a theme applies immediately, the
// same "set once and forget" convention the ticket's own research
// cites, rather than waiting on the rest of the settings form's
// own Save button.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/theme (the `SetTheme` operationId).
func (c *ClientWithResponses) SetThemeWithResponse(ctx context.Context, body SetThemeJSONRequestBody, reqEditors ...RequestEditorFn) (*SetThemeResponse, error) {
rsp, err := c.SetTheme(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetThemeResponse(rsp)
}
// GetTimezoneWithResponse The signed-in user's own saved time zone
//
// A lightweight, side-effect-free read of one field, for every page to
// check on load so it can show times in the user's zone. Deliberately
// not GET /api/settings, for the reason GET /api/settings/theme isn't.
// Empty means "use the browser's own zone".
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/settings/timezone (the `GetTimezone` operationId).
func (c *ClientWithResponses) GetTimezoneWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetTimezoneResponse, error) {
rsp, err := c.GetTimezone(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetTimezoneResponse(rsp)
}
// SetTimezoneWithBodyWithResponse Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
func (c *ClientWithResponses) SetTimezoneWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetTimezoneResponse, error) {
rsp, err := c.SetTimezoneWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetTimezoneResponse(rsp)
}
// SetTimezoneWithResponse Save the signed-in user's own time zone
//
// A dedicated, instant save, not routed through PUT /api/settings,
// which replaces every other field. Exists for browsers that report
// UTC to every page, such as Firefox with fingerprint resistance.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /api/settings/timezone (the `SetTimezone` operationId).
func (c *ClientWithResponses) SetTimezoneWithResponse(ctx context.Context, body SetTimezoneJSONRequestBody, reqEditors ...RequestEditorFn) (*SetTimezoneResponse, error) {
rsp, err := c.SetTimezone(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseSetTimezoneResponse(rsp)
}
// GetForgeApiStatsWithResponse How many forge API calls the dashboard has spent, and on what
//
// Counts the forge requests made since the server started, so a change
// to what the dashboard refreshes can be shown to have saved budget, and
// a rate-limit incident traced to the refresh that caused it. One bucket
// per forge, credential, refresh `kind` and repository, each with the
// REST calls made, the GraphQL calls made, the GraphQL `rateLimit.cost`
// they were charged, and the requests answered `304 Not Modified`. A 304
// is not charged against the REST budget, so it is counted on its own and
// not as a REST call.
//
// `kind` says why the request was made: `full` (a whole-account
// refresh), `scoped_webhook` (one repository, after a webhook),
// `ci_poll` (one repository, waiting on a running check),
// `auto_merge_poll` (one repository, waiting on an armed auto-merge),
// `details` (a dialog or check list opened), `hook_maintenance`
// (checking, adding or upgrading webhooks), `advisories` (reading a
// repository's open Dependabot alerts, or a Forgejo repository's lockfiles), `user_action` (a button
// pressed, a queued action, or something the dashboard does for you such
// as auto-merge) and `unknown` (a request nobody tagged, which is a bug
// to report). A request that names no repository, such as listing an
// account's repositories, has an empty `repo`.
//
// The counters live in memory and start from zero on every start;
// `since` says when counting began. `credential` names the connected
// account or App installation by a label that carries no secret and no
// user id (`app:<installation id>`, `token:<short hash>`,
// `public:<username>`). Only the buckets of the caller's own
// credentials are returned. They are matched to the credentials
// the caller has saved, and a GitHub App installation id is a number the
// caller types in, so until the dashboard has one user, someone who saves
// another account's installation id sees that installation's counts. `budgets` are the rate limits each forge last
// reported, the same figures as `forges` on GET /api/dashboard.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/stats/forge-api (the `GetForgeApiStats` operationId).
func (c *ClientWithResponses) GetForgeApiStatsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetForgeApiStatsResponse, error) {
rsp, err := c.GetForgeApiStats(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetForgeApiStatsResponse(rsp)
}
// ListAPITokensWithResponse List the signed-in user's own personal API tokens
//
// Metadata only, per APIToken's own description — a raw value never reappears once created.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/tokens (the `ListAPITokens` operationId).
func (c *ClientWithResponses) ListAPITokensWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAPITokensResponse, error) {
rsp, err := c.ListAPITokens(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseListAPITokensResponse(rsp)
}
// CreateAPITokenWithBodyWithResponse Generate a new personal API token
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
func (c *ClientWithResponses) CreateAPITokenWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateAPITokenResponse, error) {
rsp, err := c.CreateAPITokenWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateAPITokenResponse(rsp)
}
// CreateAPITokenWithResponse Generate a new personal API token
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/tokens (the `CreateAPIToken` operationId).
func (c *ClientWithResponses) CreateAPITokenWithResponse(ctx context.Context, body CreateAPITokenJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateAPITokenResponse, error) {
rsp, err := c.CreateAPIToken(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseCreateAPITokenResponse(rsp)
}
// DeleteAPITokenWithResponse Revoke a personal API token
//
// Stops the token authenticating immediately. Idempotent — deleting
// an id that's already gone (or never belonged to the signed-in
// user) still answers 204, the same as any other delete-by-id
// endpoint here, so a double-click or a retried request isn't an
// error.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /api/tokens/{id} (the `DeleteAPIToken` operationId).
func (c *ClientWithResponses) DeleteAPITokenWithResponse(ctx context.Context, id PathTokenID, reqEditors ...RequestEditorFn) (*DeleteAPITokenResponse, error) {
rsp, err := c.DeleteAPIToken(ctx, id, reqEditors...)
if err != nil {
return nil, err
}
return ParseDeleteAPITokenResponse(rsp)
}
// GetVersionWithResponse The running server's own version
//
// The tag goreleaser stamped the running binary with ("dev" for a
// build outside the release pipeline). Public and unauthenticated —
// every page, including the pre-login screen, links to the matching
// GitHub release from its footer so a person can tell what's
// actually deployed without shelling into the box.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /api/version (the `GetVersion` operationId).
func (c *ClientWithResponses) GetVersionWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionResponse, error) {
rsp, err := c.GetVersion(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseGetVersionResponse(rsp)
}
// EnsureWebhookWithBodyWithResponse Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
func (c *ClientWithResponses) EnsureWebhookWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*EnsureWebhookResponse, error) {
rsp, err := c.EnsureWebhookWithBody(ctx, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnsureWebhookResponse(rsp)
}
// EnsureWebhookWithResponse Create or fix up a webhook on one tracked repo, on the signed-in user's behalf
//
// Creates a webhook on the named repo, pointed at the signed-in
// user's own webhook URL and secret, subscribed to the events
// docs/webhooks.md's manual steps recommend. If one already exists
// there (found the same way GET /api/dashboard's own `hasWebhook`
// does — matching by URL path, not object identity) it's brought
// back to active with the right events instead of creating a
// duplicate.
//
// One of a small number of endpoints in this API that write to a
// forge rather than just reading from it — see also the
// pull-requests tag.
//
// A refusal from the forge (403, 404, 429 and 502) answers with the
// same `ActionError` a refused pull request action does, so a client
// reads one shape: `code` is `permission` or `rate_limited` where
// the forge said so (with `resetsAt` for a rate limit), and
// `unknown` otherwise, with a plain `message` either way. No new
// code is needed: a repo the forge can't find is `unknown` with its
// own message. 400 and 401 stay a plain `Error`, since they are
// about the request, not a refusal by the forge.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/ensure (the `EnsureWebhook` operationId).
func (c *ClientWithResponses) EnsureWebhookWithResponse(ctx context.Context, body EnsureWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*EnsureWebhookResponse, error) {
rsp, err := c.EnsureWebhook(ctx, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseEnsureWebhookResponse(rsp)
}
// ReceiveForgejoWebhookWithBodyWithResponse Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
func (c *ClientWithResponses) ReceiveForgejoWebhookWithBodyWithResponse(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReceiveForgejoWebhookResponse, error) {
rsp, err := c.ReceiveForgejoWebhookWithBody(ctx, webhookToken, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReceiveForgejoWebhookResponse(rsp)
}
// ReceiveForgejoWebhookWithResponse Receive a Forgejo repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's signature header is verified against that
// user's webhook secret — `X-Forgejo-Signature` on a webhook set up
// with the "Forgejo" type, `X-Gitea-Signature` on one set up with the
// legacy "Gitea" type; both carry the same raw hex HMAC-SHA256. Every
// delivery means the same thing here — something changed, refresh —
// so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/forgejo/{webhookToken} (the `ReceiveForgejoWebhook` operationId).
func (c *ClientWithResponses) ReceiveForgejoWebhookWithResponse(ctx context.Context, webhookToken PathWebhookToken, body ReceiveForgejoWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*ReceiveForgejoWebhookResponse, error) {
rsp, err := c.ReceiveForgejoWebhook(ctx, webhookToken, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReceiveForgejoWebhookResponse(rsp)
}
// ReceiveGitHubWebhookWithBodyWithResponse Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
func (c *ClientWithResponses) ReceiveGitHubWebhookWithBodyWithResponse(ctx context.Context, webhookToken PathWebhookToken, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ReceiveGitHubWebhookResponse, error) {
rsp, err := c.ReceiveGitHubWebhookWithBody(ctx, webhookToken, contentType, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReceiveGitHubWebhookResponse(rsp)
}
// ReceiveGitHubWebhookWithResponse Receive a GitHub repository webhook delivery
//
// Triggers an immediate refresh for the user webhookToken identifies,
// once the request's `X-Hub-Signature-256` header is verified against
// that user's webhook secret. Every delivery GitHub can send for a
// repository webhook (a new pull request, a closed issue, a status or
// check-run update, even the `ping` event GitHub sends when the
// webhook is first created) means the same thing here — something
// changed, refresh — so nothing about the payload itself is parsed.
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /api/webhooks/github/{webhookToken} (the `ReceiveGitHubWebhook` operationId).
func (c *ClientWithResponses) ReceiveGitHubWebhookWithResponse(ctx context.Context, webhookToken PathWebhookToken, body ReceiveGitHubWebhookJSONRequestBody, reqEditors ...RequestEditorFn) (*ReceiveGitHubWebhookResponse, error) {
rsp, err := c.ReceiveGitHubWebhook(ctx, webhookToken, body, reqEditors...)
if err != nil {
return nil, err
}
return ParseReceiveGitHubWebhookResponse(rsp)
}
// HealthWithResponse Liveness
//
// Answers 200 once the server has started. Doesn't reflect whether
// either forge is reachable — see forges[].reachable on the dashboard
// response for that.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /healthz (the `Health` operationId).
func (c *ClientWithResponses) HealthWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*HealthResponse, error) {
rsp, err := c.Health(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseHealthResponse(rsp)
}
// ReadyWithResponse Readiness
//
// Answers 200 once the server can actually serve: the database answers
// a ping with its schema in place, and the first dashboard refresh has
// completed, or 30 seconds have passed since it started. The wait is
// bounded because how fast a forge answers is how fresh the data is,
// not whether the server can serve: a slow or unreachable forge must not
// keep the container unready. A refresh that finished with a forge
// unreachable counts, and a forge going unreachable afterwards never
// turns this into a 503. See forges[].reachable on the dashboard
// response for that. Before any account has signed in there is no
// refresh to wait for, so only the database is checked.
//
// The database ping gets 2 seconds, less than the HEALTHCHECK's own 5,
// so a database that doesn't answer turns into a 503 instead of a hung
// probe. The ping's result, pass or fail, is reused for about 3
// seconds, so probes arriving every second don't each reach the
// database. On SIGTERM this answers 503 ("shutting down") at once, and
// the server waits a drain period (`SHUTDOWN_DRAIN`, default 5 seconds)
// before it stops accepting connections, so a router that polls this
// path stops sending traffic first.
//
// The container's HEALTHCHECK probes this path (`/healthz` stays the
// cheap liveness answer), so Docker's single health state and Compose's
// `depends_on: condition: service_healthy` mean "ready", not just
// "started".
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /readyz (the `Ready` operationId).
func (c *ClientWithResponses) ReadyWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ReadyResponse, error) {
rsp, err := c.Ready(ctx, reqEditors...)
if err != nil {
return nil, err
}
return ParseReadyResponse(rsp)
}
// ParseListCredentialsResponse parses an HTTP response from a ListCredentialsWithResponse call
func ParseListCredentialsResponse(rsp *http.Response) (*ListCredentialsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListCredentialsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []Credential
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseBeginAddCredentialResponse parses an HTTP response from a BeginAddCredentialWithResponse call
func ParseBeginAddCredentialResponse(rsp *http.Response) (*BeginAddCredentialResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &BeginAddCredentialResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest WebAuthnCeremonyOptions
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseFinishAddCredentialResponse parses an HTTP response from a FinishAddCredentialWithResponse call
func ParseFinishAddCredentialResponse(rsp *http.Response) (*FinishAddCredentialResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &FinishAddCredentialResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
var dest Credential
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON201 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseDeleteCredentialResponse parses an HTTP response from a DeleteCredentialWithResponse call
func ParseDeleteCredentialResponse(rsp *http.Response) (*DeleteCredentialResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteCredentialResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseRenameCredentialResponse parses an HTTP response from a RenameCredentialWithResponse call
func ParseRenameCredentialResponse(rsp *http.Response) (*RenameCredentialResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &RenameCredentialResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Credential
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseBeginLoginResponse parses an HTTP response from a BeginLoginWithResponse call
func ParseBeginLoginResponse(rsp *http.Response) (*BeginLoginResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &BeginLoginResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest WebAuthnCeremonyOptions
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest AuthRateLimited
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
}
switch {
case rsp.StatusCode == 429:
var headers BeginLoginResponse429Headers
if values := rsp.Header.Values("Retry-After"); len(values) > 0 {
var value int
if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: ""}); err != nil {
return nil, err
}
headers.RetryAfter = &value
}
response.Headers429 = &headers
}
return response, nil
}
// ParseFinishLoginResponse parses an HTTP response from a FinishLoginWithResponse call
func ParseFinishLoginResponse(rsp *http.Response) (*FinishLoginResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &FinishLoginResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest SessionUser
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest AuthRateLimited
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
}
switch {
case rsp.StatusCode == 429:
var headers FinishLoginResponse429Headers
if values := rsp.Header.Values("Retry-After"); len(values) > 0 {
var value int
if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: ""}); err != nil {
return nil, err
}
headers.RetryAfter = &value
}
response.Headers429 = &headers
}
return response, nil
}
// ParseLogoutResponse parses an HTTP response from a LogoutWithResponse call
func ParseLogoutResponse(rsp *http.Response) (*LogoutResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &LogoutResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
return response, nil
}
// ParseBeginRegistrationResponse parses an HTTP response from a BeginRegistrationWithResponse call
func ParseBeginRegistrationResponse(rsp *http.Response) (*BeginRegistrationResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &BeginRegistrationResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest WebAuthnCeremonyOptions
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest AuthRateLimited
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
}
switch {
case rsp.StatusCode == 429:
var headers BeginRegistrationResponse429Headers
if values := rsp.Header.Values("Retry-After"); len(values) > 0 {
var value int
if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: ""}); err != nil {
return nil, err
}
headers.RetryAfter = &value
}
response.Headers429 = &headers
}
return response, nil
}
// ParseFinishRegistrationResponse parses an HTTP response from a FinishRegistrationWithResponse call
func ParseFinishRegistrationResponse(rsp *http.Response) (*FinishRegistrationResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &FinishRegistrationResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest SessionUser
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest AuthRateLimited
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
}
switch {
case rsp.StatusCode == 429:
var headers FinishRegistrationResponse429Headers
if values := rsp.Header.Values("Retry-After"); len(values) > 0 {
var value int
if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: ""}); err != nil {
return nil, err
}
headers.RetryAfter = &value
}
response.Headers429 = &headers
}
return response, nil
}
// ParseGetRegistrationStatusResponse parses an HTTP response from a GetRegistrationStatusWithResponse call
func ParseGetRegistrationStatusResponse(rsp *http.Response) (*GetRegistrationStatusResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetRegistrationStatusResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest RegistrationStatus
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
}
return response, nil
}
// ParseGetSessionResponse parses an HTTP response from a GetSessionWithResponse call
func ParseGetSessionResponse(rsp *http.Response) (*GetSessionResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetSessionResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest SessionUser
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseCancelWorkflowRunResponse parses an HTTP response from a CancelWorkflowRunWithResponse call
func ParseCancelWorkflowRunResponse(rsp *http.Response) (*CancelWorkflowRunResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CancelWorkflowRunResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseGetCheckLogResponse parses an HTTP response from a GetCheckLogWithResponse call
func ParseGetCheckLogResponse(rsp *http.Response) (*GetCheckLogResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetCheckLogResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest CheckLog
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON503 = &dest
}
return response, nil
}
// ParseGetDashboardResponse parses an HTTP response from a GetDashboardWithResponse call
func ParseGetDashboardResponse(rsp *http.Response) (*GetDashboardResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetDashboardResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Dashboard
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseRefreshDashboardResponse parses an HTTP response from a RefreshDashboardWithResponse call
func ParseRefreshDashboardResponse(rsp *http.Response) (*RefreshDashboardResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &RefreshDashboardResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Dashboard
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
switch {
case rsp.StatusCode == 200:
var headers RefreshDashboardResponse200Headers
if values := rsp.Header.Values("Retry-After"); len(values) > 0 {
var value int
if err := runtime.BindStyledParameterWithOptions("simple", "Retry-After", values[0], &value, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationHeader, Explode: false, Required: false, Type: "integer", Format: ""}); err != nil {
return nil, err
}
headers.RetryAfter = &value
}
response.Headers200 = &headers
}
return response, nil
}
// ParseStreamDashboardResponse parses an HTTP response from a StreamDashboardWithResponse call
func ParseStreamDashboardResponse(rsp *http.Response) (*StreamDashboardResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &StreamDashboardResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseWatchDashboardStreamChecksResponse parses an HTTP response from a WatchDashboardStreamChecksWithResponse call
func ParseWatchDashboardStreamChecksResponse(rsp *http.Response) (*WatchDashboardStreamChecksResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &WatchDashboardStreamChecksResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseCloseIssueResponse parses an HTTP response from a CloseIssueWithResponse call
func ParseCloseIssueResponse(rsp *http.Response) (*CloseIssueResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CloseIssueResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseCommentOnIssueResponse parses an HTTP response from a CommentOnIssueWithResponse call
func ParseCommentOnIssueResponse(rsp *http.Response) (*CommentOnIssueResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CommentOnIssueResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseGetIssueDetailsResponse parses an HTTP response from a GetIssueDetailsWithResponse call
func ParseGetIssueDetailsResponse(rsp *http.Response) (*GetIssueDetailsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetIssueDetailsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest IssueDetails
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseReopenIssueResponse parses an HTTP response from a ReopenIssueWithResponse call
func ParseReopenIssueResponse(rsp *http.Response) (*ReopenIssueResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ReopenIssueResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseGetMainBranchesResponse parses an HTTP response from a GetMainBranchesWithResponse call
func ParseGetMainBranchesResponse(rsp *http.Response) (*GetMainBranchesResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetMainBranchesResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest MainBranches
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseListAdvisoriesResponse parses an HTTP response from a ListAdvisoriesWithResponse call
func ParseListAdvisoriesResponse(rsp *http.Response) (*ListAdvisoriesResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListAdvisoriesResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest AdvisoryList
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseRerunMainBranchChecksResponse parses an HTTP response from a RerunMainBranchChecksWithResponse call
func ParseRerunMainBranchChecksResponse(rsp *http.Response) (*RerunMainBranchChecksResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &RerunMainBranchChecksResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseReportDashboardPresenceResponse parses an HTTP response from a ReportDashboardPresenceWithResponse call
func ParseReportDashboardPresenceResponse(rsp *http.Response) (*ReportDashboardPresenceResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ReportDashboardPresenceResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest PresenceAnswer
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
}
return response, nil
}
// ParseEnablePullRequestAutoMergeResponse parses an HTTP response from a EnablePullRequestAutoMergeWithResponse call
func ParseEnablePullRequestAutoMergeResponse(rsp *http.Response) (*EnablePullRequestAutoMergeResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &EnablePullRequestAutoMergeResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseCancelPullRequestAutoMergeResponse parses an HTTP response from a CancelPullRequestAutoMergeWithResponse call
func ParseCancelPullRequestAutoMergeResponse(rsp *http.Response) (*CancelPullRequestAutoMergeResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CancelPullRequestAutoMergeResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseSetPullRequestAutoUpdateResponse parses an HTTP response from a SetPullRequestAutoUpdateWithResponse call
func ParseSetPullRequestAutoUpdateResponse(rsp *http.Response) (*SetPullRequestAutoUpdateResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &SetPullRequestAutoUpdateResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseClosePullRequestResponse parses an HTTP response from a ClosePullRequestWithResponse call
func ParseClosePullRequestResponse(rsp *http.Response) (*ClosePullRequestResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ClosePullRequestResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParsePostPullRequestDependabotActionResponse parses an HTTP response from a PostPullRequestDependabotActionWithResponse call
func ParsePostPullRequestDependabotActionResponse(rsp *http.Response) (*PostPullRequestDependabotActionResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PostPullRequestDependabotActionResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseGetPullRequestDetailsResponse parses an HTTP response from a GetPullRequestDetailsWithResponse call
func ParseGetPullRequestDetailsResponse(rsp *http.Response) (*GetPullRequestDetailsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetPullRequestDetailsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest PullRequestDetails
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseHidePullRequestResponse parses an HTTP response from a HidePullRequestWithResponse call
func ParseHidePullRequestResponse(rsp *http.Response) (*HidePullRequestResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &HidePullRequestResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseMergePullRequestResponse parses an HTTP response from a MergePullRequestWithResponse call
func ParseMergePullRequestResponse(rsp *http.Response) (*MergePullRequestResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &MergePullRequestResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest PullRequestMergeResult
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParsePostPullRequestRenovateRebaseResponse parses an HTTP response from a PostPullRequestRenovateRebaseWithResponse call
func ParsePostPullRequestRenovateRebaseResponse(rsp *http.Response) (*PostPullRequestRenovateRebaseResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PostPullRequestRenovateRebaseResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseCancelPullRequestRenovateRebaseResponse parses an HTTP response from a CancelPullRequestRenovateRebaseWithResponse call
func ParseCancelPullRequestRenovateRebaseResponse(rsp *http.Response) (*CancelPullRequestRenovateRebaseResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CancelPullRequestRenovateRebaseResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseReopenPullRequestResponse parses an HTTP response from a ReopenPullRequestWithResponse call
func ParseReopenPullRequestResponse(rsp *http.Response) (*ReopenPullRequestResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ReopenPullRequestResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseRerunPullRequestChecksResponse parses an HTTP response from a RerunPullRequestChecksWithResponse call
func ParseRerunPullRequestChecksResponse(rsp *http.Response) (*RerunPullRequestChecksResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &RerunPullRequestChecksResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseUnhidePullRequestResponse parses an HTTP response from a UnhidePullRequestWithResponse call
func ParseUnhidePullRequestResponse(rsp *http.Response) (*UnhidePullRequestResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &UnhidePullRequestResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseUpdatePullRequestBranchResponse parses an HTTP response from a UpdatePullRequestBranchWithResponse call
func ParseUpdatePullRequestBranchResponse(rsp *http.Response) (*UpdatePullRequestBranchResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &UpdatePullRequestBranchResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 202:
break // No content-type
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseListQueuedActionsResponse parses an HTTP response from a ListQueuedActionsWithResponse call
func ParseListQueuedActionsResponse(rsp *http.Response) (*ListQueuedActionsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListQueuedActionsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []QueuedAction
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseQueueActionResponse parses an HTTP response from a QueueActionWithResponse call
func ParseQueueActionResponse(rsp *http.Response) (*QueueActionResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &QueueActionResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest QueuedAction
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
var dest QueuedAction
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON201 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 409:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON409 = &dest
}
return response, nil
}
// ParseCancelQueuedActionResponse parses an HTTP response from a CancelQueuedActionWithResponse call
func ParseCancelQueuedActionResponse(rsp *http.Response) (*CancelQueuedActionResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CancelQueuedActionResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseGetReleaseDetailsResponse parses an HTTP response from a GetReleaseDetailsWithResponse call
func ParseGetReleaseDetailsResponse(rsp *http.Response) (*GetReleaseDetailsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetReleaseDetailsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest ReleaseDetails
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseDisableAutoUpdateBranchResponse parses an HTTP response from a DisableAutoUpdateBranchWithResponse call
func ParseDisableAutoUpdateBranchResponse(rsp *http.Response) (*DisableAutoUpdateBranchResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DisableAutoUpdateBranchResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseEnableAutoUpdateBranchResponse parses an HTTP response from a EnableAutoUpdateBranchWithResponse call
func ParseEnableAutoUpdateBranchResponse(rsp *http.Response) (*EnableAutoUpdateBranchResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &EnableAutoUpdateBranchResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseIgnoreRepoResponse parses an HTTP response from a IgnoreRepoWithResponse call
func ParseIgnoreRepoResponse(rsp *http.Response) (*IgnoreRepoResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &IgnoreRepoResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseDisableRebaseBotsResponse parses an HTTP response from a DisableRebaseBotsWithResponse call
func ParseDisableRebaseBotsResponse(rsp *http.Response) (*DisableRebaseBotsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DisableRebaseBotsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseEnableRebaseBotsResponse parses an HTTP response from a EnableRebaseBotsWithResponse call
func ParseEnableRebaseBotsResponse(rsp *http.Response) (*EnableRebaseBotsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &EnableRebaseBotsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseUnignoreRepoResponse parses an HTTP response from a UnignoreRepoWithResponse call
func ParseUnignoreRepoResponse(rsp *http.Response) (*UnignoreRepoResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &UnignoreRepoResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseGetSettingsResponse parses an HTTP response from a GetSettingsWithResponse call
func ParseGetSettingsResponse(rsp *http.Response) (*GetSettingsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetSettingsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest SettingsResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParsePutSettingsResponse parses an HTTP response from a PutSettingsWithResponse call
func ParsePutSettingsResponse(rsp *http.Response) (*PutSettingsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &PutSettingsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest SettingsResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseGetFilterStateResponse parses an HTTP response from a GetFilterStateWithResponse call
func ParseGetFilterStateResponse(rsp *http.Response) (*GetFilterStateResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetFilterStateResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest FilterState
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
}
return response, nil
}
// ParseSetFilterStateResponse parses an HTTP response from a SetFilterStateWithResponse call
func ParseSetFilterStateResponse(rsp *http.Response) (*SetFilterStateResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &SetFilterStateResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
}
return response, nil
}
// ParseGetSettingsSummaryResponse parses an HTTP response from a GetSettingsSummaryWithResponse call
func ParseGetSettingsSummaryResponse(rsp *http.Response) (*GetSettingsSummaryResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetSettingsSummaryResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest SettingsSummary
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseGetThemeResponse parses an HTTP response from a GetThemeWithResponse call
func ParseGetThemeResponse(rsp *http.Response) (*GetThemeResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetThemeResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest ThemeResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseSetThemeResponse parses an HTTP response from a SetThemeWithResponse call
func ParseSetThemeResponse(rsp *http.Response) (*SetThemeResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &SetThemeResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest ThemeResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseGetTimezoneResponse parses an HTTP response from a GetTimezoneWithResponse call
func ParseGetTimezoneResponse(rsp *http.Response) (*GetTimezoneResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetTimezoneResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest TimezoneResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseSetTimezoneResponse parses an HTTP response from a SetTimezoneWithResponse call
func ParseSetTimezoneResponse(rsp *http.Response) (*SetTimezoneResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &SetTimezoneResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest TimezoneResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseGetForgeApiStatsResponse parses an HTTP response from a GetForgeApiStatsWithResponse call
func ParseGetForgeApiStatsResponse(rsp *http.Response) (*GetForgeApiStatsResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetForgeApiStatsResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest ForgeApiStats
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseListAPITokensResponse parses an HTTP response from a ListAPITokensWithResponse call
func ParseListAPITokensResponse(rsp *http.Response) (*ListAPITokensResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ListAPITokensResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest []APIToken
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseCreateAPITokenResponse parses an HTTP response from a CreateAPITokenWithResponse call
func ParseCreateAPITokenResponse(rsp *http.Response) (*CreateAPITokenResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &CreateAPITokenResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
var dest APITokenCreateResponse
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON201 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseDeleteAPITokenResponse parses an HTTP response from a DeleteAPITokenWithResponse call
func ParseDeleteAPITokenResponse(rsp *http.Response) (*DeleteAPITokenResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &DeleteAPITokenResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
}
return response, nil
}
// ParseGetVersionResponse parses an HTTP response from a GetVersionWithResponse call
func ParseGetVersionResponse(rsp *http.Response) (*GetVersionResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &GetVersionResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Version
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
}
return response, nil
}
// ParseEnsureWebhookResponse parses an HTTP response from a EnsureWebhookWithResponse call
func ParseEnsureWebhookResponse(rsp *http.Response) (*EnsureWebhookResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &EnsureWebhookResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON400 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 403:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON403 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 429:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON429 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 502:
var dest ActionError
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON502 = &dest
}
return response, nil
}
// ParseReceiveForgejoWebhookResponse parses an HTTP response from a ReceiveForgejoWebhookWithResponse call
func ParseReceiveForgejoWebhookResponse(rsp *http.Response) (*ReceiveForgejoWebhookResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ReceiveForgejoWebhookResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseReceiveGitHubWebhookResponse parses an HTTP response from a ReceiveGitHubWebhookWithResponse call
func ParseReceiveGitHubWebhookResponse(rsp *http.Response) (*ReceiveGitHubWebhookResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ReceiveGitHubWebhookResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case rsp.StatusCode == 204:
break // No content-type
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 401:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON401 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON404 = &dest
}
return response, nil
}
// ParseHealthResponse parses an HTTP response from a HealthWithResponse call
func ParseHealthResponse(rsp *http.Response) (*HealthResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &HealthResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Health
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
}
return response, nil
}
// ParseReadyResponse parses an HTTP response from a ReadyWithResponse call
func ParseReadyResponse(rsp *http.Response) (*ReadyResponse, error) {
bodyBytes, err := io.ReadAll(rsp.Body)
defer func() { _ = rsp.Body.Close() }()
if err != nil {
return nil, err
}
response := &ReadyResponse{
Body: bodyBytes,
HTTPResponse: rsp,
}
switch {
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
var dest Ready
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON200 = &dest
case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 503:
var dest Error
if err := json.Unmarshal(bodyBytes, &dest); err != nil {
return nil, err
}
response.JSON503 = &dest
}
return response, nil
}
package forgedashboard
import (
"fmt"
"math/rand/v2"
"net/http"
"strconv"
"time"
)
type retryConfig struct {
maxRetries int
base time.Duration
}
var defaultRetryConfig = retryConfig{maxRetries: 3, base: 250 * time.Millisecond}
// retryTransport retries a 5xx or 429 response with exponential backoff
// and jitter, honoring a server-sent Retry-After ahead of its own
// schedule. It never retries any other 4xx -- those won't succeed on a
// second attempt, and retrying only delays the real error reaching the
// caller (rules/sdk-generation.md's "Client shape").
type retryTransport struct {
next http.RoundTripper
config retryConfig
}
func (t *retryTransport) RoundTrip(req *http.Request) (*http.Response, error) {
var resp *http.Response
var err error
for attempt := 0; ; attempt++ {
attemptReq := req
if attempt > 0 {
attemptReq, err = rewind(req)
if err != nil {
// The body can't be replayed (no GetBody) -- return
// whatever the previous attempt produced rather than
// risk sending a truncated or duplicate body.
return resp, err
}
}
resp, err = t.next.RoundTrip(attemptReq)
if err != nil {
err = fmt.Errorf("forge-dashboard: round trip: %w", err)
}
if !t.shouldRetry(attempt, resp, err) {
return resp, err
}
wait := retryDelay(resp, attempt, t.config.base)
timer := time.NewTimer(wait)
select {
case <-req.Context().Done():
timer.Stop()
return resp, fmt.Errorf("forge-dashboard: %w", req.Context().Err())
case <-timer.C:
}
if resp != nil {
_ = resp.Body.Close()
}
}
}
func (t *retryTransport) shouldRetry(attempt int, resp *http.Response, err error) bool {
if attempt >= t.config.maxRetries {
return false
}
if err != nil {
// A network-level failure (connection reset, timeout) is
// retry-worthy the same as a 5xx.
return true
}
return resp.StatusCode == http.StatusTooManyRequests || resp.StatusCode >= 500
}
// rewind clones req with a fresh, unread body for a retry attempt.
func rewind(req *http.Request) (*http.Request, error) {
clone := req.Clone(req.Context())
if req.Body == nil || req.Body == http.NoBody {
return clone, nil
}
if req.GetBody == nil {
return nil, errNonReplayableBody
}
body, err := req.GetBody()
if err != nil {
return nil, fmt.Errorf("forge-dashboard: rewind request body for retry: %w", err)
}
clone.Body = body
return clone, nil
}
var errNonReplayableBody = &nonReplayableBodyError{}
type nonReplayableBodyError struct{}
func (*nonReplayableBodyError) Error() string {
return "forge-dashboard: request body can't be replayed for a retry"
}
// retryDelay honors Retry-After (seconds or HTTP-date, per RFC 9110)
// ahead of the client's own exponential-backoff-with-jitter schedule.
func retryDelay(resp *http.Response, attempt int, base time.Duration) time.Duration {
if resp != nil {
if d, ok := retryAfter(resp.Header.Get("Retry-After")); ok {
return d
}
}
backoff := base * time.Duration(1<<attempt)
jitter := time.Duration(rand.Int64N(int64(backoff) + 1)) //nolint:gosec // retry jitter, not security-sensitive
return backoff/2 + jitter/2
}
func retryAfter(header string) (time.Duration, bool) {
if header == "" {
return 0, false
}
if secs, err := strconv.Atoi(header); err == nil {
return time.Duration(secs) * time.Second, true
}
if when, err := http.ParseTime(header); err == nil {
if d := time.Until(when); d > 0 {
return d, true
}
return 0, true
}
return 0, false
}