types

package
v0.31.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoFileName                  = "info.json"
	ExporterLogsFileName          = "ExporterLogs.log"
	PullRequestDir                = "pr"
	GitDir                        = "git"
	WebhookFileName               = "webhooks.json"
	BranchRulesFileName           = "branch_rules.json"
	LabelsFileName                = "labels.json"
	UsersFileName                 = "users.json"
	RuleTypeBranch       RuleType = "branch"
)

Variables

This section is empty.

Functions

func ToJSON

func ToJSON(v any) (json.RawMessage, error)

ToJSON is utility function that converts types to a JSON message.

Types

type Approvals

type Approvals struct {
	RequireCodeOwners      bool `json:"require_code_owners,omitempty"`
	RequireMinimumCount    int  `json:"require_minimum_count,omitempty"`
	RequireLatestCommit    bool `json:"require_latest_commit,omitempty"`
	RequireNoChangeRequest bool `json:"require_no_change_request,omitempty"`
}

type BranchPattern

type BranchPattern struct {
	Default bool     `json:"default,omitempty"`
	Include []string `json:"include,omitempty"`
	Exclude []string `json:"exclude,omitempty"`
}

func (*BranchPattern) JSON

func (p *BranchPattern) JSON() json.RawMessage

type BranchRule

type BranchRule struct {
	ID         int           `json:"id"`
	Identifier string        `json:"identifier"`
	State      string        `json:"state"`
	Definition Definition    `json:"definition"`
	Pattern    BranchPattern `json:"pattern"`
	Created    time.Time     `json:"created"`
	Updated    time.Time     `json:"updated"`
}

type Bypass

type Bypass struct {
	UserEmails []string `json:"user_emails,omitempty"`
	RepoOwners bool     `json:"repo_owners,omitempty"`
}

type CheckUsersInput

type CheckUsersInput struct {
	Emails []string `json:"emails"`
}

CheckUsersInput is object for checking users existence during repo(s) import.

type CheckUsersOutput

type CheckUsersOutput struct {
	UnknownEmails []string `json:"unknown_emails"`
}

CheckUsersOutput is output object for checking users existence.

type CodeComment

type CodeComment struct {
	Path         string `json:"path"`
	CodeSnippet  Hunk   `json:"code_snippet"`
	Side         string `json:"side"`
	HunkHeader   string `json:"hunk_header"`
	SourceSHA    string `json:"source_sha"`
	MergeBaseSHA string `json:"merge_base_sha"`
	Outdated     bool   `json:"outdated"`
}

type Comment

type Comment struct {
	ID          int          `json:"id"`
	Body        string       `json:"body"`
	Author      User         `json:"author"`
	Created     time.Time    `json:"created"`
	Updated     time.Time    `json:"updated"`
	ParentID    int          `json:"parent_id"`
	CodeComment *CodeComment `json:"code_comment"`
}

type Comments

type Comments struct {
	RequireResolveAll bool `json:"require_resolve_all,omitempty"`
}

type Definition

type Definition struct {
	Bypass    Bypass    `json:"bypass,omitempty"`
	PullReq   PullReq   `json:"pullreq,omitempty"`
	Lifecycle Lifecycle `json:"lifecycle,omitempty"`
}

func (*Definition) JSON

func (d *Definition) JSON() json.RawMessage

type Hook

type Hook struct {
	ID         string   `json:"id"`
	Identifier string   `json:"identifier"`
	Target     string   `json:"target"`
	Events     []string `json:"events"`
	Active     bool     `json:"active"`
	SkipVerify bool     `json:"skip_verify"`
}

Hook represents a repository hook.

type Hunk

type Hunk struct {
	Header string   `json:"header"`
	Lines  []string `json:"lines"`
}

type Label

type Label struct {
	Name        string `json:"name"`
	Value       string `json:"value"`
	Description string `json:"description"`
	Color       string `json:"color"`
}

type LabelsInput added in v0.24.0

type LabelsInput struct {
	Labels []*Label `json:"labels"`
}

type Lifecycle

type Lifecycle struct {
	CreateForbidden      bool `json:"create_forbidden,omitempty"`
	DeleteForbidden      bool `json:"delete_forbidden,omitempty"`
	UpdateForbidden      bool `json:"update_forbidden,omitempty"`
	UpdateForceForbidden bool `json:"update_force_forbidden,omitempty"`
}

