- Add pop mail search CLI command with pagination support - Create internal/labels package with types and API client - Add folder list/create/update/delete CLI commands - Add label list/create/update/delete/apply/remove CLI commands - Register folder and label commands in root.go - Fix gopenpgp v2 API mismatches in pgp.go (NewPlainMessage, Armor, KeyRing.Encrypt/Decrypt, SessionKey) - Fix NewSessionManager error handling across cmd files - Fix variable shadowing bug in mail/client.go
59 lines
1.5 KiB
Go
59 lines
1.5 KiB
Go
package labels
|
|
|
|
// Folder represents a ProtonMail folder (system or custom)
|
|
type Folder struct {
|
|
ID string `json:"ID"`
|
|
Name string `json:"Name"`
|
|
Type int `json:"Type"`
|
|
MessageCount int `json:"MessageCount,omitempty"`
|
|
ParentID string `json:"ParentID,omitempty"`
|
|
SortOrder int `json:"SortOrder,omitempty"`
|
|
}
|
|
|
|
// Label represents a user-created label/tag
|
|
type Label struct {
|
|
ID string `json:"ID"`
|
|
Name string `json:"Name"`
|
|
Color string `json:"Color,omitempty"`
|
|
}
|
|
|
|
// CreateFolderRequest for creating a new folder
|
|
type CreateFolderRequest struct {
|
|
Name string `json:"Name"`
|
|
ParentID string `json:"ParentID,omitempty"`
|
|
}
|
|
|
|
// UpdateFolderRequest for updating a folder
|
|
type UpdateFolderRequest struct {
|
|
Name string `json:"Name,omitempty"`
|
|
SortOrder *int `json:"SortOrder,omitempty"`
|
|
}
|
|
|
|
// CreateLabelRequest for creating a new label
|
|
type CreateLabelRequest struct {
|
|
Name string `json:"Name"`
|
|
Color string `json:"Color,omitempty"`
|
|
}
|
|
|
|
// UpdateLabelRequest for updating a label
|
|
type UpdateLabelRequest struct {
|
|
Name string `json:"Name,omitempty"`
|
|
Color *string `json:"Color,omitempty"`
|
|
}
|
|
|
|
// LabelMessageRequest for applying/removing labels from messages
|
|
type LabelMessageRequest struct {
|
|
MessageID string `json:"MessageID"`
|
|
LabelID string `json:"LabelID"`
|
|
}
|
|
|
|
// ListFoldersResponse for listing folders
|
|
type ListFoldersResponse struct {
|
|
Folders []Folder `json:"Folders"`
|
|
}
|
|
|
|
// ListLabelsResponse for listing labels
|
|
type ListLabelsResponse struct {
|
|
Labels []Label `json:"Labels"`
|
|
}
|