wekan-cli 0.1.0

Agent-first, human-friendly command-line client for Wekan
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
use serde::{Deserialize, Serialize};
use serde_json::{Number, Value};

#[derive(Debug, Eq, PartialEq)]
pub enum CommandSuccess {
    ApiResponse(ApiResponseSuccess),
    Cancelled(CancellationSuccess),
    Registration(AuthSuccess),
    Login(AuthSuccess),
    Logout(LogoutSuccess),
    AuthStatus(AuthStatusSuccess),
    UserCurrent(UserDetail),
    UserList(UserListSuccess),
    UserShown(UserDetail),
    UserCards(UserCardsSuccess),
    UserCreated(UserCreateSuccess),
    UserBoards(UserBoardsSuccess),
    UserOwnershipTaken(UserOwnershipSuccess),
    UserLoginChanged(UserLoginChangeSuccess),
    UserDeleted(UserDeleteSuccess),
    BoardList(BoardListSuccess),
    BoardCount(BoardCountSuccess),
    BoardShown(Box<BoardDetail>),
    BoardCreated(BoardCreateSuccess),
    BoardRenamed(BoardRenameSuccess),
    BoardDeleted(BoardDeleteSuccess),
    ListCollection(ListCollectionSuccess),
    ListShown(ListDetail),
    ListCreated(ListCreateSuccess),
    ListUpdated(ListUpdateSuccess),
    ListDeleted(ListDeleteSuccess),
    CardCollection(CardCollectionSuccess),
    CardShown(Box<CardDetail>),
    CardCreated(CardCreateSuccess),
    CardUpdated(CardUpdateSuccess),
    CardDeleted(CardDeleteSuccess),
    CommentCollection(CommentCollectionSuccess),
    CommentShown(CommentDetail),
    CommentCreated(CommentCreateSuccess),
    CommentDeleted(CommentDeleteSuccess),
    SwimlaneCollection(SwimlaneCollectionSuccess),
    SwimlaneShown(SwimlaneDetail),
    SwimlaneCreated(SwimlaneCreateSuccess),
    SwimlaneUpdated(SwimlaneUpdateSuccess),
    SwimlaneDeleted(SwimlaneDeleteSuccess),
    ProfileAdded(ProfileItem),
    ProfileList(ProfileListSuccess),
    ProfileShown(ProfileItem),
    ProfileUsed(ProfileItem),
    ProfileUpdated(ProfileItem),
    ProfileRemoved(ProfileRemoveSuccess),
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum DestructiveOperation {
    ApiRequest,
    AuthLogout,
    ProfileRemove,
    UserTakeOwnership,
    UserDisableLogin,
    UserDelete,
    BoardDelete,
    ListDelete,
    CardDelete,
    CommentDelete,
    SwimlaneDelete,
}

impl DestructiveOperation {
    pub const fn as_command(self) -> &'static str {
        match self {
            Self::ApiRequest => "api request",
            Self::AuthLogout => "auth logout",
            Self::ProfileRemove => "profile remove",
            Self::UserTakeOwnership => "user take-ownership",
            Self::UserDisableLogin => "user disable-login",
            Self::UserDelete => "user delete",
            Self::BoardDelete => "board delete",
            Self::ListDelete => "list delete",
            Self::CardDelete => "card delete",
            Self::CommentDelete => "comment delete",
            Self::SwimlaneDelete => "swimlane delete",
        }
    }
}

