1mod admin;
14mod branch;
15mod commit;
16mod common;
17mod content;
18mod diff;
19pub mod pagination;
20mod repo;
21
22pub use admin::{ApiKey, ApiKeyCreated, ApiKeyScope, CreateApiKeyRequest, ListApiKeysResponse};
23pub use branch::{Branch, CreateBranchRequest, ListBranchesResponse};
24pub use commit::{
25 Author, Commit, CommitFile, CommitFileAction, CommitSummary, CreateCommitRequest,
26 ListCommitsResponse,
27};
28pub use common::SuccessResponse;
29pub use content::{Content, DirEntry, DirEntryType};
30pub use diff::{Diff, DiffFile, DiffStats};
31pub use pagination::{Paginated, PaginationParams};
32pub use repo::{CreateRepoRequest, ListReposResponse, RenameRepoRequest, Repo};
33
34impl Paginated for ListReposResponse {
37 type Item = Repo;
38
39 fn items(self) -> Vec<Self::Item> {
40 self.repos
41 }
42
43 fn next_cursor(&self) -> Option<&str> {
44 self.next_cursor.as_deref()
45 }
46
47 fn has_more(&self) -> bool {
48 self.has_more
49 }
50}
51
52impl Paginated for ListBranchesResponse {
53 type Item = Branch;
54
55 fn items(self) -> Vec<Self::Item> {
56 self.branches
57 }
58
59 fn next_cursor(&self) -> Option<&str> {
60 self.next_cursor.as_deref()
61 }
62
63 fn has_more(&self) -> bool {
64 self.has_more
65 }
66}
67
68impl Paginated for ListCommitsResponse {
69 type Item = CommitSummary;
70
71 fn items(self) -> Vec<Self::Item> {
72 self.commits
73 }
74
75 fn next_cursor(&self) -> Option<&str> {
76 self.next_cursor.as_deref()
77 }
78
79 fn has_more(&self) -> bool {
80 self.has_more
81 }
82}