package domain import ( "errors" "time" ) type User struct { ID string `json:"id"` Username string `json:"username"` DisplayName string `json:"display_name"` CreatedAt time.Time `json:"created_at"` } type Chat struct { ID string `json:"id"` Title string `json:"title"` MemberIDs []string `json:"member_ids"` CreatedAt time.Time `json:"created_at"` } type Message struct { ID string `json:"id"` ChatID string `json:"chat_id"` SenderID string `json:"sender_id"` Text string `json:"text"` CreatedAt time.Time `json:"created_at"` AttachmentIDs []string `json:"attachment_ids"` } type MessagePage struct { Items []Message `json:"items"` NextCursor *string `json:"next_cursor"` } type ChatPage struct { Items []Chat `json:"items"` NextCursor *string `json:"next_cursor"` } type Session struct { Token string `json:"token"` TokenType string `json:"token_type"` ExpiresAt time.Time `json:"expires_at"` User User `json:"user"` } type ErrorBody struct { Error ErrorDetail `json:"error"` } type ErrorDetail struct { Code string `json:"code"` Message string `json:"message"` RequestID string `json:"request_id"` } type Variant struct { Name string `json:"name"` ContentType string `json:"content_type"` SizeBytes int64 `json:"size_bytes"` Width int `json:"width"` Height int `json:"height"` SHA256 string `json:"sha256"` } type Attachment struct { ID string `json:"id"` ChatID string `json:"chat_id"` OwnerID string `json:"owner_id"` Filename string `json:"filename"` ContentType string `json:"content_type"` SizeBytes int64 `json:"size_bytes"` SHA256 string `json:"sha256"` Status string `json:"status"` Variants []Variant `json:"variants"` ErrorCode *string `json:"error_code"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } var ( ErrNotFound = errors.New("not found") ErrConflict = errors.New("conflict") ErrInvalid = errors.New("invalid request") ErrUnauthorized = errors.New("unauthorized") ErrTimeout = errors.New("timeout") ErrUnavailable = errors.New("unavailable") ErrTooLarge = errors.New("payload too large") ErrUnsupported = errors.New("unsupported media type") ErrNotImage = errors.New("not a valid image") )