1use crate::{impl_from_response, StructureError};
2use std::collections::BTreeMap;
3#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
5pub struct APIError {
6 pub message: Option<String>,
7 #[serde(deserialize_with = "crate::none_if_blank_url")]
8 pub url: Option<url::Url>,
9}
10
11impl_from_response!(APIError);
12
13#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
14pub struct APIForbiddenError {
15 pub message: Option<String>,
16 pub url: Option<String>,
17}
18
19impl_from_response!(APIForbiddenError);
20
21#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
22pub struct APIInternalServerError {
23 pub message: Option<String>,
24 pub url: Option<String>,
25}
26
27impl_from_response!(APIInternalServerError);
28
29#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
30pub struct APIInvalidTopicsError {
31 #[serde(rename = "invalidTopics")]
32 pub invalid_topics: Option<Vec<String>>,
33 pub message: Option<String>,
34}
35
36impl_from_response!(APIInvalidTopicsError);
37
38#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
39pub struct APINotFound {
40 pub errors: Option<Vec<String>>,
41 pub message: Option<String>,
42 pub url: Option<String>,
43}
44
45impl_from_response!(APINotFound);
46
47#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
48pub struct APIRepoArchivedError {
49 pub message: Option<String>,
50 pub url: Option<String>,
51}
52
53impl_from_response!(APIRepoArchivedError);
54
55#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
56pub struct APIUnauthorizedError {
57 pub message: Option<String>,
58 pub url: Option<String>,
59}
60
61impl_from_response!(APIUnauthorizedError);
62
63#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
64pub struct APIValidationError {
65 pub message: Option<String>,
66 pub url: Option<String>,
67}
68
69impl_from_response!(APIValidationError);
70
71#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
72pub struct AccessToken {
73 pub id: Option<i64>,
74 pub name: Option<String>,
75 pub scopes: Option<Vec<String>>,
76 pub sha1: Option<String>,
77 pub token_last_eight: Option<String>,
78}
79
80impl_from_response!(AccessToken);
81
82#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
84pub struct ActionRun {
85 #[serde(rename = "ScheduleID")]
87 pub schedule_id: Option<i64>,
88 pub approved_by: Option<i64>,
90 pub commit_sha: Option<String>,
92 #[serde(with = "time::serde::rfc3339::option")]
93 pub created: Option<time::OffsetDateTime>,
95 pub duration: Option<i64>,
96 pub event: Option<String>,
98 pub event_payload: Option<String>,
100 #[serde(deserialize_with = "crate::none_if_blank_url")]
101 pub html_url: Option<url::Url>,
103 pub id: Option<i64>,
105 pub index_in_repo: Option<i64>,
107 pub is_fork_pull_request: Option<bool>,
109 pub is_ref_deleted: Option<bool>,
111 pub need_approval: Option<bool>,
113 pub prettyref: Option<String>,
115 pub repository: Option<Repository>,
116 #[serde(with = "time::serde::rfc3339::option")]
117 pub started: Option<time::OffsetDateTime>,
119 pub status: Option<String>,
121 #[serde(with = "time::serde::rfc3339::option")]
122 pub stopped: Option<time::OffsetDateTime>,
124 pub title: Option<String>,
126 pub trigger_event: Option<String>,
128 pub trigger_user: Option<User>,
129 #[serde(with = "time::serde::rfc3339::option")]
130 pub updated: Option<time::OffsetDateTime>,
132 pub workflow_id: Option<String>,
134}
135
136impl_from_response!(ActionRun);
137
138#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
140pub struct ActionRunJob {
141 pub id: Option<i64>,
143 pub name: Option<String>,
145 pub needs: Option<Vec<String>>,
147 pub owner_id: Option<i64>,
149 pub repo_id: Option<i64>,
151 pub runs_on: Option<Vec<String>>,
153 pub status: Option<String>,
155 pub task_id: Option<i64>,
157}
158
159impl_from_response!(ActionRunJob);
160
161#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
163pub struct ActionTask {
164 #[serde(with = "time::serde::rfc3339::option")]
165 pub created_at: Option<time::OffsetDateTime>,
166 pub display_title: Option<String>,
167 pub event: Option<String>,
168 pub head_branch: Option<String>,
169 pub head_sha: Option<String>,
170 pub id: Option<i64>,
171 pub name: Option<String>,
172 pub run_number: Option<i64>,
173 #[serde(with = "time::serde::rfc3339::option")]
174 pub run_started_at: Option<time::OffsetDateTime>,
175 pub status: Option<String>,
176 #[serde(with = "time::serde::rfc3339::option")]
177 pub updated_at: Option<time::OffsetDateTime>,
178 #[serde(deserialize_with = "crate::none_if_blank_url")]
179 pub url: Option<url::Url>,
180 pub workflow_id: Option<String>,
181}
182
183#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
185pub struct ActionTaskResponse {
186 pub total_count: Option<i64>,
187 pub workflow_runs: Option<Vec<ActionTask>>,
188}
189
190impl_from_response!(ActionTaskResponse);
191
192#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
194pub struct ActionVariable {
195 pub data: Option<String>,
197 pub name: Option<String>,
199 pub owner_id: Option<i64>,
201 pub repo_id: Option<i64>,
203}
204
205impl_from_response!(ActionVariable);
206
207#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
208pub struct Activity {
209 pub act_user: Option<User>,
210 pub act_user_id: Option<i64>,
211 pub comment: Option<Comment>,
212 pub comment_id: Option<i64>,
213 pub content: Option<String>,
214 #[serde(with = "time::serde::rfc3339::option")]
215 pub created: Option<time::OffsetDateTime>,
216 pub id: Option<i64>,
217 pub is_private: Option<bool>,
218 pub op_type: Option<ActivityOpType>,
220 pub ref_name: Option<String>,
221 pub repo: Option<Repository>,
222 pub repo_id: Option<i64>,
223 pub user_id: Option<i64>,
224}
225
226impl_from_response!(Activity);
227
228#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
231pub enum ActivityOpType {
232 #[serde(rename = "create_repo")]
233 CreateRepo,
234 #[serde(rename = "rename_repo")]
235 RenameRepo,
236 #[serde(rename = "star_repo")]
237 StarRepo,
238 #[serde(rename = "watch_repo")]
239 WatchRepo,
240 #[serde(rename = "commit_repo")]
241 CommitRepo,
242 #[serde(rename = "create_issue")]
243 CreateIssue,
244 #[serde(rename = "create_pull_request")]
245 CreatePullRequest,
246 #[serde(rename = "transfer_repo")]
247 TransferRepo,
248 #[serde(rename = "push_tag")]
249 PushTag,
250 #[serde(rename = "comment_issue")]
251 CommentIssue,
252 #[serde(rename = "merge_pull_request")]
253 MergePullRequest,
254 #[serde(rename = "close_issue")]
255 CloseIssue,
256 #[serde(rename = "reopen_issue")]
257 ReopenIssue,
258 #[serde(rename = "close_pull_request")]
259 ClosePullRequest,
260 #[serde(rename = "reopen_pull_request")]
261 ReopenPullRequest,
262 #[serde(rename = "delete_tag")]
263 DeleteTag,
264 #[serde(rename = "delete_branch")]
265 DeleteBranch,
266 #[serde(rename = "mirror_sync_push")]
267 MirrorSyncPush,
268 #[serde(rename = "mirror_sync_create")]
269 MirrorSyncCreate,
270 #[serde(rename = "mirror_sync_delete")]
271 MirrorSyncDelete,
272 #[serde(rename = "approve_pull_request")]
273 ApprovePullRequest,
274 #[serde(rename = "reject_pull_request")]
275 RejectPullRequest,
276 #[serde(rename = "comment_pull")]
277 CommentPull,
278 #[serde(rename = "publish_release")]
279 PublishRelease,
280 #[serde(rename = "pull_review_dismissed")]
281 PullReviewDismissed,
282 #[serde(rename = "pull_request_ready_for_review")]
283 PullRequestReadyForReview,
284 #[serde(rename = "auto_merge_pull_request")]
285 AutoMergePullRequest,
286}
287#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
289pub struct ActivityPub {
290 #[serde(rename = "@context")]
291 pub context: Option<String>,
292}
293
294impl_from_response!(ActivityPub);
295
296#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
298pub struct AddCollaboratorOption {
299 pub permission: Option<AddCollaboratorOptionPermission>,
300}
301
302#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
303pub enum AddCollaboratorOptionPermission {
304 #[serde(rename = "read")]
305 Read,
306 #[serde(rename = "write")]
307 Write,
308 #[serde(rename = "admin")]
309 Admin,
310}
311#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
313pub struct AddTimeOption {
314 #[serde(with = "time::serde::rfc3339::option")]
315 pub created: Option<time::OffsetDateTime>,
316 pub time: i64,
318 pub user_name: Option<String>,
320}
321
322#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
324pub struct AnnotatedTag {
325 pub archive_download_count: Option<TagArchiveDownloadCount>,
326 pub message: Option<String>,
327 pub object: Option<AnnotatedTagObject>,
328 pub sha: Option<String>,
329 pub tag: Option<String>,
330 pub tagger: Option<CommitUser>,
331 #[serde(deserialize_with = "crate::none_if_blank_url")]
332 pub url: Option<url::Url>,
333 pub verification: Option<PayloadCommitVerification>,
334}
335
336impl_from_response!(AnnotatedTag);
337
338#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
340pub struct AnnotatedTagObject {
341 pub sha: Option<String>,
342 #[serde(rename = "type")]
343 pub r#type: Option<String>,
344 #[serde(deserialize_with = "crate::none_if_blank_url")]
345 pub url: Option<url::Url>,
346}
347
348#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
350pub struct Attachment {
351 #[serde(deserialize_with = "crate::none_if_blank_url")]
352 pub browser_download_url: Option<url::Url>,
353 #[serde(with = "time::serde::rfc3339::option")]
354 pub created_at: Option<time::OffsetDateTime>,
355 pub download_count: Option<i64>,
356 pub id: Option<i64>,
357 pub name: Option<String>,
358 pub size: Option<i64>,
359 #[serde(rename = "type")]
360 pub r#type: Option<AttachmentType>,
361 pub uuid: Option<String>,
362}
363
364impl_from_response!(Attachment);
365
366#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
367pub enum AttachmentType {
368 #[serde(rename = "attachment")]
369 Attachment,
370 #[serde(rename = "external")]
371 External,
372}
373#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
374pub struct BlockedUser {
375 pub block_id: Option<i64>,
376 #[serde(with = "time::serde::rfc3339::option")]
377 pub created_at: Option<time::OffsetDateTime>,
378}
379
380impl_from_response!(BlockedUser);
381
382#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
384pub struct Branch {
385 pub commit: Option<PayloadCommit>,
386 pub effective_branch_protection_name: Option<String>,
387 pub enable_status_check: Option<bool>,
388 pub name: Option<String>,
389 pub protected: Option<bool>,
390 pub required_approvals: Option<i64>,
391 pub status_check_contexts: Option<Vec<String>>,
392 pub user_can_merge: Option<bool>,
393 pub user_can_push: Option<bool>,
394}
395
396impl_from_response!(Branch);
397
398#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
400pub struct BranchProtection {
401 pub apply_to_admins: Option<bool>,
402 pub approvals_whitelist_teams: Option<Vec<String>>,
403 pub approvals_whitelist_username: Option<Vec<String>>,
404 pub block_on_official_review_requests: Option<bool>,
405 pub block_on_outdated_branch: Option<bool>,
406 pub block_on_rejected_reviews: Option<bool>,
407 pub branch_name: Option<String>,
409 #[serde(with = "time::serde::rfc3339::option")]
410 pub created_at: Option<time::OffsetDateTime>,
411 pub dismiss_stale_approvals: Option<bool>,
412 pub enable_approvals_whitelist: Option<bool>,
413 pub enable_merge_whitelist: Option<bool>,
414 pub enable_push: Option<bool>,
415 pub enable_push_whitelist: Option<bool>,
416 pub enable_status_check: Option<bool>,
417 pub ignore_stale_approvals: Option<bool>,
418 pub merge_whitelist_teams: Option<Vec<String>>,
419 pub merge_whitelist_usernames: Option<Vec<String>>,
420 pub protected_file_patterns: Option<String>,
421 pub push_whitelist_deploy_keys: Option<bool>,
422 pub push_whitelist_teams: Option<Vec<String>>,
423 pub push_whitelist_usernames: Option<Vec<String>>,
424 pub require_signed_commits: Option<bool>,
425 pub required_approvals: Option<i64>,
426 pub rule_name: Option<String>,
427 pub status_check_contexts: Option<Vec<String>>,
428 pub unprotected_file_patterns: Option<String>,
429 #[serde(with = "time::serde::rfc3339::option")]
430 pub updated_at: Option<time::OffsetDateTime>,
431}
432
433impl_from_response!(BranchProtection);
434
435#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
437pub struct ChangeFileOperation {
438 pub content: Option<String>,
440 pub from_path: Option<String>,
442 pub operation: ChangeFileOperationOperation,
444 pub path: String,
446 pub sha: Option<String>,
448}
449
450#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
453pub enum ChangeFileOperationOperation {
454 #[serde(rename = "create")]
455 Create,
456 #[serde(rename = "update")]
457 Update,
458 #[serde(rename = "delete")]
459 Delete,
460}
461#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
465pub struct ChangeFilesOptions {
466 pub author: Option<Identity>,
467 pub branch: Option<String>,
469 pub committer: Option<Identity>,
470 pub dates: Option<CommitDateOptions>,
471 pub files: Vec<ChangeFileOperation>,
473 pub message: Option<String>,
475 pub new_branch: Option<String>,
477 pub signoff: Option<bool>,
479}
480
481#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
483pub struct ChangedFile {
484 pub additions: Option<i64>,
485 pub changes: Option<i64>,
486 #[serde(deserialize_with = "crate::none_if_blank_url")]
487 pub contents_url: Option<url::Url>,
488 pub deletions: Option<i64>,
489 pub filename: Option<String>,
490 #[serde(deserialize_with = "crate::none_if_blank_url")]
491 pub html_url: Option<url::Url>,
492 pub previous_filename: Option<String>,
493 #[serde(deserialize_with = "crate::none_if_blank_url")]
494 pub raw_url: Option<url::Url>,
495 pub status: Option<String>,
496}
497
498impl_from_response!(ChangedFile);
499
500#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
502pub struct CombinedStatus {
503 #[serde(deserialize_with = "crate::none_if_blank_url")]
504 pub commit_url: Option<url::Url>,
505 pub repository: Option<Repository>,
506 pub sha: Option<String>,
507 pub state: Option<CommitStatusState>,
508 pub statuses: Option<Vec<CommitStatus>>,
509 pub total_count: Option<i64>,
510 #[serde(deserialize_with = "crate::none_if_blank_url")]
511 pub url: Option<url::Url>,
512}
513
514impl_from_response!(CombinedStatus);
515
516impl crate::sealed::Sealed for CombinedStatus {}
517impl crate::PageSize for CombinedStatus {
518 fn page_size(&self) -> usize {
519 self.statuses.as_ref().map(|x| x.page_size()).unwrap_or(0)
520 }
521}
522
523#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
525pub struct Comment {
526 pub assets: Option<Vec<Attachment>>,
527 pub body: Option<String>,
528 #[serde(with = "time::serde::rfc3339::option")]
529 pub created_at: Option<time::OffsetDateTime>,
530 #[serde(deserialize_with = "crate::none_if_blank_url")]
531 pub html_url: Option<url::Url>,
532 pub id: Option<i64>,
533 #[serde(deserialize_with = "crate::none_if_blank_url")]
534 pub issue_url: Option<url::Url>,
535 pub original_author: Option<String>,
536 pub original_author_id: Option<i64>,
537 #[serde(deserialize_with = "crate::none_if_blank_url")]
538 pub pull_request_url: Option<url::Url>,
539 #[serde(with = "time::serde::rfc3339::option")]
540 pub updated_at: Option<time::OffsetDateTime>,
541 pub user: Option<User>,
542}
543
544impl_from_response!(Comment);
545
546#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
547pub struct Commit {
548 pub author: Option<User>,
549 pub commit: Option<RepoCommit>,
550 pub committer: Option<User>,
551 #[serde(with = "time::serde::rfc3339::option")]
552 pub created: Option<time::OffsetDateTime>,
553 pub files: Option<Vec<CommitAffectedFiles>>,
554 #[serde(deserialize_with = "crate::none_if_blank_url")]
555 pub html_url: Option<url::Url>,
556 pub parents: Option<Vec<CommitMeta>>,
557 pub sha: Option<String>,
558 pub stats: Option<CommitStats>,
559 #[serde(deserialize_with = "crate::none_if_blank_url")]
560 pub url: Option<url::Url>,
561}
562
563impl_from_response!(Commit);
564
565#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
567pub struct CommitAffectedFiles {
568 pub filename: Option<String>,
569 pub status: Option<String>,
570}
571
572#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
574pub struct CommitDateOptions {
575 #[serde(with = "time::serde::rfc3339::option")]
576 pub author: Option<time::OffsetDateTime>,
577 #[serde(with = "time::serde::rfc3339::option")]
578 pub committer: Option<time::OffsetDateTime>,
579}
580
581#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
582pub struct CommitMeta {
583 #[serde(with = "time::serde::rfc3339::option")]
584 pub created: Option<time::OffsetDateTime>,
585 pub sha: Option<String>,
586 #[serde(deserialize_with = "crate::none_if_blank_url")]
587 pub url: Option<url::Url>,
588}
589
590#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
592pub struct CommitStats {
593 pub additions: Option<i64>,
594 pub deletions: Option<i64>,
595 pub total: Option<i64>,
596}
597
598#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
600pub struct CommitStatus {
601 pub context: Option<String>,
602 #[serde(with = "time::serde::rfc3339::option")]
603 pub created_at: Option<time::OffsetDateTime>,
604 pub creator: Option<User>,
605 pub description: Option<String>,
606 pub id: Option<i64>,
607 pub status: Option<CommitStatusState>,
608 #[serde(deserialize_with = "crate::none_if_blank_url")]
609 pub target_url: Option<url::Url>,
610 #[serde(with = "time::serde::rfc3339::option")]
611 pub updated_at: Option<time::OffsetDateTime>,
612 #[serde(deserialize_with = "crate::none_if_blank_url")]
613 pub url: Option<url::Url>,
614}
615
616impl_from_response!(CommitStatus);
617
618#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
623pub enum CommitStatusState {
624 #[serde(rename = "pending")]
625 Pending,
626 #[serde(rename = "success")]
627 Success,
628 #[serde(rename = "error")]
629 Error,
630 #[serde(rename = "failure")]
631 Failure,
632 #[serde(rename = "warning")]
633 Warning,
634}
635#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
636pub struct CommitUser {
637 pub date: Option<String>,
638 pub email: Option<String>,
639 pub name: Option<String>,
640}
641
642#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
643pub struct Compare {
644 pub commits: Option<Vec<Commit>>,
645 pub files: Option<Vec<CommitAffectedFiles>>,
646 pub total_commits: Option<i64>,
647}
648
649impl_from_response!(Compare);
650
651#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
653pub struct ContentsResponse {
654 #[serde(rename = "_links")]
655 pub links: Option<FileLinksResponse>,
656 pub content: Option<String>,
658 #[serde(deserialize_with = "crate::none_if_blank_url")]
659 pub download_url: Option<url::Url>,
660 pub encoding: Option<String>,
662 #[serde(deserialize_with = "crate::none_if_blank_url")]
663 pub git_url: Option<url::Url>,
664 #[serde(deserialize_with = "crate::none_if_blank_url")]
665 pub html_url: Option<url::Url>,
666 pub last_commit_sha: Option<String>,
667 #[serde(with = "time::serde::rfc3339::option")]
668 pub last_commit_when: Option<time::OffsetDateTime>,
669 pub name: Option<String>,
670 pub path: Option<String>,
671 pub sha: Option<String>,
672 pub size: Option<i64>,
673 #[serde(deserialize_with = "crate::none_if_blank_url")]
674 pub submodule_git_url: Option<url::Url>,
676 pub target: Option<String>,
678 #[serde(rename = "type")]
680 pub r#type: Option<String>,
681 #[serde(deserialize_with = "crate::none_if_blank_url")]
682 pub url: Option<url::Url>,
683}
684
685impl_from_response!(ContentsResponse);
686
687#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
689pub struct CreateAccessTokenOption {
690 pub name: String,
691 pub scopes: Option<Vec<String>>,
692}
693
694#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
696pub struct CreateBranchProtectionOption {
697 pub apply_to_admins: Option<bool>,
698 pub approvals_whitelist_teams: Option<Vec<String>>,
699 pub approvals_whitelist_username: Option<Vec<String>>,
700 pub block_on_official_review_requests: Option<bool>,
701 pub block_on_outdated_branch: Option<bool>,
702 pub block_on_rejected_reviews: Option<bool>,
703 pub branch_name: Option<String>,
705 pub dismiss_stale_approvals: Option<bool>,
706 pub enable_approvals_whitelist: Option<bool>,
707 pub enable_merge_whitelist: Option<bool>,
708 pub enable_push: Option<bool>,
709 pub enable_push_whitelist: Option<bool>,
710 pub enable_status_check: Option<bool>,
711 pub ignore_stale_approvals: Option<bool>,
712 pub merge_whitelist_teams: Option<Vec<String>>,
713 pub merge_whitelist_usernames: Option<Vec<String>>,
714 pub protected_file_patterns: Option<String>,
715 pub push_whitelist_deploy_keys: Option<bool>,
716 pub push_whitelist_teams: Option<Vec<String>>,
717 pub push_whitelist_usernames: Option<Vec<String>>,
718 pub require_signed_commits: Option<bool>,
719 pub required_approvals: Option<i64>,
720 pub rule_name: Option<String>,
721 pub status_check_contexts: Option<Vec<String>>,
722 pub unprotected_file_patterns: Option<String>,
723}
724
725#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
727pub struct CreateBranchRepoOption {
728 pub new_branch_name: String,
730 pub old_branch_name: Option<String>,
734 pub old_ref_name: Option<String>,
736}
737
738#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
740pub struct CreateEmailOption {
741 pub emails: Option<Vec<String>>,
743}
744
745#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
749pub struct CreateFileOptions {
750 pub author: Option<Identity>,
751 pub branch: Option<String>,
753 pub committer: Option<Identity>,
754 pub content: String,
756 pub dates: Option<CommitDateOptions>,
757 pub message: Option<String>,
759 pub new_branch: Option<String>,
761 pub signoff: Option<bool>,
763}
764
765#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
767pub struct CreateForkOption {
768 pub name: Option<String>,
770 pub organization: Option<String>,
772}
773
774#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
776pub struct CreateGPGKeyOption {
777 pub armored_public_key: String,
779 pub armored_signature: Option<String>,
780}
781
782#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
784pub struct CreateHookOption {
785 pub active: Option<bool>,
786 pub authorization_header: Option<String>,
787 pub branch_filter: Option<String>,
788 pub config: CreateHookOptionConfig,
789 pub events: Option<Vec<String>>,
790 #[serde(rename = "type")]
791 pub r#type: CreateHookOptionType,
792}
793
794#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
795pub enum CreateHookOptionType {
796 #[serde(rename = "forgejo")]
797 Forgejo,
798 #[serde(rename = "dingtalk")]
799 Dingtalk,
800 #[serde(rename = "discord")]
801 Discord,
802 #[serde(rename = "gitea")]
803 Gitea,
804 #[serde(rename = "gogs")]
805 Gogs,
806 #[serde(rename = "msteams")]
807 Msteams,
808 #[serde(rename = "slack")]
809 Slack,
810 #[serde(rename = "telegram")]
811 Telegram,
812 #[serde(rename = "feishu")]
813 Feishu,
814 #[serde(rename = "wechatwork")]
815 Wechatwork,
816 #[serde(rename = "packagist")]
817 Packagist,
818}
819#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
823pub struct CreateHookOptionConfig {
824 pub content_type: String,
825 pub url: url::Url,
826 #[serde(flatten)]
827 pub additional: BTreeMap<String, String>,
828}
829
830#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
832pub struct CreateIssueCommentOption {
833 pub body: String,
834 #[serde(with = "time::serde::rfc3339::option")]
835 pub updated_at: Option<time::OffsetDateTime>,
836}
837
838#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
840pub struct CreateIssueOption {
841 pub assignee: Option<String>,
843 pub assignees: Option<Vec<String>>,
844 pub body: Option<String>,
845 pub closed: Option<bool>,
846 #[serde(with = "time::serde::rfc3339::option")]
847 pub due_date: Option<time::OffsetDateTime>,
848 pub labels: Option<Vec<i64>>,
850 pub milestone: Option<i64>,
852 #[serde(rename = "ref")]
853 pub r#ref: Option<String>,
854 pub title: String,
855}
856
857#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
859pub struct CreateKeyOption {
860 pub key: String,
862 pub read_only: Option<bool>,
864 pub title: String,
866}
867
868#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
870pub struct CreateLabelOption {
871 pub color: String,
872 pub description: Option<String>,
873 pub exclusive: Option<bool>,
874 pub is_archived: Option<bool>,
875 pub name: String,
876}
877
878#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
880pub struct CreateMilestoneOption {
881 pub description: Option<String>,
882 #[serde(with = "time::serde::rfc3339::option")]
883 pub due_on: Option<time::OffsetDateTime>,
884 pub state: Option<CreateMilestoneOptionState>,
885 pub title: Option<String>,
886}
887
888#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
889pub enum CreateMilestoneOptionState {
890 #[serde(rename = "open")]
891 Open,
892 #[serde(rename = "closed")]
893 Closed,
894}
895#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
897pub struct CreateOAuth2ApplicationOptions {
898 pub confidential_client: Option<bool>,
899 pub name: Option<String>,
900 pub redirect_uris: Option<Vec<String>>,
901}
902
903#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
905pub struct CreateOrUpdateSecretOption {
906 pub data: String,
908}
909
910#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
912pub struct CreateOrgOption {
913 pub description: Option<String>,
914 pub email: Option<String>,
915 pub full_name: Option<String>,
916 pub location: Option<String>,
917 pub repo_admin_change_team_access: Option<bool>,
918 pub username: String,
919 pub visibility: Option<CreateOrgOptionVisibility>,
921 pub website: Option<String>,
922}
923
924#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
927pub enum CreateOrgOptionVisibility {
928 #[serde(rename = "public")]
929 Public,
930 #[serde(rename = "limited")]
931 Limited,
932 #[serde(rename = "private")]
933 Private,
934}
935#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
937pub struct CreatePullRequestOption {
938 pub assignee: Option<String>,
939 pub assignees: Option<Vec<String>>,
940 pub base: Option<String>,
941 pub body: Option<String>,
942 #[serde(with = "time::serde::rfc3339::option")]
943 pub due_date: Option<time::OffsetDateTime>,
944 pub head: Option<String>,
945 pub labels: Option<Vec<i64>>,
946 pub milestone: Option<i64>,
947 pub title: Option<String>,
948}
949
950#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
952pub struct CreatePullReviewComment {
953 pub body: Option<String>,
954 pub new_position: Option<i64>,
956 pub old_position: Option<i64>,
958 pub path: Option<String>,
960}
961
962#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
964pub struct CreatePullReviewOptions {
965 pub body: Option<String>,
966 pub comments: Option<Vec<CreatePullReviewComment>>,
967 pub commit_id: Option<String>,
968 pub event: Option<String>,
969}
970
971#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
972pub struct CreatePushMirrorOption {
973 pub branch_filter: Option<String>,
974 pub interval: Option<String>,
975 pub remote_address: Option<String>,
976 pub remote_password: Option<String>,
977 pub remote_username: Option<String>,
978 pub sync_on_commit: Option<bool>,
979 pub use_ssh: Option<bool>,
980}
981
982#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
984pub struct CreateQuotaGroupOptions {
985 pub name: Option<String>,
987 pub rules: Option<Vec<CreateQuotaRuleOptions>>,
991}
992
993#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
995pub struct CreateQuotaRuleOptions {
996 pub limit: Option<i64>,
998 pub name: Option<String>,
1000 pub subjects: Option<Vec<CreateQuotaRuleOptionsSubjects>>,
1002}
1003
1004#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1005pub enum CreateQuotaRuleOptionsSubjects {
1006 #[serde(rename = "none")]
1007 None,
1008 #[serde(rename = "size:all")]
1009 SizeAll,
1010 #[serde(rename = "size:repos:all")]
1011 SizeReposAll,
1012 #[serde(rename = "size:repos:public")]
1013 SizeReposPublic,
1014 #[serde(rename = "size:repos:private")]
1015 SizeReposPrivate,
1016 #[serde(rename = "size:git:all")]
1017 SizeGitAll,
1018 #[serde(rename = "size:git:lfs")]
1019 SizeGitLfs,
1020 #[serde(rename = "size:assets:all")]
1021 SizeAssetsAll,
1022 #[serde(rename = "size:assets:attachments:all")]
1023 SizeAssetsAttachmentsAll,
1024 #[serde(rename = "size:assets:attachments:issues")]
1025 SizeAssetsAttachmentsIssues,
1026 #[serde(rename = "size:assets:attachments:releases")]
1027 SizeAssetsAttachmentsReleases,
1028 #[serde(rename = "size:assets:artifacts")]
1029 SizeAssetsArtifacts,
1030 #[serde(rename = "size:assets:packages:all")]
1031 SizeAssetsPackagesAll,
1032 #[serde(rename = "size:assets:wiki")]
1033 SizeAssetsWiki,
1034}
1035#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1037pub struct CreateReleaseOption {
1038 pub body: Option<String>,
1039 pub draft: Option<bool>,
1040 pub hide_archive_links: Option<bool>,
1041 pub name: Option<String>,
1042 pub prerelease: Option<bool>,
1043 pub tag_name: String,
1044 pub target_commitish: Option<String>,
1045}
1046
1047#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1049pub struct CreateRepoOption {
1050 pub auto_init: Option<bool>,
1052 pub default_branch: Option<String>,
1054 pub description: Option<String>,
1056 pub gitignores: Option<String>,
1058 pub issue_labels: Option<String>,
1060 pub license: Option<String>,
1062 pub name: String,
1064 pub object_format_name: Option<ObjectFormatName>,
1065 pub private: Option<bool>,
1067 pub readme: Option<String>,
1069 pub template: Option<bool>,
1071 pub trust_model: Option<CreateRepoOptionTrustModel>,
1073}
1074
1075#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1078pub enum CreateRepoOptionTrustModel {
1079 #[serde(rename = "default")]
1080 Default,
1081 #[serde(rename = "collaborator")]
1082 Collaborator,
1083 #[serde(rename = "committer")]
1084 Committer,
1085 #[serde(rename = "collaboratorcommitter")]
1086 Collaboratorcommitter,
1087}
1088#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1090pub struct CreateStatusOption {
1091 pub context: Option<String>,
1092 pub description: Option<String>,
1093 pub state: Option<CommitStatusState>,
1094 #[serde(deserialize_with = "crate::none_if_blank_url")]
1095 pub target_url: Option<url::Url>,
1096}
1097
1098#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1100pub struct CreateTagOption {
1101 pub message: Option<String>,
1102 pub tag_name: String,
1103 pub target: Option<String>,
1104}
1105
1106#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1108pub struct CreateTagProtectionOption {
1109 pub name_pattern: Option<String>,
1110 pub whitelist_teams: Option<Vec<String>>,
1111 pub whitelist_usernames: Option<Vec<String>>,
1112}
1113
1114#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1116pub struct CreateTeamOption {
1117 pub can_create_org_repo: Option<bool>,
1118 pub description: Option<String>,
1119 pub includes_all_repositories: Option<bool>,
1120 pub name: String,
1121 pub permission: Option<CreateTeamOptionPermission>,
1122 pub units: Option<Vec<String>>,
1123 pub units_map: Option<BTreeMap<String, String>>,
1124}
1125
1126#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1127pub enum CreateTeamOptionPermission {
1128 #[serde(rename = "read")]
1129 Read,
1130 #[serde(rename = "write")]
1131 Write,
1132 #[serde(rename = "admin")]
1133 Admin,
1134}
1135#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1137pub struct CreateUserOption {
1138 #[serde(with = "time::serde::rfc3339::option")]
1139 pub created_at: Option<time::OffsetDateTime>,
1145 pub email: String,
1146 pub full_name: Option<String>,
1147 pub login_name: Option<String>,
1148 pub must_change_password: Option<bool>,
1149 pub password: Option<String>,
1150 pub restricted: Option<bool>,
1151 pub send_notify: Option<bool>,
1152 pub source_id: Option<i64>,
1153 pub username: String,
1154 pub visibility: Option<String>,
1155}
1156
1157#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1159pub struct CreateVariableOption {
1160 pub value: String,
1162}
1163
1164#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1166pub struct CreateWikiPageOptions {
1167 pub content_base64: Option<String>,
1169 pub message: Option<String>,
1171 pub title: Option<String>,
1173}
1174
1175#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1177pub struct Cron {
1178 pub exec_times: Option<i64>,
1179 pub name: Option<String>,
1180 #[serde(with = "time::serde::rfc3339::option")]
1181 pub next: Option<time::OffsetDateTime>,
1182 #[serde(with = "time::serde::rfc3339::option")]
1183 pub prev: Option<time::OffsetDateTime>,
1184 pub schedule: Option<String>,
1185}
1186
1187impl_from_response!(Cron);
1188
1189#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1190pub enum DefaultMergeStyle {
1191 #[serde(rename = "merge")]
1192 Merge,
1193 #[serde(rename = "rebase")]
1194 Rebase,
1195 #[serde(rename = "rebase-merge")]
1196 RebaseMerge,
1197 #[serde(rename = "squash")]
1198 Squash,
1199 #[serde(rename = "fast-forward-only")]
1200 FastForwardOnly,
1201}
1202#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1204pub struct DeleteEmailOption {
1205 pub emails: Option<Vec<String>>,
1207}
1208
1209#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1213pub struct DeleteFileOptions {
1214 pub author: Option<Identity>,
1215 pub branch: Option<String>,
1217 pub committer: Option<Identity>,
1218 pub dates: Option<CommitDateOptions>,
1219 pub message: Option<String>,
1221 pub new_branch: Option<String>,
1223 pub sha: String,
1225 pub signoff: Option<bool>,
1227}
1228
1229#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1231pub struct DeleteLabelsOption {
1232 #[serde(with = "time::serde::rfc3339::option")]
1233 pub updated_at: Option<time::OffsetDateTime>,
1234}
1235
1236#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1238pub struct DeployKey {
1239 #[serde(with = "time::serde::rfc3339::option")]
1240 pub created_at: Option<time::OffsetDateTime>,
1241 pub fingerprint: Option<String>,
1242 pub id: Option<i64>,
1243 pub key: Option<String>,
1244 pub key_id: Option<i64>,
1245 pub read_only: Option<bool>,
1246 pub repository: Option<Repository>,
1247 pub title: Option<String>,
1248 #[serde(deserialize_with = "crate::none_if_blank_url")]
1249 pub url: Option<url::Url>,
1250}
1251
1252impl_from_response!(DeployKey);
1253
1254#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1256pub struct DismissPullReviewOptions {
1257 pub message: Option<String>,
1258 pub priors: Option<bool>,
1259}
1260
1261#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1263pub struct DispatchWorkflowOption {
1264 pub inputs: Option<BTreeMap<String, String>>,
1266 #[serde(rename = "ref")]
1268 pub r#ref: String,
1269 pub return_run_info: Option<bool>,
1271}
1272
1273#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1275pub struct DispatchWorkflowRun {
1276 pub id: Option<i64>,
1278 pub jobs: Option<Vec<String>>,
1280 pub run_number: Option<i64>,
1282}
1283
1284impl_from_response!(DispatchWorkflowRun);
1285
1286#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1288pub struct EditAttachmentOptions {
1289 #[serde(deserialize_with = "crate::none_if_blank_url")]
1290 pub browser_download_url: Option<url::Url>,
1292 pub name: Option<String>,
1293}
1294
1295#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1297pub struct EditBranchProtectionOption {
1298 pub apply_to_admins: Option<bool>,
1299 pub approvals_whitelist_teams: Option<Vec<String>>,
1300 pub approvals_whitelist_username: Option<Vec<String>>,
1301 pub block_on_official_review_requests: Option<bool>,
1302 pub block_on_outdated_branch: Option<bool>,
1303 pub block_on_rejected_reviews: Option<bool>,
1304 pub dismiss_stale_approvals: Option<bool>,
1305 pub enable_approvals_whitelist: Option<bool>,
1306 pub enable_merge_whitelist: Option<bool>,
1307 pub enable_push: Option<bool>,
1308 pub enable_push_whitelist: Option<bool>,
1309 pub enable_status_check: Option<bool>,
1310 pub ignore_stale_approvals: Option<bool>,
1311 pub merge_whitelist_teams: Option<Vec<String>>,
1312 pub merge_whitelist_usernames: Option<Vec<String>>,
1313 pub protected_file_patterns: Option<String>,
1314 pub push_whitelist_deploy_keys: Option<bool>,
1315 pub push_whitelist_teams: Option<Vec<String>>,
1316 pub push_whitelist_usernames: Option<Vec<String>>,
1317 pub require_signed_commits: Option<bool>,
1318 pub required_approvals: Option<i64>,
1319 pub status_check_contexts: Option<Vec<String>>,
1320 pub unprotected_file_patterns: Option<String>,
1321}
1322
1323#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1325pub struct EditDeadlineOption {
1326 #[serde(with = "time::serde::rfc3339")]
1327 pub due_date: time::OffsetDateTime,
1328}
1329
1330#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1332pub struct EditGitHookOption {
1333 pub content: Option<String>,
1334}
1335
1336#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1338pub struct EditHookOption {
1339 pub active: Option<bool>,
1340 pub authorization_header: Option<String>,
1341 pub branch_filter: Option<String>,
1342 pub config: Option<BTreeMap<String, String>>,
1343 pub events: Option<Vec<String>>,
1344}
1345
1346#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1348pub struct EditIssueCommentOption {
1349 pub body: String,
1350 #[serde(with = "time::serde::rfc3339::option")]
1351 pub updated_at: Option<time::OffsetDateTime>,
1352}
1353
1354#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1356pub struct EditIssueOption {
1357 pub assignee: Option<String>,
1359 pub assignees: Option<Vec<String>>,
1360 pub body: Option<String>,
1361 #[serde(with = "time::serde::rfc3339::option")]
1362 pub due_date: Option<time::OffsetDateTime>,
1363 pub milestone: Option<i64>,
1364 #[serde(rename = "ref")]
1365 pub r#ref: Option<String>,
1366 pub state: Option<String>,
1367 pub title: Option<String>,
1368 pub unset_due_date: Option<bool>,
1369 #[serde(with = "time::serde::rfc3339::option")]
1370 pub updated_at: Option<time::OffsetDateTime>,
1371}
1372
1373#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1375pub struct EditLabelOption {
1376 pub color: Option<String>,
1377 pub description: Option<String>,
1378 pub exclusive: Option<bool>,
1379 pub is_archived: Option<bool>,
1380 pub name: Option<String>,
1381}
1382
1383#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1385pub struct EditMilestoneOption {
1386 pub description: Option<String>,
1387 #[serde(with = "time::serde::rfc3339::option")]
1388 pub due_on: Option<time::OffsetDateTime>,
1389 pub state: Option<String>,
1390 pub title: Option<String>,
1391}
1392
1393#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1395pub struct EditOrgOption {
1396 pub description: Option<String>,
1397 pub email: Option<String>,
1398 pub full_name: Option<String>,
1399 pub location: Option<String>,
1400 pub repo_admin_change_team_access: Option<bool>,
1401 pub visibility: Option<EditOrgOptionVisibility>,
1403 pub website: Option<String>,
1404}
1405
1406#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1409pub enum EditOrgOptionVisibility {
1410 #[serde(rename = "public")]
1411 Public,
1412 #[serde(rename = "limited")]
1413 Limited,
1414 #[serde(rename = "private")]
1415 Private,
1416}
1417#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1419pub struct EditPullRequestOption {
1420 pub allow_maintainer_edit: Option<bool>,
1421 pub assignee: Option<String>,
1422 pub assignees: Option<Vec<String>>,
1423 pub base: Option<String>,
1424 pub body: Option<String>,
1425 #[serde(with = "time::serde::rfc3339::option")]
1426 pub due_date: Option<time::OffsetDateTime>,
1427 pub labels: Option<Vec<i64>>,
1428 pub milestone: Option<i64>,
1429 pub state: Option<String>,
1430 pub title: Option<String>,
1431 pub unset_due_date: Option<bool>,
1432}
1433
1434#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1436pub struct EditQuotaRuleOptions {
1437 pub limit: Option<i64>,
1439 pub subjects: Option<Vec<String>>,
1441}
1442
1443#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1445pub struct EditReactionOption {
1446 pub content: Option<String>,
1447}
1448
1449#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1451pub struct EditReleaseOption {
1452 pub body: Option<String>,
1453 pub draft: Option<bool>,
1454 pub hide_archive_links: Option<bool>,
1455 pub name: Option<String>,
1456 pub prerelease: Option<bool>,
1457 pub tag_name: Option<String>,
1458 pub target_commitish: Option<String>,
1459}
1460
1461#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1463pub struct EditRepoOption {
1464 pub allow_fast_forward_only_merge: Option<bool>,
1466 pub allow_manual_merge: Option<bool>,
1468 pub allow_merge_commits: Option<bool>,
1470 pub allow_rebase: Option<bool>,
1472 pub allow_rebase_explicit: Option<bool>,
1474 pub allow_rebase_update: Option<bool>,
1476 pub allow_squash_merge: Option<bool>,
1478 pub archived: Option<bool>,
1480 pub autodetect_manual_merge: Option<bool>,
1482 pub default_allow_maintainer_edit: Option<bool>,
1484 pub default_branch: Option<String>,
1486 pub default_delete_branch_after_merge: Option<bool>,
1488 pub default_merge_style: Option<DefaultMergeStyle>,
1489 pub default_update_style: Option<String>,
1491 pub description: Option<String>,
1493 pub enable_prune: Option<bool>,
1495 pub external_tracker: Option<ExternalTracker>,
1496 pub external_wiki: Option<ExternalWiki>,
1497 pub globally_editable_wiki: Option<bool>,
1499 pub has_actions: Option<bool>,
1501 pub has_issues: Option<bool>,
1503 pub has_packages: Option<bool>,
1505 pub has_projects: Option<bool>,
1507 pub has_pull_requests: Option<bool>,
1509 pub has_releases: Option<bool>,
1511 pub has_wiki: Option<bool>,
1513 pub ignore_whitespace_conflicts: Option<bool>,
1515 pub internal_tracker: Option<InternalTracker>,
1516 pub mirror_interval: Option<String>,
1518 pub name: Option<String>,
1520 pub private: Option<bool>,
1526 pub template: Option<bool>,
1528 pub website: Option<String>,
1530 pub wiki_branch: Option<String>,
1532}
1533
1534#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1536pub struct EditTagProtectionOption {
1537 pub name_pattern: Option<String>,
1538 pub whitelist_teams: Option<Vec<String>>,
1539 pub whitelist_usernames: Option<Vec<String>>,
1540}
1541
1542#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1544pub struct EditTeamOption {
1545 pub can_create_org_repo: Option<bool>,
1546 pub description: Option<String>,
1547 pub includes_all_repositories: Option<bool>,
1548 pub name: String,
1549 pub permission: Option<EditTeamOptionPermission>,
1550 pub units: Option<Vec<String>>,
1551 pub units_map: Option<BTreeMap<String, String>>,
1552}
1553
1554#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1555pub enum EditTeamOptionPermission {
1556 #[serde(rename = "read")]
1557 Read,
1558 #[serde(rename = "write")]
1559 Write,
1560 #[serde(rename = "admin")]
1561 Admin,
1562}
1563#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1565pub struct EditUserOption {
1566 pub active: Option<bool>,
1567 pub admin: Option<bool>,
1568 pub allow_create_organization: Option<bool>,
1569 pub allow_git_hook: Option<bool>,
1570 pub allow_import_local: Option<bool>,
1571 pub description: Option<String>,
1572 pub email: Option<String>,
1573 pub full_name: Option<String>,
1574 pub hide_email: Option<bool>,
1575 pub location: Option<String>,
1576 pub login_name: Option<String>,
1577 pub max_repo_creation: Option<i64>,
1578 pub must_change_password: Option<bool>,
1579 pub password: Option<String>,
1580 pub prohibit_login: Option<bool>,
1581 pub pronouns: Option<String>,
1582 pub restricted: Option<bool>,
1583 pub source_id: Option<i64>,
1584 pub visibility: Option<String>,
1585 pub website: Option<String>,
1586}
1587
1588#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1590pub struct Email {
1591 pub email: Option<String>,
1592 pub primary: Option<bool>,
1593 pub user_id: Option<i64>,
1594 pub username: Option<String>,
1595 pub verified: Option<bool>,
1596}
1597
1598impl_from_response!(Email);
1599
1600#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1602pub struct ExternalTracker {
1603 pub external_tracker_format: Option<String>,
1605 pub external_tracker_regexp_pattern: Option<String>,
1607 pub external_tracker_style: Option<String>,
1609 #[serde(deserialize_with = "crate::none_if_blank_url")]
1610 pub external_tracker_url: Option<url::Url>,
1612}
1613
1614#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1616pub struct ExternalWiki {
1617 #[serde(deserialize_with = "crate::none_if_blank_url")]
1618 pub external_wiki_url: Option<url::Url>,
1620}
1621
1622#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1623pub struct FileCommitResponse {
1624 pub author: Option<CommitUser>,
1625 pub committer: Option<CommitUser>,
1626 #[serde(with = "time::serde::rfc3339::option")]
1627 pub created: Option<time::OffsetDateTime>,
1628 #[serde(deserialize_with = "crate::none_if_blank_url")]
1629 pub html_url: Option<url::Url>,
1630 pub message: Option<String>,
1631 pub parents: Option<Vec<CommitMeta>>,
1632 pub sha: Option<String>,
1633 pub tree: Option<CommitMeta>,
1634 #[serde(deserialize_with = "crate::none_if_blank_url")]
1635 pub url: Option<url::Url>,
1636}
1637
1638#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1640pub struct FileDeleteResponse {
1641 pub commit: Option<FileCommitResponse>,
1642 pub content: Option<serde_json::Value>,
1643 pub verification: Option<PayloadCommitVerification>,
1644}
1645
1646impl_from_response!(FileDeleteResponse);
1647
1648#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1650pub struct FileLinksResponse {
1651 pub git: Option<String>,
1652 pub html: Option<String>,
1653 #[serde(rename = "self")]
1654 pub this: Option<String>,
1655}
1656
1657#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1659pub struct FileResponse {
1660 pub commit: Option<FileCommitResponse>,
1661 pub content: Option<ContentsResponse>,
1662 pub verification: Option<PayloadCommitVerification>,
1663}
1664
1665impl_from_response!(FileResponse);
1666
1667#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1669pub struct FilesResponse {
1670 pub commit: Option<FileCommitResponse>,
1671 pub files: Option<Vec<ContentsResponse>>,
1672 pub verification: Option<PayloadCommitVerification>,
1673}
1674
1675impl_from_response!(FilesResponse);
1676
1677#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1679pub struct ForgeLike {}
1680
1681#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1683pub struct ForgeOutbox {}
1684
1685impl_from_response!(ForgeOutbox);
1686
1687#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1689pub struct GPGKey {
1690 pub can_certify: Option<bool>,
1691 pub can_encrypt_comms: Option<bool>,
1692 pub can_encrypt_storage: Option<bool>,
1693 pub can_sign: Option<bool>,
1694 #[serde(with = "time::serde::rfc3339::option")]
1695 pub created_at: Option<time::OffsetDateTime>,
1696 pub emails: Option<Vec<GPGKeyEmail>>,
1697 #[serde(with = "time::serde::rfc3339::option")]
1698 pub expires_at: Option<time::OffsetDateTime>,
1699 pub id: Option<i64>,
1700 pub key_id: Option<String>,
1701 pub primary_key_id: Option<String>,
1702 pub public_key: Option<String>,
1703 pub subkeys: Option<Vec<GPGKey>>,
1704 pub verified: Option<bool>,
1705}
1706
1707impl_from_response!(GPGKey);
1708
1709#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1711pub struct GPGKeyEmail {
1712 pub email: Option<String>,
1713 pub verified: Option<bool>,
1714}
1715
1716#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1718pub struct GeneralAPISettings {
1719 pub default_git_trees_per_page: Option<i64>,
1720 pub default_max_blob_size: Option<i64>,
1721 pub default_paging_num: Option<i64>,
1722 pub max_response_items: Option<i64>,
1723}
1724
1725impl_from_response!(GeneralAPISettings);
1726
1727#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1729pub struct GeneralAttachmentSettings {
1730 pub allowed_types: Option<String>,
1731 pub enabled: Option<bool>,
1732 pub max_files: Option<i64>,
1733 pub max_size: Option<i64>,
1734}
1735
1736impl_from_response!(GeneralAttachmentSettings);
1737
1738#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1740pub struct GeneralRepoSettings {
1741 pub forks_disabled: Option<bool>,
1742 pub http_git_disabled: Option<bool>,
1743 pub lfs_disabled: Option<bool>,
1744 pub migrations_disabled: Option<bool>,
1745 pub mirrors_disabled: Option<bool>,
1746 pub stars_disabled: Option<bool>,
1747 pub time_tracking_disabled: Option<bool>,
1748}
1749
1750impl_from_response!(GeneralRepoSettings);
1751
1752#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1754pub struct GeneralUISettings {
1755 pub allowed_reactions: Option<Vec<String>>,
1756 pub custom_emojis: Option<Vec<String>>,
1757 pub default_theme: Option<String>,
1758}
1759
1760impl_from_response!(GeneralUISettings);
1761
1762#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1764pub struct GenerateRepoOption {
1765 pub avatar: Option<bool>,
1767 pub default_branch: Option<String>,
1769 pub description: Option<String>,
1771 pub git_content: Option<bool>,
1773 pub git_hooks: Option<bool>,
1775 pub labels: Option<bool>,
1777 pub name: String,
1779 pub owner: String,
1781 pub private: Option<bool>,
1783 pub protected_branch: Option<bool>,
1785 pub topics: Option<bool>,
1787 pub webhooks: Option<bool>,
1789}
1790
1791#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1793pub struct GitBlob {
1794 pub content: Option<String>,
1795 pub encoding: Option<String>,
1796 pub sha: Option<String>,
1797 pub size: Option<i64>,
1798 #[serde(deserialize_with = "crate::none_if_blank_url")]
1799 pub url: Option<url::Url>,
1800}
1801
1802impl_from_response!(GitBlob);
1803
1804#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1806pub struct GitEntry {
1807 pub mode: Option<String>,
1808 pub path: Option<String>,
1809 pub sha: Option<String>,
1810 pub size: Option<i64>,
1811 #[serde(rename = "type")]
1812 pub r#type: Option<String>,
1813 #[serde(deserialize_with = "crate::none_if_blank_url")]
1814 pub url: Option<url::Url>,
1815}
1816
1817#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1819pub struct GitHook {
1820 pub content: Option<String>,
1821 pub is_active: Option<bool>,
1822 pub name: Option<String>,
1823}
1824
1825impl_from_response!(GitHook);
1826
1827#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1828pub struct GitObject {
1829 pub sha: Option<String>,
1830 #[serde(rename = "type")]
1831 pub r#type: Option<String>,
1832 #[serde(deserialize_with = "crate::none_if_blank_url")]
1833 pub url: Option<url::Url>,
1834}
1835
1836#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1838pub struct GitTreeResponse {
1839 pub page: Option<i64>,
1840 pub sha: Option<String>,
1841 pub total_count: Option<i64>,
1842 pub tree: Option<Vec<GitEntry>>,
1843 pub truncated: Option<bool>,
1844 #[serde(deserialize_with = "crate::none_if_blank_url")]
1845 pub url: Option<url::Url>,
1846}
1847
1848impl_from_response!(GitTreeResponse);
1849
1850#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1852pub struct GitignoreTemplateInfo {
1853 pub name: Option<String>,
1854 pub source: Option<String>,
1855}
1856
1857impl_from_response!(GitignoreTemplateInfo);
1858
1859#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1861pub struct Hook {
1862 pub active: Option<bool>,
1863 pub authorization_header: Option<String>,
1864 pub branch_filter: Option<String>,
1865 pub config: Option<BTreeMap<String, String>>,
1867 pub content_type: Option<String>,
1868 #[serde(with = "time::serde::rfc3339::option")]
1869 pub created_at: Option<time::OffsetDateTime>,
1870 pub events: Option<Vec<String>>,
1871 pub id: Option<i64>,
1872 pub metadata: Option<serde_json::Value>,
1873 #[serde(rename = "type")]
1874 pub r#type: Option<String>,
1875 #[serde(with = "time::serde::rfc3339::option")]
1876 pub updated_at: Option<time::OffsetDateTime>,
1877 #[serde(deserialize_with = "crate::none_if_blank_url")]
1878 pub url: Option<url::Url>,
1879}
1880
1881impl_from_response!(Hook);
1882
1883#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1885pub struct Identity {
1886 pub email: Option<String>,
1887 pub name: Option<String>,
1888}
1889
1890#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1892pub struct InternalTracker {
1893 pub allow_only_contributors_to_track_time: Option<bool>,
1895 pub enable_issue_dependencies: Option<bool>,
1897 pub enable_time_tracker: Option<bool>,
1899}
1900
1901#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1903pub struct Issue {
1904 pub assets: Option<Vec<Attachment>>,
1905 pub assignee: Option<User>,
1906 pub assignees: Option<Vec<User>>,
1907 pub body: Option<String>,
1908 #[serde(with = "time::serde::rfc3339::option")]
1909 pub closed_at: Option<time::OffsetDateTime>,
1910 pub comments: Option<i64>,
1911 #[serde(with = "time::serde::rfc3339::option")]
1912 pub created_at: Option<time::OffsetDateTime>,
1913 #[serde(with = "time::serde::rfc3339::option")]
1914 pub due_date: Option<time::OffsetDateTime>,
1915 #[serde(deserialize_with = "crate::none_if_blank_url")]
1916 pub html_url: Option<url::Url>,
1917 pub id: Option<i64>,
1918 pub is_locked: Option<bool>,
1919 pub labels: Option<Vec<Label>>,
1920 pub milestone: Option<Milestone>,
1921 pub number: Option<i64>,
1922 pub original_author: Option<String>,
1923 pub original_author_id: Option<i64>,
1924 pub pin_order: Option<i64>,
1925 pub pull_request: Option<PullRequestMeta>,
1926 #[serde(rename = "ref")]
1927 pub r#ref: Option<String>,
1928 pub repository: Option<RepositoryMeta>,
1929 pub state: Option<StateType>,
1930 pub title: Option<String>,
1931 #[serde(with = "time::serde::rfc3339::option")]
1932 pub updated_at: Option<time::OffsetDateTime>,
1933 #[serde(deserialize_with = "crate::none_if_blank_url")]
1934 pub url: Option<url::Url>,
1935 pub user: Option<User>,
1936}
1937
1938impl_from_response!(Issue);
1939
1940#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1941pub struct IssueConfig {
1942 pub blank_issues_enabled: Option<bool>,
1943 pub contact_links: Option<Vec<IssueConfigContactLink>>,
1944}
1945
1946impl_from_response!(IssueConfig);
1947
1948#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1949pub struct IssueConfigContactLink {
1950 pub about: Option<String>,
1951 pub name: Option<String>,
1952 #[serde(deserialize_with = "crate::none_if_blank_url")]
1953 pub url: Option<url::Url>,
1954}
1955
1956#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1957pub struct IssueConfigValidation {
1958 pub message: Option<String>,
1959 pub valid: Option<bool>,
1960}
1961
1962impl_from_response!(IssueConfigValidation);
1963
1964#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1966pub struct IssueDeadline {
1967 #[serde(with = "time::serde::rfc3339::option")]
1968 pub due_date: Option<time::OffsetDateTime>,
1969}
1970
1971impl_from_response!(IssueDeadline);
1972
1973#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1975pub struct IssueFormField {
1976 pub attributes: Option<BTreeMap<String, serde_json::Value>>,
1977 pub id: Option<String>,
1978 #[serde(rename = "type")]
1979 pub r#type: Option<IssueFormFieldType>,
1980 pub validations: Option<BTreeMap<String, serde_json::Value>>,
1981 pub visible: Option<Vec<String>>,
1982}
1983
1984#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1985pub enum IssueFormFieldType {
1986 #[serde(rename = "markdown")]
1987 Markdown,
1988 #[serde(rename = "textarea")]
1989 Textarea,
1990 #[serde(rename = "input")]
1991 Input,
1992 #[serde(rename = "dropdown")]
1993 Dropdown,
1994 #[serde(rename = "checkboxes")]
1995 Checkboxes,
1996}
1997#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1999pub struct IssueLabelsOption {
2000 pub labels: Option<Vec<serde_json::Value>>,
2004 #[serde(with = "time::serde::rfc3339::option")]
2005 pub updated_at: Option<time::OffsetDateTime>,
2006}
2007
2008#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2010pub struct IssueMeta {
2011 pub index: Option<i64>,
2012 pub owner: Option<String>,
2013 pub repo: Option<String>,
2014}
2015
2016#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2018pub struct IssueTemplate {
2019 pub about: Option<String>,
2020 pub body: Option<Vec<IssueFormField>>,
2021 pub content: Option<String>,
2022 pub file_name: Option<String>,
2023 pub labels: Option<Vec<String>>,
2024 pub name: Option<String>,
2025 #[serde(rename = "ref")]
2026 pub r#ref: Option<String>,
2027 pub title: Option<String>,
2028}
2029
2030impl_from_response!(IssueTemplate);
2031
2032#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2034pub struct Label {
2035 pub color: Option<String>,
2036 pub description: Option<String>,
2037 pub exclusive: Option<bool>,
2038 pub id: Option<i64>,
2039 pub is_archived: Option<bool>,
2040 pub name: Option<String>,
2041 #[serde(deserialize_with = "crate::none_if_blank_url")]
2042 pub url: Option<url::Url>,
2043}
2044
2045impl_from_response!(Label);
2046
2047#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2049pub struct LabelTemplate {
2050 pub color: Option<String>,
2051 pub description: Option<String>,
2052 pub exclusive: Option<bool>,
2053 pub name: Option<String>,
2054}
2055
2056impl_from_response!(LabelTemplate);
2057
2058#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2060pub struct LicenseTemplateInfo {
2061 pub body: Option<String>,
2062 pub implementation: Option<String>,
2063 pub key: Option<String>,
2064 pub name: Option<String>,
2065 #[serde(deserialize_with = "crate::none_if_blank_url")]
2066 pub url: Option<url::Url>,
2067}
2068
2069impl_from_response!(LicenseTemplateInfo);
2070
2071#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2073pub struct LicensesTemplateListEntry {
2074 pub key: Option<String>,
2075 pub name: Option<String>,
2076 #[serde(deserialize_with = "crate::none_if_blank_url")]
2077 pub url: Option<url::Url>,
2078}
2079
2080impl_from_response!(LicensesTemplateListEntry);
2081
2082#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2084pub struct ListActionRunResponse {
2085 pub total_count: Option<i64>,
2086 pub workflow_runs: Option<Vec<ActionRun>>,
2087}
2088
2089impl_from_response!(ListActionRunResponse);
2090
2091#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2093pub struct MarkdownOption {
2094 #[serde(rename = "Context")]
2100 pub context: Option<String>,
2101 #[serde(rename = "Mode")]
2107 pub mode: Option<String>,
2108 #[serde(rename = "Text")]
2114 pub text: Option<String>,
2115 #[serde(rename = "Wiki")]
2121 pub wiki: Option<bool>,
2122}
2123
2124#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2126pub struct MarkupOption {
2127 #[serde(rename = "BranchPath")]
2133 pub branch_path: Option<String>,
2134 #[serde(rename = "Context")]
2140 pub context: Option<String>,
2141 #[serde(rename = "FilePath")]
2147 pub file_path: Option<String>,
2148 #[serde(rename = "Mode")]
2154 pub mode: Option<String>,
2155 #[serde(rename = "Text")]
2161 pub text: Option<String>,
2162 #[serde(rename = "Wiki")]
2168 pub wiki: Option<bool>,
2169}
2170
2171#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2173pub struct MergePullRequestOption {
2174 #[serde(rename = "Do")]
2175 pub r#do: MergePullRequestOptionDo,
2176 #[serde(rename = "MergeCommitID")]
2177 pub merge_commit_id: Option<String>,
2178 #[serde(rename = "MergeMessageField")]
2179 pub merge_message_field: Option<String>,
2180 #[serde(rename = "MergeTitleField")]
2181 pub merge_title_field: Option<String>,
2182 pub delete_branch_after_merge: Option<bool>,
2183 pub force_merge: Option<bool>,
2184 pub head_commit_id: Option<String>,
2185 pub merge_when_checks_succeed: Option<bool>,
2186}
2187
2188#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2189pub enum MergePullRequestOptionDo {
2190 #[serde(rename = "merge")]
2191 Merge,
2192 #[serde(rename = "rebase")]
2193 Rebase,
2194 #[serde(rename = "rebase-merge")]
2195 RebaseMerge,
2196 #[serde(rename = "squash")]
2197 Squash,
2198 #[serde(rename = "fast-forward-only")]
2199 FastForwardOnly,
2200 #[serde(rename = "manually-merged")]
2201 ManuallyMerged,
2202}
2203#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2207pub struct MigrateRepoOptions {
2208 pub auth_password: Option<String>,
2209 pub auth_token: Option<String>,
2210 pub auth_username: Option<String>,
2211 pub clone_addr: String,
2212 pub description: Option<String>,
2213 pub issues: Option<bool>,
2214 pub labels: Option<bool>,
2215 pub lfs: Option<bool>,
2216 pub lfs_endpoint: Option<String>,
2217 pub milestones: Option<bool>,
2218 pub mirror: Option<bool>,
2219 pub mirror_interval: Option<String>,
2220 pub private: Option<bool>,
2221 pub pull_requests: Option<bool>,
2222 pub releases: Option<bool>,
2223 pub repo_name: String,
2224 pub repo_owner: Option<String>,
2226 pub service: Option<MigrateRepoOptionsService>,
2227 pub uid: Option<i64>,
2229 pub wiki: Option<bool>,
2230}
2231
2232#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2233pub enum MigrateRepoOptionsService {
2234 #[serde(rename = "git")]
2235 Git,
2236 #[serde(rename = "github")]
2237 Github,
2238 #[serde(rename = "gitea")]
2239 Gitea,
2240 #[serde(rename = "gitlab")]
2241 Gitlab,
2242 #[serde(rename = "gogs")]
2243 Gogs,
2244 #[serde(rename = "onedev")]
2245 Onedev,
2246 #[serde(rename = "gitbucket")]
2247 Gitbucket,
2248 #[serde(rename = "codebase")]
2249 Codebase,
2250}
2251#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2253pub struct Milestone {
2254 #[serde(with = "time::serde::rfc3339::option")]
2255 pub closed_at: Option<time::OffsetDateTime>,
2256 pub closed_issues: Option<i64>,
2257 #[serde(with = "time::serde::rfc3339::option")]
2258 pub created_at: Option<time::OffsetDateTime>,
2259 pub description: Option<String>,
2260 #[serde(with = "time::serde::rfc3339::option")]
2261 pub due_on: Option<time::OffsetDateTime>,
2262 pub id: Option<i64>,
2263 pub open_issues: Option<i64>,
2264 pub state: Option<StateType>,
2265 pub title: Option<String>,
2266 #[serde(with = "time::serde::rfc3339::option")]
2267 pub updated_at: Option<time::OffsetDateTime>,
2268}
2269
2270impl_from_response!(Milestone);
2271
2272#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2274pub struct NewIssuePinsAllowed {
2275 pub issues: Option<bool>,
2276 pub pull_requests: Option<bool>,
2277}
2278
2279impl_from_response!(NewIssuePinsAllowed);
2280
2281#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2283pub struct NodeInfo {
2284 pub metadata: Option<BTreeMap<String, serde_json::Value>>,
2285 #[serde(rename = "openRegistrations")]
2286 pub open_registrations: Option<bool>,
2287 pub protocols: Option<Vec<String>>,
2288 pub services: Option<NodeInfoServices>,
2289 pub software: Option<NodeInfoSoftware>,
2290 pub usage: Option<NodeInfoUsage>,
2291 pub version: Option<String>,
2292}
2293
2294impl_from_response!(NodeInfo);
2295
2296#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2298pub struct NodeInfoServices {
2299 pub inbound: Option<Vec<String>>,
2300 pub outbound: Option<Vec<String>>,
2301}
2302
2303#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2305pub struct NodeInfoSoftware {
2306 pub homepage: Option<String>,
2307 pub name: Option<String>,
2308 pub repository: Option<String>,
2309 pub version: Option<String>,
2310}
2311
2312#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2314pub struct NodeInfoUsage {
2315 #[serde(rename = "localComments")]
2316 pub local_comments: Option<i64>,
2317 #[serde(rename = "localPosts")]
2318 pub local_posts: Option<i64>,
2319 pub users: Option<NodeInfoUsageUsers>,
2320}
2321
2322#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2324pub struct NodeInfoUsageUsers {
2325 #[serde(rename = "activeHalfyear")]
2326 pub active_halfyear: Option<i64>,
2327 #[serde(rename = "activeMonth")]
2328 pub active_month: Option<i64>,
2329 pub total: Option<i64>,
2330}
2331
2332#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2334pub struct Note {
2335 pub commit: Option<Commit>,
2336 pub message: Option<String>,
2337}
2338
2339impl_from_response!(Note);
2340
2341#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2342pub struct NoteOptions {
2343 pub message: Option<String>,
2344}
2345
2346#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2348pub struct NotificationCount {
2349 pub new: Option<i64>,
2350}
2351
2352impl_from_response!(NotificationCount);
2353
2354#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2356pub struct NotificationSubject {
2357 #[serde(deserialize_with = "crate::none_if_blank_url")]
2358 pub html_url: Option<url::Url>,
2359 #[serde(deserialize_with = "crate::none_if_blank_url")]
2360 pub latest_comment_html_url: Option<url::Url>,
2361 #[serde(deserialize_with = "crate::none_if_blank_url")]
2362 pub latest_comment_url: Option<url::Url>,
2363 pub state: Option<StateType>,
2364 pub title: Option<String>,
2365 #[serde(rename = "type")]
2366 pub r#type: Option<NotifySubjectType>,
2367 #[serde(deserialize_with = "crate::none_if_blank_url")]
2368 pub url: Option<url::Url>,
2369}
2370
2371#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2373pub struct NotificationThread {
2374 pub id: Option<i64>,
2375 pub pinned: Option<bool>,
2376 pub repository: Option<Repository>,
2377 pub subject: Option<NotificationSubject>,
2378 pub unread: Option<bool>,
2379 #[serde(with = "time::serde::rfc3339::option")]
2380 pub updated_at: Option<time::OffsetDateTime>,
2381 #[serde(deserialize_with = "crate::none_if_blank_url")]
2382 pub url: Option<url::Url>,
2383}
2384
2385impl_from_response!(NotificationThread);
2386
2387#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2390pub enum NotifySubjectType {
2391 #[serde(rename = "Issue")]
2392 Issue,
2393 #[serde(rename = "Pull")]
2394 Pull,
2395 #[serde(rename = "Commit")]
2396 Commit,
2397 #[serde(rename = "Repository")]
2398 Repository,
2399}
2400#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2401pub struct OAuth2Application {
2402 pub client_id: Option<String>,
2403 pub client_secret: Option<String>,
2404 pub confidential_client: Option<bool>,
2405 #[serde(with = "time::serde::rfc3339::option")]
2406 pub created: Option<time::OffsetDateTime>,
2407 pub id: Option<i64>,
2408 pub name: Option<String>,
2409 pub redirect_uris: Option<Vec<String>>,
2410}
2411
2412impl_from_response!(OAuth2Application);
2413
2414#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2417pub enum ObjectFormatName {
2418 #[serde(rename = "sha1")]
2419 Sha1,
2420 #[serde(rename = "sha256")]
2421 Sha256,
2422}
2423#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2425pub struct Organization {
2426 #[serde(deserialize_with = "crate::none_if_blank_url")]
2427 pub avatar_url: Option<url::Url>,
2428 pub description: Option<String>,
2429 pub email: Option<String>,
2430 pub full_name: Option<String>,
2431 pub id: Option<i64>,
2432 pub location: Option<String>,
2433 pub name: Option<String>,
2434 pub repo_admin_change_team_access: Option<bool>,
2435 pub username: Option<String>,
2437 pub visibility: Option<String>,
2438 pub website: Option<String>,
2439}
2440
2441impl_from_response!(Organization);
2442
2443#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2445pub struct OrganizationPermissions {
2446 pub can_create_repository: Option<bool>,
2447 pub can_read: Option<bool>,
2448 pub can_write: Option<bool>,
2449 pub is_admin: Option<bool>,
2450 pub is_owner: Option<bool>,
2451}
2452
2453impl_from_response!(OrganizationPermissions);
2454
2455#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2457pub struct PRBranchInfo {
2458 pub label: Option<String>,
2459 #[serde(rename = "ref")]
2460 pub r#ref: Option<String>,
2461 pub repo: Option<Repository>,
2462 pub repo_id: Option<i64>,
2463 pub sha: Option<String>,
2464}
2465
2466#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2468pub struct Package {
2469 #[serde(with = "time::serde::rfc3339::option")]
2470 pub created_at: Option<time::OffsetDateTime>,
2471 pub creator: Option<User>,
2472 #[serde(deserialize_with = "crate::none_if_blank_url")]
2473 pub html_url: Option<url::Url>,
2474 pub id: Option<i64>,
2475 pub name: Option<String>,
2476 pub owner: Option<User>,
2477 pub repository: Option<Repository>,
2478 #[serde(rename = "type")]
2479 pub r#type: Option<String>,
2480 pub version: Option<String>,
2481}
2482
2483impl_from_response!(Package);
2484
2485#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2487pub struct PackageFile {
2488 #[serde(rename = "Size")]
2489 pub size: Option<i64>,
2490 pub id: Option<i64>,
2491 pub md5: Option<String>,
2492 pub name: Option<String>,
2493 pub sha1: Option<String>,
2494 pub sha256: Option<String>,
2495 pub sha512: Option<String>,
2496}
2497
2498impl_from_response!(PackageFile);
2499
2500#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2502pub struct PayloadCommit {
2503 pub added: Option<Vec<String>>,
2504 pub author: Option<PayloadUser>,
2505 pub committer: Option<PayloadUser>,
2506 pub id: Option<String>,
2508 pub message: Option<String>,
2509 pub modified: Option<Vec<String>>,
2510 pub removed: Option<Vec<String>>,
2511 #[serde(with = "time::serde::rfc3339::option")]
2512 pub timestamp: Option<time::OffsetDateTime>,
2513 #[serde(deserialize_with = "crate::none_if_blank_url")]
2514 pub url: Option<url::Url>,
2515 pub verification: Option<PayloadCommitVerification>,
2516}
2517
2518#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2520pub struct PayloadCommitVerification {
2521 pub payload: Option<String>,
2522 pub reason: Option<String>,
2523 pub signature: Option<String>,
2524 pub signer: Option<PayloadUser>,
2525 pub verified: Option<bool>,
2526}
2527
2528#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2530pub struct PayloadUser {
2531 pub email: Option<String>,
2532 pub name: Option<String>,
2534 pub username: Option<String>,
2535}
2536
2537#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2539pub struct Permission {
2540 pub admin: Option<bool>,
2541 pub pull: Option<bool>,
2542 pub push: Option<bool>,
2543}
2544
2545#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2547pub struct PublicKey {
2548 #[serde(with = "time::serde::rfc3339::option")]
2549 pub created_at: Option<time::OffsetDateTime>,
2550 pub fingerprint: Option<String>,
2551 pub id: Option<i64>,
2552 pub key: Option<String>,
2553 pub key_type: Option<String>,
2554 pub read_only: Option<bool>,
2555 pub title: Option<String>,
2556 #[serde(deserialize_with = "crate::none_if_blank_url")]
2557 pub url: Option<url::Url>,
2558 pub user: Option<User>,
2559}
2560
2561impl_from_response!(PublicKey);
2562
2563#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2565pub struct PullRequest {
2566 pub additions: Option<i64>,
2567 pub allow_maintainer_edit: Option<bool>,
2568 pub assignee: Option<User>,
2569 pub assignees: Option<Vec<User>>,
2570 pub base: Option<PRBranchInfo>,
2571 pub body: Option<String>,
2572 pub changed_files: Option<i64>,
2573 #[serde(with = "time::serde::rfc3339::option")]
2574 pub closed_at: Option<time::OffsetDateTime>,
2575 pub comments: Option<i64>,
2576 #[serde(with = "time::serde::rfc3339::option")]
2577 pub created_at: Option<time::OffsetDateTime>,
2578 pub deletions: Option<i64>,
2579 #[serde(deserialize_with = "crate::none_if_blank_url")]
2580 pub diff_url: Option<url::Url>,
2581 pub draft: Option<bool>,
2582 #[serde(with = "time::serde::rfc3339::option")]
2583 pub due_date: Option<time::OffsetDateTime>,
2584 pub flow: Option<i64>,
2585 pub head: Option<PRBranchInfo>,
2586 #[serde(deserialize_with = "crate::none_if_blank_url")]
2587 pub html_url: Option<url::Url>,
2588 pub id: Option<i64>,
2589 pub is_locked: Option<bool>,
2590 pub labels: Option<Vec<Label>>,
2591 pub merge_base: Option<String>,
2592 pub merge_commit_sha: Option<String>,
2593 pub mergeable: Option<bool>,
2594 pub merged: Option<bool>,
2595 #[serde(with = "time::serde::rfc3339::option")]
2596 pub merged_at: Option<time::OffsetDateTime>,
2597 pub merged_by: Option<User>,
2598 pub milestone: Option<Milestone>,
2599 pub number: Option<i64>,
2600 #[serde(deserialize_with = "crate::none_if_blank_url")]
2601 pub patch_url: Option<url::Url>,
2602 pub pin_order: Option<i64>,
2603 #[serde(deserialize_with = "crate::requested_reviewers_ignore_null")]
2604 pub requested_reviewers: Option<Vec<User>>,
2605 pub requested_reviewers_teams: Option<Vec<Team>>,
2606 pub review_comments: Option<i64>,
2608 pub state: Option<StateType>,
2609 pub title: Option<String>,
2610 #[serde(with = "time::serde::rfc3339::option")]
2611 pub updated_at: Option<time::OffsetDateTime>,
2612 #[serde(deserialize_with = "crate::none_if_blank_url")]
2613 pub url: Option<url::Url>,
2614 pub user: Option<User>,
2615}
2616
2617impl_from_response!(PullRequest);
2618
2619#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2621pub struct PullRequestMeta {
2622 pub draft: Option<bool>,
2623 #[serde(deserialize_with = "crate::none_if_blank_url")]
2624 pub html_url: Option<url::Url>,
2625 pub merged: Option<bool>,
2626 #[serde(with = "time::serde::rfc3339::option")]
2627 pub merged_at: Option<time::OffsetDateTime>,
2628}
2629
2630#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2632pub struct PullReview {
2633 pub body: Option<String>,
2634 pub comments_count: Option<i64>,
2635 pub commit_id: Option<String>,
2636 pub dismissed: Option<bool>,
2637 #[serde(deserialize_with = "crate::none_if_blank_url")]
2638 pub html_url: Option<url::Url>,
2639 pub id: Option<i64>,
2640 pub official: Option<bool>,
2641 #[serde(deserialize_with = "crate::none_if_blank_url")]
2642 pub pull_request_url: Option<url::Url>,
2643 pub stale: Option<bool>,
2644 pub state: Option<String>,
2645 #[serde(with = "time::serde::rfc3339::option")]
2646 pub submitted_at: Option<time::OffsetDateTime>,
2647 pub team: Option<Team>,
2648 #[serde(with = "time::serde::rfc3339::option")]
2649 pub updated_at: Option<time::OffsetDateTime>,
2650 pub user: Option<User>,
2651}
2652
2653impl_from_response!(PullReview);
2654
2655#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2657pub struct PullReviewComment {
2658 pub body: Option<String>,
2659 pub commit_id: Option<String>,
2660 #[serde(with = "time::serde::rfc3339::option")]
2661 pub created_at: Option<time::OffsetDateTime>,
2662 pub diff_hunk: Option<String>,
2663 #[serde(deserialize_with = "crate::none_if_blank_url")]
2664 pub html_url: Option<url::Url>,
2665 pub id: Option<i64>,
2666 pub original_commit_id: Option<String>,
2667 pub original_position: Option<u64>,
2668 pub path: Option<String>,
2669 pub position: Option<u64>,
2670 pub pull_request_review_id: Option<i64>,
2671 #[serde(deserialize_with = "crate::none_if_blank_url")]
2672 pub pull_request_url: Option<url::Url>,
2673 pub resolver: Option<User>,
2674 #[serde(with = "time::serde::rfc3339::option")]
2675 pub updated_at: Option<time::OffsetDateTime>,
2676 pub user: Option<User>,
2677}
2678
2679impl_from_response!(PullReviewComment);
2680
2681#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2683pub struct PullReviewRequestOptions {
2684 pub reviewers: Option<Vec<String>>,
2685 pub team_reviewers: Option<Vec<String>>,
2686}
2687
2688#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2690pub struct PushMirror {
2691 pub branch_filter: Option<String>,
2692 #[serde(with = "time::serde::rfc3339::option")]
2693 pub created: Option<time::OffsetDateTime>,
2694 pub interval: Option<String>,
2695 pub last_error: Option<String>,
2696 #[serde(with = "time::serde::rfc3339::option")]
2697 pub last_update: Option<time::OffsetDateTime>,
2698 pub public_key: Option<String>,
2699 pub remote_address: Option<String>,
2700 pub remote_name: Option<String>,
2701 pub repo_name: Option<String>,
2702 pub sync_on_commit: Option<bool>,
2703}
2704
2705impl_from_response!(PushMirror);
2706
2707#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2709pub struct QuotaGroup {
2710 pub name: Option<String>,
2712 pub rules: Option<Vec<QuotaRuleInfo>>,
2714}
2715
2716impl_from_response!(QuotaGroup);
2717
2718#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2720pub struct QuotaInfo {
2721 pub groups: Option<Vec<QuotaGroup>>,
2722 pub used: Option<QuotaUsed>,
2723}
2724
2725impl_from_response!(QuotaInfo);
2726
2727#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2729pub struct QuotaRuleInfo {
2730 pub limit: Option<i64>,
2732 pub name: Option<String>,
2734 pub subjects: Option<Vec<String>>,
2736}
2737
2738impl_from_response!(QuotaRuleInfo);
2739
2740#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2742pub struct QuotaUsed {
2743 pub size: Option<QuotaUsedSize>,
2744}
2745
2746#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2748pub struct QuotaUsedArtifact {
2749 #[serde(deserialize_with = "crate::none_if_blank_url")]
2750 pub html_url: Option<url::Url>,
2752 pub name: Option<String>,
2754 pub size: Option<i64>,
2756}
2757
2758impl_from_response!(QuotaUsedArtifact);
2759
2760#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2762pub struct QuotaUsedAttachment {
2763 #[serde(deserialize_with = "crate::none_if_blank_url")]
2764 pub api_url: Option<url::Url>,
2766 pub contained_in: Option<QuotaUsedAttachmentContainedIn>,
2768 pub name: Option<String>,
2770 pub size: Option<i64>,
2772}
2773
2774impl_from_response!(QuotaUsedAttachment);
2775
2776#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2778pub struct QuotaUsedAttachmentContainedIn {
2779 #[serde(deserialize_with = "crate::none_if_blank_url")]
2780 pub api_url: Option<url::Url>,
2782 #[serde(deserialize_with = "crate::none_if_blank_url")]
2783 pub html_url: Option<url::Url>,
2785}
2786
2787#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2789pub struct QuotaUsedPackage {
2790 #[serde(deserialize_with = "crate::none_if_blank_url")]
2791 pub html_url: Option<url::Url>,
2793 pub name: Option<String>,
2795 pub size: Option<i64>,
2797 #[serde(rename = "type")]
2799 pub r#type: Option<String>,
2800 pub version: Option<String>,
2802}
2803
2804impl_from_response!(QuotaUsedPackage);
2805
2806#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2808pub struct QuotaUsedSize {
2809 pub assets: Option<QuotaUsedSizeAssets>,
2810 pub git: Option<QuotaUsedSizeGit>,
2811 pub repos: Option<QuotaUsedSizeRepos>,
2812}
2813
2814#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2816pub struct QuotaUsedSizeAssets {
2817 pub artifacts: Option<i64>,
2819 pub attachments: Option<QuotaUsedSizeAssetsAttachments>,
2820 pub packages: Option<QuotaUsedSizeAssetsPackages>,
2821}
2822
2823#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2825pub struct QuotaUsedSizeAssetsAttachments {
2826 pub issues: Option<i64>,
2828 pub releases: Option<i64>,
2830}
2831
2832#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2834pub struct QuotaUsedSizeAssetsPackages {
2835 pub all: Option<i64>,
2837}
2838
2839#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2841pub struct QuotaUsedSizeGit {
2842 #[serde(rename = "LFS")]
2844 pub lfs: Option<i64>,
2845}
2846
2847#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2849pub struct QuotaUsedSizeRepos {
2850 pub private: Option<i64>,
2852 pub public: Option<i64>,
2854}
2855
2856#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2858pub struct Reaction {
2859 pub content: Option<String>,
2860 #[serde(with = "time::serde::rfc3339::option")]
2861 pub created_at: Option<time::OffsetDateTime>,
2862 pub user: Option<User>,
2863}
2864
2865impl_from_response!(Reaction);
2866
2867#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2868pub struct Reference {
2869 pub object: Option<GitObject>,
2870 #[serde(rename = "ref")]
2871 pub r#ref: Option<String>,
2872 #[serde(deserialize_with = "crate::none_if_blank_url")]
2873 pub url: Option<url::Url>,
2874}
2875
2876impl_from_response!(Reference);
2877
2878#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2880pub struct RegistrationToken {
2881 pub token: Option<String>,
2882}
2883
2884impl_from_response!(RegistrationToken);
2885
2886#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2888pub struct Release {
2889 pub archive_download_count: Option<TagArchiveDownloadCount>,
2890 pub assets: Option<Vec<Attachment>>,
2891 pub author: Option<User>,
2892 pub body: Option<String>,
2893 #[serde(with = "time::serde::rfc3339::option")]
2894 pub created_at: Option<time::OffsetDateTime>,
2895 pub draft: Option<bool>,
2896 pub hide_archive_links: Option<bool>,
2897 #[serde(deserialize_with = "crate::none_if_blank_url")]
2898 pub html_url: Option<url::Url>,
2899 pub id: Option<i64>,
2900 pub name: Option<String>,
2901 pub prerelease: Option<bool>,
2902 #[serde(with = "time::serde::rfc3339::option")]
2903 pub published_at: Option<time::OffsetDateTime>,
2904 pub tag_name: Option<String>,
2905 #[serde(deserialize_with = "crate::none_if_blank_url")]
2906 pub tarball_url: Option<url::Url>,
2907 pub target_commitish: Option<String>,
2908 #[serde(deserialize_with = "crate::none_if_blank_url")]
2909 pub upload_url: Option<url::Url>,
2910 #[serde(deserialize_with = "crate::none_if_blank_url")]
2911 pub url: Option<url::Url>,
2912 #[serde(deserialize_with = "crate::none_if_blank_url")]
2913 pub zipball_url: Option<url::Url>,
2914}
2915
2916impl_from_response!(Release);
2917
2918#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2920pub struct RenameOrgOption {
2921 pub new_name: String,
2923}
2924
2925#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2927pub struct RenameUserOption {
2928 pub new_username: String,
2930}
2931
2932#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2934pub struct ReplaceFlagsOption {
2935 pub flags: Option<Vec<String>>,
2936}
2937
2938#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2940pub struct RepoCollaboratorPermission {
2941 pub permission: Option<String>,
2942 pub role_name: Option<String>,
2943 pub user: Option<User>,
2944}
2945
2946impl_from_response!(RepoCollaboratorPermission);
2947
2948#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2949pub struct RepoCommit {
2950 pub author: Option<CommitUser>,
2951 pub committer: Option<CommitUser>,
2952 pub message: Option<String>,
2953 pub tree: Option<CommitMeta>,
2954 #[serde(deserialize_with = "crate::none_if_blank_url")]
2955 pub url: Option<url::Url>,
2956 pub verification: Option<PayloadCommitVerification>,
2957}
2958
2959#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2961pub struct RepoTopicOptions {
2962 pub topics: Option<Vec<String>>,
2964}
2965
2966#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2968pub struct RepoTransfer {
2969 pub doer: Option<User>,
2970 pub recipient: Option<User>,
2971 pub teams: Option<Vec<Team>>,
2972}
2973
2974#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2976pub struct Repository {
2977 pub allow_fast_forward_only_merge: Option<bool>,
2978 pub allow_merge_commits: Option<bool>,
2979 pub allow_rebase: Option<bool>,
2980 pub allow_rebase_explicit: Option<bool>,
2981 pub allow_rebase_update: Option<bool>,
2982 pub allow_squash_merge: Option<bool>,
2983 pub archived: Option<bool>,
2984 #[serde(with = "time::serde::rfc3339::option")]
2985 pub archived_at: Option<time::OffsetDateTime>,
2986 #[serde(deserialize_with = "crate::none_if_blank_url")]
2987 pub avatar_url: Option<url::Url>,
2988 #[serde(deserialize_with = "crate::none_if_blank_url")]
2989 pub clone_url: Option<url::Url>,
2990 #[serde(with = "time::serde::rfc3339::option")]
2991 pub created_at: Option<time::OffsetDateTime>,
2992 pub default_allow_maintainer_edit: Option<bool>,
2993 pub default_branch: Option<String>,
2994 pub default_delete_branch_after_merge: Option<bool>,
2995 pub default_merge_style: Option<DefaultMergeStyle>,
2996 pub default_update_style: Option<String>,
2997 pub description: Option<String>,
2998 pub empty: Option<bool>,
2999 pub external_tracker: Option<ExternalTracker>,
3000 pub external_wiki: Option<ExternalWiki>,
3001 pub fork: Option<bool>,
3002 pub forks_count: Option<i64>,
3003 pub full_name: Option<String>,
3004 pub globally_editable_wiki: Option<bool>,
3005 pub has_actions: Option<bool>,
3006 pub has_issues: Option<bool>,
3007 pub has_packages: Option<bool>,
3008 pub has_projects: Option<bool>,
3009 pub has_pull_requests: Option<bool>,
3010 pub has_releases: Option<bool>,
3011 pub has_wiki: Option<bool>,
3012 #[serde(deserialize_with = "crate::none_if_blank_url")]
3013 pub html_url: Option<url::Url>,
3014 pub id: Option<i64>,
3015 pub ignore_whitespace_conflicts: Option<bool>,
3016 pub internal: Option<bool>,
3017 pub internal_tracker: Option<InternalTracker>,
3018 pub language: Option<String>,
3019 #[serde(deserialize_with = "crate::none_if_blank_url")]
3020 pub languages_url: Option<url::Url>,
3021 pub link: Option<String>,
3022 pub mirror: Option<bool>,
3023 pub mirror_interval: Option<String>,
3024 #[serde(with = "time::serde::rfc3339::option")]
3025 pub mirror_updated: Option<time::OffsetDateTime>,
3026 pub name: Option<String>,
3027 pub object_format_name: Option<ObjectFormatName>,
3028 pub open_issues_count: Option<i64>,
3029 pub open_pr_counter: Option<i64>,
3030 #[serde(deserialize_with = "crate::none_if_blank_url")]
3031 pub original_url: Option<url::Url>,
3032 pub owner: Option<User>,
3033 pub parent: Option<Box<Repository>>,
3034 pub permissions: Option<Permission>,
3035 pub private: Option<bool>,
3036 pub release_counter: Option<i64>,
3037 pub repo_transfer: Option<RepoTransfer>,
3038 pub size: Option<i64>,
3039 #[serde(deserialize_with = "crate::deserialize_optional_ssh_url")]
3040 pub ssh_url: Option<url::Url>,
3041 pub stars_count: Option<i64>,
3042 pub template: Option<bool>,
3043 pub topics: Option<Vec<String>>,
3044 #[serde(with = "time::serde::rfc3339::option")]
3045 pub updated_at: Option<time::OffsetDateTime>,
3046 #[serde(deserialize_with = "crate::none_if_blank_url")]
3047 pub url: Option<url::Url>,
3048 pub watchers_count: Option<i64>,
3049 pub website: Option<String>,
3050 pub wiki_branch: Option<String>,
3051}
3052
3053impl_from_response!(Repository);
3054
3055#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3057pub struct RepositoryMeta {
3058 pub full_name: Option<String>,
3059 pub id: Option<i64>,
3060 pub name: Option<String>,
3061 pub owner: Option<String>,
3062}
3063
3064#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3066pub struct SearchResults {
3067 pub data: Option<Vec<Repository>>,
3068 pub ok: Option<bool>,
3069}
3070
3071impl_from_response!(SearchResults);
3072
3073#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3075pub struct Secret {
3076 #[serde(with = "time::serde::rfc3339::option")]
3077 pub created_at: Option<time::OffsetDateTime>,
3078 pub name: Option<String>,
3080}
3081
3082impl_from_response!(Secret);
3083
3084#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3086pub struct ServerVersion {
3087 pub version: Option<String>,
3088}
3089
3090impl_from_response!(ServerVersion);
3091
3092#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3094pub struct SetUserQuotaGroupsOptions {
3095 pub groups: Vec<String>,
3097}
3098
3099#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
3102pub enum StateType {
3103 #[serde(rename = "open")]
3104 Open,
3105 #[serde(rename = "closed")]
3106 Closed,
3107}
3108#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3110pub struct StopWatch {
3111 #[serde(with = "time::serde::rfc3339::option")]
3112 pub created: Option<time::OffsetDateTime>,
3113 pub duration: Option<String>,
3114 pub issue_index: Option<i64>,
3115 pub issue_title: Option<String>,
3116 pub repo_name: Option<String>,
3117 pub repo_owner_name: Option<String>,
3118 pub seconds: Option<i64>,
3119}
3120
3121impl_from_response!(StopWatch);
3122
3123#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3125pub struct SubmitPullReviewOptions {
3126 pub body: Option<String>,
3127 pub event: Option<String>,
3128}
3129
3130#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3132pub struct SyncForkInfo {
3133 pub allowed: Option<bool>,
3134 pub base_commit: Option<String>,
3135 pub commits_behind: Option<i64>,
3136 pub fork_commit: Option<String>,
3137}
3138
3139impl_from_response!(SyncForkInfo);
3140
3141#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3143pub struct Tag {
3144 pub archive_download_count: Option<TagArchiveDownloadCount>,
3145 pub commit: Option<CommitMeta>,
3146 pub id: Option<String>,
3147 pub message: Option<String>,
3148 pub name: Option<String>,
3149 #[serde(deserialize_with = "crate::none_if_blank_url")]
3150 pub tarball_url: Option<url::Url>,
3151 #[serde(deserialize_with = "crate::none_if_blank_url")]
3152 pub zipball_url: Option<url::Url>,
3153}
3154
3155impl_from_response!(Tag);
3156
3157#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3159pub struct TagArchiveDownloadCount {
3160 pub tar_gz: Option<i64>,
3161 pub zip: Option<i64>,
3162}
3163
3164#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3166pub struct TagProtection {
3167 #[serde(with = "time::serde::rfc3339::option")]
3168 pub created_at: Option<time::OffsetDateTime>,
3169 pub id: Option<i64>,
3170 pub name_pattern: Option<String>,
3171 #[serde(with = "time::serde::rfc3339::option")]
3172 pub updated_at: Option<time::OffsetDateTime>,
3173 pub whitelist_teams: Option<Vec<String>>,
3174 pub whitelist_usernames: Option<Vec<String>>,
3175}
3176
3177impl_from_response!(TagProtection);
3178
3179#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3181pub struct Team {
3182 pub can_create_org_repo: Option<bool>,
3183 pub description: Option<String>,
3184 pub id: Option<i64>,
3185 pub includes_all_repositories: Option<bool>,
3186 pub name: Option<String>,
3187 pub organization: Option<Organization>,
3188 pub permission: Option<TeamPermission>,
3189 pub units: Option<Vec<String>>,
3190 pub units_map: Option<BTreeMap<String, String>>,
3191}
3192
3193impl_from_response!(Team);
3194
3195#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
3196pub enum TeamPermission {
3197 #[serde(rename = "none")]
3198 None,
3199 #[serde(rename = "read")]
3200 Read,
3201 #[serde(rename = "write")]
3202 Write,
3203 #[serde(rename = "admin")]
3204 Admin,
3205 #[serde(rename = "owner")]
3206 Owner,
3207}
3208#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3210pub struct TimelineComment {
3211 pub assignee: Option<User>,
3212 pub assignee_team: Option<Team>,
3213 pub body: Option<String>,
3214 #[serde(with = "time::serde::rfc3339::option")]
3215 pub created_at: Option<time::OffsetDateTime>,
3216 pub dependent_issue: Option<Issue>,
3217 #[serde(deserialize_with = "crate::none_if_blank_url")]
3218 pub html_url: Option<url::Url>,
3219 pub id: Option<i64>,
3220 #[serde(deserialize_with = "crate::none_if_blank_url")]
3221 pub issue_url: Option<url::Url>,
3222 pub label: Option<Label>,
3223 pub milestone: Option<Milestone>,
3224 pub new_ref: Option<String>,
3225 pub new_title: Option<String>,
3226 pub old_milestone: Option<Milestone>,
3227 pub old_project_id: Option<i64>,
3228 pub old_ref: Option<String>,
3229 pub old_title: Option<String>,
3230 pub project_id: Option<i64>,
3231 #[serde(deserialize_with = "crate::none_if_blank_url")]
3232 pub pull_request_url: Option<url::Url>,
3233 pub ref_action: Option<String>,
3234 pub ref_comment: Option<Comment>,
3235 pub ref_commit_sha: Option<String>,
3237 pub ref_issue: Option<Issue>,
3238 pub removed_assignee: Option<bool>,
3240 pub resolve_doer: Option<User>,
3241 pub review_id: Option<i64>,
3242 pub tracked_time: Option<TrackedTime>,
3243 #[serde(rename = "type")]
3244 pub r#type: Option<String>,
3245 #[serde(with = "time::serde::rfc3339::option")]
3246 pub updated_at: Option<time::OffsetDateTime>,
3247 pub user: Option<User>,
3248}
3249
3250impl_from_response!(TimelineComment);
3251
3252#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3254pub struct TopicName {
3255 pub topics: Option<Vec<String>>,
3256}
3257
3258impl_from_response!(TopicName);
3259
3260#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3262pub struct TopicResponse {
3263 #[serde(with = "time::serde::rfc3339::option")]
3264 pub created: Option<time::OffsetDateTime>,
3265 pub id: Option<i64>,
3266 pub repo_count: Option<i64>,
3267 pub topic_name: Option<String>,
3268 #[serde(with = "time::serde::rfc3339::option")]
3269 pub updated: Option<time::OffsetDateTime>,
3270}
3271
3272#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3274pub struct TrackedTime {
3275 #[serde(with = "time::serde::rfc3339::option")]
3276 pub created: Option<time::OffsetDateTime>,
3277 pub id: Option<i64>,
3278 pub issue: Option<Issue>,
3279 pub issue_id: Option<i64>,
3281 pub time: Option<i64>,
3283 pub user_id: Option<i64>,
3285 pub user_name: Option<String>,
3286}
3287
3288impl_from_response!(TrackedTime);
3289
3290#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3292pub struct TransferRepoOption {
3293 pub new_owner: String,
3294 pub team_ids: Option<Vec<i64>>,
3296}
3297
3298#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3300pub struct UpdateBranchRepoOption {
3301 pub name: String,
3303}
3304
3305#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3309pub struct UpdateFileOptions {
3310 pub author: Option<Identity>,
3311 pub branch: Option<String>,
3313 pub committer: Option<Identity>,
3314 pub content: String,
3316 pub dates: Option<CommitDateOptions>,
3317 pub from_path: Option<String>,
3319 pub message: Option<String>,
3321 pub new_branch: Option<String>,
3323 pub sha: String,
3325 pub signoff: Option<bool>,
3327}
3328
3329#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3331pub struct UpdateRepoAvatarOption {
3332 pub image: Option<String>,
3334}
3335
3336#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3338pub struct UpdateUserAvatarOption {
3339 pub image: Option<String>,
3341}
3342
3343#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3345pub struct UpdateVariableOption {
3346 pub name: Option<String>,
3348 pub value: String,
3350}
3351
3352#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3354pub struct User {
3355 pub active: Option<bool>,
3357 #[serde(deserialize_with = "crate::none_if_blank_url")]
3358 pub avatar_url: Option<url::Url>,
3360 #[serde(with = "time::serde::rfc3339::option")]
3361 pub created: Option<time::OffsetDateTime>,
3362 pub description: Option<String>,
3364 pub email: Option<String>,
3365 pub followers_count: Option<i64>,
3367 pub following_count: Option<i64>,
3368 pub full_name: Option<String>,
3370 #[serde(deserialize_with = "crate::none_if_blank_url")]
3371 pub html_url: Option<url::Url>,
3373 pub id: Option<i64>,
3375 pub is_admin: Option<bool>,
3377 pub language: Option<String>,
3379 #[serde(with = "time::serde::rfc3339::option")]
3380 pub last_login: Option<time::OffsetDateTime>,
3381 pub location: Option<String>,
3383 pub login: Option<String>,
3385 pub login_name: Option<String>,
3387 pub prohibit_login: Option<bool>,
3389 pub pronouns: Option<String>,
3391 pub restricted: Option<bool>,
3393 pub source_id: Option<i64>,
3395 pub starred_repos_count: Option<i64>,
3396 pub visibility: Option<String>,
3398 pub website: Option<String>,
3400}
3401
3402impl_from_response!(User);
3403
3404#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3406pub struct UserHeatmapData {
3407 pub contributions: Option<i64>,
3408 pub timestamp: Option<i64>,
3409}
3410
3411impl_from_response!(UserHeatmapData);
3412
3413#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3415pub struct UserSettings {
3416 pub description: Option<String>,
3417 pub diff_view_style: Option<String>,
3418 pub enable_repo_unit_hints: Option<bool>,
3419 pub full_name: Option<String>,
3420 pub hide_activity: Option<bool>,
3421 pub hide_email: Option<bool>,
3423 pub hide_pronouns: Option<bool>,
3424 pub language: Option<String>,
3425 pub location: Option<String>,
3426 pub pronouns: Option<String>,
3427 pub theme: Option<String>,
3428 pub website: Option<String>,
3429}
3430
3431impl_from_response!(UserSettings);
3432
3433#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3435pub struct UserSettingsOptions {
3436 pub description: Option<String>,
3437 pub diff_view_style: Option<String>,
3438 pub enable_repo_unit_hints: Option<bool>,
3439 pub full_name: Option<String>,
3440 pub hide_activity: Option<bool>,
3441 pub hide_email: Option<bool>,
3443 pub hide_pronouns: Option<bool>,
3444 pub language: Option<String>,
3445 pub location: Option<String>,
3446 pub pronouns: Option<String>,
3447 pub theme: Option<String>,
3448 pub website: Option<String>,
3449}
3450
3451#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3453pub struct VerifyGPGKeyOption {
3454 pub armored_signature: Option<String>,
3455 pub key_id: String,
3457}
3458
3459#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3461pub struct WatchInfo {
3462 #[serde(with = "time::serde::rfc3339::option")]
3463 pub created_at: Option<time::OffsetDateTime>,
3464 pub ignored: Option<bool>,
3465 pub reason: Option<serde_json::Value>,
3466 #[serde(deserialize_with = "crate::none_if_blank_url")]
3467 pub repository_url: Option<url::Url>,
3468 pub subscribed: Option<bool>,
3469 #[serde(deserialize_with = "crate::none_if_blank_url")]
3470 pub url: Option<url::Url>,
3471}
3472
3473impl_from_response!(WatchInfo);
3474
3475#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3477pub struct WikiCommit {
3478 pub author: Option<CommitUser>,
3479 pub commiter: Option<CommitUser>,
3480 pub message: Option<String>,
3481 pub sha: Option<String>,
3482}
3483
3484#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3486pub struct WikiCommitList {
3487 pub commits: Option<Vec<WikiCommit>>,
3488 pub count: Option<i64>,
3489}
3490
3491impl_from_response!(WikiCommitList);
3492
3493#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3495pub struct WikiPage {
3496 pub commit_count: Option<i64>,
3497 pub content_base64: Option<String>,
3499 pub footer: Option<String>,
3500 #[serde(deserialize_with = "crate::none_if_blank_url")]
3501 pub html_url: Option<url::Url>,
3502 pub last_commit: Option<WikiCommit>,
3503 pub sidebar: Option<String>,
3504 pub sub_url: Option<String>,
3505 pub title: Option<String>,
3506}
3507
3508impl_from_response!(WikiPage);
3509
3510#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3512pub struct WikiPageMetaData {
3513 #[serde(deserialize_with = "crate::none_if_blank_url")]
3514 pub html_url: Option<url::Url>,
3515 pub last_commit: Option<WikiCommit>,
3516 pub sub_url: Option<String>,
3517 pub title: Option<String>,
3518}
3519
3520impl_from_response!(WikiPageMetaData);
3521
3522pub struct AccessTokenListHeaders {
3523 pub x_total_count: Option<i64>,
3524}
3525
3526impl TryFrom<&reqwest::header::HeaderMap> for AccessTokenListHeaders {
3527 type Error = StructureError;
3528
3529 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3530 let x_total_count = map
3531 .get("x-total-count")
3532 .map(|s| -> Result<_, _> {
3533 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3534 s.parse::<i64>()
3535 .map_err(|_| StructureError::HeaderParseFailed)
3536 })
3537 .transpose()?;
3538 Ok(Self { x_total_count })
3539 }
3540}
3541
3542impl crate::sealed::Sealed for AccessTokenListHeaders {}
3543impl crate::CountHeader for AccessTokenListHeaders {
3544 fn count(&self) -> Option<usize> {
3545 self.x_total_count.map(|x| x as usize)
3546 }
3547}
3548
3549pub struct ActivityFeedsListHeaders {
3550 pub x_total_count: Option<i64>,
3551}
3552
3553impl TryFrom<&reqwest::header::HeaderMap> for ActivityFeedsListHeaders {
3554 type Error = StructureError;
3555
3556 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3557 let x_total_count = map
3558 .get("x-total-count")
3559 .map(|s| -> Result<_, _> {
3560 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3561 s.parse::<i64>()
3562 .map_err(|_| StructureError::HeaderParseFailed)
3563 })
3564 .transpose()?;
3565 Ok(Self { x_total_count })
3566 }
3567}
3568
3569impl crate::sealed::Sealed for ActivityFeedsListHeaders {}
3570impl crate::CountHeader for ActivityFeedsListHeaders {
3571 fn count(&self) -> Option<usize> {
3572 self.x_total_count.map(|x| x as usize)
3573 }
3574}
3575
3576pub struct BlockedUserListHeaders {
3577 pub x_total_count: Option<i64>,
3578}
3579
3580impl TryFrom<&reqwest::header::HeaderMap> for BlockedUserListHeaders {
3581 type Error = StructureError;
3582
3583 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3584 let x_total_count = map
3585 .get("x-total-count")
3586 .map(|s| -> Result<_, _> {
3587 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3588 s.parse::<i64>()
3589 .map_err(|_| StructureError::HeaderParseFailed)
3590 })
3591 .transpose()?;
3592 Ok(Self { x_total_count })
3593 }
3594}
3595
3596impl crate::sealed::Sealed for BlockedUserListHeaders {}
3597impl crate::CountHeader for BlockedUserListHeaders {
3598 fn count(&self) -> Option<usize> {
3599 self.x_total_count.map(|x| x as usize)
3600 }
3601}
3602
3603pub struct BranchListHeaders {
3604 pub x_total_count: Option<i64>,
3605}
3606
3607impl TryFrom<&reqwest::header::HeaderMap> for BranchListHeaders {
3608 type Error = StructureError;
3609
3610 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3611 let x_total_count = map
3612 .get("x-total-count")
3613 .map(|s| -> Result<_, _> {
3614 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3615 s.parse::<i64>()
3616 .map_err(|_| StructureError::HeaderParseFailed)
3617 })
3618 .transpose()?;
3619 Ok(Self { x_total_count })
3620 }
3621}
3622
3623impl crate::sealed::Sealed for BranchListHeaders {}
3624impl crate::CountHeader for BranchListHeaders {
3625 fn count(&self) -> Option<usize> {
3626 self.x_total_count.map(|x| x as usize)
3627 }
3628}
3629
3630pub struct ChangedFileListHeaders {
3631 pub x_total_count: Option<i64>,
3632}
3633
3634impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders {
3635 type Error = StructureError;
3636
3637 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3638 let x_total_count = map
3639 .get("x-total-count")
3640 .map(|s| -> Result<_, _> {
3641 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3642 s.parse::<i64>()
3643 .map_err(|_| StructureError::HeaderParseFailed)
3644 })
3645 .transpose()?;
3646 Ok(Self { x_total_count })
3647 }
3648}
3649
3650impl crate::sealed::Sealed for ChangedFileListHeaders {}
3651impl crate::CountHeader for ChangedFileListHeaders {
3652 fn count(&self) -> Option<usize> {
3653 self.x_total_count.map(|x| x as usize)
3654 }
3655}
3656
3657pub struct ChangedFileListWithPaginationHeaders {
3658 pub x_has_more: Option<bool>,
3659 pub x_page: Option<i64>,
3660 pub x_page_count: Option<i64>,
3661 pub x_per_page: Option<i64>,
3662 pub x_total_count: Option<i64>,
3663}
3664
3665impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListWithPaginationHeaders {
3666 type Error = StructureError;
3667
3668 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3669 let x_has_more = map
3670 .get("x-hasmore")
3671 .map(|s| -> Result<_, _> {
3672 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3673 s.parse::<bool>()
3674 .map_err(|_| StructureError::HeaderParseFailed)
3675 })
3676 .transpose()?;
3677 let x_page = map
3678 .get("x-page")
3679 .map(|s| -> Result<_, _> {
3680 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3681 s.parse::<i64>()
3682 .map_err(|_| StructureError::HeaderParseFailed)
3683 })
3684 .transpose()?;
3685 let x_page_count = map
3686 .get("x-pagecount")
3687 .map(|s| -> Result<_, _> {
3688 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3689 s.parse::<i64>()
3690 .map_err(|_| StructureError::HeaderParseFailed)
3691 })
3692 .transpose()?;
3693 let x_per_page = map
3694 .get("x-perpage")
3695 .map(|s| -> Result<_, _> {
3696 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3697 s.parse::<i64>()
3698 .map_err(|_| StructureError::HeaderParseFailed)
3699 })
3700 .transpose()?;
3701 let x_total_count = map
3702 .get("x-total-count")
3703 .map(|s| -> Result<_, _> {
3704 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3705 s.parse::<i64>()
3706 .map_err(|_| StructureError::HeaderParseFailed)
3707 })
3708 .transpose()?;
3709 Ok(Self {
3710 x_has_more,
3711 x_page,
3712 x_page_count,
3713 x_per_page,
3714 x_total_count,
3715 })
3716 }
3717}
3718
3719impl crate::sealed::Sealed for ChangedFileListWithPaginationHeaders {}
3720impl crate::CountHeader for ChangedFileListWithPaginationHeaders {
3721 fn count(&self) -> Option<usize> {
3722 self.x_total_count.map(|x| x as usize)
3723 }
3724}
3725
3726pub struct CombinedStatusHeaders {
3727 pub x_total_count: Option<i64>,
3728}
3729
3730impl TryFrom<&reqwest::header::HeaderMap> for CombinedStatusHeaders {
3731 type Error = StructureError;
3732
3733 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3734 let x_total_count = map
3735 .get("x-total-count")
3736 .map(|s| -> Result<_, _> {
3737 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3738 s.parse::<i64>()
3739 .map_err(|_| StructureError::HeaderParseFailed)
3740 })
3741 .transpose()?;
3742 Ok(Self { x_total_count })
3743 }
3744}
3745
3746impl crate::sealed::Sealed for CombinedStatusHeaders {}
3747impl crate::CountHeader for CombinedStatusHeaders {
3748 fn count(&self) -> Option<usize> {
3749 self.x_total_count.map(|x| x as usize)
3750 }
3751}
3752
3753pub struct CommentListHeaders {
3754 pub x_total_count: Option<i64>,
3755}
3756
3757impl TryFrom<&reqwest::header::HeaderMap> for CommentListHeaders {
3758 type Error = StructureError;
3759
3760 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3761 let x_total_count = map
3762 .get("x-total-count")
3763 .map(|s| -> Result<_, _> {
3764 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3765 s.parse::<i64>()
3766 .map_err(|_| StructureError::HeaderParseFailed)
3767 })
3768 .transpose()?;
3769 Ok(Self { x_total_count })
3770 }
3771}
3772
3773impl crate::sealed::Sealed for CommentListHeaders {}
3774impl crate::CountHeader for CommentListHeaders {
3775 fn count(&self) -> Option<usize> {
3776 self.x_total_count.map(|x| x as usize)
3777 }
3778}
3779
3780pub struct CommitListHeaders {
3781 pub x_has_more: Option<bool>,
3782 pub x_total_count: Option<i64>,
3783}
3784
3785impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders {
3786 type Error = StructureError;
3787
3788 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3789 let x_has_more = map
3790 .get("x-hasmore")
3791 .map(|s| -> Result<_, _> {
3792 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3793 s.parse::<bool>()
3794 .map_err(|_| StructureError::HeaderParseFailed)
3795 })
3796 .transpose()?;
3797 let x_total_count = map
3798 .get("x-total-count")
3799 .map(|s| -> Result<_, _> {
3800 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3801 s.parse::<i64>()
3802 .map_err(|_| StructureError::HeaderParseFailed)
3803 })
3804 .transpose()?;
3805 Ok(Self {
3806 x_has_more,
3807 x_total_count,
3808 })
3809 }
3810}
3811
3812impl crate::sealed::Sealed for CommitListHeaders {}
3813impl crate::CountHeader for CommitListHeaders {
3814 fn count(&self) -> Option<usize> {
3815 self.x_total_count.map(|x| x as usize)
3816 }
3817}
3818
3819pub struct CommitStatusListHeaders {
3820 pub x_total_count: Option<i64>,
3821}
3822
3823impl TryFrom<&reqwest::header::HeaderMap> for CommitStatusListHeaders {
3824 type Error = StructureError;
3825
3826 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3827 let x_total_count = map
3828 .get("x-total-count")
3829 .map(|s| -> Result<_, _> {
3830 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3831 s.parse::<i64>()
3832 .map_err(|_| StructureError::HeaderParseFailed)
3833 })
3834 .transpose()?;
3835 Ok(Self { x_total_count })
3836 }
3837}
3838
3839impl crate::sealed::Sealed for CommitStatusListHeaders {}
3840impl crate::CountHeader for CommitStatusListHeaders {
3841 fn count(&self) -> Option<usize> {
3842 self.x_total_count.map(|x| x as usize)
3843 }
3844}
3845
3846pub struct CronListHeaders {
3847 pub x_total_count: Option<i64>,
3848}
3849
3850impl TryFrom<&reqwest::header::HeaderMap> for CronListHeaders {
3851 type Error = StructureError;
3852
3853 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3854 let x_total_count = map
3855 .get("x-total-count")
3856 .map(|s| -> Result<_, _> {
3857 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3858 s.parse::<i64>()
3859 .map_err(|_| StructureError::HeaderParseFailed)
3860 })
3861 .transpose()?;
3862 Ok(Self { x_total_count })
3863 }
3864}
3865
3866impl crate::sealed::Sealed for CronListHeaders {}
3867impl crate::CountHeader for CronListHeaders {
3868 fn count(&self) -> Option<usize> {
3869 self.x_total_count.map(|x| x as usize)
3870 }
3871}
3872
3873pub struct DeployKeyListHeaders {
3874 pub x_total_count: Option<i64>,
3875}
3876
3877impl TryFrom<&reqwest::header::HeaderMap> for DeployKeyListHeaders {
3878 type Error = StructureError;
3879
3880 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3881 let x_total_count = map
3882 .get("x-total-count")
3883 .map(|s| -> Result<_, _> {
3884 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3885 s.parse::<i64>()
3886 .map_err(|_| StructureError::HeaderParseFailed)
3887 })
3888 .transpose()?;
3889 Ok(Self { x_total_count })
3890 }
3891}
3892
3893impl crate::sealed::Sealed for DeployKeyListHeaders {}
3894impl crate::CountHeader for DeployKeyListHeaders {
3895 fn count(&self) -> Option<usize> {
3896 self.x_total_count.map(|x| x as usize)
3897 }
3898}
3899
3900pub struct GpgKeyListHeaders {
3901 pub x_total_count: Option<i64>,
3902}
3903
3904impl TryFrom<&reqwest::header::HeaderMap> for GpgKeyListHeaders {
3905 type Error = StructureError;
3906
3907 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3908 let x_total_count = map
3909 .get("x-total-count")
3910 .map(|s| -> Result<_, _> {
3911 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3912 s.parse::<i64>()
3913 .map_err(|_| StructureError::HeaderParseFailed)
3914 })
3915 .transpose()?;
3916 Ok(Self { x_total_count })
3917 }
3918}
3919
3920impl crate::sealed::Sealed for GpgKeyListHeaders {}
3921impl crate::CountHeader for GpgKeyListHeaders {
3922 fn count(&self) -> Option<usize> {
3923 self.x_total_count.map(|x| x as usize)
3924 }
3925}
3926
3927pub struct HookListHeaders {
3928 pub x_total_count: Option<i64>,
3929}
3930
3931impl TryFrom<&reqwest::header::HeaderMap> for HookListHeaders {
3932 type Error = StructureError;
3933
3934 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3935 let x_total_count = map
3936 .get("x-total-count")
3937 .map(|s| -> Result<_, _> {
3938 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3939 s.parse::<i64>()
3940 .map_err(|_| StructureError::HeaderParseFailed)
3941 })
3942 .transpose()?;
3943 Ok(Self { x_total_count })
3944 }
3945}
3946
3947impl crate::sealed::Sealed for HookListHeaders {}
3948impl crate::CountHeader for HookListHeaders {
3949 fn count(&self) -> Option<usize> {
3950 self.x_total_count.map(|x| x as usize)
3951 }
3952}
3953
3954pub struct IssueListHeaders {
3955 pub x_total_count: Option<i64>,
3956}
3957
3958impl TryFrom<&reqwest::header::HeaderMap> for IssueListHeaders {
3959 type Error = StructureError;
3960
3961 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3962 let x_total_count = map
3963 .get("x-total-count")
3964 .map(|s| -> Result<_, _> {
3965 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3966 s.parse::<i64>()
3967 .map_err(|_| StructureError::HeaderParseFailed)
3968 })
3969 .transpose()?;
3970 Ok(Self { x_total_count })
3971 }
3972}
3973
3974impl crate::sealed::Sealed for IssueListHeaders {}
3975impl crate::CountHeader for IssueListHeaders {
3976 fn count(&self) -> Option<usize> {
3977 self.x_total_count.map(|x| x as usize)
3978 }
3979}
3980
3981pub struct LabelListHeaders {
3982 pub x_total_count: Option<i64>,
3983}
3984
3985impl TryFrom<&reqwest::header::HeaderMap> for LabelListHeaders {
3986 type Error = StructureError;
3987
3988 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3989 let x_total_count = map
3990 .get("x-total-count")
3991 .map(|s| -> Result<_, _> {
3992 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3993 s.parse::<i64>()
3994 .map_err(|_| StructureError::HeaderParseFailed)
3995 })
3996 .transpose()?;
3997 Ok(Self { x_total_count })
3998 }
3999}
4000
4001impl crate::sealed::Sealed for LabelListHeaders {}
4002impl crate::CountHeader for LabelListHeaders {
4003 fn count(&self) -> Option<usize> {
4004 self.x_total_count.map(|x| x as usize)
4005 }
4006}
4007
4008pub struct MilestoneListHeaders {
4009 pub x_total_count: Option<i64>,
4010}
4011
4012impl TryFrom<&reqwest::header::HeaderMap> for MilestoneListHeaders {
4013 type Error = StructureError;
4014
4015 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4016 let x_total_count = map
4017 .get("x-total-count")
4018 .map(|s| -> Result<_, _> {
4019 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4020 s.parse::<i64>()
4021 .map_err(|_| StructureError::HeaderParseFailed)
4022 })
4023 .transpose()?;
4024 Ok(Self { x_total_count })
4025 }
4026}
4027
4028impl crate::sealed::Sealed for MilestoneListHeaders {}
4029impl crate::CountHeader for MilestoneListHeaders {
4030 fn count(&self) -> Option<usize> {
4031 self.x_total_count.map(|x| x as usize)
4032 }
4033}
4034
4035pub struct NotificationThreadListHeaders {
4036 pub x_total_count: Option<i64>,
4037}
4038
4039impl TryFrom<&reqwest::header::HeaderMap> for NotificationThreadListHeaders {
4040 type Error = StructureError;
4041
4042 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4043 let x_total_count = map
4044 .get("x-total-count")
4045 .map(|s| -> Result<_, _> {
4046 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4047 s.parse::<i64>()
4048 .map_err(|_| StructureError::HeaderParseFailed)
4049 })
4050 .transpose()?;
4051 Ok(Self { x_total_count })
4052 }
4053}
4054
4055impl crate::sealed::Sealed for NotificationThreadListHeaders {}
4056impl crate::CountHeader for NotificationThreadListHeaders {
4057 fn count(&self) -> Option<usize> {
4058 self.x_total_count.map(|x| x as usize)
4059 }
4060}
4061
4062pub struct OAuth2ApplicationListHeaders {
4063 pub x_total_count: Option<i64>,
4064}
4065
4066impl TryFrom<&reqwest::header::HeaderMap> for OAuth2ApplicationListHeaders {
4067 type Error = StructureError;
4068
4069 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4070 let x_total_count = map
4071 .get("x-total-count")
4072 .map(|s| -> Result<_, _> {
4073 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4074 s.parse::<i64>()
4075 .map_err(|_| StructureError::HeaderParseFailed)
4076 })
4077 .transpose()?;
4078 Ok(Self { x_total_count })
4079 }
4080}
4081
4082impl crate::sealed::Sealed for OAuth2ApplicationListHeaders {}
4083impl crate::CountHeader for OAuth2ApplicationListHeaders {
4084 fn count(&self) -> Option<usize> {
4085 self.x_total_count.map(|x| x as usize)
4086 }
4087}
4088
4089pub struct OrganizationListHeaders {
4090 pub x_total_count: Option<i64>,
4091}
4092
4093impl TryFrom<&reqwest::header::HeaderMap> for OrganizationListHeaders {
4094 type Error = StructureError;
4095
4096 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4097 let x_total_count = map
4098 .get("x-total-count")
4099 .map(|s| -> Result<_, _> {
4100 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4101 s.parse::<i64>()
4102 .map_err(|_| StructureError::HeaderParseFailed)
4103 })
4104 .transpose()?;
4105 Ok(Self { x_total_count })
4106 }
4107}
4108
4109impl crate::sealed::Sealed for OrganizationListHeaders {}
4110impl crate::CountHeader for OrganizationListHeaders {
4111 fn count(&self) -> Option<usize> {
4112 self.x_total_count.map(|x| x as usize)
4113 }
4114}
4115
4116pub struct PackageListHeaders {
4117 pub x_total_count: Option<i64>,
4118}
4119
4120impl TryFrom<&reqwest::header::HeaderMap> for PackageListHeaders {
4121 type Error = StructureError;
4122
4123 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4124 let x_total_count = map
4125 .get("x-total-count")
4126 .map(|s| -> Result<_, _> {
4127 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4128 s.parse::<i64>()
4129 .map_err(|_| StructureError::HeaderParseFailed)
4130 })
4131 .transpose()?;
4132 Ok(Self { x_total_count })
4133 }
4134}
4135
4136impl crate::sealed::Sealed for PackageListHeaders {}
4137impl crate::CountHeader for PackageListHeaders {
4138 fn count(&self) -> Option<usize> {
4139 self.x_total_count.map(|x| x as usize)
4140 }
4141}
4142
4143pub struct PublicKeyListHeaders {
4144 pub x_total_count: Option<i64>,
4145}
4146
4147impl TryFrom<&reqwest::header::HeaderMap> for PublicKeyListHeaders {
4148 type Error = StructureError;
4149
4150 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4151 let x_total_count = map
4152 .get("x-total-count")
4153 .map(|s| -> Result<_, _> {
4154 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4155 s.parse::<i64>()
4156 .map_err(|_| StructureError::HeaderParseFailed)
4157 })
4158 .transpose()?;
4159 Ok(Self { x_total_count })
4160 }
4161}
4162
4163impl crate::sealed::Sealed for PublicKeyListHeaders {}
4164impl crate::CountHeader for PublicKeyListHeaders {
4165 fn count(&self) -> Option<usize> {
4166 self.x_total_count.map(|x| x as usize)
4167 }
4168}
4169
4170pub struct PullRequestListHeaders {
4171 pub x_total_count: Option<i64>,
4172}
4173
4174impl TryFrom<&reqwest::header::HeaderMap> for PullRequestListHeaders {
4175 type Error = StructureError;
4176
4177 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4178 let x_total_count = map
4179 .get("x-total-count")
4180 .map(|s| -> Result<_, _> {
4181 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4182 s.parse::<i64>()
4183 .map_err(|_| StructureError::HeaderParseFailed)
4184 })
4185 .transpose()?;
4186 Ok(Self { x_total_count })
4187 }
4188}
4189
4190impl crate::sealed::Sealed for PullRequestListHeaders {}
4191impl crate::CountHeader for PullRequestListHeaders {
4192 fn count(&self) -> Option<usize> {
4193 self.x_total_count.map(|x| x as usize)
4194 }
4195}
4196
4197pub struct PullReviewListHeaders {
4198 pub x_total_count: Option<i64>,
4199}
4200
4201impl TryFrom<&reqwest::header::HeaderMap> for PullReviewListHeaders {
4202 type Error = StructureError;
4203
4204 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4205 let x_total_count = map
4206 .get("x-total-count")
4207 .map(|s| -> Result<_, _> {
4208 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4209 s.parse::<i64>()
4210 .map_err(|_| StructureError::HeaderParseFailed)
4211 })
4212 .transpose()?;
4213 Ok(Self { x_total_count })
4214 }
4215}
4216
4217impl crate::sealed::Sealed for PullReviewListHeaders {}
4218impl crate::CountHeader for PullReviewListHeaders {
4219 fn count(&self) -> Option<usize> {
4220 self.x_total_count.map(|x| x as usize)
4221 }
4222}
4223
4224pub struct PushMirrorListHeaders {
4225 pub x_total_count: Option<i64>,
4226}
4227
4228impl TryFrom<&reqwest::header::HeaderMap> for PushMirrorListHeaders {
4229 type Error = StructureError;
4230
4231 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4232 let x_total_count = map
4233 .get("x-total-count")
4234 .map(|s| -> Result<_, _> {
4235 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4236 s.parse::<i64>()
4237 .map_err(|_| StructureError::HeaderParseFailed)
4238 })
4239 .transpose()?;
4240 Ok(Self { x_total_count })
4241 }
4242}
4243
4244impl crate::sealed::Sealed for PushMirrorListHeaders {}
4245impl crate::CountHeader for PushMirrorListHeaders {
4246 fn count(&self) -> Option<usize> {
4247 self.x_total_count.map(|x| x as usize)
4248 }
4249}
4250
4251pub struct QuotaUsedArtifactListHeaders {
4252 pub x_total_count: Option<i64>,
4253}
4254
4255impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedArtifactListHeaders {
4256 type Error = StructureError;
4257
4258 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4259 let x_total_count = map
4260 .get("x-total-count")
4261 .map(|s| -> Result<_, _> {
4262 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4263 s.parse::<i64>()
4264 .map_err(|_| StructureError::HeaderParseFailed)
4265 })
4266 .transpose()?;
4267 Ok(Self { x_total_count })
4268 }
4269}
4270
4271impl crate::sealed::Sealed for QuotaUsedArtifactListHeaders {}
4272impl crate::CountHeader for QuotaUsedArtifactListHeaders {
4273 fn count(&self) -> Option<usize> {
4274 self.x_total_count.map(|x| x as usize)
4275 }
4276}
4277
4278pub struct QuotaUsedAttachmentListHeaders {
4279 pub x_total_count: Option<i64>,
4280}
4281
4282impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedAttachmentListHeaders {
4283 type Error = StructureError;
4284
4285 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4286 let x_total_count = map
4287 .get("x-total-count")
4288 .map(|s| -> Result<_, _> {
4289 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4290 s.parse::<i64>()
4291 .map_err(|_| StructureError::HeaderParseFailed)
4292 })
4293 .transpose()?;
4294 Ok(Self { x_total_count })
4295 }
4296}
4297
4298impl crate::sealed::Sealed for QuotaUsedAttachmentListHeaders {}
4299impl crate::CountHeader for QuotaUsedAttachmentListHeaders {
4300 fn count(&self) -> Option<usize> {
4301 self.x_total_count.map(|x| x as usize)
4302 }
4303}
4304
4305pub struct QuotaUsedPackageListHeaders {
4306 pub x_total_count: Option<i64>,
4307}
4308
4309impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedPackageListHeaders {
4310 type Error = StructureError;
4311
4312 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4313 let x_total_count = map
4314 .get("x-total-count")
4315 .map(|s| -> Result<_, _> {
4316 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4317 s.parse::<i64>()
4318 .map_err(|_| StructureError::HeaderParseFailed)
4319 })
4320 .transpose()?;
4321 Ok(Self { x_total_count })
4322 }
4323}
4324
4325impl crate::sealed::Sealed for QuotaUsedPackageListHeaders {}
4326impl crate::CountHeader for QuotaUsedPackageListHeaders {
4327 fn count(&self) -> Option<usize> {
4328 self.x_total_count.map(|x| x as usize)
4329 }
4330}
4331
4332pub struct ReactionListHeaders {
4333 pub x_total_count: Option<i64>,
4334}
4335
4336impl TryFrom<&reqwest::header::HeaderMap> for ReactionListHeaders {
4337 type Error = StructureError;
4338
4339 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4340 let x_total_count = map
4341 .get("x-total-count")
4342 .map(|s| -> Result<_, _> {
4343 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4344 s.parse::<i64>()
4345 .map_err(|_| StructureError::HeaderParseFailed)
4346 })
4347 .transpose()?;
4348 Ok(Self { x_total_count })
4349 }
4350}
4351
4352impl crate::sealed::Sealed for ReactionListHeaders {}
4353impl crate::CountHeader for ReactionListHeaders {
4354 fn count(&self) -> Option<usize> {
4355 self.x_total_count.map(|x| x as usize)
4356 }
4357}
4358
4359pub struct ReleaseListHeaders {
4360 pub x_total_count: Option<i64>,
4361}
4362
4363impl TryFrom<&reqwest::header::HeaderMap> for ReleaseListHeaders {
4364 type Error = StructureError;
4365
4366 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4367 let x_total_count = map
4368 .get("x-total-count")
4369 .map(|s| -> Result<_, _> {
4370 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4371 s.parse::<i64>()
4372 .map_err(|_| StructureError::HeaderParseFailed)
4373 })
4374 .transpose()?;
4375 Ok(Self { x_total_count })
4376 }
4377}
4378
4379impl crate::sealed::Sealed for ReleaseListHeaders {}
4380impl crate::CountHeader for ReleaseListHeaders {
4381 fn count(&self) -> Option<usize> {
4382 self.x_total_count.map(|x| x as usize)
4383 }
4384}
4385
4386pub struct RepositoryListHeaders {
4387 pub x_total_count: Option<i64>,
4388}
4389
4390impl TryFrom<&reqwest::header::HeaderMap> for RepositoryListHeaders {
4391 type Error = StructureError;
4392
4393 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4394 let x_total_count = map
4395 .get("x-total-count")
4396 .map(|s| -> Result<_, _> {
4397 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4398 s.parse::<i64>()
4399 .map_err(|_| StructureError::HeaderParseFailed)
4400 })
4401 .transpose()?;
4402 Ok(Self { x_total_count })
4403 }
4404}
4405
4406impl crate::sealed::Sealed for RepositoryListHeaders {}
4407impl crate::CountHeader for RepositoryListHeaders {
4408 fn count(&self) -> Option<usize> {
4409 self.x_total_count.map(|x| x as usize)
4410 }
4411}
4412
4413pub struct SecretListHeaders {
4414 pub x_total_count: Option<i64>,
4415}
4416
4417impl TryFrom<&reqwest::header::HeaderMap> for SecretListHeaders {
4418 type Error = StructureError;
4419
4420 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4421 let x_total_count = map
4422 .get("x-total-count")
4423 .map(|s| -> Result<_, _> {
4424 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4425 s.parse::<i64>()
4426 .map_err(|_| StructureError::HeaderParseFailed)
4427 })
4428 .transpose()?;
4429 Ok(Self { x_total_count })
4430 }
4431}
4432
4433impl crate::sealed::Sealed for SecretListHeaders {}
4434impl crate::CountHeader for SecretListHeaders {
4435 fn count(&self) -> Option<usize> {
4436 self.x_total_count.map(|x| x as usize)
4437 }
4438}
4439
4440pub struct StopWatchListHeaders {
4441 pub x_total_count: Option<i64>,
4442}
4443
4444impl TryFrom<&reqwest::header::HeaderMap> for StopWatchListHeaders {
4445 type Error = StructureError;
4446
4447 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4448 let x_total_count = map
4449 .get("x-total-count")
4450 .map(|s| -> Result<_, _> {
4451 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4452 s.parse::<i64>()
4453 .map_err(|_| StructureError::HeaderParseFailed)
4454 })
4455 .transpose()?;
4456 Ok(Self { x_total_count })
4457 }
4458}
4459
4460impl crate::sealed::Sealed for StopWatchListHeaders {}
4461impl crate::CountHeader for StopWatchListHeaders {
4462 fn count(&self) -> Option<usize> {
4463 self.x_total_count.map(|x| x as usize)
4464 }
4465}
4466
4467pub struct TagListHeaders {
4468 pub x_total_count: Option<i64>,
4469}
4470
4471impl TryFrom<&reqwest::header::HeaderMap> for TagListHeaders {
4472 type Error = StructureError;
4473
4474 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4475 let x_total_count = map
4476 .get("x-total-count")
4477 .map(|s| -> Result<_, _> {
4478 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4479 s.parse::<i64>()
4480 .map_err(|_| StructureError::HeaderParseFailed)
4481 })
4482 .transpose()?;
4483 Ok(Self { x_total_count })
4484 }
4485}
4486
4487impl crate::sealed::Sealed for TagListHeaders {}
4488impl crate::CountHeader for TagListHeaders {
4489 fn count(&self) -> Option<usize> {
4490 self.x_total_count.map(|x| x as usize)
4491 }
4492}
4493
4494pub struct TeamListHeaders {
4495 pub x_total_count: Option<i64>,
4496}
4497
4498impl TryFrom<&reqwest::header::HeaderMap> for TeamListHeaders {
4499 type Error = StructureError;
4500
4501 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4502 let x_total_count = map
4503 .get("x-total-count")
4504 .map(|s| -> Result<_, _> {
4505 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4506 s.parse::<i64>()
4507 .map_err(|_| StructureError::HeaderParseFailed)
4508 })
4509 .transpose()?;
4510 Ok(Self { x_total_count })
4511 }
4512}
4513
4514impl crate::sealed::Sealed for TeamListHeaders {}
4515impl crate::CountHeader for TeamListHeaders {
4516 fn count(&self) -> Option<usize> {
4517 self.x_total_count.map(|x| x as usize)
4518 }
4519}
4520
4521pub struct TimelineListHeaders {
4522 pub x_total_count: Option<i64>,
4523}
4524
4525impl TryFrom<&reqwest::header::HeaderMap> for TimelineListHeaders {
4526 type Error = StructureError;
4527
4528 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4529 let x_total_count = map
4530 .get("x-total-count")
4531 .map(|s| -> Result<_, _> {
4532 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4533 s.parse::<i64>()
4534 .map_err(|_| StructureError::HeaderParseFailed)
4535 })
4536 .transpose()?;
4537 Ok(Self { x_total_count })
4538 }
4539}
4540
4541impl crate::sealed::Sealed for TimelineListHeaders {}
4542impl crate::CountHeader for TimelineListHeaders {
4543 fn count(&self) -> Option<usize> {
4544 self.x_total_count.map(|x| x as usize)
4545 }
4546}
4547
4548pub struct TrackedTimeListHeaders {
4549 pub x_total_count: Option<i64>,
4550}
4551
4552impl TryFrom<&reqwest::header::HeaderMap> for TrackedTimeListHeaders {
4553 type Error = StructureError;
4554
4555 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4556 let x_total_count = map
4557 .get("x-total-count")
4558 .map(|s| -> Result<_, _> {
4559 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4560 s.parse::<i64>()
4561 .map_err(|_| StructureError::HeaderParseFailed)
4562 })
4563 .transpose()?;
4564 Ok(Self { x_total_count })
4565 }
4566}
4567
4568impl crate::sealed::Sealed for TrackedTimeListHeaders {}
4569impl crate::CountHeader for TrackedTimeListHeaders {
4570 fn count(&self) -> Option<usize> {
4571 self.x_total_count.map(|x| x as usize)
4572 }
4573}
4574
4575pub struct UserListHeaders {
4576 pub x_total_count: Option<i64>,
4577}
4578
4579impl TryFrom<&reqwest::header::HeaderMap> for UserListHeaders {
4580 type Error = StructureError;
4581
4582 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4583 let x_total_count = map
4584 .get("x-total-count")
4585 .map(|s| -> Result<_, _> {
4586 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4587 s.parse::<i64>()
4588 .map_err(|_| StructureError::HeaderParseFailed)
4589 })
4590 .transpose()?;
4591 Ok(Self { x_total_count })
4592 }
4593}
4594
4595impl crate::sealed::Sealed for UserListHeaders {}
4596impl crate::CountHeader for UserListHeaders {
4597 fn count(&self) -> Option<usize> {
4598 self.x_total_count.map(|x| x as usize)
4599 }
4600}
4601
4602pub struct VariableListHeaders {
4603 pub x_total_count: Option<i64>,
4604}
4605
4606impl TryFrom<&reqwest::header::HeaderMap> for VariableListHeaders {
4607 type Error = StructureError;
4608
4609 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4610 let x_total_count = map
4611 .get("x-total-count")
4612 .map(|s| -> Result<_, _> {
4613 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4614 s.parse::<i64>()
4615 .map_err(|_| StructureError::HeaderParseFailed)
4616 })
4617 .transpose()?;
4618 Ok(Self { x_total_count })
4619 }
4620}
4621
4622impl crate::sealed::Sealed for VariableListHeaders {}
4623impl crate::CountHeader for VariableListHeaders {
4624 fn count(&self) -> Option<usize> {
4625 self.x_total_count.map(|x| x as usize)
4626 }
4627}
4628
4629pub struct WikiCommitListHeaders {
4630 pub x_total_count: Option<i64>,
4631}
4632
4633impl TryFrom<&reqwest::header::HeaderMap> for WikiCommitListHeaders {
4634 type Error = StructureError;
4635
4636 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4637 let x_total_count = map
4638 .get("x-total-count")
4639 .map(|s| -> Result<_, _> {
4640 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4641 s.parse::<i64>()
4642 .map_err(|_| StructureError::HeaderParseFailed)
4643 })
4644 .transpose()?;
4645 Ok(Self { x_total_count })
4646 }
4647}
4648
4649impl crate::sealed::Sealed for WikiCommitListHeaders {}
4650impl crate::CountHeader for WikiCommitListHeaders {
4651 fn count(&self) -> Option<usize> {
4652 self.x_total_count.map(|x| x as usize)
4653 }
4654}
4655
4656pub struct WikiPageListHeaders {
4657 pub x_total_count: Option<i64>,
4658}
4659
4660impl TryFrom<&reqwest::header::HeaderMap> for WikiPageListHeaders {
4661 type Error = StructureError;
4662
4663 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4664 let x_total_count = map
4665 .get("x-total-count")
4666 .map(|s| -> Result<_, _> {
4667 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4668 s.parse::<i64>()
4669 .map_err(|_| StructureError::HeaderParseFailed)
4670 })
4671 .transpose()?;
4672 Ok(Self { x_total_count })
4673 }
4674}
4675
4676impl crate::sealed::Sealed for WikiPageListHeaders {}
4677impl crate::CountHeader for WikiPageListHeaders {
4678 fn count(&self) -> Option<usize> {
4679 self.x_total_count.map(|x| x as usize)
4680 }
4681}
4682
4683pub struct QuotaExceededHeaders {
4684 pub message: Option<String>,
4685 pub user_id: Option<i64>,
4686 pub username: Option<String>,
4687}
4688
4689impl TryFrom<&reqwest::header::HeaderMap> for QuotaExceededHeaders {
4690 type Error = StructureError;
4691
4692 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4693 let message = map
4694 .get("message")
4695 .map(|s| -> Result<_, _> {
4696 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4697 Ok::<_, StructureError>(s.to_string())
4698 })
4699 .transpose()?;
4700 let user_id = map
4701 .get("user_id")
4702 .map(|s| -> Result<_, _> {
4703 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4704 s.parse::<i64>()
4705 .map_err(|_| StructureError::HeaderParseFailed)
4706 })
4707 .transpose()?;
4708 let username = map
4709 .get("username")
4710 .map(|s| -> Result<_, _> {
4711 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4712 Ok::<_, StructureError>(s.to_string())
4713 })
4714 .transpose()?;
4715 Ok(Self {
4716 message,
4717 user_id,
4718 username,
4719 })
4720 }
4721}
4722
4723#[derive(Debug, Clone, PartialEq, Default)]
4724pub struct AdminSearchEmailsQuery {
4725 pub q: Option<String>,
4727}
4728
4729impl AdminSearchEmailsQuery {
4730 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4731 let mut list = Vec::new();
4732 if let Some(q) = self.q {
4733 list.push(("q", q));
4734 }
4735
4736 list
4737 }
4738}
4739
4740#[derive(Debug, Clone, PartialEq, Default)]
4741pub struct AdminSearchRunJobsQuery {
4742 pub labels: Option<String>,
4744}
4745
4746impl AdminSearchRunJobsQuery {
4747 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4748 let mut list = Vec::new();
4749 if let Some(labels) = self.labels {
4750 list.push(("labels", labels));
4751 }
4752
4753 list
4754 }
4755}
4756
4757#[derive(Debug, Clone, PartialEq, Default)]
4758pub struct AdminUnadoptedListQuery {
4759 pub pattern: Option<String>,
4761}
4762
4763impl AdminUnadoptedListQuery {
4764 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4765 let mut list = Vec::new();
4766 if let Some(pattern) = self.pattern {
4767 list.push(("pattern", pattern));
4768 }
4769
4770 list
4771 }
4772}
4773
4774#[derive(Debug, Clone, PartialEq, Default)]
4775pub struct AdminSearchUsersQuery {
4776 pub source_id: Option<i64>,
4778 pub login_name: Option<String>,
4780 pub sort: Option<AdminSearchUsersQuerySort>,
4782}
4783
4784impl AdminSearchUsersQuery {
4785 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4786 let mut list = Vec::new();
4787 if let Some(source_id) = self.source_id {
4788 list.push(("source_id", source_id.to_string()));
4789 }
4790 if let Some(login_name) = self.login_name {
4791 list.push(("login_name", login_name));
4792 }
4793 if let Some(sort) = self.sort {
4794 list.push(("sort", sort.as_str().to_string()));
4795 }
4796
4797 list
4798 }
4799}
4800
4801#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
4802pub enum AdminSearchUsersQuerySort {
4803 #[serde(rename = "oldest")]
4804 Oldest,
4805 #[serde(rename = "newest")]
4806 Newest,
4807 #[serde(rename = "alphabetically")]
4808 Alphabetically,
4809 #[serde(rename = "reversealphabetically")]
4810 Reversealphabetically,
4811 #[serde(rename = "recentupdate")]
4812 Recentupdate,
4813 #[serde(rename = "leastupdate")]
4814 Leastupdate,
4815}
4816
4817impl AdminSearchUsersQuerySort {
4818 fn as_str(&self) -> &'static str {
4819 match self {
4820 AdminSearchUsersQuerySort::Oldest => "oldest",
4821 AdminSearchUsersQuerySort::Newest => "newest",
4822 AdminSearchUsersQuerySort::Alphabetically => "alphabetically",
4823 AdminSearchUsersQuerySort::Reversealphabetically => "reversealphabetically",
4824 AdminSearchUsersQuerySort::Recentupdate => "recentupdate",
4825 AdminSearchUsersQuerySort::Leastupdate => "leastupdate",
4826 }
4827 }
4828}
4829#[derive(Debug, Clone, PartialEq, Default)]
4830pub struct AdminDeleteUserQuery {
4831 pub purge: Option<bool>,
4833}
4834
4835impl AdminDeleteUserQuery {
4836 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4837 let mut list = Vec::new();
4838 if let Some(purge) = self.purge {
4839 list.push(("purge", purge.to_string()));
4840 }
4841
4842 list
4843 }
4844}
4845
4846#[derive(Debug, Clone, PartialEq, Default)]
4847pub struct NotifyGetListQuery {
4848 pub all: Option<bool>,
4850 pub status_types: Option<Vec<String>>,
4852 pub subject_type: Option<Vec<NotifyGetListQuerySubjectType>>,
4854 pub since: Option<time::OffsetDateTime>,
4856 pub before: Option<time::OffsetDateTime>,
4858}
4859
4860impl NotifyGetListQuery {
4861 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4862 let mut list = Vec::new();
4863 if let Some(all) = self.all {
4864 list.push(("all", all.to_string()));
4865 }
4866 if let Some(status_types) = self.status_types {
4867 if !status_types.is_empty() {
4868 for item in status_types {
4869 list.push(("status-types", item.to_string()));
4870 }
4871 }
4872 }
4873 if let Some(subject_type) = self.subject_type {
4874 if !subject_type.is_empty() {
4875 for item in subject_type {
4876 list.push(("subject-type", item.as_str().to_string()));
4877 }
4878 }
4879 }
4880 if let Some(since) = self.since {
4881 list.push((
4882 "since",
4883 since
4884 .format(&time::format_description::well_known::Rfc3339)
4885 .unwrap(),
4886 ));
4887 }
4888 if let Some(before) = self.before {
4889 list.push((
4890 "before",
4891 before
4892 .format(&time::format_description::well_known::Rfc3339)
4893 .unwrap(),
4894 ));
4895 }
4896
4897 list
4898 }
4899}
4900
4901#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
4902pub enum NotifyGetListQuerySubjectType {
4903 #[serde(rename = "issue")]
4904 Issue,
4905 #[serde(rename = "pull")]
4906 Pull,
4907 #[serde(rename = "repository")]
4908 Repository,
4909}
4910
4911impl NotifyGetListQuerySubjectType {
4912 fn as_str(&self) -> &'static str {
4913 match self {
4914 NotifyGetListQuerySubjectType::Issue => "issue",
4915 NotifyGetListQuerySubjectType::Pull => "pull",
4916 NotifyGetListQuerySubjectType::Repository => "repository",
4917 }
4918 }
4919}
4920#[derive(Debug, Clone, PartialEq, Default)]
4921pub struct NotifyReadListQuery {
4922 pub last_read_at: Option<time::OffsetDateTime>,
4924 pub all: Option<bool>,
4926 pub status_types: Option<Vec<String>>,
4928 pub to_status: Option<String>,
4930}
4931
4932impl NotifyReadListQuery {
4933 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4934 let mut list = Vec::new();
4935 if let Some(last_read_at) = self.last_read_at {
4936 list.push((
4937 "last_read_at",
4938 last_read_at
4939 .format(&time::format_description::well_known::Rfc3339)
4940 .unwrap(),
4941 ));
4942 }
4943 if let Some(all) = self.all {
4944 list.push(("all", all.to_string()));
4945 }
4946 if let Some(status_types) = self.status_types {
4947 if !status_types.is_empty() {
4948 for item in status_types {
4949 list.push(("status-types", item.to_string()));
4950 }
4951 }
4952 }
4953 if let Some(to_status) = self.to_status {
4954 list.push(("to-status", to_status));
4955 }
4956
4957 list
4958 }
4959}
4960
4961#[derive(Debug, Clone, PartialEq, Default)]
4962pub struct NotifyReadThreadQuery {
4963 pub to_status: Option<String>,
4965}
4966
4967impl NotifyReadThreadQuery {
4968 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4969 let mut list = Vec::new();
4970 if let Some(to_status) = self.to_status {
4971 list.push(("to-status", to_status));
4972 }
4973
4974 list
4975 }
4976}
4977
4978#[derive(Debug, Clone, PartialEq, Default)]
4979pub struct OrgSearchRunJobsQuery {
4980 pub labels: Option<String>,
4982}
4983
4984impl OrgSearchRunJobsQuery {
4985 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4986 let mut list = Vec::new();
4987 if let Some(labels) = self.labels {
4988 list.push(("labels", labels));
4989 }
4990
4991 list
4992 }
4993}
4994
4995#[derive(Debug, Clone, PartialEq, Default)]
4996pub struct OrgListActivityFeedsQuery {
4997 pub date: Option<time::Date>,
4999}
5000
5001impl OrgListActivityFeedsQuery {
5002 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5003 let mut list = Vec::new();
5004 if let Some(date) = self.date {
5005 list.push((
5006 "date",
5007 date.format(&time::format_description::well_known::Rfc3339)
5008 .unwrap(),
5009 ));
5010 }
5011
5012 list
5013 }
5014}
5015
5016#[derive(Debug, Clone, PartialEq, Default)]
5017pub struct OrgListLabelsQuery {
5018 pub sort: Option<OrgListLabelsQuerySort>,
5020}
5021
5022impl OrgListLabelsQuery {
5023 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5024 let mut list = Vec::new();
5025 if let Some(sort) = self.sort {
5026 list.push(("sort", sort.as_str().to_string()));
5027 }
5028
5029 list
5030 }
5031}
5032
5033#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5034pub enum OrgListLabelsQuerySort {
5035 #[serde(rename = "mostissues")]
5036 Mostissues,
5037 #[serde(rename = "leastissues")]
5038 Leastissues,
5039 #[serde(rename = "reversealphabetically")]
5040 Reversealphabetically,
5041}
5042
5043impl OrgListLabelsQuerySort {
5044 fn as_str(&self) -> &'static str {
5045 match self {
5046 OrgListLabelsQuerySort::Mostissues => "mostissues",
5047 OrgListLabelsQuerySort::Leastissues => "leastissues",
5048 OrgListLabelsQuerySort::Reversealphabetically => "reversealphabetically",
5049 }
5050 }
5051}
5052#[derive(Debug, Clone, PartialEq)]
5053pub struct OrgCheckQuotaQuery {
5054 pub subject: String,
5056}
5057
5058impl OrgCheckQuotaQuery {
5059 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5060 let mut list = Vec::new();
5061 let subject = self.subject;
5062 list.push(("subject", subject));
5063
5064 list
5065 }
5066}
5067
5068#[derive(Debug, Clone, PartialEq, Default)]
5069pub struct TeamSearchQuery {
5070 pub q: Option<String>,
5072 pub include_desc: Option<bool>,
5074}
5075
5076impl TeamSearchQuery {
5077 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5078 let mut list = Vec::new();
5079 if let Some(q) = self.q {
5080 list.push(("q", q));
5081 }
5082 if let Some(include_desc) = self.include_desc {
5083 list.push(("include_desc", include_desc.to_string()));
5084 }
5085
5086 list
5087 }
5088}
5089#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
5090pub struct TeamSearchResults {
5091 pub data: Option<Vec<Team>>,
5092 pub ok: Option<bool>,
5093}
5094
5095impl_from_response!(TeamSearchResults);
5096
5097#[derive(Debug, Clone, PartialEq, Default)]
5098pub struct ListPackagesQuery {
5099 pub r#type: Option<ListPackagesQueryType>,
5101 pub q: Option<String>,
5103}
5104
5105impl ListPackagesQuery {
5106 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5107 let mut list = Vec::new();
5108 if let Some(r#type) = self.r#type {
5109 list.push(("type", r#type.as_str().to_string()));
5110 }
5111 if let Some(q) = self.q {
5112 list.push(("q", q));
5113 }
5114
5115 list
5116 }
5117}
5118
5119#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5120pub enum ListPackagesQueryType {
5121 #[serde(rename = "alpine")]
5122 Alpine,
5123 #[serde(rename = "cargo")]
5124 Cargo,
5125 #[serde(rename = "chef")]
5126 Chef,
5127 #[serde(rename = "composer")]
5128 Composer,
5129 #[serde(rename = "conan")]
5130 Conan,
5131 #[serde(rename = "conda")]
5132 Conda,
5133 #[serde(rename = "container")]
5134 Container,
5135 #[serde(rename = "cran")]
5136 Cran,
5137 #[serde(rename = "debian")]
5138 Debian,
5139 #[serde(rename = "generic")]
5140 Generic,
5141 #[serde(rename = "go")]
5142 Go,
5143 #[serde(rename = "helm")]
5144 Helm,
5145 #[serde(rename = "maven")]
5146 Maven,
5147 #[serde(rename = "npm")]
5148 Npm,
5149 #[serde(rename = "nuget")]
5150 Nuget,
5151 #[serde(rename = "pub")]
5152 Pub,
5153 #[serde(rename = "pypi")]
5154 Pypi,
5155 #[serde(rename = "rpm")]
5156 Rpm,
5157 #[serde(rename = "rubygems")]
5158 Rubygems,
5159 #[serde(rename = "swift")]
5160 Swift,
5161 #[serde(rename = "vagrant")]
5162 Vagrant,
5163}
5164
5165impl ListPackagesQueryType {
5166 fn as_str(&self) -> &'static str {
5167 match self {
5168 ListPackagesQueryType::Alpine => "alpine",
5169 ListPackagesQueryType::Cargo => "cargo",
5170 ListPackagesQueryType::Chef => "chef",
5171 ListPackagesQueryType::Composer => "composer",
5172 ListPackagesQueryType::Conan => "conan",
5173 ListPackagesQueryType::Conda => "conda",
5174 ListPackagesQueryType::Container => "container",
5175 ListPackagesQueryType::Cran => "cran",
5176 ListPackagesQueryType::Debian => "debian",
5177 ListPackagesQueryType::Generic => "generic",
5178 ListPackagesQueryType::Go => "go",
5179 ListPackagesQueryType::Helm => "helm",
5180 ListPackagesQueryType::Maven => "maven",
5181 ListPackagesQueryType::Npm => "npm",
5182 ListPackagesQueryType::Nuget => "nuget",
5183 ListPackagesQueryType::Pub => "pub",
5184 ListPackagesQueryType::Pypi => "pypi",
5185 ListPackagesQueryType::Rpm => "rpm",
5186 ListPackagesQueryType::Rubygems => "rubygems",
5187 ListPackagesQueryType::Swift => "swift",
5188 ListPackagesQueryType::Vagrant => "vagrant",
5189 }
5190 }
5191}
5192#[derive(Debug, Clone, PartialEq, Default)]
5193pub struct IssueSearchIssuesQuery {
5194 pub state: Option<IssueSearchIssuesQueryState>,
5196 pub labels: Option<String>,
5198 pub milestones: Option<String>,
5200 pub q: Option<String>,
5202 pub priority_repo_id: Option<i64>,
5204 pub r#type: Option<IssueSearchIssuesQueryType>,
5206 pub since: Option<time::OffsetDateTime>,
5208 pub before: Option<time::OffsetDateTime>,
5210 pub assigned: Option<bool>,
5212 pub created: Option<bool>,
5214 pub mentioned: Option<bool>,
5216 pub review_requested: Option<bool>,
5218 pub reviewed: Option<bool>,
5220 pub owner: Option<String>,
5222 pub team: Option<String>,
5224 pub sort: Option<IssueSearchIssuesQuerySort>,
5226}
5227
5228impl IssueSearchIssuesQuery {
5229 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5230 let mut list = Vec::new();
5231 if let Some(state) = self.state {
5232 list.push(("state", state.as_str().to_string()));
5233 }
5234 if let Some(labels) = self.labels {
5235 list.push(("labels", labels));
5236 }
5237 if let Some(milestones) = self.milestones {
5238 list.push(("milestones", milestones));
5239 }
5240 if let Some(q) = self.q {
5241 list.push(("q", q));
5242 }
5243 if let Some(priority_repo_id) = self.priority_repo_id {
5244 list.push(("priority_repo_id", priority_repo_id.to_string()));
5245 }
5246 if let Some(r#type) = self.r#type {
5247 list.push(("type", r#type.as_str().to_string()));
5248 }
5249 if let Some(since) = self.since {
5250 list.push((
5251 "since",
5252 since
5253 .format(&time::format_description::well_known::Rfc3339)
5254 .unwrap(),
5255 ));
5256 }
5257 if let Some(before) = self.before {
5258 list.push((
5259 "before",
5260 before
5261 .format(&time::format_description::well_known::Rfc3339)
5262 .unwrap(),
5263 ));
5264 }
5265 if let Some(assigned) = self.assigned {
5266 list.push(("assigned", assigned.to_string()));
5267 }
5268 if let Some(created) = self.created {
5269 list.push(("created", created.to_string()));
5270 }
5271 if let Some(mentioned) = self.mentioned {
5272 list.push(("mentioned", mentioned.to_string()));
5273 }
5274 if let Some(review_requested) = self.review_requested {
5275 list.push(("review_requested", review_requested.to_string()));
5276 }
5277 if let Some(reviewed) = self.reviewed {
5278 list.push(("reviewed", reviewed.to_string()));
5279 }
5280 if let Some(owner) = self.owner {
5281 list.push(("owner", owner));
5282 }
5283 if let Some(team) = self.team {
5284 list.push(("team", team));
5285 }
5286 if let Some(sort) = self.sort {
5287 list.push(("sort", sort.as_str().to_string()));
5288 }
5289
5290 list
5291 }
5292}
5293
5294#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5295pub enum IssueSearchIssuesQueryState {
5296 #[serde(rename = "open")]
5297 Open,
5298 #[serde(rename = "closed")]
5299 Closed,
5300 #[serde(rename = "all")]
5301 All,
5302}
5303
5304impl IssueSearchIssuesQueryState {
5305 fn as_str(&self) -> &'static str {
5306 match self {
5307 IssueSearchIssuesQueryState::Open => "open",
5308 IssueSearchIssuesQueryState::Closed => "closed",
5309 IssueSearchIssuesQueryState::All => "all",
5310 }
5311 }
5312}
5313
5314#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5315pub enum IssueSearchIssuesQueryType {
5316 #[serde(rename = "issues")]
5317 Issues,
5318 #[serde(rename = "pulls")]
5319 Pulls,
5320}
5321
5322impl IssueSearchIssuesQueryType {
5323 fn as_str(&self) -> &'static str {
5324 match self {
5325 IssueSearchIssuesQueryType::Issues => "issues",
5326 IssueSearchIssuesQueryType::Pulls => "pulls",
5327 }
5328 }
5329}
5330
5331#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5332pub enum IssueSearchIssuesQuerySort {
5333 #[serde(rename = "relevance")]
5334 Relevance,
5335 #[serde(rename = "latest")]
5336 Latest,
5337 #[serde(rename = "oldest")]
5338 Oldest,
5339 #[serde(rename = "recentupdate")]
5340 Recentupdate,
5341 #[serde(rename = "leastupdate")]
5342 Leastupdate,
5343 #[serde(rename = "mostcomment")]
5344 Mostcomment,
5345 #[serde(rename = "leastcomment")]
5346 Leastcomment,
5347 #[serde(rename = "nearduedate")]
5348 Nearduedate,
5349 #[serde(rename = "farduedate")]
5350 Farduedate,
5351}
5352
5353impl IssueSearchIssuesQuerySort {
5354 fn as_str(&self) -> &'static str {
5355 match self {
5356 IssueSearchIssuesQuerySort::Relevance => "relevance",
5357 IssueSearchIssuesQuerySort::Latest => "latest",
5358 IssueSearchIssuesQuerySort::Oldest => "oldest",
5359 IssueSearchIssuesQuerySort::Recentupdate => "recentupdate",
5360 IssueSearchIssuesQuerySort::Leastupdate => "leastupdate",
5361 IssueSearchIssuesQuerySort::Mostcomment => "mostcomment",
5362 IssueSearchIssuesQuerySort::Leastcomment => "leastcomment",
5363 IssueSearchIssuesQuerySort::Nearduedate => "nearduedate",
5364 IssueSearchIssuesQuerySort::Farduedate => "farduedate",
5365 }
5366 }
5367}
5368#[derive(Debug, Clone, PartialEq, Default)]
5369pub struct RepoSearchQuery {
5370 pub q: Option<String>,
5372 pub topic: Option<bool>,
5374 pub include_desc: Option<bool>,
5376 pub uid: Option<i64>,
5378 pub priority_owner_id: Option<i64>,
5380 pub team_id: Option<i64>,
5382 pub starred_by: Option<i64>,
5384 pub private: Option<bool>,
5386 pub is_private: Option<bool>,
5388 pub template: Option<bool>,
5390 pub archived: Option<bool>,
5392 pub mode: Option<String>,
5394 pub exclusive: Option<bool>,
5396 pub sort: Option<RepoSearchQuerySort>,
5398 pub order: Option<RepoSearchQueryOrder>,
5400}
5401
5402impl RepoSearchQuery {
5403 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5404 let mut list = Vec::new();
5405 if let Some(q) = self.q {
5406 list.push(("q", q));
5407 }
5408 if let Some(topic) = self.topic {
5409 list.push(("topic", topic.to_string()));
5410 }
5411 if let Some(include_desc) = self.include_desc {
5412 list.push(("includeDesc", include_desc.to_string()));
5413 }
5414 if let Some(uid) = self.uid {
5415 list.push(("uid", uid.to_string()));
5416 }
5417 if let Some(priority_owner_id) = self.priority_owner_id {
5418 list.push(("priority_owner_id", priority_owner_id.to_string()));
5419 }
5420 if let Some(team_id) = self.team_id {
5421 list.push(("team_id", team_id.to_string()));
5422 }
5423 if let Some(starred_by) = self.starred_by {
5424 list.push(("starredBy", starred_by.to_string()));
5425 }
5426 if let Some(private) = self.private {
5427 list.push(("private", private.to_string()));
5428 }
5429 if let Some(is_private) = self.is_private {
5430 list.push(("is_private", is_private.to_string()));
5431 }
5432 if let Some(template) = self.template {
5433 list.push(("template", template.to_string()));
5434 }
5435 if let Some(archived) = self.archived {
5436 list.push(("archived", archived.to_string()));
5437 }
5438 if let Some(mode) = self.mode {
5439 list.push(("mode", mode));
5440 }
5441 if let Some(exclusive) = self.exclusive {
5442 list.push(("exclusive", exclusive.to_string()));
5443 }
5444 if let Some(sort) = self.sort {
5445 list.push(("sort", sort.as_str().to_string()));
5446 }
5447 if let Some(order) = self.order {
5448 list.push(("order", order.as_str().to_string()));
5449 }
5450
5451 list
5452 }
5453}
5454
5455#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5456pub enum RepoSearchQuerySort {
5457 #[serde(rename = "alpha")]
5458 Alpha,
5459 #[serde(rename = "created")]
5460 Created,
5461 #[serde(rename = "updated")]
5462 Updated,
5463 #[serde(rename = "size")]
5464 Size,
5465 #[serde(rename = "git_size")]
5466 GitSize,
5467 #[serde(rename = "lfs_size")]
5468 LfsSize,
5469 #[serde(rename = "id")]
5470 Id,
5471 #[serde(rename = "stars")]
5472 Stars,
5473 #[serde(rename = "forks")]
5474 Forks,
5475}
5476
5477impl RepoSearchQuerySort {
5478 fn as_str(&self) -> &'static str {
5479 match self {
5480 RepoSearchQuerySort::Alpha => "alpha",
5481 RepoSearchQuerySort::Created => "created",
5482 RepoSearchQuerySort::Updated => "updated",
5483 RepoSearchQuerySort::Size => "size",
5484 RepoSearchQuerySort::GitSize => "git_size",
5485 RepoSearchQuerySort::LfsSize => "lfs_size",
5486 RepoSearchQuerySort::Id => "id",
5487 RepoSearchQuerySort::Stars => "stars",
5488 RepoSearchQuerySort::Forks => "forks",
5489 }
5490 }
5491}
5492
5493#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5494pub enum RepoSearchQueryOrder {
5495 #[serde(rename = "asc")]
5496 Asc,
5497 #[serde(rename = "desc")]
5498 Desc,
5499}
5500
5501impl RepoSearchQueryOrder {
5502 fn as_str(&self) -> &'static str {
5503 match self {
5504 RepoSearchQueryOrder::Asc => "asc",
5505 RepoSearchQueryOrder::Desc => "desc",
5506 }
5507 }
5508}
5509#[derive(Debug, Clone, PartialEq, Default)]
5510pub struct RepoSearchRunJobsQuery {
5511 pub labels: Option<String>,
5513}
5514
5515impl RepoSearchRunJobsQuery {
5516 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5517 let mut list = Vec::new();
5518 if let Some(labels) = self.labels {
5519 list.push(("labels", labels));
5520 }
5521
5522 list
5523 }
5524}
5525
5526#[derive(Debug, Clone, PartialEq, Default)]
5527pub struct ListActionRunsQuery {
5528 pub event: Option<Vec<String>>,
5530 pub status: Option<Vec<ListActionRunsQueryStatus>>,
5532 pub run_number: Option<i64>,
5534 pub head_sha: Option<String>,
5536}
5537
5538impl ListActionRunsQuery {
5539 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5540 let mut list = Vec::new();
5541 if let Some(event) = self.event {
5542 if !event.is_empty() {
5543 let mut s = String::new();
5544 for (i, item) in event.iter().enumerate() {
5545 s.push_str(item);
5546 if i < event.len() - 1 {
5547 s.push(',')
5548 }
5549 }
5550 list.push(("event", s));
5551 }
5552 }
5553 if let Some(status) = self.status {
5554 if !status.is_empty() {
5555 let mut s = String::new();
5556 for (i, item) in status.iter().enumerate() {
5557 s.push_str(item.as_str());
5558 if i < status.len() - 1 {
5559 s.push(',')
5560 }
5561 }
5562 list.push(("status", s));
5563 }
5564 }
5565 if let Some(run_number) = self.run_number {
5566 list.push(("run_number", run_number.to_string()));
5567 }
5568 if let Some(head_sha) = self.head_sha {
5569 list.push(("head_sha", head_sha));
5570 }
5571
5572 list
5573 }
5574}
5575
5576#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5577pub enum ListActionRunsQueryStatus {
5578 #[serde(rename = "unknown")]
5579 Unknown,
5580 #[serde(rename = "waiting")]
5581 Waiting,
5582 #[serde(rename = "running")]
5583 Running,
5584 #[serde(rename = "success")]
5585 Success,
5586 #[serde(rename = "failure")]
5587 Failure,
5588 #[serde(rename = "cancelled")]
5589 Cancelled,
5590 #[serde(rename = "skipped")]
5591 Skipped,
5592 #[serde(rename = "blocked")]
5593 Blocked,
5594}
5595
5596impl ListActionRunsQueryStatus {
5597 fn as_str(&self) -> &'static str {
5598 match self {
5599 ListActionRunsQueryStatus::Unknown => "unknown",
5600 ListActionRunsQueryStatus::Waiting => "waiting",
5601 ListActionRunsQueryStatus::Running => "running",
5602 ListActionRunsQueryStatus::Success => "success",
5603 ListActionRunsQueryStatus::Failure => "failure",
5604 ListActionRunsQueryStatus::Cancelled => "cancelled",
5605 ListActionRunsQueryStatus::Skipped => "skipped",
5606 ListActionRunsQueryStatus::Blocked => "blocked",
5607 }
5608 }
5609}
5610#[derive(Debug, Clone, PartialEq, Default)]
5611pub struct RepoListActivityFeedsQuery {
5612 pub date: Option<time::Date>,
5614}
5615
5616impl RepoListActivityFeedsQuery {
5617 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5618 let mut list = Vec::new();
5619 if let Some(date) = self.date {
5620 list.push((
5621 "date",
5622 date.format(&time::format_description::well_known::Rfc3339)
5623 .unwrap(),
5624 ));
5625 }
5626
5627 list
5628 }
5629}
5630
5631#[derive(Debug, Clone, PartialEq, Default)]
5632pub struct RepoGetAllCommitsQuery {
5633 pub sha: Option<String>,
5635 pub path: Option<String>,
5637 pub stat: Option<bool>,
5639 pub verification: Option<bool>,
5641 pub files: Option<bool>,
5643 pub not: Option<String>,
5645}
5646
5647impl RepoGetAllCommitsQuery {
5648 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5649 let mut list = Vec::new();
5650 if let Some(sha) = self.sha {
5651 list.push(("sha", sha));
5652 }
5653 if let Some(path) = self.path {
5654 list.push(("path", path));
5655 }
5656 if let Some(stat) = self.stat {
5657 list.push(("stat", stat.to_string()));
5658 }
5659 if let Some(verification) = self.verification {
5660 list.push(("verification", verification.to_string()));
5661 }
5662 if let Some(files) = self.files {
5663 list.push(("files", files.to_string()));
5664 }
5665 if let Some(not) = self.not {
5666 list.push(("not", not));
5667 }
5668
5669 list
5670 }
5671}
5672
5673#[derive(Debug, Clone, PartialEq, Default)]
5674pub struct RepoListStatusesByRefQuery {
5675 pub sort: Option<RepoListStatusesByRefQuerySort>,
5677 pub state: Option<RepoListStatusesByRefQueryState>,
5679}
5680
5681impl RepoListStatusesByRefQuery {
5682 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5683 let mut list = Vec::new();
5684 if let Some(sort) = self.sort {
5685 list.push(("sort", sort.as_str().to_string()));
5686 }
5687 if let Some(state) = self.state {
5688 list.push(("state", state.as_str().to_string()));
5689 }
5690
5691 list
5692 }
5693}
5694
5695#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5696pub enum RepoListStatusesByRefQuerySort {
5697 #[serde(rename = "oldest")]
5698 Oldest,
5699 #[serde(rename = "recentupdate")]
5700 Recentupdate,
5701 #[serde(rename = "leastupdate")]
5702 Leastupdate,
5703 #[serde(rename = "leastindex")]
5704 Leastindex,
5705 #[serde(rename = "highestindex")]
5706 Highestindex,
5707}
5708
5709impl RepoListStatusesByRefQuerySort {
5710 fn as_str(&self) -> &'static str {
5711 match self {
5712 RepoListStatusesByRefQuerySort::Oldest => "oldest",
5713 RepoListStatusesByRefQuerySort::Recentupdate => "recentupdate",
5714 RepoListStatusesByRefQuerySort::Leastupdate => "leastupdate",
5715 RepoListStatusesByRefQuerySort::Leastindex => "leastindex",
5716 RepoListStatusesByRefQuerySort::Highestindex => "highestindex",
5717 }
5718 }
5719}
5720
5721#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5722pub enum RepoListStatusesByRefQueryState {
5723 #[serde(rename = "pending")]
5724 Pending,
5725 #[serde(rename = "success")]
5726 Success,
5727 #[serde(rename = "error")]
5728 Error,
5729 #[serde(rename = "failure")]
5730 Failure,
5731 #[serde(rename = "warning")]
5732 Warning,
5733}
5734
5735impl RepoListStatusesByRefQueryState {
5736 fn as_str(&self) -> &'static str {
5737 match self {
5738 RepoListStatusesByRefQueryState::Pending => "pending",
5739 RepoListStatusesByRefQueryState::Success => "success",
5740 RepoListStatusesByRefQueryState::Error => "error",
5741 RepoListStatusesByRefQueryState::Failure => "failure",
5742 RepoListStatusesByRefQueryState::Warning => "warning",
5743 }
5744 }
5745}
5746#[derive(Debug, Clone, PartialEq, Default)]
5747pub struct RepoGetContentsListQuery {
5748 pub r#ref: Option<String>,
5750}
5751
5752impl RepoGetContentsListQuery {
5753 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5754 let mut list = Vec::new();
5755 if let Some(r#ref) = self.r#ref {
5756 list.push(("ref", r#ref));
5757 }
5758
5759 list
5760 }
5761}
5762
5763#[derive(Debug, Clone, PartialEq, Default)]
5764pub struct RepoGetContentsQuery {
5765 pub r#ref: Option<String>,
5767}
5768
5769impl RepoGetContentsQuery {
5770 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5771 let mut list = Vec::new();
5772 if let Some(r#ref) = self.r#ref {
5773 list.push(("ref", r#ref));
5774 }
5775
5776 list
5777 }
5778}
5779
5780#[derive(Debug, Clone, PartialEq, Default)]
5781pub struct RepoGetEditorConfigQuery {
5782 pub r#ref: Option<String>,
5784}
5785
5786impl RepoGetEditorConfigQuery {
5787 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5788 let mut list = Vec::new();
5789 if let Some(r#ref) = self.r#ref {
5790 list.push(("ref", r#ref));
5791 }
5792
5793 list
5794 }
5795}
5796
5797#[derive(Debug, Clone, PartialEq)]
5798pub struct GetBlobsQuery {
5799 pub shas: String,
5801}
5802
5803impl GetBlobsQuery {
5804 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5805 let mut list = Vec::new();
5806 let shas = self.shas;
5807 list.push(("shas", shas));
5808
5809 list
5810 }
5811}
5812
5813#[derive(Debug, Clone, PartialEq, Default)]
5814pub struct RepoGetSingleCommitQuery {
5815 pub stat: Option<bool>,
5817 pub verification: Option<bool>,
5819 pub files: Option<bool>,
5821}
5822
5823impl RepoGetSingleCommitQuery {
5824 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5825 let mut list = Vec::new();
5826 if let Some(stat) = self.stat {
5827 list.push(("stat", stat.to_string()));
5828 }
5829 if let Some(verification) = self.verification {
5830 list.push(("verification", verification.to_string()));
5831 }
5832 if let Some(files) = self.files {
5833 list.push(("files", files.to_string()));
5834 }
5835
5836 list
5837 }
5838}
5839
5840#[derive(Debug, Clone, PartialEq, Default)]
5841pub struct RepoGetNoteQuery {
5842 pub verification: Option<bool>,
5844 pub files: Option<bool>,
5846}
5847
5848impl RepoGetNoteQuery {
5849 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5850 let mut list = Vec::new();
5851 if let Some(verification) = self.verification {
5852 list.push(("verification", verification.to_string()));
5853 }
5854 if let Some(files) = self.files {
5855 list.push(("files", files.to_string()));
5856 }
5857
5858 list
5859 }
5860}
5861
5862#[derive(Debug, Clone, PartialEq, Default)]
5863pub struct GetTreeQuery {
5864 pub recursive: Option<bool>,
5866 pub per_page: Option<u32>,
5868}
5869
5870impl GetTreeQuery {
5871 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5872 let mut list = Vec::new();
5873 if let Some(recursive) = self.recursive {
5874 list.push(("recursive", recursive.to_string()));
5875 }
5876 if let Some(per_page) = self.per_page {
5877 list.push(("per_page", per_page.to_string()));
5878 }
5879
5880 list
5881 }
5882}
5883
5884#[derive(Debug, Clone, PartialEq, Default)]
5885pub struct RepoTestHookQuery {
5886 pub r#ref: Option<String>,
5888}
5889
5890impl RepoTestHookQuery {
5891 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5892 let mut list = Vec::new();
5893 if let Some(r#ref) = self.r#ref {
5894 list.push(("ref", r#ref));
5895 }
5896
5897 list
5898 }
5899}
5900
5901#[derive(Debug, Clone, PartialEq, Default)]
5902pub struct IssueListIssuesQuery {
5903 pub state: Option<IssueListIssuesQueryState>,
5905 pub labels: Option<String>,
5907 pub q: Option<String>,
5909 pub r#type: Option<IssueListIssuesQueryType>,
5911 pub milestones: Option<String>,
5913 pub since: Option<time::OffsetDateTime>,
5915 pub before: Option<time::OffsetDateTime>,
5917 pub created_by: Option<String>,
5919 pub assigned_by: Option<String>,
5921 pub mentioned_by: Option<String>,
5923 pub sort: Option<IssueListIssuesQuerySort>,
5925}
5926
5927impl IssueListIssuesQuery {
5928 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5929 let mut list = Vec::new();
5930 if let Some(state) = self.state {
5931 list.push(("state", state.as_str().to_string()));
5932 }
5933 if let Some(labels) = self.labels {
5934 list.push(("labels", labels));
5935 }
5936 if let Some(q) = self.q {
5937 list.push(("q", q));
5938 }
5939 if let Some(r#type) = self.r#type {
5940 list.push(("type", r#type.as_str().to_string()));
5941 }
5942 if let Some(milestones) = self.milestones {
5943 list.push(("milestones", milestones));
5944 }
5945 if let Some(since) = self.since {
5946 list.push((
5947 "since",
5948 since
5949 .format(&time::format_description::well_known::Rfc3339)
5950 .unwrap(),
5951 ));
5952 }
5953 if let Some(before) = self.before {
5954 list.push((
5955 "before",
5956 before
5957 .format(&time::format_description::well_known::Rfc3339)
5958 .unwrap(),
5959 ));
5960 }
5961 if let Some(created_by) = self.created_by {
5962 list.push(("created_by", created_by));
5963 }
5964 if let Some(assigned_by) = self.assigned_by {
5965 list.push(("assigned_by", assigned_by));
5966 }
5967 if let Some(mentioned_by) = self.mentioned_by {
5968 list.push(("mentioned_by", mentioned_by));
5969 }
5970 if let Some(sort) = self.sort {
5971 list.push(("sort", sort.as_str().to_string()));
5972 }
5973
5974 list
5975 }
5976}
5977
5978#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5979pub enum IssueListIssuesQueryState {
5980 #[serde(rename = "closed")]
5981 Closed,
5982 #[serde(rename = "open")]
5983 Open,
5984 #[serde(rename = "all")]
5985 All,
5986}
5987
5988impl IssueListIssuesQueryState {
5989 fn as_str(&self) -> &'static str {
5990 match self {
5991 IssueListIssuesQueryState::Closed => "closed",
5992 IssueListIssuesQueryState::Open => "open",
5993 IssueListIssuesQueryState::All => "all",
5994 }
5995 }
5996}
5997
5998#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5999pub enum IssueListIssuesQueryType {
6000 #[serde(rename = "issues")]
6001 Issues,
6002 #[serde(rename = "pulls")]
6003 Pulls,
6004}
6005
6006impl IssueListIssuesQueryType {
6007 fn as_str(&self) -> &'static str {
6008 match self {
6009 IssueListIssuesQueryType::Issues => "issues",
6010 IssueListIssuesQueryType::Pulls => "pulls",
6011 }
6012 }
6013}
6014
6015#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6016pub enum IssueListIssuesQuerySort {
6017 #[serde(rename = "relevance")]
6018 Relevance,
6019 #[serde(rename = "latest")]
6020 Latest,
6021 #[serde(rename = "oldest")]
6022 Oldest,
6023 #[serde(rename = "recentupdate")]
6024 Recentupdate,
6025 #[serde(rename = "leastupdate")]
6026 Leastupdate,
6027 #[serde(rename = "mostcomment")]
6028 Mostcomment,
6029 #[serde(rename = "leastcomment")]
6030 Leastcomment,
6031 #[serde(rename = "nearduedate")]
6032 Nearduedate,
6033 #[serde(rename = "farduedate")]
6034 Farduedate,
6035}
6036
6037impl IssueListIssuesQuerySort {
6038 fn as_str(&self) -> &'static str {
6039 match self {
6040 IssueListIssuesQuerySort::Relevance => "relevance",
6041 IssueListIssuesQuerySort::Latest => "latest",
6042 IssueListIssuesQuerySort::Oldest => "oldest",
6043 IssueListIssuesQuerySort::Recentupdate => "recentupdate",
6044 IssueListIssuesQuerySort::Leastupdate => "leastupdate",
6045 IssueListIssuesQuerySort::Mostcomment => "mostcomment",
6046 IssueListIssuesQuerySort::Leastcomment => "leastcomment",
6047 IssueListIssuesQuerySort::Nearduedate => "nearduedate",
6048 IssueListIssuesQuerySort::Farduedate => "farduedate",
6049 }
6050 }
6051}
6052#[derive(Debug, Clone, PartialEq, Default)]
6053pub struct IssueGetRepoCommentsQuery {
6054 pub since: Option<time::OffsetDateTime>,
6056 pub before: Option<time::OffsetDateTime>,
6058}
6059
6060impl IssueGetRepoCommentsQuery {
6061 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6062 let mut list = Vec::new();
6063 if let Some(since) = self.since {
6064 list.push((
6065 "since",
6066 since
6067 .format(&time::format_description::well_known::Rfc3339)
6068 .unwrap(),
6069 ));
6070 }
6071 if let Some(before) = self.before {
6072 list.push((
6073 "before",
6074 before
6075 .format(&time::format_description::well_known::Rfc3339)
6076 .unwrap(),
6077 ));
6078 }
6079
6080 list
6081 }
6082}
6083
6084#[derive(Debug, Clone, PartialEq, Default)]
6085pub struct IssueCreateIssueCommentAttachmentQuery {
6086 pub name: Option<String>,
6088 pub updated_at: Option<time::OffsetDateTime>,
6090}
6091
6092impl IssueCreateIssueCommentAttachmentQuery {
6093 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6094 let mut list = Vec::new();
6095 if let Some(name) = self.name {
6096 list.push(("name", name));
6097 }
6098 if let Some(updated_at) = self.updated_at {
6099 list.push((
6100 "updated_at",
6101 updated_at
6102 .format(&time::format_description::well_known::Rfc3339)
6103 .unwrap(),
6104 ));
6105 }
6106
6107 list
6108 }
6109}
6110
6111#[derive(Debug, Clone, PartialEq, Default)]
6112pub struct IssueCreateIssueAttachmentQuery {
6113 pub name: Option<String>,
6115 pub updated_at: Option<time::OffsetDateTime>,
6117}
6118
6119impl IssueCreateIssueAttachmentQuery {
6120 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6121 let mut list = Vec::new();
6122 if let Some(name) = self.name {
6123 list.push(("name", name));
6124 }
6125 if let Some(updated_at) = self.updated_at {
6126 list.push((
6127 "updated_at",
6128 updated_at
6129 .format(&time::format_description::well_known::Rfc3339)
6130 .unwrap(),
6131 ));
6132 }
6133
6134 list
6135 }
6136}
6137
6138#[derive(Debug, Clone, PartialEq, Default)]
6139pub struct IssueGetCommentsQuery {
6140 pub since: Option<time::OffsetDateTime>,
6142 pub before: Option<time::OffsetDateTime>,
6144}
6145
6146impl IssueGetCommentsQuery {
6147 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6148 let mut list = Vec::new();
6149 if let Some(since) = self.since {
6150 list.push((
6151 "since",
6152 since
6153 .format(&time::format_description::well_known::Rfc3339)
6154 .unwrap(),
6155 ));
6156 }
6157 if let Some(before) = self.before {
6158 list.push((
6159 "before",
6160 before
6161 .format(&time::format_description::well_known::Rfc3339)
6162 .unwrap(),
6163 ));
6164 }
6165
6166 list
6167 }
6168}
6169
6170#[derive(Debug, Clone, PartialEq, Default)]
6171pub struct IssueGetCommentsAndTimelineQuery {
6172 pub since: Option<time::OffsetDateTime>,
6174 pub before: Option<time::OffsetDateTime>,
6176}
6177
6178impl IssueGetCommentsAndTimelineQuery {
6179 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6180 let mut list = Vec::new();
6181 if let Some(since) = self.since {
6182 list.push((
6183 "since",
6184 since
6185 .format(&time::format_description::well_known::Rfc3339)
6186 .unwrap(),
6187 ));
6188 }
6189 if let Some(before) = self.before {
6190 list.push((
6191 "before",
6192 before
6193 .format(&time::format_description::well_known::Rfc3339)
6194 .unwrap(),
6195 ));
6196 }
6197
6198 list
6199 }
6200}
6201
6202#[derive(Debug, Clone, PartialEq, Default)]
6203pub struct IssueTrackedTimesQuery {
6204 pub user: Option<String>,
6206 pub since: Option<time::OffsetDateTime>,
6208 pub before: Option<time::OffsetDateTime>,
6210}
6211
6212impl IssueTrackedTimesQuery {
6213 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6214 let mut list = Vec::new();
6215 if let Some(user) = self.user {
6216 list.push(("user", user));
6217 }
6218 if let Some(since) = self.since {
6219 list.push((
6220 "since",
6221 since
6222 .format(&time::format_description::well_known::Rfc3339)
6223 .unwrap(),
6224 ));
6225 }
6226 if let Some(before) = self.before {
6227 list.push((
6228 "before",
6229 before
6230 .format(&time::format_description::well_known::Rfc3339)
6231 .unwrap(),
6232 ));
6233 }
6234
6235 list
6236 }
6237}
6238
6239#[derive(Debug, Clone, PartialEq, Default)]
6240pub struct RepoListKeysQuery {
6241 pub key_id: Option<u32>,
6243 pub fingerprint: Option<String>,
6245}
6246
6247impl RepoListKeysQuery {
6248 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6249 let mut list = Vec::new();
6250 if let Some(key_id) = self.key_id {
6251 list.push(("key_id", key_id.to_string()));
6252 }
6253 if let Some(fingerprint) = self.fingerprint {
6254 list.push(("fingerprint", fingerprint));
6255 }
6256
6257 list
6258 }
6259}
6260
6261#[derive(Debug, Clone, PartialEq, Default)]
6262pub struct IssueListLabelsQuery {
6263 pub sort: Option<IssueListLabelsQuerySort>,
6265}
6266
6267impl IssueListLabelsQuery {
6268 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6269 let mut list = Vec::new();
6270 if let Some(sort) = self.sort {
6271 list.push(("sort", sort.as_str().to_string()));
6272 }
6273
6274 list
6275 }
6276}
6277
6278#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6279pub enum IssueListLabelsQuerySort {
6280 #[serde(rename = "mostissues")]
6281 Mostissues,
6282 #[serde(rename = "leastissues")]
6283 Leastissues,
6284 #[serde(rename = "reversealphabetically")]
6285 Reversealphabetically,
6286}
6287
6288impl IssueListLabelsQuerySort {
6289 fn as_str(&self) -> &'static str {
6290 match self {
6291 IssueListLabelsQuerySort::Mostissues => "mostissues",
6292 IssueListLabelsQuerySort::Leastissues => "leastissues",
6293 IssueListLabelsQuerySort::Reversealphabetically => "reversealphabetically",
6294 }
6295 }
6296}
6297#[derive(Debug, Clone, PartialEq, Default)]
6298pub struct RepoGetRawFileOrLfsQuery {
6299 pub r#ref: Option<String>,
6301}
6302
6303impl RepoGetRawFileOrLfsQuery {
6304 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6305 let mut list = Vec::new();
6306 if let Some(r#ref) = self.r#ref {
6307 list.push(("ref", r#ref));
6308 }
6309
6310 list
6311 }
6312}
6313
6314#[derive(Debug, Clone, PartialEq, Default)]
6315pub struct IssueGetMilestonesListQuery {
6316 pub state: Option<String>,
6318 pub name: Option<String>,
6320}
6321
6322impl IssueGetMilestonesListQuery {
6323 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6324 let mut list = Vec::new();
6325 if let Some(state) = self.state {
6326 list.push(("state", state));
6327 }
6328 if let Some(name) = self.name {
6329 list.push(("name", name));
6330 }
6331
6332 list
6333 }
6334}
6335
6336#[derive(Debug, Clone, PartialEq, Default)]
6337pub struct NotifyGetRepoListQuery {
6338 pub all: Option<bool>,
6340 pub status_types: Option<Vec<String>>,
6342 pub subject_type: Option<Vec<NotifyGetRepoListQuerySubjectType>>,
6344 pub since: Option<time::OffsetDateTime>,
6346 pub before: Option<time::OffsetDateTime>,
6348}
6349
6350impl NotifyGetRepoListQuery {
6351 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6352 let mut list = Vec::new();
6353 if let Some(all) = self.all {
6354 list.push(("all", all.to_string()));
6355 }
6356 if let Some(status_types) = self.status_types {
6357 if !status_types.is_empty() {
6358 for item in status_types {
6359 list.push(("status-types", item.to_string()));
6360 }
6361 }
6362 }
6363 if let Some(subject_type) = self.subject_type {
6364 if !subject_type.is_empty() {
6365 for item in subject_type {
6366 list.push(("subject-type", item.as_str().to_string()));
6367 }
6368 }
6369 }
6370 if let Some(since) = self.since {
6371 list.push((
6372 "since",
6373 since
6374 .format(&time::format_description::well_known::Rfc3339)
6375 .unwrap(),
6376 ));
6377 }
6378 if let Some(before) = self.before {
6379 list.push((
6380 "before",
6381 before
6382 .format(&time::format_description::well_known::Rfc3339)
6383 .unwrap(),
6384 ));
6385 }
6386
6387 list
6388 }
6389}
6390
6391#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6392pub enum NotifyGetRepoListQuerySubjectType {
6393 #[serde(rename = "issue")]
6394 Issue,
6395 #[serde(rename = "pull")]
6396 Pull,
6397 #[serde(rename = "repository")]
6398 Repository,
6399}
6400
6401impl NotifyGetRepoListQuerySubjectType {
6402 fn as_str(&self) -> &'static str {
6403 match self {
6404 NotifyGetRepoListQuerySubjectType::Issue => "issue",
6405 NotifyGetRepoListQuerySubjectType::Pull => "pull",
6406 NotifyGetRepoListQuerySubjectType::Repository => "repository",
6407 }
6408 }
6409}
6410#[derive(Debug, Clone, PartialEq, Default)]
6411pub struct NotifyReadRepoListQuery {
6412 pub all: Option<bool>,
6414 pub status_types: Option<Vec<String>>,
6416 pub to_status: Option<String>,
6418 pub last_read_at: Option<time::OffsetDateTime>,
6420}
6421
6422impl NotifyReadRepoListQuery {
6423 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6424 let mut list = Vec::new();
6425 if let Some(all) = self.all {
6426 list.push(("all", all.to_string()));
6427 }
6428 if let Some(status_types) = self.status_types {
6429 if !status_types.is_empty() {
6430 for item in status_types {
6431 list.push(("status-types", item.to_string()));
6432 }
6433 }
6434 }
6435 if let Some(to_status) = self.to_status {
6436 list.push(("to-status", to_status));
6437 }
6438 if let Some(last_read_at) = self.last_read_at {
6439 list.push((
6440 "last_read_at",
6441 last_read_at
6442 .format(&time::format_description::well_known::Rfc3339)
6443 .unwrap(),
6444 ));
6445 }
6446
6447 list
6448 }
6449}
6450
6451#[derive(Debug, Clone, PartialEq, Default)]
6452pub struct RepoListPullRequestsQuery {
6453 pub state: Option<RepoListPullRequestsQueryState>,
6455 pub sort: Option<RepoListPullRequestsQuerySort>,
6457 pub milestone: Option<i64>,
6459 pub labels: Option<Vec<i64>>,
6461 pub poster: Option<String>,
6463}
6464
6465impl RepoListPullRequestsQuery {
6466 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6467 let mut list = Vec::new();
6468 if let Some(state) = self.state {
6469 list.push(("state", state.as_str().to_string()));
6470 }
6471 if let Some(sort) = self.sort {
6472 list.push(("sort", sort.as_str().to_string()));
6473 }
6474 if let Some(milestone) = self.milestone {
6475 list.push(("milestone", milestone.to_string()));
6476 }
6477 if let Some(labels) = self.labels {
6478 if !labels.is_empty() {
6479 for item in labels {
6480 list.push(("labels", format!("{item}")));
6481 }
6482 }
6483 }
6484 if let Some(poster) = self.poster {
6485 list.push(("poster", poster));
6486 }
6487
6488 list
6489 }
6490}
6491
6492#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6493pub enum RepoListPullRequestsQueryState {
6494 #[serde(rename = "open")]
6495 Open,
6496 #[serde(rename = "closed")]
6497 Closed,
6498 #[serde(rename = "all")]
6499 All,
6500}
6501
6502impl RepoListPullRequestsQueryState {
6503 fn as_str(&self) -> &'static str {
6504 match self {
6505 RepoListPullRequestsQueryState::Open => "open",
6506 RepoListPullRequestsQueryState::Closed => "closed",
6507 RepoListPullRequestsQueryState::All => "all",
6508 }
6509 }
6510}
6511
6512#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6513pub enum RepoListPullRequestsQuerySort {
6514 #[serde(rename = "oldest")]
6515 Oldest,
6516 #[serde(rename = "recentupdate")]
6517 Recentupdate,
6518 #[serde(rename = "recentclose")]
6519 Recentclose,
6520 #[serde(rename = "leastupdate")]
6521 Leastupdate,
6522 #[serde(rename = "mostcomment")]
6523 Mostcomment,
6524 #[serde(rename = "leastcomment")]
6525 Leastcomment,
6526 #[serde(rename = "priority")]
6527 Priority,
6528}
6529
6530impl RepoListPullRequestsQuerySort {
6531 fn as_str(&self) -> &'static str {
6532 match self {
6533 RepoListPullRequestsQuerySort::Oldest => "oldest",
6534 RepoListPullRequestsQuerySort::Recentupdate => "recentupdate",
6535 RepoListPullRequestsQuerySort::Recentclose => "recentclose",
6536 RepoListPullRequestsQuerySort::Leastupdate => "leastupdate",
6537 RepoListPullRequestsQuerySort::Mostcomment => "mostcomment",
6538 RepoListPullRequestsQuerySort::Leastcomment => "leastcomment",
6539 RepoListPullRequestsQuerySort::Priority => "priority",
6540 }
6541 }
6542}
6543#[derive(Debug, Clone, PartialEq, Default)]
6544pub struct RepoDownloadPullDiffOrPatchQuery {
6545 pub binary: Option<bool>,
6547}
6548
6549impl RepoDownloadPullDiffOrPatchQuery {
6550 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6551 let mut list = Vec::new();
6552 if let Some(binary) = self.binary {
6553 list.push(("binary", binary.to_string()));
6554 }
6555
6556 list
6557 }
6558}
6559
6560#[derive(Debug, Clone, PartialEq, Default)]
6561pub struct RepoGetPullRequestCommitsQuery {
6562 pub verification: Option<bool>,
6564 pub files: Option<bool>,
6566}
6567
6568impl RepoGetPullRequestCommitsQuery {
6569 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6570 let mut list = Vec::new();
6571 if let Some(verification) = self.verification {
6572 list.push(("verification", verification.to_string()));
6573 }
6574 if let Some(files) = self.files {
6575 list.push(("files", files.to_string()));
6576 }
6577
6578 list
6579 }
6580}
6581
6582#[derive(Debug, Clone, PartialEq, Default)]
6583pub struct RepoGetPullRequestFilesQuery {
6584 pub skip_to: Option<String>,
6586 pub whitespace: Option<RepoGetPullRequestFilesQueryWhitespace>,
6588}
6589
6590impl RepoGetPullRequestFilesQuery {
6591 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6592 let mut list = Vec::new();
6593 if let Some(skip_to) = self.skip_to {
6594 list.push(("skip-to", skip_to));
6595 }
6596 if let Some(whitespace) = self.whitespace {
6597 list.push(("whitespace", whitespace.as_str().to_string()));
6598 }
6599
6600 list
6601 }
6602}
6603
6604#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6605pub enum RepoGetPullRequestFilesQueryWhitespace {
6606 #[serde(rename = "ignore-all")]
6607 IgnoreAll,
6608 #[serde(rename = "ignore-change")]
6609 IgnoreChange,
6610 #[serde(rename = "ignore-eol")]
6611 IgnoreEol,
6612 #[serde(rename = "show-all")]
6613 ShowAll,
6614}
6615
6616impl RepoGetPullRequestFilesQueryWhitespace {
6617 fn as_str(&self) -> &'static str {
6618 match self {
6619 RepoGetPullRequestFilesQueryWhitespace::IgnoreAll => "ignore-all",
6620 RepoGetPullRequestFilesQueryWhitespace::IgnoreChange => "ignore-change",
6621 RepoGetPullRequestFilesQueryWhitespace::IgnoreEol => "ignore-eol",
6622 RepoGetPullRequestFilesQueryWhitespace::ShowAll => "show-all",
6623 }
6624 }
6625}
6626#[derive(Debug, Clone, PartialEq, Default)]
6627pub struct RepoUpdatePullRequestQuery {
6628 pub style: Option<RepoUpdatePullRequestQueryStyle>,
6630}
6631
6632impl RepoUpdatePullRequestQuery {
6633 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6634 let mut list = Vec::new();
6635 if let Some(style) = self.style {
6636 list.push(("style", style.as_str().to_string()));
6637 }
6638
6639 list
6640 }
6641}
6642
6643#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6644pub enum RepoUpdatePullRequestQueryStyle {
6645 #[serde(rename = "merge")]
6646 Merge,
6647 #[serde(rename = "rebase")]
6648 Rebase,
6649}
6650
6651impl RepoUpdatePullRequestQueryStyle {
6652 fn as_str(&self) -> &'static str {
6653 match self {
6654 RepoUpdatePullRequestQueryStyle::Merge => "merge",
6655 RepoUpdatePullRequestQueryStyle::Rebase => "rebase",
6656 }
6657 }
6658}
6659#[derive(Debug, Clone, PartialEq, Default)]
6660pub struct RepoGetRawFileQuery {
6661 pub r#ref: Option<String>,
6663}
6664
6665impl RepoGetRawFileQuery {
6666 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6667 let mut list = Vec::new();
6668 if let Some(r#ref) = self.r#ref {
6669 list.push(("ref", r#ref));
6670 }
6671
6672 list
6673 }
6674}
6675
6676#[derive(Debug, Clone, PartialEq, Default)]
6677pub struct RepoListReleasesQuery {
6678 pub draft: Option<bool>,
6680 pub pre_release: Option<bool>,
6682 pub q: Option<String>,
6684}
6685
6686impl RepoListReleasesQuery {
6687 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6688 let mut list = Vec::new();
6689 if let Some(draft) = self.draft {
6690 list.push(("draft", draft.to_string()));
6691 }
6692 if let Some(pre_release) = self.pre_release {
6693 list.push(("pre-release", pre_release.to_string()));
6694 }
6695 if let Some(q) = self.q {
6696 list.push(("q", q));
6697 }
6698
6699 list
6700 }
6701}
6702
6703#[derive(Debug, Clone, PartialEq, Default)]
6704pub struct RepoCreateReleaseAttachmentQuery {
6705 pub name: Option<String>,
6707}
6708
6709impl RepoCreateReleaseAttachmentQuery {
6710 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6711 let mut list = Vec::new();
6712 if let Some(name) = self.name {
6713 list.push(("name", name));
6714 }
6715
6716 list
6717 }
6718}
6719
6720#[derive(Debug, Clone, PartialEq, Default)]
6721pub struct RepoListStatusesQuery {
6722 pub sort: Option<RepoListStatusesQuerySort>,
6724 pub state: Option<RepoListStatusesQueryState>,
6726}
6727
6728impl RepoListStatusesQuery {
6729 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6730 let mut list = Vec::new();
6731 if let Some(sort) = self.sort {
6732 list.push(("sort", sort.as_str().to_string()));
6733 }
6734 if let Some(state) = self.state {
6735 list.push(("state", state.as_str().to_string()));
6736 }
6737
6738 list
6739 }
6740}
6741
6742#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6743pub enum RepoListStatusesQuerySort {
6744 #[serde(rename = "oldest")]
6745 Oldest,
6746 #[serde(rename = "recentupdate")]
6747 Recentupdate,
6748 #[serde(rename = "leastupdate")]
6749 Leastupdate,
6750 #[serde(rename = "leastindex")]
6751 Leastindex,
6752 #[serde(rename = "highestindex")]
6753 Highestindex,
6754}
6755
6756impl RepoListStatusesQuerySort {
6757 fn as_str(&self) -> &'static str {
6758 match self {
6759 RepoListStatusesQuerySort::Oldest => "oldest",
6760 RepoListStatusesQuerySort::Recentupdate => "recentupdate",
6761 RepoListStatusesQuerySort::Leastupdate => "leastupdate",
6762 RepoListStatusesQuerySort::Leastindex => "leastindex",
6763 RepoListStatusesQuerySort::Highestindex => "highestindex",
6764 }
6765 }
6766}
6767
6768#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6769pub enum RepoListStatusesQueryState {
6770 #[serde(rename = "pending")]
6771 Pending,
6772 #[serde(rename = "success")]
6773 Success,
6774 #[serde(rename = "error")]
6775 Error,
6776 #[serde(rename = "failure")]
6777 Failure,
6778 #[serde(rename = "warning")]
6779 Warning,
6780}
6781
6782impl RepoListStatusesQueryState {
6783 fn as_str(&self) -> &'static str {
6784 match self {
6785 RepoListStatusesQueryState::Pending => "pending",
6786 RepoListStatusesQueryState::Success => "success",
6787 RepoListStatusesQueryState::Error => "error",
6788 RepoListStatusesQueryState::Failure => "failure",
6789 RepoListStatusesQueryState::Warning => "warning",
6790 }
6791 }
6792}
6793#[derive(Debug, Clone, PartialEq, Default)]
6794pub struct RepoTrackedTimesQuery {
6795 pub user: Option<String>,
6797 pub since: Option<time::OffsetDateTime>,
6799 pub before: Option<time::OffsetDateTime>,
6801}
6802
6803impl RepoTrackedTimesQuery {
6804 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6805 let mut list = Vec::new();
6806 if let Some(user) = self.user {
6807 list.push(("user", user));
6808 }
6809 if let Some(since) = self.since {
6810 list.push((
6811 "since",
6812 since
6813 .format(&time::format_description::well_known::Rfc3339)
6814 .unwrap(),
6815 ));
6816 }
6817 if let Some(before) = self.before {
6818 list.push((
6819 "before",
6820 before
6821 .format(&time::format_description::well_known::Rfc3339)
6822 .unwrap(),
6823 ));
6824 }
6825
6826 list
6827 }
6828}
6829
6830#[derive(Debug, Clone, PartialEq, Default)]
6831pub struct OrgListTeamActivityFeedsQuery {
6832 pub date: Option<time::Date>,
6834}
6835
6836impl OrgListTeamActivityFeedsQuery {
6837 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6838 let mut list = Vec::new();
6839 if let Some(date) = self.date {
6840 list.push((
6841 "date",
6842 date.format(&time::format_description::well_known::Rfc3339)
6843 .unwrap(),
6844 ));
6845 }
6846
6847 list
6848 }
6849}
6850
6851#[derive(Debug, Clone, PartialEq)]
6852pub struct TopicSearchQuery {
6853 pub q: String,
6855}
6856
6857impl TopicSearchQuery {
6858 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6859 let mut list = Vec::new();
6860 let q = self.q;
6861 list.push(("q", q));
6862
6863 list
6864 }
6865}
6866#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
6867pub struct TopicSearchResults {
6868 pub topics: Option<Vec<TopicResponse>>,
6869}
6870
6871impl_from_response!(TopicSearchResults);
6872
6873#[derive(Debug, Clone, PartialEq, Default)]
6874pub struct UserSearchRunJobsQuery {
6875 pub labels: Option<String>,
6877}
6878
6879impl UserSearchRunJobsQuery {
6880 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6881 let mut list = Vec::new();
6882 if let Some(labels) = self.labels {
6883 list.push(("labels", labels));
6884 }
6885
6886 list
6887 }
6888}
6889
6890#[derive(Debug, Clone, PartialEq, Default)]
6891pub struct UserCurrentListKeysQuery {
6892 pub fingerprint: Option<String>,
6894}
6895
6896impl UserCurrentListKeysQuery {
6897 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6898 let mut list = Vec::new();
6899 if let Some(fingerprint) = self.fingerprint {
6900 list.push(("fingerprint", fingerprint));
6901 }
6902
6903 list
6904 }
6905}
6906
6907#[derive(Debug, Clone, PartialEq)]
6908pub struct UserCheckQuotaQuery {
6909 pub subject: String,
6911}
6912
6913impl UserCheckQuotaQuery {
6914 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6915 let mut list = Vec::new();
6916 let subject = self.subject;
6917 list.push(("subject", subject));
6918
6919 list
6920 }
6921}
6922
6923#[derive(Debug, Clone, PartialEq, Default)]
6924pub struct UserCurrentListReposQuery {
6925 pub order_by: Option<UserCurrentListReposQueryOrderBy>,
6927}
6928
6929impl UserCurrentListReposQuery {
6930 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6931 let mut list = Vec::new();
6932 if let Some(order_by) = self.order_by {
6933 list.push(("order_by", order_by.as_str().to_string()));
6934 }
6935
6936 list
6937 }
6938}
6939
6940#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6941pub enum UserCurrentListReposQueryOrderBy {
6942 #[serde(rename = "name")]
6943 Name,
6944 #[serde(rename = "id")]
6945 Id,
6946 #[serde(rename = "newest")]
6947 Newest,
6948 #[serde(rename = "oldest")]
6949 Oldest,
6950 #[serde(rename = "recentupdate")]
6951 Recentupdate,
6952 #[serde(rename = "leastupdate")]
6953 Leastupdate,
6954 #[serde(rename = "reversealphabetically")]
6955 Reversealphabetically,
6956 #[serde(rename = "alphabetically")]
6957 Alphabetically,
6958 #[serde(rename = "reversesize")]
6959 Reversesize,
6960 #[serde(rename = "size")]
6961 Size,
6962 #[serde(rename = "reversegitsize")]
6963 Reversegitsize,
6964 #[serde(rename = "gitsize")]
6965 Gitsize,
6966 #[serde(rename = "reverselfssize")]
6967 Reverselfssize,
6968 #[serde(rename = "lfssize")]
6969 Lfssize,
6970 #[serde(rename = "moststars")]
6971 Moststars,
6972 #[serde(rename = "feweststars")]
6973 Feweststars,
6974 #[serde(rename = "mostforks")]
6975 Mostforks,
6976 #[serde(rename = "fewestforks")]
6977 Fewestforks,
6978}
6979
6980impl UserCurrentListReposQueryOrderBy {
6981 fn as_str(&self) -> &'static str {
6982 match self {
6983 UserCurrentListReposQueryOrderBy::Name => "name",
6984 UserCurrentListReposQueryOrderBy::Id => "id",
6985 UserCurrentListReposQueryOrderBy::Newest => "newest",
6986 UserCurrentListReposQueryOrderBy::Oldest => "oldest",
6987 UserCurrentListReposQueryOrderBy::Recentupdate => "recentupdate",
6988 UserCurrentListReposQueryOrderBy::Leastupdate => "leastupdate",
6989 UserCurrentListReposQueryOrderBy::Reversealphabetically => "reversealphabetically",
6990 UserCurrentListReposQueryOrderBy::Alphabetically => "alphabetically",
6991 UserCurrentListReposQueryOrderBy::Reversesize => "reversesize",
6992 UserCurrentListReposQueryOrderBy::Size => "size",
6993 UserCurrentListReposQueryOrderBy::Reversegitsize => "reversegitsize",
6994 UserCurrentListReposQueryOrderBy::Gitsize => "gitsize",
6995 UserCurrentListReposQueryOrderBy::Reverselfssize => "reverselfssize",
6996 UserCurrentListReposQueryOrderBy::Lfssize => "lfssize",
6997 UserCurrentListReposQueryOrderBy::Moststars => "moststars",
6998 UserCurrentListReposQueryOrderBy::Feweststars => "feweststars",
6999 UserCurrentListReposQueryOrderBy::Mostforks => "mostforks",
7000 UserCurrentListReposQueryOrderBy::Fewestforks => "fewestforks",
7001 }
7002 }
7003}
7004#[derive(Debug, Clone, PartialEq, Default)]
7005pub struct UserCurrentTrackedTimesQuery {
7006 pub since: Option<time::OffsetDateTime>,
7008 pub before: Option<time::OffsetDateTime>,
7010}
7011
7012impl UserCurrentTrackedTimesQuery {
7013 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7014 let mut list = Vec::new();
7015 if let Some(since) = self.since {
7016 list.push((
7017 "since",
7018 since
7019 .format(&time::format_description::well_known::Rfc3339)
7020 .unwrap(),
7021 ));
7022 }
7023 if let Some(before) = self.before {
7024 list.push((
7025 "before",
7026 before
7027 .format(&time::format_description::well_known::Rfc3339)
7028 .unwrap(),
7029 ));
7030 }
7031
7032 list
7033 }
7034}
7035
7036#[derive(Debug, Clone, PartialEq, Default)]
7037pub struct UserSearchQuery {
7038 pub q: Option<String>,
7040 pub uid: Option<i64>,
7042 pub sort: Option<UserSearchQuerySort>,
7044}
7045
7046impl UserSearchQuery {
7047 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7048 let mut list = Vec::new();
7049 if let Some(q) = self.q {
7050 list.push(("q", q));
7051 }
7052 if let Some(uid) = self.uid {
7053 list.push(("uid", uid.to_string()));
7054 }
7055 if let Some(sort) = self.sort {
7056 list.push(("sort", sort.as_str().to_string()));
7057 }
7058
7059 list
7060 }
7061}
7062
7063#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
7064pub enum UserSearchQuerySort {
7065 #[serde(rename = "oldest")]
7066 Oldest,
7067 #[serde(rename = "newest")]
7068 Newest,
7069 #[serde(rename = "alphabetically")]
7070 Alphabetically,
7071 #[serde(rename = "reversealphabetically")]
7072 Reversealphabetically,
7073 #[serde(rename = "recentupdate")]
7074 Recentupdate,
7075 #[serde(rename = "leastupdate")]
7076 Leastupdate,
7077}
7078
7079impl UserSearchQuerySort {
7080 fn as_str(&self) -> &'static str {
7081 match self {
7082 UserSearchQuerySort::Oldest => "oldest",
7083 UserSearchQuerySort::Newest => "newest",
7084 UserSearchQuerySort::Alphabetically => "alphabetically",
7085 UserSearchQuerySort::Reversealphabetically => "reversealphabetically",
7086 UserSearchQuerySort::Recentupdate => "recentupdate",
7087 UserSearchQuerySort::Leastupdate => "leastupdate",
7088 }
7089 }
7090}
7091#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
7092pub struct UserSearchResults {
7093 pub data: Option<Vec<User>>,
7094 pub ok: Option<bool>,
7095}
7096
7097impl_from_response!(UserSearchResults);
7098
7099#[derive(Debug, Clone, PartialEq, Default)]
7100pub struct UserListActivityFeedsQuery {
7101 pub only_performed_by: Option<bool>,
7103 pub date: Option<time::Date>,
7105}
7106
7107impl UserListActivityFeedsQuery {
7108 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7109 let mut list = Vec::new();
7110 if let Some(only_performed_by) = self.only_performed_by {
7111 list.push(("only-performed-by", only_performed_by.to_string()));
7112 }
7113 if let Some(date) = self.date {
7114 list.push((
7115 "date",
7116 date.format(&time::format_description::well_known::Rfc3339)
7117 .unwrap(),
7118 ));
7119 }
7120
7121 list
7122 }
7123}
7124
7125#[derive(Debug, Clone, PartialEq, Default)]
7126pub struct UserListKeysQuery {
7127 pub fingerprint: Option<String>,
7129}
7130
7131impl UserListKeysQuery {
7132 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7133 let mut list = Vec::new();
7134 if let Some(fingerprint) = self.fingerprint {
7135 list.push(("fingerprint", fingerprint));
7136 }
7137
7138 list
7139 }
7140}