// Code generated by github.com/99designs/gqlgen, DO NOT EDIT. package model import ( "fmt" "io" "strconv" ) // How a merge was authorized. Auto-merged is not human-approved, and readers must // be able to tell: a bot asking for the approved text of a spec should be able to // require human approval and get a different answer than for a firehose note. type Approval string const ( ApprovalHuman Approval = "HUMAN" ApprovalPolicy Approval = "POLICY" ) var AllApproval = []Approval{ ApprovalHuman, ApprovalPolicy, } func (e Approval) IsValid() bool { switch e { case ApprovalHuman, ApprovalPolicy: return true } return false } func (e Approval) String() string { return string(e) } func (e *Approval) UnmarshalGQL(v interface{}) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") } *e = Approval(str) if !e.IsValid() { return fmt.Errorf("%s is not a valid Approval", str) } return nil } func (e Approval) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) } // The lifecycle of a proposal. Collapsed from the usual five states because there // is exactly one reviewer: "approve" is "merge now", and a proposal you dislike is // rejected rather than sent back for changes. type ProposalState string const ( ProposalStateOpen ProposalState = "OPEN" ProposalStateMerged ProposalState = "MERGED" ProposalStateRejected ProposalState = "REJECTED" ) var AllProposalState = []ProposalState{ ProposalStateOpen, ProposalStateMerged, ProposalStateRejected, } func (e ProposalState) IsValid() bool { switch e { case ProposalStateOpen, ProposalStateMerged, ProposalStateRejected: return true } return false } func (e ProposalState) String() string { return string(e) } func (e *ProposalState) UnmarshalGQL(v interface{}) error { str, ok := v.(string) if !ok { return fmt.Errorf("enums must be strings") } *e = ProposalState(str) if !e.IsValid() { return fmt.Errorf("%s is not a valid ProposalState", str) } return nil } func (e ProposalState) MarshalGQL(w io.Writer) { fmt.Fprint(w, strconv.Quote(e.String())) }