Files
email-api-client/client/types.go
Ron Rise d1af60afb2
All checks were successful
🚀 Publish Release Package / publish (push) Successful in 22s
refactor: restructure EmailRequest and related types for improved clarity and maintainability
2025-06-25 11:43:52 -04:00

58 lines
1.4 KiB
Go
Executable File

package client
import "time"
type Body struct {
Html Data `json:"Html,omitempty"`
Text Data `json:"Text,omitempty"`
}
type Data struct {
Data string `json:"Data"`
}
type Addresses []string
type Message struct {
Body Body `json:"Body"`
Subject Data `json:"Subject"`
}
type EmailRequest struct {
Source string `json:"Source"`
Destination struct {
ToAddresses Addresses `json:"ToAddresses"`
CcAddresses Addresses `json:"CcAddresses"`
BccAddresses Addresses `json:"BccAddresses"`
} `json:"Destination"`
Message Message `json:"Message"`
ScheduledTime time.Time `json:"ScheduledTime,omitempty"`
Catch bool `json:"Catch,omitempty"`
}
type Email struct {
Uuid string `json:"uuid"`
IsSent uint8 `json:"is_sent"`
CreatedAt time.Time `json:"created_at"`
SentTime time.Time `json:"sent_time"`
To string `json:"to"`
From string `json:"from"`
Subject string `json:"subject"`
Body string `json:"body,omitempty"`
}
type EmailResponse struct {
Emails []Email `json:"emails"`
Page uint16 `json:"page"`
AvailablePages uint16 `json:"availablePages"`
Total uint16 `json:"total"`
}
type Response[T any] struct {
Payload T `json:"payload"`
Time uint32 `json:"time"`
Version string `json:"version"`
Status string `json:"status"`
Md5 string `json:"md5"`
}