Lifecycle represents the lifecycle rules for branches.

type Merge

type Merge struct {
	StrategiesAllowed []string `json:"strategies_allowed,omitempty"`
	DeleteBranch      bool     `json:"delete_branch,omitempty"`
	Block             bool     `json:"block,omitempty"`
}

type PRsImportInput

type PRsImportInput struct {
	PullRequestData []*PullRequestData `json:"pull_request_data"`
}

type Perm

type Perm struct {
	Pull  bool `json:"pull"`
	Push  bool `json:"push"`
	Admin bool `json:"admin"`
}

type PullReq

type PullReq struct {
	Approvals Approvals `json:"approvals,omitempty"`
	Comments  Comments  `json:"comments,omitempty"`
	Merge     Merge     `json:"merge,omitempty"`
}

type PullRequest

type PullRequest struct {
	Number  int       `json:"number"`
	Title   string    `json:"title"`
	Body    string    `json:"body"`
	SHA     string    `json:"sha"`
	Ref     string    `json:"ref"`
	Source  string    `json:"source"`
	Target  string    `json:"target"`
	Fork    string    `json:"fork"`
	Link    string    `json:"link"`
	Diff    string    `json:"diff"`
	Draft   bool      `json:"draft"`
	Closed  bool      `json:"closed"`
	Merged  bool      `json:"merged"`
	Merge   string    `json:"merge"`
	Base    Reference `json:"base"`
	Head    Reference `json:"head"`
	Author  User      `json:"author"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`
	Labels  []Label   `json:"labels"`
}

type PullRequestData

type PullRequestData struct {
	PullRequest PullRequest `json:"pull_request"`
	Comments    []Comment   `json:"comments"`
}

type Reference

type Reference struct {
	Name string `json:"name"`
	Path string `json:"path"`
	SHA  string `json:"sha"`
}

Reference represents a git reference.

type Repository

type Repository struct {
	Slug       string     `json:"slug"`
	ID         string     `json:"id"`
	Namespace  string     `json:"namespace"`
	Name       string     `json:"name"`
	Branch     string     `json:"branch"`
	Archived   bool       `json:"archived"`
	Private    bool       `json:"private"`
	Visibility Visibility `json:"visibility"`
	Clone      string     `json:"clone"`
	CloneSSH   string     `json:"clone_ssh"`
	Link       string     `json:"link"`
	Created    time.Time  `json:"created"`
	Updated    time.Time  `json:"updated"`
	IsEmpty    bool       `json:"is_empty"`
}

type RepositoryData

type RepositoryData struct {
	Repository      Repository         `json:"repository"`
	PullRequestData []*PullRequestData `json:"pull_request_data"`
	BranchRules     []*BranchRule      `json:"branch_rules"`
	Webhooks        WebhookData        `json:"webhooks"`
	Labels          []Label            `json:"labels"`
}

type Response

type Response struct {
	Success      bool   `json:"success"`
	ErrorMessage string `json:"error_message"`
}

type Rule

type Rule struct {
	ID         int             `json:"id"`
	Identifier string          `json:"identifier"`
	State      string          `json:"state"`
	Definition json.RawMessage `json:"definition"`
	Pattern    json.RawMessage `json:"pattern"`
	Created    time.Time       `json:"created"`
	Updated    time.Time       `json:"updated"`
}

type RuleType

type RuleType string

type RulesInput

type RulesInput struct {
	Type  RuleType `json:"type"`
	Rules []*Rule  `json:"rules"`
}

type StatusChecks

type StatusChecks struct {
	RequireIdentifiers []string `json:"require_uids,omitempty"`
}

type User

type User struct {
	ID      string    `json:"id"`
	Login   string    `json:"login"`
	Name    string    `json:"name"`
	Email   string    `json:"email"`
	Avatar  string    `json:"avatar"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`
}

User represents a user account.

type Visibility

type Visibility int
const (
	VisibilityUndefined Visibility = iota
	VisibilityPublic
	VisibilityInternal
	VisibilityPrivate
)

Role values.

type WebhookData

type WebhookData struct {
	Hooks []*Hook `json:"hooks"`
}

type WebhookInput

type WebhookInput struct {
	WebhookData
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL