132 lines
2.7 KiB
Go
132 lines
2.7 KiB
Go
// Code generated by github.com/99designs/gqlgen, DO NOT EDIT.
|
|
|
|
package graph
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"io"
|
|
"strconv"
|
|
)
|
|
|
|
type FollowResult struct {
|
|
Success bool `json:"success"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type Follower struct {
|
|
UserID int `json:"userId"`
|
|
Username string `json:"username"`
|
|
Avatar string `json:"avatar"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type FollowersResponse struct {
|
|
Followers []*Follower `json:"followers"`
|
|
TotalCount int `json:"totalCount"`
|
|
}
|
|
|
|
type Following struct {
|
|
UserID int `json:"userId"`
|
|
Username string `json:"username"`
|
|
Avatar string `json:"avatar"`
|
|
CreatedAt string `json:"createdAt"`
|
|
}
|
|
|
|
type FollowingResponse struct {
|
|
Following []*Following `json:"following"`
|
|
TotalCount int `json:"totalCount"`
|
|
}
|
|
|
|
type MarkNotificationReadResult struct {
|
|
Success bool `json:"success"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type Mutation struct {
|
|
}
|
|
|
|
type NotificationsResponse struct {
|
|
Notifications []*SubscriptionNotification `json:"notifications"`
|
|
TotalCount int `json:"totalCount"`
|
|
UnreadCount int `json:"unreadCount"`
|
|
}
|
|
|
|
type Query struct {
|
|
}
|
|
|
|
type Subscription struct {
|
|
}
|
|
|
|
type SubscriptionNotification struct {
|
|
ID int `json:"id"`
|
|
FollowerID int `json:"followerId"`
|
|
FollowerUsername string `json:"followerUsername"`
|
|
FollowerAvatar string `json:"followerAvatar"`
|
|
IsRead bool `json:"isRead"`
|
|
CreatedAt string `json:"createdAt"`
|
|
ExpiresAt string `json:"expiresAt"`
|
|
}
|
|
|
|
type UnfollowResult struct {
|
|
Success bool `json:"success"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type MessageStatus string
|
|
|
|
const (
|
|
MessageStatusSent MessageStatus = "SENT"
|
|
MessageStatusDelivered MessageStatus = "DELIVERED"
|
|
MessageStatusRead MessageStatus = "READ"
|
|
)
|
|
|
|
var AllMessageStatus = []MessageStatus{
|
|
MessageStatusSent,
|
|
MessageStatusDelivered,
|
|
MessageStatusRead,
|
|
}
|
|
|
|
func (e MessageStatus) IsValid() bool {
|
|
switch e {
|
|
case MessageStatusSent, MessageStatusDelivered, MessageStatusRead:
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (e MessageStatus) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
func (e *MessageStatus) UnmarshalGQL(v any) error {
|
|
str, ok := v.(string)
|
|
if !ok {
|
|
return fmt.Errorf("enums must be strings")
|
|
}
|
|
|
|
*e = MessageStatus(str)
|
|
if !e.IsValid() {
|
|
return fmt.Errorf("%s is not a valid MessageStatus", str)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (e MessageStatus) MarshalGQL(w io.Writer) {
|
|
fmt.Fprint(w, strconv.Quote(e.String()))
|
|
}
|
|
|
|
func (e *MessageStatus) UnmarshalJSON(b []byte) error {
|
|
s, err := strconv.Unquote(string(b))
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return e.UnmarshalGQL(s)
|
|
}
|
|
|
|
func (e MessageStatus) MarshalJSON() ([]byte, error) {
|
|
var buf bytes.Buffer
|
|
e.MarshalGQL(&buf)
|
|
return buf.Bytes(), nil
|
|
}
|