module Github.Data.Issues where
import Github.Data.Definitions
import Github.Data.Id (Id)
import Github.Data.PullRequests
import Control.DeepSeq (NFData (..))
import Control.DeepSeq.Generics (genericRnf)
import Data.Data (Data, Typeable)
import Data.Text (Text)
import Data.Time (UTCTime)
import Data.Vector (Vector)
import GHC.Generics (Generic)
data Issue = Issue {
issueClosedAt :: Maybe UTCTime
,issueUpdatedAt :: UTCTime
,issueEventsUrl :: Text
,issueHtmlUrl :: Maybe Text
,issueClosedBy :: Maybe SimpleOwner
,issueLabels :: (Vector IssueLabel)
,issueNumber :: Int
,issueAssignee :: Maybe SimpleOwner
,issueUser :: SimpleOwner
,issueTitle :: Text
,issuePullRequest :: Maybe PullRequestReference
,issueUrl :: Text
,issueCreatedAt :: UTCTime
,issueBody :: Maybe Text
,issueState :: Text
,issueId :: Id Issue
,issueComments :: Int
,issueMilestone :: Maybe Milestone
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData Issue where rnf = genericRnf
data NewIssue = NewIssue {
newIssueTitle :: Text
, newIssueBody :: Maybe Text
, newIssueAssignee :: Maybe Text
, newIssueMilestone :: Maybe Int
, newIssueLabels :: Maybe (Vector Text)
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData NewIssue where rnf = genericRnf
data EditIssue = EditIssue {
editIssueTitle :: Maybe Text
, editIssueBody :: Maybe Text
, editIssueAssignee :: Maybe Text
, editIssueState :: Maybe Text
, editIssueMilestone :: Maybe Int
, editIssueLabels :: Maybe (Vector Text)
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData EditIssue where rnf = genericRnf
data Milestone = Milestone {
milestoneCreator :: SimpleOwner
,milestoneDueOn :: Maybe UTCTime
,milestoneOpenIssues :: Int
,milestoneNumber :: Int
,milestoneClosedIssues :: Int
,milestoneDescription :: Maybe Text
,milestoneTitle :: Text
,milestoneUrl :: Text
,milestoneCreatedAt :: UTCTime
,milestoneState :: Text
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData Milestone where rnf = genericRnf
data IssueLabel = IssueLabel {
labelColor :: Text
,labelUrl :: Text
,labelName :: Text
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData IssueLabel where rnf = genericRnf
data IssueComment = IssueComment {
issueCommentUpdatedAt :: UTCTime
,issueCommentUser :: SimpleOwner
,issueCommentUrl :: Text
,issueCommentHtmlUrl :: Text
,issueCommentCreatedAt :: UTCTime
,issueCommentBody :: Text
,issueCommentId :: Int
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData IssueComment where rnf = genericRnf
data EventType =
Mentioned
| Subscribed
| Unsubscribed
| Referenced
| Merged
| Assigned
| Closed
| Reopened
| ActorUnassigned
| Labeled
| Unlabeled
| Milestoned
| Demilestoned
| Renamed
| Locked
| Unlocked
| HeadRefDeleted
| HeadRefRestored
deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData EventType where rnf = genericRnf
data Event = Event {
eventActor :: !SimpleOwner
,eventType :: !EventType
,eventCommitId :: !(Maybe Text)
,eventUrl :: !Text
,eventCreatedAt :: !UTCTime
,eventId :: !Int
,eventIssue :: !(Maybe Issue)
} deriving (Show, Data, Typeable, Eq, Ord, Generic)
instance NFData Event where rnf = genericRnf
data IssueLimitation =
AnyMilestone
| NoMilestone
| MilestoneId Int
| Open
| OnlyClosed
| Unassigned
| AnyAssignment
| AssignedTo String
| Mentions String
| Labels [String]
| Ascending
| Descending
| Since UTCTime
| PerPage Int
deriving (Eq, Ord, Show, Typeable, Data, Generic)
instance NFData IssueLimitation where rnf = genericRnf