1use serde::{Deserialize, Serialize};
2use serde_json::{Number, Value};
3
4#[derive(Debug, Eq, PartialEq)]
5pub enum CommandSuccess {
6 ApiResponse(ApiResponseSuccess),
7 Cancelled(CancellationSuccess),
8 Registration(AuthSuccess),
9 Login(AuthSuccess),
10 Logout(LogoutSuccess),
11 AuthStatus(AuthStatusSuccess),
12 UserCurrent(UserDetail),
13 UserList(UserListSuccess),
14 UserShown(UserDetail),
15 UserCards(UserCardsSuccess),
16 UserCreated(UserCreateSuccess),
17 UserBoards(UserBoardsSuccess),
18 UserOwnershipTaken(UserOwnershipSuccess),
19 UserLoginChanged(UserLoginChangeSuccess),
20 UserDeleted(UserDeleteSuccess),
21 BoardList(BoardListSuccess),
22 BoardCount(BoardCountSuccess),
23 BoardShown(Box<BoardDetail>),
24 BoardCreated(BoardCreateSuccess),
25 BoardRenamed(BoardRenameSuccess),
26 BoardDeleted(BoardDeleteSuccess),
27 ListCollection(ListCollectionSuccess),
28 ListShown(ListDetail),
29 ListCreated(ListCreateSuccess),
30 ListUpdated(ListUpdateSuccess),
31 ListDeleted(ListDeleteSuccess),
32 CardCollection(CardCollectionSuccess),
33 CardShown(Box<CardDetail>),
34 CardCreated(CardCreateSuccess),
35 CardUpdated(CardUpdateSuccess),
36 CardDeleted(CardDeleteSuccess),
37 CommentCollection(CommentCollectionSuccess),
38 CommentShown(CommentDetail),
39 CommentCreated(CommentCreateSuccess),
40 CommentDeleted(CommentDeleteSuccess),
41 SwimlaneCollection(SwimlaneCollectionSuccess),
42 SwimlaneShown(SwimlaneDetail),
43 SwimlaneCreated(SwimlaneCreateSuccess),
44 SwimlaneUpdated(SwimlaneUpdateSuccess),
45 SwimlaneDeleted(SwimlaneDeleteSuccess),
46 ProfileAdded(ProfileItem),
47 ProfileList(ProfileListSuccess),
48 ProfileShown(ProfileItem),
49 ProfileUsed(ProfileItem),
50 ProfileUpdated(ProfileItem),
51 ProfileRemoved(ProfileRemoveSuccess),
52}
53
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
55#[serde(rename_all = "snake_case")]
56pub enum DestructiveOperation {
57 ApiRequest,
58 AuthLogout,
59 ProfileRemove,
60 UserTakeOwnership,
61 UserDisableLogin,
62 UserDelete,
63 BoardDelete,
64 ListDelete,
65 CardDelete,
66 CommentDelete,
67 SwimlaneDelete,
68}
69
70impl DestructiveOperation {
71 pub const fn as_command(self) -> &'static str {
72 match self {
73 Self::ApiRequest => "api request",
74 Self::AuthLogout => "auth logout",
75 Self::ProfileRemove => "profile remove",
76 Self::UserTakeOwnership => "user take-ownership",
77 Self::UserDisableLogin => "user disable-login",
78 Self::UserDelete => "user delete",
79 Self::BoardDelete => "board delete",
80 Self::ListDelete => "list delete",
81 Self::CardDelete => "card delete",
82 Self::CommentDelete => "comment delete",
83 Self::SwimlaneDelete => "swimlane delete",
84 }
85 }
86}
87
88#[derive(Debug, Eq, PartialEq)]
89pub struct ApiResponseSuccess {
90 pub profile: String,
91 pub unsafe_method: bool,
92 pub authenticated: bool,
93 pub response: crate::client::RawApiResponse,
94}
95
96#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
97#[serde(rename_all = "snake_case")]
98pub enum RawValueEncoding {
99 Text,
100 Base64,
101}
102
103#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
104pub struct RawResponseHeader {
105 pub name: String,
106 pub encoding: RawValueEncoding,
107 pub value: String,
108}
109
110#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
111#[serde(tag = "encoding", rename_all = "snake_case")]
112pub enum RawResponseBody {
113 Json { value: Value },
114 Text { value: String },
115 Base64 { value: String },
116}
117
118#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
119pub struct RawApiResponseData {
120 pub http_status: u16,
121 pub mutation_attempted: bool,
122 pub mutation_confirmed: bool,
123 pub headers: Vec<RawResponseHeader>,
124 pub body: RawResponseBody,
125}
126
127#[derive(Debug, Eq, PartialEq, Serialize)]
128pub struct CancellationSuccess {
129 pub cancelled: bool,
130 pub operation: DestructiveOperation,
131}
132
133impl CancellationSuccess {
134 pub const fn new(operation: DestructiveOperation) -> Self {
135 Self {
136 cancelled: true,
137 operation,
138 }
139 }
140}
141
142#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
143#[serde(rename_all = "snake_case")]
144pub enum LogoutScope {
145 CurrentToken,
146 AllTokens,
147 LocalOnly,
148}
149
150#[derive(Debug, Eq, PartialEq, Serialize)]
151pub struct LogoutSuccess {
152 pub server: String,
153 pub profile: String,
154 pub logout_scope: LogoutScope,
155 pub remote_logout_completed: bool,
156 pub credential_stored: bool,
157 pub local_credential_removed: bool,
158}
159
160#[derive(Debug, Eq, PartialEq, Serialize)]
161pub struct AuthSuccess {
162 pub server: String,
163 pub profile: String,
164 pub user_id: String,
165 pub token_expires: String,
166 pub credential_stored: bool,
167 pub profile_created: bool,
168 pub profile_active: bool,
169}
170
171#[derive(Debug, Eq, PartialEq, Serialize)]
172pub struct AuthStatusSuccess {
173 pub server: String,
174 pub profile: String,
175 pub authenticated: bool,
176 pub token_expires: String,
177 pub credential_stored: bool,
178 pub user: AuthStatusUser,
179}
180
181#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
182pub struct ProfileItem {
183 pub name: String,
184 pub server: String,
185 pub active: bool,
186}
187
188#[derive(Debug, Eq, PartialEq, Serialize)]
189pub struct ProfileListSuccess {
190 pub active_profile: Option<String>,
191 pub profiles: Vec<ProfileItem>,
192}
193
194#[derive(Debug, Eq, PartialEq, Serialize)]
195pub struct ProfileRemoveSuccess {
196 pub name: String,
197 pub server: String,
198 pub removed: bool,
199 pub active_profile: Option<String>,
200}
201
202#[derive(Debug, Eq, PartialEq, Serialize)]
203pub struct AuthStatusUser {
204 pub user_id: String,
205 pub username: Option<String>,
206 pub full_name: Option<String>,
207 pub is_admin: Option<bool>,
208 pub emails: Vec<AuthStatusEmail>,
209}
210
211#[derive(Debug, Eq, PartialEq, Serialize)]
212pub struct AuthStatusEmail {
213 pub address: Option<String>,
214 pub verified: Option<bool>,
215}
216
217#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
218pub struct UserDetail {
219 pub user_id: String,
220 pub username: Option<String>,
221 pub full_name: Option<String>,
222 pub emails: Vec<UserEmail>,
223 pub is_admin: Option<bool>,
224 pub login_disabled: Option<bool>,
225 pub authentication_method: Option<String>,
226 pub created_at: Option<String>,
227 pub modified_at: Option<String>,
228 pub last_connection_date: Option<String>,
229 pub organizations: Vec<UserOrganization>,
230 pub teams: Vec<UserTeam>,
231 pub boards: Vec<UserBoardMembership>,
232}
233
234#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
235pub struct UserEmail {
236 pub address: Option<String>,
237 pub verified: Option<bool>,
238}
239
240#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
241pub struct UserOrganization {
242 pub organization_id: Option<String>,
243 pub display_name: Option<String>,
244 pub is_admin: Option<bool>,
245}
246
247#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
248pub struct UserTeam {
249 pub team_id: Option<String>,
250 pub display_name: Option<String>,
251}
252
253#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
254pub struct UserBoardMembership {
255 pub board_id: String,
256 pub is_active: Option<bool>,
257 pub is_admin: Option<bool>,
258 pub is_no_comments: Option<bool>,
259 pub is_comment_only: Option<bool>,
260 pub is_worker: Option<bool>,
261 pub is_normal_assigned_only: Option<bool>,
262 pub is_comment_assigned_only: Option<bool>,
263 pub is_read_only: Option<bool>,
264 pub is_read_assigned_only: Option<bool>,
265}
266
267#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
268pub struct UserSummary {
269 pub user_id: String,
270 pub username: Option<String>,
271}
272
273#[derive(Debug, Eq, PartialEq, Serialize)]
274pub struct UserListSuccess {
275 pub users: Vec<UserSummary>,
276}
277
278#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
279pub struct UserCard {
280 pub card_id: String,
281 pub title: Option<String>,
282 pub board_id: Option<String>,
283 pub swimlane_id: Option<String>,
284 pub list_id: Option<String>,
285 pub due_at: Option<String>,
286 pub start_at: Option<String>,
287 pub end_at: Option<String>,
288 pub members: Vec<String>,
289 pub assignees: Vec<String>,
290}
291
292#[derive(Debug, Eq, PartialEq, Serialize)]
293pub struct UserCardsSuccess {
294 pub cards: Vec<UserCard>,
295}
296
297#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
298pub struct BoardSummary {
299 pub board_id: String,
300 pub title: String,
301}
302
303pub type UserBoardSummary = BoardSummary;
304
305#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
306#[serde(rename_all = "snake_case")]
307pub struct BoardDetailMember {
308 pub user_id: String,
309 pub is_admin: bool,
310 pub is_active: bool,
311 pub is_no_comments: Option<bool>,
312 pub is_comment_only: Option<bool>,
313 pub is_worker: Option<bool>,
314 pub is_normal_assigned_only: Option<bool>,
315 pub is_comment_assigned_only: Option<bool>,
316 pub is_read_only: Option<bool>,
317 pub is_read_assigned_only: Option<bool>,
318}
319
320#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
321#[serde(rename_all = "snake_case")]
322pub struct BoardDetailWatcher {
323 pub user_id: String,
324 pub level: String,
325}
326
327#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
328#[serde(rename_all = "snake_case")]
329pub struct BoardDetailLabel {
330 pub label_id: String,
331 pub name: Option<String>,
332 pub color: String,
333}
334
335#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
336#[serde(rename_all = "snake_case")]
337pub struct BoardDetailOrganization {
338 pub org_id: String,
339 pub org_display_name: String,
340 pub is_active: bool,
341}
342
343#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
344#[serde(rename_all = "snake_case")]
345pub struct BoardDetailTeam {
346 pub team_id: String,
347 pub team_display_name: String,
348 pub is_active: bool,
349}
350
351#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
352#[serde(rename_all = "snake_case")]
353pub struct BoardDetailDomain {
354 pub domain: String,
355 pub is_active: bool,
356}
357
358#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
359#[serde(rename_all = "snake_case")]
360pub struct BoardDetail {
361 pub board_id: String,
362 pub title: String,
363 pub slug: Option<String>,
364 pub archived: Option<bool>,
365 pub archived_at: Option<String>,
366 pub created_at: Option<String>,
367 pub modified_at: Option<String>,
368 pub stars: Option<Number>,
369 #[serde(default)]
370 pub labels: Vec<BoardDetailLabel>,
371 #[serde(default)]
372 pub members: Vec<BoardDetailMember>,
373 #[serde(default)]
374 pub watchers: Vec<BoardDetailWatcher>,
375 pub permission: Option<String>,
376 #[serde(default)]
377 pub orgs: Vec<BoardDetailOrganization>,
378 #[serde(default)]
379 pub teams: Vec<BoardDetailTeam>,
380 #[serde(default)]
381 pub domains: Vec<BoardDetailDomain>,
382 #[serde(default)]
383 pub import_usernames: Vec<String>,
384 pub color: Option<String>,
385 #[serde(default)]
386 pub custom_theme_colors: Vec<String>,
387 pub background_image_url: Option<String>,
388 pub background_image_id: Option<String>,
389 pub allows_card_counter_list: Option<bool>,
390 pub card_aging: Option<bool>,
391 pub show_dependencies: Option<bool>,
392 pub card_aging_days1: Option<Number>,
393 pub card_aging_days2: Option<Number>,
394 pub card_aging_days3: Option<Number>,
395 pub allows_board_member_list: Option<bool>,
396 pub description: Option<String>,
397 pub subtasks_default_board_id: Option<String>,
398 pub migration_version: Option<Number>,
399 pub subtasks_default_list_id: Option<String>,
400 pub date_settings_default_board_id: Option<String>,
401 pub date_settings_default_list_id: Option<String>,
402 pub allows_subtasks: Option<bool>,
403 pub allows_subtasks_on_minicard: Option<bool>,
404 pub allows_attachments: Option<bool>,
405 pub allows_attachments_on_minicard: Option<bool>,
406 pub allows_checklists: Option<bool>,
407 pub allows_checklists_on_minicard: Option<bool>,
408 pub allows_custom_fields: Option<bool>,
409 pub allows_custom_fields_on_minicard: Option<bool>,
410 pub allows_checklist_count_badge_on_minicard: Option<bool>,
411 pub allows_comments: Option<bool>,
412 pub allows_description_title: Option<bool>,
413 pub allows_description_title_on_minicard: Option<bool>,
414 pub allows_description_text: Option<bool>,
415 pub allows_description_text_on_minicard: Option<bool>,
416 pub allows_cover_attachment_on_minicard: Option<bool>,
417 pub allows_cover_attachment_on_card: Option<bool>,
418 pub allows_badge_attachment_on_minicard: Option<bool>,
419 pub allows_attachment_count_on_card: Option<bool>,
420 pub allows_checklist_count_badge_on_card: Option<bool>,
421 pub allows_card_sorting_by_number_on_minicard: Option<bool>,
422 pub allows_card_number: Option<bool>,
423 pub allows_card_number_on_minicard: Option<bool>,
424 pub allows_activities: Option<bool>,
425 pub allows_labels: Option<bool>,
426 pub allows_labels_on_minicard: Option<bool>,
427 pub allows_creator: Option<bool>,
428 pub allows_creator_on_minicard: Option<bool>,
429 pub allows_assignee: Option<bool>,
430 pub allows_assignee_on_minicard: Option<bool>,
431 pub allows_members: Option<bool>,
432 pub allows_members_on_minicard: Option<bool>,
433 pub allows_requested_by: Option<bool>,
434 pub allows_requested_by_on_minicard: Option<bool>,
435 pub allows_card_sorting_by_number: Option<bool>,
436 pub allows_show_lists: Option<bool>,
437 pub allows_assigned_by: Option<bool>,
438 pub allows_assigned_by_on_minicard: Option<bool>,
439 pub allows_show_lists_on_minicard: Option<bool>,
440 pub allows_checklist_at_minicard: Option<bool>,
441 pub allows_received_date: Option<bool>,
442 pub restrict_comment_editing: Option<bool>,
443 pub allows_personal_list_width: Option<bool>,
444 pub auto_width: Option<bool>,
445 pub allows_received_date_on_minicard: Option<bool>,
446 pub allows_start_date: Option<bool>,
447 pub allows_start_date_on_minicard: Option<bool>,
448 pub allows_end_date: Option<bool>,
449 pub allows_end_date_on_minicard: Option<bool>,
450 pub allows_due_date: Option<bool>,
451 pub allows_due_date_on_minicard: Option<bool>,
452 pub allows_due_complete: Option<bool>,
453 pub allows_due_complete_on_minicard: Option<bool>,
454 pub present_parent_task: Option<String>,
455 pub received_at: Option<String>,
456 pub start_at: Option<String>,
457 pub due_at: Option<String>,
458 pub end_at: Option<String>,
459 pub spent_time: Option<Number>,
460 pub is_overtime: Option<bool>,
461 pub board_type: Option<String>,
462 pub sort: Option<Number>,
463 pub show_activities: Option<bool>,
464}
465
466#[derive(Debug, Eq, PartialEq, Serialize)]
467pub struct UserBoardsSuccess {
468 pub user_id: String,
469 pub boards: Vec<UserBoardSummary>,
470}
471
472#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
473#[serde(rename_all = "snake_case")]
474pub enum UserCreateWarning {
475 #[serde(rename = "user_id_unavailable_in_wekan_v11_06")]
476 UserIdUnavailableInWekanV1106,
477}
478
479#[derive(Debug, Eq, PartialEq, Serialize)]
480pub struct UserCreateSuccess {
481 pub created: bool,
482 pub username: String,
483 pub email: String,
484 pub user_id: Option<String>,
485 pub warning: Option<UserCreateWarning>,
486}
487
488#[derive(Debug, Eq, PartialEq, Serialize)]
489pub struct UserOwnershipSuccess {
490 pub from_user_id: String,
491 pub to_user_id: String,
492 pub boards: Vec<UserBoardSummary>,
493}
494
495#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
496#[serde(rename_all = "snake_case")]
497pub enum UserLoginAction {
498 Disabled,
499 Enabled,
500}
501
502#[derive(Debug, Eq, PartialEq, Serialize)]
503pub struct UserLoginChangeSuccess {
504 pub action: UserLoginAction,
505 pub user: UserDetail,
506}
507
508#[derive(Debug, Eq, PartialEq, Serialize)]
509pub struct UserDeleteSuccess {
510 pub user_id: String,
511 pub deleted: bool,
512 pub deleted_current_user: bool,
513 pub credential_stored: bool,
514 pub local_credential_removed: bool,
515}
516
517#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
518#[serde(rename_all = "snake_case")]
519pub enum BoardListScope {
520 Active,
521 Public,
522}
523
524#[derive(Debug, Eq, PartialEq, Serialize)]
525pub struct BoardListSuccess {
526 pub scope: BoardListScope,
527 pub boards: Vec<BoardSummary>,
528}
529
530#[derive(Debug, Eq, PartialEq, Serialize)]
531pub struct BoardCountSuccess {
532 pub private: u64,
533 pub public: u64,
534}
535
536#[derive(Debug, Eq, PartialEq, Serialize)]
537pub struct BoardCreateSuccess {
538 pub board_id: String,
539 pub default_swimlane_id: String,
540}
541
542#[derive(Debug, Eq, PartialEq, Serialize)]
543pub struct BoardRenameSuccess {
544 pub board_id: String,
545 pub title: String,
546}
547
548#[derive(Debug, Eq, PartialEq, Serialize)]
549pub struct BoardDeleteSuccess {
550 pub board_id: String,
551 pub deleted: bool,
552}
553
554#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
555pub struct ListSummary {
556 pub list_id: String,
557 pub title: String,
558 pub modified_at: Option<String>,
559 pub cards_modified_at: Option<String>,
560}
561
562#[derive(Debug, Eq, PartialEq, Serialize)]
563pub struct ListCollectionSuccess {
564 pub board_id: String,
565 pub lists: Vec<ListSummary>,
566}
567
568#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
569pub struct ListWipLimitDetail {
570 pub value: Number,
571 pub enabled: bool,
572 pub soft: bool,
573}
574
575#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
576pub struct ListDetail {
577 pub list_id: String,
578 pub title: String,
579 pub starred: Option<bool>,
580 pub archived: bool,
581 pub archived_at: Option<String>,
582 pub deleted_at: Option<String>,
583 pub deleted_by: Option<String>,
584 pub delete_batch_id: Option<String>,
585 pub board_id: String,
586 pub swimlane_id: Option<String>,
587 pub created_at: String,
588 pub sort: Option<Number>,
589 pub updated_at: Option<String>,
590 pub modified_at: String,
591 pub position_updated_at: Option<String>,
592 pub wip_limit: Option<ListWipLimitDetail>,
593 pub color: Option<String>,
594 pub list_type: String,
595 pub width: Option<Number>,
596}
597
598#[derive(Debug, Eq, PartialEq, Serialize)]
599pub struct ListCreateSuccess {
600 pub board_id: String,
601 pub list_id: String,
602}
603
604#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
605#[serde(rename_all = "snake_case")]
606pub enum ListUpdatedField {
607 Title,
608 Color,
609 Starred,
610 WipLimit,
611}
612
613#[derive(Debug, Eq, PartialEq, Serialize)]
614pub struct ListUpdateSuccess {
615 pub board_id: String,
616 pub list_id: String,
617 pub updated_fields: Vec<ListUpdatedField>,
618}
619
620#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
621#[serde(rename_all = "snake_case")]
622pub enum ListDeleteMode {
623 Soft,
624}
625
626#[derive(Debug, Eq, PartialEq, Serialize)]
627pub struct ListDeleteSuccess {
628 pub board_id: String,
629 pub list_id: String,
630 pub deleted: bool,
631 pub delete_mode: ListDeleteMode,
632}
633
634#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
635pub struct CardSummary {
636 pub card_id: String,
637 pub title: Option<String>,
638 pub description: Option<String>,
639 pub swimlane_id: Option<String>,
640 pub received_at: Option<String>,
641 pub start_at: Option<String>,
642 pub due_at: Option<String>,
643 pub end_at: Option<String>,
644 pub assignees: Vec<String>,
645 pub sort: Option<Number>,
646}
647
648#[derive(Debug, Eq, PartialEq, Serialize)]
649pub struct CardCollectionSuccess {
650 pub board_id: String,
651 pub list_id: String,
652 pub cards: Vec<CardSummary>,
653}
654
655#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
656#[serde(untagged)]
657pub enum CardDetailCustomFieldValue {
658 String(String),
659 Number(Number),
660 Boolean(bool),
661 Strings(Vec<String>),
662}
663
664#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
665pub struct CardDetailCustomField {
666 pub custom_field_id: Option<String>,
667 pub value: Option<CardDetailCustomFieldValue>,
668}
669
670#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
671#[serde(rename_all = "lowercase")]
672pub enum CardDetailStickerHighlight {
673 Underline,
674 Round,
675}
676
677#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
678pub struct CardDetailSticker {
679 pub icon: Option<String>,
680 pub name: Option<String>,
681 pub highlight: Option<CardDetailStickerHighlight>,
682 pub position: Option<Number>,
683}
684
685#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
686pub struct CardDetailLocation {
687 pub location_id: String,
688 pub name: Option<String>,
689 pub address: Option<String>,
690 pub latitude: Option<Number>,
691 pub longitude: Option<Number>,
692}
693
694#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
695pub struct CardDetailDependency {
696 pub card_id: String,
697 pub dependency_type: Option<String>,
698 pub color: Option<String>,
699 pub icon: Option<String>,
700}
701
702#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
703pub struct CardDetailVote {
704 pub question: String,
705 pub positive: Vec<String>,
706 pub negative: Vec<String>,
707 pub end: Option<String>,
708 pub public: bool,
709 pub allow_non_board_members: bool,
710}
711
712#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
713pub struct CardDetailPoker {
714 pub question: Option<bool>,
715 pub one: Vec<String>,
716 pub two: Vec<String>,
717 pub three: Vec<String>,
718 pub five: Vec<String>,
719 pub eight: Vec<String>,
720 pub thirteen: Vec<String>,
721 pub twenty: Vec<String>,
722 pub forty: Vec<String>,
723 pub one_hundred: Vec<String>,
724 pub unsure: Vec<String>,
725 pub end: Option<String>,
726 pub allow_non_board_members: Option<bool>,
727 pub estimation: Option<Number>,
728}
729
730#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
731pub struct CardDetail {
732 pub card_id: String,
733 pub title: Option<String>,
734 pub archived: bool,
735 pub archived_at: Option<String>,
736 pub deleted_at: Option<String>,
737 pub deleted_by: Option<String>,
738 pub delete_batch_id: Option<String>,
739 pub parent_id: Option<String>,
740 pub list_id: Option<String>,
741 pub swimlane_id: String,
742 pub board_id: Option<String>,
743 pub cover_id: Option<String>,
744 pub color: Option<String>,
745 pub created_at: String,
746 pub modified_at: String,
747 pub custom_fields: Vec<CardDetailCustomField>,
748 pub date_last_activity: String,
749 pub description: Option<String>,
750 pub requested_by: Option<String>,
751 pub assigned_by: Option<String>,
752 pub label_ids: Vec<String>,
753 pub members: Vec<String>,
754 pub assignees: Vec<String>,
755 pub requesters: Vec<String>,
756 pub assigners: Vec<String>,
757 pub received_at: Option<String>,
758 pub start_at: Option<String>,
759 pub due_at: Option<String>,
760 pub end_at: Option<String>,
761 pub due_complete: Option<bool>,
762 pub stickers: Vec<CardDetailSticker>,
763 pub location_name: Option<String>,
764 pub location_address: Option<String>,
765 pub location_latitude: Option<Number>,
766 pub location_longitude: Option<Number>,
767 pub locations: Vec<CardDetailLocation>,
768 pub spent_time: Option<Number>,
769 pub is_overtime: Option<bool>,
770 pub user_id: String,
771 pub sort: Option<Number>,
772 pub subtask_sort: Option<Number>,
773 pub card_type: String,
774 pub linked_id: Option<String>,
775 pub card_dependencies: Vec<CardDetailDependency>,
776 pub vote: Option<CardDetailVote>,
777 pub poker: Option<CardDetailPoker>,
778 pub target_id_gantt: Vec<String>,
779 pub link_type_gantt: Vec<Number>,
780 pub link_id_gantt: Vec<String>,
781 pub card_number: Option<Number>,
782 pub show_activities: bool,
783 pub show_list_on_minicard: Option<bool>,
784 pub show_checklist_at_minicard: Option<bool>,
785 pub hide_finished_checklist_if_items_are_hidden: Option<bool>,
786}
787
788#[derive(Debug, Eq, PartialEq, Serialize)]
789pub struct CardCreateSuccess {
790 pub board_id: String,
791 pub list_id: String,
792 pub card_id: String,
793}
794
795#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
796#[serde(rename_all = "snake_case")]
797pub enum CardSubmittedField {
798 Title,
799 Sort,
800 ParentId,
801 Description,
802 Color,
803 LabelIds,
804 RequestedBy,
805 AssignedBy,
806 ReceivedAt,
807 StartAt,
808 DueAt,
809 EndAt,
810 SpentTime,
811 IsOverTime,
812 Members,
813 Assignees,
814 DueComplete,
815}
816
817#[derive(Debug, Eq, PartialEq, Serialize)]
818pub struct CardUpdateSuccess {
819 pub board_id: String,
820 pub list_id: String,
821 pub card_id: String,
822 pub submitted_fields: Vec<CardSubmittedField>,
823}
824
825#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
826#[serde(rename_all = "snake_case")]
827pub enum CardDeleteMode {
828 Hard,
829}
830
831#[derive(Debug, Eq, PartialEq, Serialize)]
832pub struct CardDeleteSuccess {
833 pub board_id: String,
834 pub list_id: String,
835 pub card_id: String,
836 pub deleted: bool,
837 pub delete_mode: CardDeleteMode,
838}
839
840#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
841pub struct CommentSummary {
842 pub comment_id: String,
843 pub text: String,
844 pub author_id: String,
845}
846
847#[derive(Debug, Eq, PartialEq, Serialize)]
848pub struct CommentCollectionSuccess {
849 pub board_id: String,
850 pub card_id: String,
851 pub comments: Vec<CommentSummary>,
852}
853
854#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
855pub struct CommentDetail {
856 pub comment_id: String,
857 pub board_id: String,
858 pub card_id: String,
859 pub text: String,
860 pub parent_id: Option<String>,
861 pub created_at: String,
862 pub modified_at: String,
863 pub author_id: String,
864}
865
866#[derive(Debug, Eq, PartialEq, Serialize)]
867pub struct CommentCreateSuccess {
868 pub board_id: String,
869 pub card_id: String,
870 pub comment_id: String,
871}
872
873#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
874#[serde(rename_all = "snake_case")]
875pub enum CommentDeleteMode {
876 Hard,
877}
878
879#[derive(Debug, Eq, PartialEq, Serialize)]
880pub struct CommentDeleteSuccess {
881 pub board_id: String,
882 pub card_id: String,
883 pub comment_id: String,
884 pub deleted: bool,
885 pub delete_mode: CommentDeleteMode,
886}
887
888#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
889pub struct SwimlaneSummary {
890 pub swimlane_id: String,
891 pub title: String,
892}
893
894#[derive(Debug, Eq, PartialEq, Serialize)]
895pub struct SwimlaneCollectionSuccess {
896 pub board_id: String,
897 pub swimlanes: Vec<SwimlaneSummary>,
898}
899
900#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
901pub struct SwimlaneDetail {
902 pub swimlane_id: String,
903 pub title: String,
904 pub archived: bool,
905 pub archived_at: Option<String>,
906 pub board_id: String,
907 pub created_at: String,
908 pub sort: Option<Number>,
909 pub color: Option<String>,
910 pub updated_at: Option<String>,
911 pub modified_at: String,
912 pub swimlane_type: String,
913 pub height: Option<Number>,
914}
915
916#[derive(Debug, Eq, PartialEq, Serialize)]
917pub struct SwimlaneCreateSuccess {
918 pub board_id: String,
919 pub swimlane_id: String,
920}
921
922#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
923#[serde(rename_all = "snake_case")]
924pub enum SwimlaneUpdatedField {
925 Title,
926}
927
928#[derive(Debug, Eq, PartialEq, Serialize)]
929pub struct SwimlaneUpdateSuccess {
930 pub board_id: String,
931 pub swimlane_id: String,
932 pub updated_fields: Vec<SwimlaneUpdatedField>,
933}
934
935#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
936#[serde(rename_all = "snake_case")]
937pub enum SwimlaneDeleteMode {
938 Hard,
939}
940
941#[derive(Debug, Eq, PartialEq, Serialize)]
942pub struct SwimlaneDeleteSuccess {
943 pub board_id: String,
944 pub swimlane_id: String,
945 pub deleted: bool,
946 pub delete_mode: SwimlaneDeleteMode,
947}