2017-04-16 14:51:04 +02:00
|
|
|
// Copyright 2017 The Gitea Authors. All rights reserved.
|
2022-11-27 13:20:29 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2017-04-16 14:51:04 +02:00
|
|
|
|
2019-05-11 18:21:34 +08:00
|
|
|
package structs
|
2017-04-16 14:51:04 +02:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"time"
|
2025-06-09 12:05:33 +08:00
|
|
|
|
|
|
|
|
"code.gitea.io/gitea/modules/commitstatus"
|
2017-04-16 14:51:04 +02:00
|
|
|
)
|
|
|
|
|
|
2020-12-18 03:33:32 +00:00
|
|
|
// CommitStatus holds a single status of a single Commit
|
|
|
|
|
type CommitStatus struct {
|
2025-09-06 09:52:41 -07:00
|
|
|
// ID is the unique identifier for the commit status
|
|
|
|
|
ID int64 `json:"id"`
|
|
|
|
|
// State represents the status state (pending, success, error, failure)
|
|
|
|
|
State commitstatus.CommitStatusState `json:"status"`
|
|
|
|
|
// TargetURL is the URL to link to for more details
|
|
|
|
|
TargetURL string `json:"target_url"`
|
|
|
|
|
// Description provides a brief description of the status
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
// URL is the API URL for this status
|
|
|
|
|
URL string `json:"url"`
|
|
|
|
|
// Context is the unique context identifier for the status
|
|
|
|
|
Context string `json:"context"`
|
|
|
|
|
// Creator is the user who created the status
|
|
|
|
|
Creator *User `json:"creator"`
|
2017-11-12 23:02:25 -08:00
|
|
|
// swagger:strfmt date-time
|
2018-03-06 02:22:16 +01:00
|
|
|
Created time.Time `json:"created_at"`
|
2017-11-12 23:02:25 -08:00
|
|
|
// swagger:strfmt date-time
|
2018-03-06 02:22:16 +01:00
|
|
|
Updated time.Time `json:"updated_at"`
|
2017-04-16 14:51:04 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CombinedStatus holds the combined state of several statuses for a single commit
|
|
|
|
|
type CombinedStatus struct {
|
2025-09-06 09:52:41 -07:00
|
|
|
// State is the overall combined status state
|
|
|
|
|
State commitstatus.CommitStatusState `json:"state"`
|
|
|
|
|
// SHA is the commit SHA this status applies to
|
|
|
|
|
SHA string `json:"sha"`
|
|
|
|
|
// TotalCount is the total number of statuses
|
|
|
|
|
TotalCount int `json:"total_count"`
|
|
|
|
|
// Statuses contains all individual commit statuses
|
|
|
|
|
Statuses []*CommitStatus `json:"statuses"`
|
|
|
|
|
// Repository is the repository this status belongs to
|
|
|
|
|
Repository *Repository `json:"repository"`
|
|
|
|
|
// CommitURL is the API URL for the commit
|
|
|
|
|
CommitURL string `json:"commit_url"`
|
|
|
|
|
// URL is the API URL for this combined status
|
|
|
|
|
URL string `json:"url"`
|
2017-04-16 14:51:04 +02:00
|
|
|
}
|
|
|
|
|
|
2020-12-18 03:33:32 +00:00
|
|
|
// CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
|
2017-04-16 14:51:04 +02:00
|
|
|
type CreateStatusOption struct {
|
2025-09-06 09:52:41 -07:00
|
|
|
// State represents the status state to set (pending, success, error, failure)
|
|
|
|
|
State commitstatus.CommitStatusState `json:"state"`
|
|
|
|
|
// TargetURL is the URL to link to for more details
|
|
|
|
|
TargetURL string `json:"target_url"`
|
|
|
|
|
// Description provides a brief description of the status
|
|
|
|
|
Description string `json:"description"`
|
|
|
|
|
// Context is the unique context identifier for the status
|
|
|
|
|
Context string `json:"context"`
|
2017-04-16 14:51:04 +02:00
|
|
|
}
|