1mod api;
2mod auth;
3mod boards;
4mod cards;
5mod checklist_items;
6mod checklists;
7mod comments;
8mod custom_field_items;
9mod custom_fields;
10mod dependencies;
11mod lists;
12mod profiles;
13mod swimlanes;
14mod users;
15
16pub use api::{
17 ApiResponseSuccess, RawApiResponseData, RawResponseBody, RawResponseHeader, RawValueEncoding,
18};
19pub use auth::{
20 AuthStatusEmail, AuthStatusSuccess, AuthStatusUser, AuthSuccess, LogoutScope, LogoutSuccess,
21};
22pub use boards::{
23 BoardCountSuccess, BoardCreateSuccess, BoardDeleteSuccess, BoardDetail, BoardDetailDomain,
24 BoardDetailLabel, BoardDetailMember, BoardDetailOrganization, BoardDetailTeam,
25 BoardDetailWatcher, BoardListScope, BoardListSuccess, BoardRenameSuccess, BoardSummary,
26 UserBoardSummary,
27};
28pub use cards::{
29 CardArchiveSuccess, CardCollectionSuccess, CardCreateSuccess, CardDeleteMode,
30 CardDeleteSuccess, CardDetail, CardDetailCustomField, CardDetailCustomFieldValue,
31 CardDetailDependency, CardDetailLocation, CardDetailPoker, CardDetailSticker,
32 CardDetailStickerHighlight, CardDetailVote, CardRestoreSuccess, CardSubmittedField,
33 CardSummary, CardUpdateSuccess,
34};
35pub use cards::{CardCustomFieldQuerySuccess, CardCustomFieldSetSuccess};
36pub use checklist_items::{
37 ChecklistItemCreateSuccess, ChecklistItemDeleteMode, ChecklistItemDeleteSuccess,
38 ChecklistItemDetail, ChecklistItemSubmittedField, ChecklistItemUpdateSuccess,
39};
40pub use checklists::{
41 ChecklistCollectionSuccess, ChecklistCreateSuccess, ChecklistDeleteMode,
42 ChecklistDeleteSuccess, ChecklistDetail, ChecklistItemSummary, ChecklistSummary,
43};
44pub use comments::{
45 CommentCollectionSuccess, CommentCreateSuccess, CommentDeleteMode, CommentDeleteSuccess,
46 CommentDetail, CommentSummary,
47};
48pub use custom_field_items::{
49 CustomFieldItemCreateSuccess, CustomFieldItemDeleteMode, CustomFieldItemDeleteSuccess,
50 CustomFieldItemSubmittedField, CustomFieldItemUpdateSuccess,
51};
52pub use custom_fields::{
53 CustomFieldCollectionSuccess, CustomFieldCreateSuccess, CustomFieldDeleteMode,
54 CustomFieldDeleteSuccess, CustomFieldDetail, CustomFieldDropdownItem, CustomFieldSettings,
55 CustomFieldSubmittedField, CustomFieldSummary, CustomFieldUpdateSuccess,
56};
57pub use dependencies::{
58 BoardDependencyCollectionSuccess, CardDependencyCollectionSuccess, DependencyCreateSuccess,
59 DependencyDeleteSuccess, DependencyLine, DependencySubmittedField, DependencySummary,
60 DependencyUpdateSuccess,
61};
62pub use lists::{
63 ListCollectionSuccess, ListCreateSuccess, ListDeleteMode, ListDeleteSuccess, ListDetail,
64 ListSummary, ListUpdateSuccess, ListUpdatedField, ListWipLimitDetail,
65};
66pub use profiles::{ProfileItem, ProfileListSuccess, ProfileRemoveSuccess};
67pub use swimlanes::{
68 SwimlaneCollectionSuccess, SwimlaneCreateSuccess, SwimlaneDeleteMode, SwimlaneDeleteSuccess,
69 SwimlaneDetail, SwimlaneSummary, SwimlaneUpdateSuccess, SwimlaneUpdatedField,
70};
71pub use users::{
72 UserBoardMembership, UserBoardsSuccess, UserCard, UserCardsSuccess, UserCreateSuccess,
73 UserCreateWarning, UserDeleteSuccess, UserDetail, UserEmail, UserListSuccess, UserLoginAction,
74 UserLoginChangeSuccess, UserOrganization, UserOwnershipSuccess, UserProfileDetail,
75 UserProfileNotificationDetail, UserProfileStarredPageDetail, UserSessionData, UserSummary,
76 UserTeam, UserWorkspaceNodeDetail,
77};
78
79use serde::Serialize;
80
81pub mod attachments;
82pub use attachments::*;
83
84#[derive(Debug, Eq, PartialEq)]
85pub enum CommandSuccess {
86 BoardDependencies(BoardDependencyCollectionSuccess),
87 CardDependencies(CardDependencyCollectionSuccess),
88 DependencyCreated(DependencyCreateSuccess),
89 DependencyUpdated(DependencyUpdateSuccess),
90 DependencyDeleted(DependencyDeleteSuccess),
91 AttachmentList(AttachmentCollectionSuccess),
92 AttachmentShown(crate::client::attachments::AttachmentInfo),
93 AttachmentUploaded(
94 AttachmentMutationSuccess<crate::client::attachments::AttachmentUploadResponse>,
95 ),
96 BackgroundUploaded(
97 AttachmentMutationSuccess<crate::client::attachments::BackgroundUploadResponse>,
98 ),
99 AttachmentCopied(AttachmentMutationSuccess<crate::client::attachments::AttachmentCopyResponse>),
100 AttachmentMoved(AttachmentMutationSuccess<crate::client::attachments::AttachmentMoveResponse>),
101 AttachmentDeleted(
102 AttachmentMutationSuccess<crate::client::attachments::AttachmentDeleteResponse>,
103 ),
104 AttachmentDownloaded(AttachmentDownloadSuccess),
105 ApiResponse(ApiResponseSuccess),
106 Cancelled(CancellationSuccess),
107 Registration(AuthSuccess),
108 Login(AuthSuccess),
109 Logout(LogoutSuccess),
110 AuthStatus(AuthStatusSuccess),
111 UserCurrent(UserDetail),
112 UserList(UserListSuccess),
113 UserShown(UserDetail),
114 UserUpdated(UserDetail),
115 UserCards(UserCardsSuccess),
116 UserCreated(UserCreateSuccess),
117 UserBoards(UserBoardsSuccess),
118 UserOwnershipTaken(UserOwnershipSuccess),
119 UserLoginChanged(UserLoginChangeSuccess),
120 UserDeleted(UserDeleteSuccess),
121 BoardList(BoardListSuccess),
122 BoardCount(BoardCountSuccess),
123 BoardShown(Box<BoardDetail>),
124 BoardCreated(BoardCreateSuccess),
125 BoardRenamed(BoardRenameSuccess),
126 BoardDeleted(BoardDeleteSuccess),
127 ListCollection(ListCollectionSuccess),
128 ListShown(ListDetail),
129 ListCreated(ListCreateSuccess),
130 ListUpdated(ListUpdateSuccess),
131 ListDeleted(ListDeleteSuccess),
132 CardCollection(CardCollectionSuccess),
133 CardShown(Box<CardDetail>),
134 CardCreated(CardCreateSuccess),
135 CardUpdated(CardUpdateSuccess),
136 CardArchived(CardArchiveSuccess),
137 CardRestored(CardRestoreSuccess),
138 CardDeleted(CardDeleteSuccess),
139 ChecklistCollection(ChecklistCollectionSuccess),
140 ChecklistShown(ChecklistDetail),
141 ChecklistCreated(ChecklistCreateSuccess),
142 ChecklistDeleted(ChecklistDeleteSuccess),
143 ChecklistItemShown(ChecklistItemDetail),
144 ChecklistItemCreated(ChecklistItemCreateSuccess),
145 ChecklistItemUpdated(ChecklistItemUpdateSuccess),
146 ChecklistItemDeleted(ChecklistItemDeleteSuccess),
147 CustomFieldCollection(CustomFieldCollectionSuccess),
148 CustomFieldShown(CustomFieldDetail),
149 CustomFieldCreated(CustomFieldCreateSuccess),
150 CustomFieldUpdated(CustomFieldUpdateSuccess),
151 CustomFieldDeleted(CustomFieldDeleteSuccess),
152 CustomFieldItemsCreated(CustomFieldItemCreateSuccess),
153 CustomFieldItemUpdated(CustomFieldItemUpdateSuccess),
154 CustomFieldItemDeleted(CustomFieldItemDeleteSuccess),
155 CardCustomFieldSet(CardCustomFieldSetSuccess),
156 CardCustomFieldQuery(CardCustomFieldQuerySuccess),
157 CommentCollection(CommentCollectionSuccess),
158 CommentShown(CommentDetail),
159 CommentCreated(CommentCreateSuccess),
160 CommentDeleted(CommentDeleteSuccess),
161 SwimlaneCollection(SwimlaneCollectionSuccess),
162 SwimlaneShown(SwimlaneDetail),
163 SwimlaneCreated(SwimlaneCreateSuccess),
164 SwimlaneUpdated(SwimlaneUpdateSuccess),
165 SwimlaneDeleted(SwimlaneDeleteSuccess),
166 ProfileAdded(ProfileItem),
167 ProfileList(ProfileListSuccess),
168 ProfileShown(ProfileItem),
169 ProfileUsed(ProfileItem),
170 ProfileUpdated(ProfileItem),
171 ProfileRemoved(ProfileRemoveSuccess),
172}
173
174#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
175#[serde(rename_all = "snake_case")]
176pub enum DestructiveOperation {
177 DependencyDelete,
178 AttachmentDelete,
179 ApiRequest,
180 AuthLogout,
181 ProfileRemove,
182 UserTakeOwnership,
183 UserDisableLogin,
184 UserDelete,
185 BoardDelete,
186 ListDelete,
187 CardDelete,
188 ChecklistDelete,
189 ChecklistItemDelete,
190 CustomFieldDelete,
191 CustomFieldItemDelete,
192 CommentDelete,
193 SwimlaneDelete,
194}
195
196impl DestructiveOperation {
197 pub const fn as_command(self) -> &'static str {
198 match self {
199 Self::DependencyDelete => "dependency delete",
200 Self::AttachmentDelete => "attachment delete",
201 Self::ApiRequest => "api request",
202 Self::AuthLogout => "auth logout",
203 Self::ProfileRemove => "profile remove",
204 Self::UserTakeOwnership => "user take-ownership",
205 Self::UserDisableLogin => "user disable-login",
206 Self::UserDelete => "user delete",
207 Self::BoardDelete => "board delete",
208 Self::ListDelete => "list delete",
209 Self::CardDelete => "card delete",
210 Self::ChecklistDelete => "checklist delete",
211 Self::ChecklistItemDelete => "checklist-item delete",
212 Self::CustomFieldDelete => "custom-field delete",
213 Self::CustomFieldItemDelete => "custom-field-item delete",
214 Self::CommentDelete => "comment delete",
215 Self::SwimlaneDelete => "swimlane delete",
216 }
217 }
218}
219
220#[derive(Debug, Eq, PartialEq, Serialize)]
221pub struct CancellationSuccess {
222 pub cancelled: bool,
223 pub operation: DestructiveOperation,
224}
225
226impl CancellationSuccess {
227 pub const fn new(operation: DestructiveOperation) -> Self {
228 Self {
229 cancelled: true,
230 operation,
231 }
232 }
233}