Files
forge/modules/structs/notifications.go
zeekayandHanzo Dev 9a07b4d089 legal: Hanzo AI, Inc. copyright above the upstream notices
2978 files. The fork is 2026-07-15 (rebrand: gitea.dev -> github.com/hanzoai/git),
so 2026 is the year, and "Copyright 2026 Hanzo AI, Inc." was already the form
used by the handful of files that had ours.

Shape is now:

	// Copyright 2026 Hanzo AI, Inc. All rights reserved.
	// Copyright 2015 The Gogs Authors. All rights reserved.
	// Copyright 2019 The Gitea Authors. All rights reserved.
	// SPDX-License-Identifier: MIT

Ours on top, theirs retained verbatim. Retained because MIT requires it, and
separately because they are true — those authors did write that code.

Not renamed to "The Git Authors": Git is a different project under a different
license, and putting its name here would attribute this code to people who have
nothing to do with it. Adding our line is the fix; overwriting theirs would have
been both a licence violation and a false statement.

gofmt still reports import-order drift in some of these files. It predates this
change (verified against a stash) and is left alone rather than burying a
one-line-per-file legal change under 3000 files of unrelated reordering.

Build clean.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-27 13:49:52 -07:00

81 lines
2.9 KiB
Go

// Copyright 2026 Hanzo AI, Inc. All rights reserved.
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package structs
import (
"time"
)
// NotificationThread expose Notification on API
type NotificationThread struct {
// ID is the unique identifier for the notification thread
ID int64 `json:"id"`
// Repository is the repository associated with the notification
Repository *Repository `json:"repository"`
// Subject contains details about the notification subject
Subject *NotificationSubject `json:"subject"`
// Unread indicates if the notification has been read
Unread bool `json:"unread"`
// Pinned indicates if the notification is pinned
Pinned bool `json:"pinned"`
// UpdatedAt is the time when the notification was last updated
UpdatedAt time.Time `json:"updated_at"`
// URL is the API URL for this notification thread
URL string `json:"url"`
}
// NotificationSubject contains the notification subject (Issue/Pull/Commit)
type NotificationSubject struct {
// Title is the title of the notification subject
Title string `json:"title"`
// URL is the API URL for the notification subject
URL string `json:"url"`
// LatestCommentURL is the API URL for the latest comment
LatestCommentURL string `json:"latest_comment_url"`
// HTMLURL is the web URL for the notification subject
HTMLURL string `json:"html_url"`
// LatestCommentHTMLURL is the web URL for the latest comment
LatestCommentHTMLURL string `json:"latest_comment_html_url"`
// Type indicates the type of the notification subject
Type NotifySubjectType `json:"type" binding:"In(Issue,Pull,Commit,Repository)"`
// State indicates the current state of the notification subject
State NotifySubjectStateType `json:"state"`
}
// NotificationCount number of unread notifications
type NotificationCount struct {
// New is the number of unread notifications
New int64 `json:"new"`
}
// NotifySubjectStateType represents the state of a notification subject
// swagger:enum NotifySubjectStateType
type NotifySubjectStateType string
const (
// NotifySubjectStateOpen is an open subject
NotifySubjectStateOpen NotifySubjectStateType = "open"
// NotifySubjectStateClosed is a closed subject
NotifySubjectStateClosed NotifySubjectStateType = "closed"
// NotifySubjectStateMerged is a merged pull request
NotifySubjectStateMerged NotifySubjectStateType = "merged"
)
// NotifySubjectType represent type of notification subject
//
// swagger:enum NotifySubjectType
type NotifySubjectType string
const (
// NotifySubjectIssue an issue is subject of a notification
NotifySubjectIssue NotifySubjectType = "Issue"
// NotifySubjectPull a pull is subject of an notification
NotifySubjectPull NotifySubjectType = "Pull"
// NotifySubjectCommit a commit is subject of an notification
NotifySubjectCommit NotifySubjectType = "Commit"
// NotifySubjectRepository a repository is subject of an notification
NotifySubjectRepository NotifySubjectType = "Repository"
)