aboutsummaryrefslogtreecommitdiffstats
path: root/modules/structs/status.go
blob: ed42b24be81bde7616627ad4c27f1022d189f4e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2017 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package structs

import (
	"time"
)

// CommitStatus holds a single status of a single Commit
type CommitStatus struct {
	ID          int64             `json:"id"`
	State       CommitStatusState `json:"status"`
	TargetURL   string            `json:"target_url"`
	Description string            `json:"description"`
	URL         string            `json:"url"`
	Context     string            `json:"context"`
	Creator     *User             `json:"creator"`
	// swagger:strfmt date-time
	Created time.Time `json:"created_at"`
	// swagger:strfmt date-time
	Updated time.Time `json:"updated_at"`
}

// CombinedStatus holds the combined state of several statuses for a single commit
type CombinedStatus struct {
	State      CommitStatusState `json:"state"`
	SHA        string            `json:"sha"`
	TotalCount int               `json:"total_count"`
	Statuses   []*CommitStatus   `json:"statuses"`
	Repository *Repository       `json:"repository"`
	CommitURL  string            `json:"commit_url"`
	URL        string            `json:"url"`
}

// CreateStatusOption holds the information needed to create a new CommitStatus for a Commit
type CreateStatusOption struct {
	State       CommitStatusState `json:"state"`
	TargetURL   string            `json:"target_url"`
	Description string            `json:"description"`
	Context     string            `json:"context"`
}