#[derive(Debug, Eq, PartialEq)]
pub struct ApiResponseSuccess {
    pub profile: String,
    pub unsafe_method: bool,
    pub authenticated: bool,
    pub response: crate::client::RawApiResponse,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum RawValueEncoding {
    Text,
    Base64,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct RawResponseHeader {
    pub name: String,
    pub encoding: RawValueEncoding,
    pub value: String,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(tag = "encoding", rename_all = "snake_case")]
pub enum RawResponseBody {
    Json { value: Value },
    Text { value: String },
    Base64 { value: String },
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct RawApiResponseData {
    pub http_status: u16,
    pub mutation_attempted: bool,
    pub mutation_confirmed: bool,
    pub headers: Vec<RawResponseHeader>,
    pub body: RawResponseBody,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CancellationSuccess {
    pub cancelled: bool,
    pub operation: DestructiveOperation,
}

impl CancellationSuccess {
    pub const fn new(operation: DestructiveOperation) -> Self {
        Self {
            cancelled: true,
            operation,
        }
    }
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum LogoutScope {
    CurrentToken,
    AllTokens,
    LocalOnly,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct LogoutSuccess {
    pub server: String,
    pub profile: String,
    pub logout_scope: LogoutScope,
    pub remote_logout_completed: bool,
    pub credential_stored: bool,
    pub local_credential_removed: bool,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AuthSuccess {
    pub server: String,
    pub profile: String,
    pub user_id: String,
    pub token_expires: String,
    pub credential_stored: bool,
    pub profile_created: bool,
    pub profile_active: bool,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AuthStatusSuccess {
    pub server: String,
    pub profile: String,
    pub authenticated: bool,
    pub token_expires: String,
    pub credential_stored: bool,
    pub user: AuthStatusUser,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct ProfileItem {
    pub name: String,
    pub server: String,
    pub active: bool,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ProfileListSuccess {
    pub active_profile: Option<String>,
    pub profiles: Vec<ProfileItem>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ProfileRemoveSuccess {
    pub name: String,
    pub server: String,
    pub removed: bool,
    pub active_profile: Option<String>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AuthStatusUser {
    pub user_id: String,
    pub username: Option<String>,
    pub full_name: Option<String>,
    pub is_admin: Option<bool>,
    pub emails: Vec<AuthStatusEmail>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AuthStatusEmail {
    pub address: Option<String>,
    pub verified: Option<bool>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserDetail {
    pub user_id: String,
    pub username: Option<String>,
    pub full_name: Option<String>,
    pub emails: Vec<UserEmail>,
    pub is_admin: Option<bool>,
    pub login_disabled: Option<bool>,
    pub authentication_method: Option<String>,
    pub created_at: Option<String>,
    pub modified_at: Option<String>,
    pub last_connection_date: Option<String>,
    pub organizations: Vec<UserOrganization>,
    pub teams: Vec<UserTeam>,
    pub boards: Vec<UserBoardMembership>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserEmail {
    pub address: Option<String>,
    pub verified: Option<bool>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserOrganization {
    pub organization_id: Option<String>,
    pub display_name: Option<String>,
    pub is_admin: Option<bool>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserTeam {
    pub team_id: Option<String>,
    pub display_name: Option<String>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserBoardMembership {
    pub board_id: String,
    pub is_active: Option<bool>,
    pub is_admin: Option<bool>,
    pub is_no_comments: Option<bool>,
    pub is_comment_only: Option<bool>,
    pub is_worker: Option<bool>,
    pub is_normal_assigned_only: Option<bool>,
    pub is_comment_assigned_only: Option<bool>,
    pub is_read_only: Option<bool>,
    pub is_read_assigned_only: Option<bool>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserSummary {
    pub user_id: String,
    pub username: Option<String>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserListSuccess {
    pub users: Vec<UserSummary>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct UserCard {
    pub card_id: String,
    pub title: Option<String>,
    pub board_id: Option<String>,
    pub swimlane_id: Option<String>,
    pub list_id: Option<String>,
    pub due_at: Option<String>,
    pub start_at: Option<String>,
    pub end_at: Option<String>,
    pub members: Vec<String>,
    pub assignees: Vec<String>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserCardsSuccess {
    pub cards: Vec<UserCard>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct BoardSummary {
    pub board_id: String,
    pub title: String,
}

pub type UserBoardSummary = BoardSummary;

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetailMember {
    pub user_id: String,
    pub is_admin: bool,
    pub is_active: bool,
    pub is_no_comments: Option<bool>,
    pub is_comment_only: Option<bool>,
    pub is_worker: Option<bool>,
    pub is_normal_assigned_only: Option<bool>,
    pub is_comment_assigned_only: Option<bool>,
    pub is_read_only: Option<bool>,
    pub is_read_assigned_only: Option<bool>,
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetailWatcher {
    pub user_id: String,
    pub level: String,
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetailLabel {
    pub label_id: String,
    pub name: Option<String>,
    pub color: String,
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetailOrganization {
    pub org_id: String,
    pub org_display_name: String,
    pub is_active: bool,
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetailTeam {
    pub team_id: String,
    pub team_display_name: String,
    pub is_active: bool,
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetailDomain {
    pub domain: String,
    pub is_active: bool,
}

#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub struct BoardDetail {
    pub board_id: String,
    pub title: String,
    pub slug: Option<String>,
    pub archived: Option<bool>,
    pub archived_at: Option<String>,
    pub created_at: Option<String>,
    pub modified_at: Option<String>,
    pub stars: Option<Number>,
    #[serde(default)]
    pub labels: Vec<BoardDetailLabel>,
    #[serde(default)]
    pub members: Vec<BoardDetailMember>,
    #[serde(default)]
    pub watchers: Vec<BoardDetailWatcher>,
    pub permission: Option<String>,
    #[serde(default)]
    pub orgs: Vec<BoardDetailOrganization>,
    #[serde(default)]
    pub teams: Vec<BoardDetailTeam>,
    #[serde(default)]
    pub domains: Vec<BoardDetailDomain>,
    #[serde(default)]
    pub import_usernames: Vec<String>,
    pub color: Option<String>,
    #[serde(default)]
    pub custom_theme_colors: Vec<String>,
    pub background_image_url: Option<String>,
    pub background_image_id: Option<String>,
    pub allows_card_counter_list: Option<bool>,
    pub card_aging: Option<bool>,
    pub show_dependencies: Option<bool>,
    pub card_aging_days1: Option<Number>,
    pub card_aging_days2: Option<Number>,
    pub card_aging_days3: Option<Number>,
    pub allows_board_member_list: Option<bool>,
    pub description: Option<String>,
    pub subtasks_default_board_id: Option<String>,
    pub migration_version: Option<Number>,
    pub subtasks_default_list_id: Option<String>,
    pub date_settings_default_board_id: Option<String>,
    pub date_settings_default_list_id: Option<String>,
    pub allows_subtasks: Option<bool>,
    pub allows_subtasks_on_minicard: Option<bool>,
    pub allows_attachments: Option<bool>,
    pub allows_attachments_on_minicard: Option<bool>,
    pub allows_checklists: Option<bool>,
    pub allows_checklists_on_minicard: Option<bool>,
    pub allows_custom_fields: Option<bool>,
    pub allows_custom_fields_on_minicard: Option<bool>,
    pub allows_checklist_count_badge_on_minicard: Option<bool>,
    pub allows_comments: Option<bool>,
    pub allows_description_title: Option<bool>,
    pub allows_description_title_on_minicard: Option<bool>,
    pub allows_description_text: Option<bool>,
    pub allows_description_text_on_minicard: Option<bool>,
    pub allows_cover_attachment_on_minicard: Option<bool>,
    pub allows_cover_attachment_on_card: Option<bool>,
    pub allows_badge_attachment_on_minicard: Option<bool>,
    pub allows_attachment_count_on_card: Option<bool>,
    pub allows_checklist_count_badge_on_card: Option<bool>,
    pub allows_card_sorting_by_number_on_minicard: Option<bool>,
    pub allows_card_number: Option<bool>,
    pub allows_card_number_on_minicard: Option<bool>,
    pub allows_activities: Option<bool>,
    pub allows_labels: Option<bool>,
    pub allows_labels_on_minicard: Option<bool>,
    pub allows_creator: Option<bool>,
    pub allows_creator_on_minicard: Option<bool>,
    pub allows_assignee: Option<bool>,
    pub allows_assignee_on_minicard: Option<bool>,
    pub allows_members: Option<bool>,
    pub allows_members_on_minicard: Option<bool>,
    pub allows_requested_by: Option<bool>,
    pub allows_requested_by_on_minicard: Option<bool>,
    pub allows_card_sorting_by_number: Option<bool>,
    pub allows_show_lists: Option<bool>,
    pub allows_assigned_by: Option<bool>,
    pub allows_assigned_by_on_minicard: Option<bool>,
    pub allows_show_lists_on_minicard: Option<bool>,
    pub allows_checklist_at_minicard: Option<bool>,
    pub allows_received_date: Option<bool>,
    pub restrict_comment_editing: Option<bool>,
    pub allows_personal_list_width: Option<bool>,
    pub auto_width: Option<bool>,
    pub allows_received_date_on_minicard: Option<bool>,
    pub allows_start_date: Option<bool>,
    pub allows_start_date_on_minicard: Option<bool>,
    pub allows_end_date: Option<bool>,
    pub allows_end_date_on_minicard: Option<bool>,
    pub allows_due_date: Option<bool>,
    pub allows_due_date_on_minicard: Option<bool>,
    pub allows_due_complete: Option<bool>,
    pub allows_due_complete_on_minicard: Option<bool>,
    pub present_parent_task: Option<String>,
    pub received_at: Option<String>,
    pub start_at: Option<String>,
    pub due_at: Option<String>,
    pub end_at: Option<String>,
    pub spent_time: Option<Number>,
    pub is_overtime: Option<bool>,
    pub board_type: Option<String>,
    pub sort: Option<Number>,
    pub show_activities: Option<bool>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserBoardsSuccess {
    pub user_id: String,
    pub boards: Vec<UserBoardSummary>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum UserCreateWarning {
    #[serde(rename = "user_id_unavailable_in_wekan_v11_06")]
    UserIdUnavailableInWekanV1106,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserCreateSuccess {
    pub created: bool,
    pub username: String,
    pub email: String,
    pub user_id: Option<String>,
    pub warning: Option<UserCreateWarning>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserOwnershipSuccess {
    pub from_user_id: String,
    pub to_user_id: String,
    pub boards: Vec<UserBoardSummary>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum UserLoginAction {
    Disabled,
    Enabled,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserLoginChangeSuccess {
    pub action: UserLoginAction,
    pub user: UserDetail,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct UserDeleteSuccess {
    pub user_id: String,
    pub deleted: bool,
    pub deleted_current_user: bool,
    pub credential_stored: bool,
    pub local_credential_removed: bool,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum BoardListScope {
    Active,
    Public,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BoardListSuccess {
    pub scope: BoardListScope,
    pub boards: Vec<BoardSummary>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BoardCountSuccess {
    pub private: u64,
    pub public: u64,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BoardCreateSuccess {
    pub board_id: String,
    pub default_swimlane_id: String,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BoardRenameSuccess {
    pub board_id: String,
    pub title: String,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BoardDeleteSuccess {
    pub board_id: String,
    pub deleted: bool,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct ListSummary {
    pub list_id: String,
    pub title: String,
    pub modified_at: Option<String>,
    pub cards_modified_at: Option<String>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ListCollectionSuccess {
    pub board_id: String,
    pub lists: Vec<ListSummary>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct ListWipLimitDetail {
    pub value: Number,
    pub enabled: bool,
    pub soft: bool,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct ListDetail {
    pub list_id: String,
    pub title: String,
    pub starred: Option<bool>,
    pub archived: bool,
    pub archived_at: Option<String>,
    pub deleted_at: Option<String>,
    pub deleted_by: Option<String>,
    pub delete_batch_id: Option<String>,
    pub board_id: String,
    pub swimlane_id: Option<String>,
    pub created_at: String,
    pub sort: Option<Number>,
    pub updated_at: Option<String>,
    pub modified_at: String,
    pub position_updated_at: Option<String>,
    pub wip_limit: Option<ListWipLimitDetail>,
    pub color: Option<String>,
    pub list_type: String,
    pub width: Option<Number>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ListCreateSuccess {
    pub board_id: String,
    pub list_id: String,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ListUpdatedField {
    Title,
    Color,
    Starred,
    WipLimit,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ListUpdateSuccess {
    pub board_id: String,
    pub list_id: String,
    pub updated_fields: Vec<ListUpdatedField>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ListDeleteMode {
    Soft,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ListDeleteSuccess {
    pub board_id: String,
    pub list_id: String,
    pub deleted: bool,
    pub delete_mode: ListDeleteMode,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardSummary {
    pub card_id: String,
    pub title: Option<String>,
    pub description: Option<String>,
    pub swimlane_id: Option<String>,
    pub received_at: Option<String>,
    pub start_at: Option<String>,
    pub due_at: Option<String>,
    pub end_at: Option<String>,
    pub assignees: Vec<String>,
    pub sort: Option<Number>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CardCollectionSuccess {
    pub board_id: String,
    pub list_id: String,
    pub cards: Vec<CardSummary>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum CardDetailCustomFieldValue {
    String(String),
    Number(Number),
    Boolean(bool),
    Strings(Vec<String>),
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetailCustomField {
    pub custom_field_id: Option<String>,
    pub value: Option<CardDetailCustomFieldValue>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum CardDetailStickerHighlight {
    Underline,
    Round,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetailSticker {
    pub icon: Option<String>,
    pub name: Option<String>,
    pub highlight: Option<CardDetailStickerHighlight>,
    pub position: Option<Number>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetailLocation {
    pub location_id: String,
    pub name: Option<String>,
    pub address: Option<String>,
    pub latitude: Option<Number>,
    pub longitude: Option<Number>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetailDependency {
    pub card_id: String,
    pub dependency_type: Option<String>,
    pub color: Option<String>,
    pub icon: Option<String>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetailVote {
    pub question: String,
    pub positive: Vec<String>,
    pub negative: Vec<String>,
    pub end: Option<String>,
    pub public: bool,
    pub allow_non_board_members: bool,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetailPoker {
    pub question: Option<bool>,
    pub one: Vec<String>,
    pub two: Vec<String>,
    pub three: Vec<String>,
    pub five: Vec<String>,
    pub eight: Vec<String>,
    pub thirteen: Vec<String>,
    pub twenty: Vec<String>,
    pub forty: Vec<String>,
    pub one_hundred: Vec<String>,
    pub unsure: Vec<String>,
    pub end: Option<String>,
    pub allow_non_board_members: Option<bool>,
    pub estimation: Option<Number>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CardDetail {
    pub card_id: String,
    pub title: Option<String>,
    pub archived: bool,
    pub archived_at: Option<String>,
    pub deleted_at: Option<String>,
    pub deleted_by: Option<String>,
    pub delete_batch_id: Option<String>,
    pub parent_id: Option<String>,
    pub list_id: Option<String>,
    pub swimlane_id: String,
    pub board_id: Option<String>,
    pub cover_id: Option<String>,
    pub color: Option<String>,
    pub created_at: String,
    pub modified_at: String,
    pub custom_fields: Vec<CardDetailCustomField>,
    pub date_last_activity: String,
    pub description: Option<String>,
    pub requested_by: Option<String>,
    pub assigned_by: Option<String>,
    pub label_ids: Vec<String>,
    pub members: Vec<String>,
    pub assignees: Vec<String>,
    pub requesters: Vec<String>,
    pub assigners: Vec<String>,
    pub received_at: Option<String>,
    pub start_at: Option<String>,
    pub due_at: Option<String>,
    pub end_at: Option<String>,
    pub due_complete: Option<bool>,
    pub stickers: Vec<CardDetailSticker>,
    pub location_name: Option<String>,
    pub location_address: Option<String>,
    pub location_latitude: Option<Number>,
    pub location_longitude: Option<Number>,
    pub locations: Vec<CardDetailLocation>,
    pub spent_time: Option<Number>,
    pub is_overtime: Option<bool>,
    pub user_id: String,
    pub sort: Option<Number>,
    pub subtask_sort: Option<Number>,
    pub card_type: String,
    pub linked_id: Option<String>,
    pub card_dependencies: Vec<CardDetailDependency>,
    pub vote: Option<CardDetailVote>,
    pub poker: Option<CardDetailPoker>,
    pub target_id_gantt: Vec<String>,
    pub link_type_gantt: Vec<Number>,
    pub link_id_gantt: Vec<String>,
    pub card_number: Option<Number>,
    pub show_activities: bool,
    pub show_list_on_minicard: Option<bool>,
    pub show_checklist_at_minicard: Option<bool>,
    pub hide_finished_checklist_if_items_are_hidden: Option<bool>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CardCreateSuccess {
    pub board_id: String,
    pub list_id: String,
    pub card_id: String,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum CardSubmittedField {
    Title,
    Sort,
    ParentId,
    Description,
    Color,
    LabelIds,
    RequestedBy,
    AssignedBy,
    ReceivedAt,
    StartAt,
    DueAt,
    EndAt,
    SpentTime,
    IsOverTime,
    Members,
    Assignees,
    DueComplete,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CardUpdateSuccess {
    pub board_id: String,
    pub list_id: String,
    pub card_id: String,
    pub submitted_fields: Vec<CardSubmittedField>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum CardDeleteMode {
    Hard,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CardDeleteSuccess {
    pub board_id: String,
    pub list_id: String,
    pub card_id: String,
    pub deleted: bool,
    pub delete_mode: CardDeleteMode,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CommentSummary {
    pub comment_id: String,
    pub text: String,
    pub author_id: String,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CommentCollectionSuccess {
    pub board_id: String,
    pub card_id: String,
    pub comments: Vec<CommentSummary>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct CommentDetail {
    pub comment_id: String,
    pub board_id: String,
    pub card_id: String,
    pub text: String,
    pub parent_id: Option<String>,
    pub created_at: String,
    pub modified_at: String,
    pub author_id: String,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CommentCreateSuccess {
    pub board_id: String,
    pub card_id: String,
    pub comment_id: String,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum CommentDeleteMode {
    Hard,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CommentDeleteSuccess {
    pub board_id: String,
    pub card_id: String,
    pub comment_id: String,
    pub deleted: bool,
    pub delete_mode: CommentDeleteMode,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct SwimlaneSummary {
    pub swimlane_id: String,
    pub title: String,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct SwimlaneCollectionSuccess {
    pub board_id: String,
    pub swimlanes: Vec<SwimlaneSummary>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
pub struct SwimlaneDetail {
    pub swimlane_id: String,
    pub title: String,
    pub archived: bool,
    pub archived_at: Option<String>,
    pub board_id: String,
    pub created_at: String,
    pub sort: Option<Number>,
    pub color: Option<String>,
    pub updated_at: Option<String>,
    pub modified_at: String,
    pub swimlane_type: String,
    pub height: Option<Number>,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct SwimlaneCreateSuccess {
    pub board_id: String,
    pub swimlane_id: String,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SwimlaneUpdatedField {
    Title,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct SwimlaneUpdateSuccess {
    pub board_id: String,
    pub swimlane_id: String,
    pub updated_fields: Vec<SwimlaneUpdatedField>,
}

#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum SwimlaneDeleteMode {
    Hard,
}

#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct SwimlaneDeleteSuccess {
    pub board_id: String,
    pub swimlane_id: String,
    pub deleted: bool,
    pub delete_mode: SwimlaneDeleteMode,
}