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 #[serde(with = "time::serde::rfc3339::option")]
638 pub date: Option<time::OffsetDateTime>,
639 pub email: Option<String>,
640 pub name: Option<String>,
641}
642
643#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
644pub struct Compare {
645 pub commits: Option<Vec<Commit>>,
646 pub files: Option<Vec<CommitAffectedFiles>>,
647 pub total_commits: Option<i64>,
648}
649
650impl_from_response!(Compare);
651
652#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
654pub struct ContentsResponse {
655 #[serde(rename = "_links")]
656 pub links: Option<FileLinksResponse>,
657 pub content: Option<String>,
659 #[serde(deserialize_with = "crate::none_if_blank_url")]
660 pub download_url: Option<url::Url>,
661 pub encoding: Option<String>,
663 #[serde(deserialize_with = "crate::none_if_blank_url")]
664 pub git_url: Option<url::Url>,
665 #[serde(deserialize_with = "crate::none_if_blank_url")]
666 pub html_url: Option<url::Url>,
667 pub last_commit_sha: Option<String>,
668 #[serde(with = "time::serde::rfc3339::option")]
669 pub last_commit_when: Option<time::OffsetDateTime>,
670 pub name: Option<String>,
671 pub path: Option<String>,
672 pub sha: Option<String>,
673 pub size: Option<i64>,
674 #[serde(deserialize_with = "crate::none_if_blank_url")]
675 pub submodule_git_url: Option<url::Url>,
677 pub target: Option<String>,
679 #[serde(rename = "type")]
681 pub r#type: Option<String>,
682 #[serde(deserialize_with = "crate::none_if_blank_url")]
683 pub url: Option<url::Url>,
684}
685
686impl_from_response!(ContentsResponse);
687
688#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
690pub struct CreateAccessTokenOption {
691 pub name: String,
692 pub scopes: Option<Vec<String>>,
693}
694
695#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
697pub struct CreateBranchProtectionOption {
698 pub apply_to_admins: Option<bool>,
699 pub approvals_whitelist_teams: Option<Vec<String>>,
700 pub approvals_whitelist_username: Option<Vec<String>>,
701 pub block_on_official_review_requests: Option<bool>,
702 pub block_on_outdated_branch: Option<bool>,
703 pub block_on_rejected_reviews: Option<bool>,
704 pub branch_name: Option<String>,
706 pub dismiss_stale_approvals: Option<bool>,
707 pub enable_approvals_whitelist: Option<bool>,
708 pub enable_merge_whitelist: Option<bool>,
709 pub enable_push: Option<bool>,
710 pub enable_push_whitelist: Option<bool>,
711 pub enable_status_check: Option<bool>,
712 pub ignore_stale_approvals: Option<bool>,
713 pub merge_whitelist_teams: Option<Vec<String>>,
714 pub merge_whitelist_usernames: Option<Vec<String>>,
715 pub protected_file_patterns: Option<String>,
716 pub push_whitelist_deploy_keys: Option<bool>,
717 pub push_whitelist_teams: Option<Vec<String>>,
718 pub push_whitelist_usernames: Option<Vec<String>>,
719 pub require_signed_commits: Option<bool>,
720 pub required_approvals: Option<i64>,
721 pub rule_name: Option<String>,
722 pub status_check_contexts: Option<Vec<String>>,
723 pub unprotected_file_patterns: Option<String>,
724}
725
726#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
728pub struct CreateBranchRepoOption {
729 pub new_branch_name: String,
731 pub old_branch_name: Option<String>,
735 pub old_ref_name: Option<String>,
737}
738
739#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
741pub struct CreateEmailOption {
742 pub emails: Option<Vec<String>>,
744}
745
746#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
750pub struct CreateFileOptions {
751 pub author: Option<Identity>,
752 pub branch: Option<String>,
754 pub committer: Option<Identity>,
755 pub content: String,
757 pub dates: Option<CommitDateOptions>,
758 pub message: Option<String>,
760 pub new_branch: Option<String>,
762 pub signoff: Option<bool>,
764}
765
766#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
768pub struct CreateForkOption {
769 pub name: Option<String>,
771 pub organization: Option<String>,
773}
774
775#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
777pub struct CreateGPGKeyOption {
778 pub armored_public_key: String,
780 pub armored_signature: Option<String>,
781}
782
783#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
785pub struct CreateHookOption {
786 pub active: Option<bool>,
787 pub authorization_header: Option<String>,
788 pub branch_filter: Option<String>,
789 pub config: CreateHookOptionConfig,
790 pub events: Option<Vec<String>>,
791 #[serde(rename = "type")]
792 pub r#type: CreateHookOptionType,
793}
794
795#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
796pub enum CreateHookOptionType {
797 #[serde(rename = "forgejo")]
798 Forgejo,
799 #[serde(rename = "dingtalk")]
800 Dingtalk,
801 #[serde(rename = "discord")]
802 Discord,
803 #[serde(rename = "gitea")]
804 Gitea,
805 #[serde(rename = "gogs")]
806 Gogs,
807 #[serde(rename = "msteams")]
808 Msteams,
809 #[serde(rename = "slack")]
810 Slack,
811 #[serde(rename = "telegram")]
812 Telegram,
813 #[serde(rename = "feishu")]
814 Feishu,
815 #[serde(rename = "wechatwork")]
816 Wechatwork,
817 #[serde(rename = "packagist")]
818 Packagist,
819}
820#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
824pub struct CreateHookOptionConfig {
825 pub content_type: String,
826 pub url: url::Url,
827 #[serde(flatten)]
828 pub additional: BTreeMap<String, String>,
829}
830
831#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
833pub struct CreateIssueCommentOption {
834 pub body: String,
835 #[serde(with = "time::serde::rfc3339::option")]
836 pub updated_at: Option<time::OffsetDateTime>,
837}
838
839#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
841pub struct CreateIssueOption {
842 pub assignee: Option<String>,
844 pub assignees: Option<Vec<String>>,
845 pub body: Option<String>,
846 pub closed: Option<bool>,
847 #[serde(with = "time::serde::rfc3339::option")]
848 pub due_date: Option<time::OffsetDateTime>,
849 pub labels: Option<Vec<i64>>,
851 pub milestone: Option<i64>,
853 #[serde(rename = "ref")]
854 pub r#ref: Option<String>,
855 pub title: String,
856}
857
858#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
860pub struct CreateKeyOption {
861 pub key: String,
863 pub read_only: Option<bool>,
865 pub title: String,
867}
868
869#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
871pub struct CreateLabelOption {
872 pub color: String,
873 pub description: Option<String>,
874 pub exclusive: Option<bool>,
875 pub is_archived: Option<bool>,
876 pub name: String,
877}
878
879#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
881pub struct CreateMilestoneOption {
882 pub description: Option<String>,
883 #[serde(with = "time::serde::rfc3339::option")]
884 pub due_on: Option<time::OffsetDateTime>,
885 pub state: Option<CreateMilestoneOptionState>,
886 pub title: Option<String>,
887}
888
889#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
890pub enum CreateMilestoneOptionState {
891 #[serde(rename = "open")]
892 Open,
893 #[serde(rename = "closed")]
894 Closed,
895}
896#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
898pub struct CreateOAuth2ApplicationOptions {
899 pub confidential_client: Option<bool>,
900 pub name: Option<String>,
901 pub redirect_uris: Option<Vec<String>>,
902}
903
904#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
906pub struct CreateOrUpdateSecretOption {
907 pub data: String,
909}
910
911#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
913pub struct CreateOrgOption {
914 pub description: Option<String>,
915 pub email: Option<String>,
916 pub full_name: Option<String>,
917 pub location: Option<String>,
918 pub repo_admin_change_team_access: Option<bool>,
919 pub username: String,
920 pub visibility: Option<CreateOrgOptionVisibility>,
922 pub website: Option<String>,
923}
924
925#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
928pub enum CreateOrgOptionVisibility {
929 #[serde(rename = "public")]
930 Public,
931 #[serde(rename = "limited")]
932 Limited,
933 #[serde(rename = "private")]
934 Private,
935}
936#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
938pub struct CreatePullRequestOption {
939 pub assignee: Option<String>,
940 pub assignees: Option<Vec<String>>,
941 pub base: Option<String>,
942 pub body: Option<String>,
943 #[serde(with = "time::serde::rfc3339::option")]
944 pub due_date: Option<time::OffsetDateTime>,
945 pub head: Option<String>,
946 pub labels: Option<Vec<i64>>,
947 pub milestone: Option<i64>,
948 pub title: Option<String>,
949}
950
951#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
953pub struct CreatePullReviewComment {
954 pub body: Option<String>,
955 pub new_position: Option<i64>,
957 pub old_position: Option<i64>,
959 pub path: Option<String>,
961}
962
963#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
965pub struct CreatePullReviewOptions {
966 pub body: Option<String>,
967 pub comments: Option<Vec<CreatePullReviewComment>>,
968 pub commit_id: Option<String>,
969 pub event: Option<String>,
970}
971
972#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
973pub struct CreatePushMirrorOption {
974 pub branch_filter: Option<String>,
975 pub interval: Option<String>,
976 pub remote_address: Option<String>,
977 pub remote_password: Option<String>,
978 pub remote_username: Option<String>,
979 pub sync_on_commit: Option<bool>,
980 pub use_ssh: Option<bool>,
981}
982
983#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
985pub struct CreateQuotaGroupOptions {
986 pub name: Option<String>,
988 pub rules: Option<Vec<CreateQuotaRuleOptions>>,
992}
993
994#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
996pub struct CreateQuotaRuleOptions {
997 pub limit: Option<i64>,
999 pub name: Option<String>,
1001 pub subjects: Option<Vec<CreateQuotaRuleOptionsSubjects>>,
1003}
1004
1005#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1006pub enum CreateQuotaRuleOptionsSubjects {
1007 #[serde(rename = "none")]
1008 None,
1009 #[serde(rename = "size:all")]
1010 SizeAll,
1011 #[serde(rename = "size:repos:all")]
1012 SizeReposAll,
1013 #[serde(rename = "size:repos:public")]
1014 SizeReposPublic,
1015 #[serde(rename = "size:repos:private")]
1016 SizeReposPrivate,
1017 #[serde(rename = "size:git:all")]
1018 SizeGitAll,
1019 #[serde(rename = "size:git:lfs")]
1020 SizeGitLfs,
1021 #[serde(rename = "size:assets:all")]
1022 SizeAssetsAll,
1023 #[serde(rename = "size:assets:attachments:all")]
1024 SizeAssetsAttachmentsAll,
1025 #[serde(rename = "size:assets:attachments:issues")]
1026 SizeAssetsAttachmentsIssues,
1027 #[serde(rename = "size:assets:attachments:releases")]
1028 SizeAssetsAttachmentsReleases,
1029 #[serde(rename = "size:assets:artifacts")]
1030 SizeAssetsArtifacts,
1031 #[serde(rename = "size:assets:packages:all")]
1032 SizeAssetsPackagesAll,
1033 #[serde(rename = "size:assets:wiki")]
1034 SizeAssetsWiki,
1035}
1036#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1038pub struct CreateReleaseOption {
1039 pub body: Option<String>,
1040 pub draft: Option<bool>,
1041 pub hide_archive_links: Option<bool>,
1042 pub name: Option<String>,
1043 pub prerelease: Option<bool>,
1044 pub tag_name: String,
1045 pub target_commitish: Option<String>,
1046}
1047
1048#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1050pub struct CreateRepoOption {
1051 pub auto_init: Option<bool>,
1053 pub default_branch: Option<String>,
1055 pub description: Option<String>,
1057 pub gitignores: Option<String>,
1059 pub issue_labels: Option<String>,
1061 pub license: Option<String>,
1063 pub name: String,
1065 pub object_format_name: Option<ObjectFormatName>,
1066 pub private: Option<bool>,
1068 pub readme: Option<String>,
1070 pub template: Option<bool>,
1072 pub trust_model: Option<CreateRepoOptionTrustModel>,
1074}
1075
1076#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1079pub enum CreateRepoOptionTrustModel {
1080 #[serde(rename = "default")]
1081 Default,
1082 #[serde(rename = "collaborator")]
1083 Collaborator,
1084 #[serde(rename = "committer")]
1085 Committer,
1086 #[serde(rename = "collaboratorcommitter")]
1087 Collaboratorcommitter,
1088}
1089#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1091pub struct CreateStatusOption {
1092 pub context: Option<String>,
1093 pub description: Option<String>,
1094 pub state: Option<CommitStatusState>,
1095 #[serde(deserialize_with = "crate::none_if_blank_url")]
1096 pub target_url: Option<url::Url>,
1097}
1098
1099#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1101pub struct CreateTagOption {
1102 pub message: Option<String>,
1103 pub tag_name: String,
1104 pub target: Option<String>,
1105}
1106
1107#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1109pub struct CreateTagProtectionOption {
1110 pub name_pattern: Option<String>,
1111 pub whitelist_teams: Option<Vec<String>>,
1112 pub whitelist_usernames: Option<Vec<String>>,
1113}
1114
1115#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1117pub struct CreateTeamOption {
1118 pub can_create_org_repo: Option<bool>,
1119 pub description: Option<String>,
1120 pub includes_all_repositories: Option<bool>,
1121 pub name: String,
1122 pub permission: Option<CreateTeamOptionPermission>,
1123 pub units: Option<Vec<String>>,
1124 pub units_map: Option<BTreeMap<String, String>>,
1125}
1126
1127#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1128pub enum CreateTeamOptionPermission {
1129 #[serde(rename = "read")]
1130 Read,
1131 #[serde(rename = "write")]
1132 Write,
1133 #[serde(rename = "admin")]
1134 Admin,
1135}
1136#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1138pub struct CreateUserOption {
1139 #[serde(with = "time::serde::rfc3339::option")]
1140 pub created_at: Option<time::OffsetDateTime>,
1146 pub email: String,
1147 pub full_name: Option<String>,
1148 pub login_name: Option<String>,
1149 pub must_change_password: Option<bool>,
1150 pub password: Option<String>,
1151 pub restricted: Option<bool>,
1152 pub send_notify: Option<bool>,
1153 pub source_id: Option<i64>,
1154 pub username: String,
1155 pub visibility: Option<String>,
1156}
1157
1158#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1160pub struct CreateVariableOption {
1161 pub value: String,
1163}
1164
1165#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1167pub struct CreateWikiPageOptions {
1168 pub content_base64: Option<String>,
1170 pub message: Option<String>,
1172 pub title: Option<String>,
1174}
1175
1176#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1178pub struct Cron {
1179 pub exec_times: Option<i64>,
1180 pub name: Option<String>,
1181 #[serde(with = "time::serde::rfc3339::option")]
1182 pub next: Option<time::OffsetDateTime>,
1183 #[serde(with = "time::serde::rfc3339::option")]
1184 pub prev: Option<time::OffsetDateTime>,
1185 pub schedule: Option<String>,
1186}
1187
1188impl_from_response!(Cron);
1189
1190#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1191pub enum DefaultMergeStyle {
1192 #[serde(rename = "merge")]
1193 Merge,
1194 #[serde(rename = "rebase")]
1195 Rebase,
1196 #[serde(rename = "rebase-merge")]
1197 RebaseMerge,
1198 #[serde(rename = "squash")]
1199 Squash,
1200 #[serde(rename = "fast-forward-only")]
1201 FastForwardOnly,
1202}
1203#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1205pub struct DeleteEmailOption {
1206 pub emails: Option<Vec<String>>,
1208}
1209
1210#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1214pub struct DeleteFileOptions {
1215 pub author: Option<Identity>,
1216 pub branch: Option<String>,
1218 pub committer: Option<Identity>,
1219 pub dates: Option<CommitDateOptions>,
1220 pub message: Option<String>,
1222 pub new_branch: Option<String>,
1224 pub sha: String,
1226 pub signoff: Option<bool>,
1228}
1229
1230#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1232pub struct DeleteLabelsOption {
1233 #[serde(with = "time::serde::rfc3339::option")]
1234 pub updated_at: Option<time::OffsetDateTime>,
1235}
1236
1237#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1239pub struct DeployKey {
1240 #[serde(with = "time::serde::rfc3339::option")]
1241 pub created_at: Option<time::OffsetDateTime>,
1242 pub fingerprint: Option<String>,
1243 pub id: Option<i64>,
1244 pub key: Option<String>,
1245 pub key_id: Option<i64>,
1246 pub read_only: Option<bool>,
1247 pub repository: Option<Repository>,
1248 pub title: Option<String>,
1249 #[serde(deserialize_with = "crate::none_if_blank_url")]
1250 pub url: Option<url::Url>,
1251}
1252
1253impl_from_response!(DeployKey);
1254
1255#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1257pub struct DismissPullReviewOptions {
1258 pub message: Option<String>,
1259 pub priors: Option<bool>,
1260}
1261
1262#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1264pub struct DispatchWorkflowOption {
1265 pub inputs: Option<BTreeMap<String, String>>,
1267 #[serde(rename = "ref")]
1269 pub r#ref: String,
1270 pub return_run_info: Option<bool>,
1272}
1273
1274#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1276pub struct DispatchWorkflowRun {
1277 pub id: Option<i64>,
1279 pub jobs: Option<Vec<String>>,
1281 pub run_number: Option<i64>,
1283}
1284
1285impl_from_response!(DispatchWorkflowRun);
1286
1287#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1289pub struct EditAttachmentOptions {
1290 #[serde(deserialize_with = "crate::none_if_blank_url")]
1291 pub browser_download_url: Option<url::Url>,
1293 pub name: Option<String>,
1294}
1295
1296#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1298pub struct EditBranchProtectionOption {
1299 pub apply_to_admins: Option<bool>,
1300 pub approvals_whitelist_teams: Option<Vec<String>>,
1301 pub approvals_whitelist_username: Option<Vec<String>>,
1302 pub block_on_official_review_requests: Option<bool>,
1303 pub block_on_outdated_branch: Option<bool>,
1304 pub block_on_rejected_reviews: Option<bool>,
1305 pub dismiss_stale_approvals: Option<bool>,
1306 pub enable_approvals_whitelist: Option<bool>,
1307 pub enable_merge_whitelist: Option<bool>,
1308 pub enable_push: Option<bool>,
1309 pub enable_push_whitelist: Option<bool>,
1310 pub enable_status_check: Option<bool>,
1311 pub ignore_stale_approvals: Option<bool>,
1312 pub merge_whitelist_teams: Option<Vec<String>>,
1313 pub merge_whitelist_usernames: Option<Vec<String>>,
1314 pub protected_file_patterns: Option<String>,
1315 pub push_whitelist_deploy_keys: Option<bool>,
1316 pub push_whitelist_teams: Option<Vec<String>>,
1317 pub push_whitelist_usernames: Option<Vec<String>>,
1318 pub require_signed_commits: Option<bool>,
1319 pub required_approvals: Option<i64>,
1320 pub status_check_contexts: Option<Vec<String>>,
1321 pub unprotected_file_patterns: Option<String>,
1322}
1323
1324#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1326pub struct EditDeadlineOption {
1327 #[serde(with = "time::serde::rfc3339")]
1328 pub due_date: time::OffsetDateTime,
1329}
1330
1331#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1333pub struct EditGitHookOption {
1334 pub content: Option<String>,
1335}
1336
1337#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1339pub struct EditHookOption {
1340 pub active: Option<bool>,
1341 pub authorization_header: Option<String>,
1342 pub branch_filter: Option<String>,
1343 pub config: Option<BTreeMap<String, String>>,
1344 pub events: Option<Vec<String>>,
1345}
1346
1347#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1349pub struct EditIssueCommentOption {
1350 pub body: String,
1351 #[serde(with = "time::serde::rfc3339::option")]
1352 pub updated_at: Option<time::OffsetDateTime>,
1353}
1354
1355#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1357pub struct EditIssueOption {
1358 pub assignee: Option<String>,
1360 pub assignees: Option<Vec<String>>,
1361 pub body: Option<String>,
1362 #[serde(with = "time::serde::rfc3339::option")]
1363 pub due_date: Option<time::OffsetDateTime>,
1364 pub milestone: Option<i64>,
1365 #[serde(rename = "ref")]
1366 pub r#ref: Option<String>,
1367 pub state: Option<String>,
1368 pub title: Option<String>,
1369 pub unset_due_date: Option<bool>,
1370 #[serde(with = "time::serde::rfc3339::option")]
1371 pub updated_at: Option<time::OffsetDateTime>,
1372}
1373
1374#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1376pub struct EditLabelOption {
1377 pub color: Option<String>,
1378 pub description: Option<String>,
1379 pub exclusive: Option<bool>,
1380 pub is_archived: Option<bool>,
1381 pub name: Option<String>,
1382}
1383
1384#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1386pub struct EditMilestoneOption {
1387 pub description: Option<String>,
1388 #[serde(with = "time::serde::rfc3339::option")]
1389 pub due_on: Option<time::OffsetDateTime>,
1390 pub state: Option<String>,
1391 pub title: Option<String>,
1392}
1393
1394#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1396pub struct EditOrgOption {
1397 pub description: Option<String>,
1398 pub email: Option<String>,
1399 pub full_name: Option<String>,
1400 pub location: Option<String>,
1401 pub repo_admin_change_team_access: Option<bool>,
1402 pub visibility: Option<EditOrgOptionVisibility>,
1404 pub website: Option<String>,
1405}
1406
1407#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1410pub enum EditOrgOptionVisibility {
1411 #[serde(rename = "public")]
1412 Public,
1413 #[serde(rename = "limited")]
1414 Limited,
1415 #[serde(rename = "private")]
1416 Private,
1417}
1418#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1420pub struct EditPullRequestOption {
1421 pub allow_maintainer_edit: Option<bool>,
1422 pub assignee: Option<String>,
1423 pub assignees: Option<Vec<String>>,
1424 pub base: Option<String>,
1425 pub body: Option<String>,
1426 #[serde(with = "time::serde::rfc3339::option")]
1427 pub due_date: Option<time::OffsetDateTime>,
1428 pub labels: Option<Vec<i64>>,
1429 pub milestone: Option<i64>,
1430 pub state: Option<String>,
1431 pub title: Option<String>,
1432 pub unset_due_date: Option<bool>,
1433}
1434
1435#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1437pub struct EditQuotaRuleOptions {
1438 pub limit: Option<i64>,
1440 pub subjects: Option<Vec<String>>,
1442}
1443
1444#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1446pub struct EditReactionOption {
1447 pub content: Option<String>,
1448}
1449
1450#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1452pub struct EditReleaseOption {
1453 pub body: Option<String>,
1454 pub draft: Option<bool>,
1455 pub hide_archive_links: Option<bool>,
1456 pub name: Option<String>,
1457 pub prerelease: Option<bool>,
1458 pub tag_name: Option<String>,
1459 pub target_commitish: Option<String>,
1460}
1461
1462#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1464pub struct EditRepoOption {
1465 pub allow_fast_forward_only_merge: Option<bool>,
1467 pub allow_manual_merge: Option<bool>,
1469 pub allow_merge_commits: Option<bool>,
1471 pub allow_rebase: Option<bool>,
1473 pub allow_rebase_explicit: Option<bool>,
1475 pub allow_rebase_update: Option<bool>,
1477 pub allow_squash_merge: Option<bool>,
1479 pub archived: Option<bool>,
1481 pub autodetect_manual_merge: Option<bool>,
1483 pub default_allow_maintainer_edit: Option<bool>,
1485 pub default_branch: Option<String>,
1487 pub default_delete_branch_after_merge: Option<bool>,
1489 pub default_merge_style: Option<DefaultMergeStyle>,
1490 pub default_update_style: Option<String>,
1492 pub description: Option<String>,
1494 pub enable_prune: Option<bool>,
1496 pub external_tracker: Option<ExternalTracker>,
1497 pub external_wiki: Option<ExternalWiki>,
1498 pub globally_editable_wiki: Option<bool>,
1500 pub has_actions: Option<bool>,
1502 pub has_issues: Option<bool>,
1504 pub has_packages: Option<bool>,
1506 pub has_projects: Option<bool>,
1508 pub has_pull_requests: Option<bool>,
1510 pub has_releases: Option<bool>,
1512 pub has_wiki: Option<bool>,
1514 pub ignore_whitespace_conflicts: Option<bool>,
1516 pub internal_tracker: Option<InternalTracker>,
1517 pub mirror_interval: Option<String>,
1519 pub name: Option<String>,
1521 pub private: Option<bool>,
1527 pub template: Option<bool>,
1529 pub website: Option<String>,
1531 pub wiki_branch: Option<String>,
1533}
1534
1535#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1537pub struct EditTagProtectionOption {
1538 pub name_pattern: Option<String>,
1539 pub whitelist_teams: Option<Vec<String>>,
1540 pub whitelist_usernames: Option<Vec<String>>,
1541}
1542
1543#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1545pub struct EditTeamOption {
1546 pub can_create_org_repo: Option<bool>,
1547 pub description: Option<String>,
1548 pub includes_all_repositories: Option<bool>,
1549 pub name: String,
1550 pub permission: Option<EditTeamOptionPermission>,
1551 pub units: Option<Vec<String>>,
1552 pub units_map: Option<BTreeMap<String, String>>,
1553}
1554
1555#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1556pub enum EditTeamOptionPermission {
1557 #[serde(rename = "read")]
1558 Read,
1559 #[serde(rename = "write")]
1560 Write,
1561 #[serde(rename = "admin")]
1562 Admin,
1563}
1564#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1566pub struct EditUserOption {
1567 pub active: Option<bool>,
1568 pub admin: Option<bool>,
1569 pub allow_create_organization: Option<bool>,
1570 pub allow_git_hook: Option<bool>,
1571 pub allow_import_local: Option<bool>,
1572 pub description: Option<String>,
1573 pub email: Option<String>,
1574 pub full_name: Option<String>,
1575 pub hide_email: Option<bool>,
1576 pub location: Option<String>,
1577 pub login_name: Option<String>,
1578 pub max_repo_creation: Option<i64>,
1579 pub must_change_password: Option<bool>,
1580 pub password: Option<String>,
1581 pub prohibit_login: Option<bool>,
1582 pub pronouns: Option<String>,
1583 pub restricted: Option<bool>,
1584 pub source_id: Option<i64>,
1585 pub visibility: Option<String>,
1586 pub website: Option<String>,
1587}
1588
1589#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1591pub struct Email {
1592 pub email: Option<String>,
1593 pub primary: Option<bool>,
1594 pub user_id: Option<i64>,
1595 pub username: Option<String>,
1596 pub verified: Option<bool>,
1597}
1598
1599impl_from_response!(Email);
1600
1601#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1603pub struct ExternalTracker {
1604 pub external_tracker_format: Option<String>,
1606 pub external_tracker_regexp_pattern: Option<String>,
1608 pub external_tracker_style: Option<String>,
1610 #[serde(deserialize_with = "crate::none_if_blank_url")]
1611 pub external_tracker_url: Option<url::Url>,
1613}
1614
1615#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1617pub struct ExternalWiki {
1618 #[serde(deserialize_with = "crate::none_if_blank_url")]
1619 pub external_wiki_url: Option<url::Url>,
1621}
1622
1623#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1624pub struct FileCommitResponse {
1625 pub author: Option<CommitUser>,
1626 pub committer: Option<CommitUser>,
1627 #[serde(with = "time::serde::rfc3339::option")]
1628 pub created: Option<time::OffsetDateTime>,
1629 #[serde(deserialize_with = "crate::none_if_blank_url")]
1630 pub html_url: Option<url::Url>,
1631 pub message: Option<String>,
1632 pub parents: Option<Vec<CommitMeta>>,
1633 pub sha: Option<String>,
1634 pub tree: Option<CommitMeta>,
1635 #[serde(deserialize_with = "crate::none_if_blank_url")]
1636 pub url: Option<url::Url>,
1637}
1638
1639#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1641pub struct FileDeleteResponse {
1642 pub commit: Option<FileCommitResponse>,
1643 pub content: Option<serde_json::Value>,
1644 pub verification: Option<PayloadCommitVerification>,
1645}
1646
1647impl_from_response!(FileDeleteResponse);
1648
1649#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1651pub struct FileLinksResponse {
1652 pub git: Option<String>,
1653 pub html: Option<String>,
1654 #[serde(rename = "self")]
1655 pub this: Option<String>,
1656}
1657
1658#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1660pub struct FileResponse {
1661 pub commit: Option<FileCommitResponse>,
1662 pub content: Option<ContentsResponse>,
1663 pub verification: Option<PayloadCommitVerification>,
1664}
1665
1666impl_from_response!(FileResponse);
1667
1668#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1670pub struct FilesResponse {
1671 pub commit: Option<FileCommitResponse>,
1672 pub files: Option<Vec<ContentsResponse>>,
1673 pub verification: Option<PayloadCommitVerification>,
1674}
1675
1676impl_from_response!(FilesResponse);
1677
1678#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1680pub struct ForgeLike {}
1681
1682#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1684pub struct ForgeOutbox {}
1685
1686impl_from_response!(ForgeOutbox);
1687
1688#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1690pub struct GPGKey {
1691 pub can_certify: Option<bool>,
1692 pub can_encrypt_comms: Option<bool>,
1693 pub can_encrypt_storage: Option<bool>,
1694 pub can_sign: Option<bool>,
1695 #[serde(with = "time::serde::rfc3339::option")]
1696 pub created_at: Option<time::OffsetDateTime>,
1697 pub emails: Option<Vec<GPGKeyEmail>>,
1698 #[serde(with = "time::serde::rfc3339::option")]
1699 pub expires_at: Option<time::OffsetDateTime>,
1700 pub id: Option<i64>,
1701 pub key_id: Option<String>,
1702 pub primary_key_id: Option<String>,
1703 pub public_key: Option<String>,
1704 pub subkeys: Option<Vec<GPGKey>>,
1705 pub verified: Option<bool>,
1706}
1707
1708impl_from_response!(GPGKey);
1709
1710#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1712pub struct GPGKeyEmail {
1713 pub email: Option<String>,
1714 pub verified: Option<bool>,
1715}
1716
1717#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1719pub struct GeneralAPISettings {
1720 pub default_git_trees_per_page: Option<i64>,
1721 pub default_max_blob_size: Option<i64>,
1722 pub default_paging_num: Option<i64>,
1723 pub max_response_items: Option<i64>,
1724}
1725
1726impl_from_response!(GeneralAPISettings);
1727
1728#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1730pub struct GeneralAttachmentSettings {
1731 pub allowed_types: Option<String>,
1732 pub enabled: Option<bool>,
1733 pub max_files: Option<i64>,
1734 pub max_size: Option<i64>,
1735}
1736
1737impl_from_response!(GeneralAttachmentSettings);
1738
1739#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1741pub struct GeneralRepoSettings {
1742 pub forks_disabled: Option<bool>,
1743 pub http_git_disabled: Option<bool>,
1744 pub lfs_disabled: Option<bool>,
1745 pub migrations_disabled: Option<bool>,
1746 pub mirrors_disabled: Option<bool>,
1747 pub stars_disabled: Option<bool>,
1748 pub time_tracking_disabled: Option<bool>,
1749}
1750
1751impl_from_response!(GeneralRepoSettings);
1752
1753#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1755pub struct GeneralUISettings {
1756 pub allowed_reactions: Option<Vec<String>>,
1757 pub custom_emojis: Option<Vec<String>>,
1758 pub default_theme: Option<String>,
1759}
1760
1761impl_from_response!(GeneralUISettings);
1762
1763#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1765pub struct GenerateRepoOption {
1766 pub avatar: Option<bool>,
1768 pub default_branch: Option<String>,
1770 pub description: Option<String>,
1772 pub git_content: Option<bool>,
1774 pub git_hooks: Option<bool>,
1776 pub labels: Option<bool>,
1778 pub name: String,
1780 pub owner: String,
1782 pub private: Option<bool>,
1784 pub protected_branch: Option<bool>,
1786 pub topics: Option<bool>,
1788 pub webhooks: Option<bool>,
1790}
1791
1792#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1794pub struct GitBlob {
1795 pub content: Option<String>,
1796 pub encoding: Option<String>,
1797 pub sha: Option<String>,
1798 pub size: Option<i64>,
1799 #[serde(deserialize_with = "crate::none_if_blank_url")]
1800 pub url: Option<url::Url>,
1801}
1802
1803impl_from_response!(GitBlob);
1804
1805#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1807pub struct GitEntry {
1808 pub mode: Option<String>,
1809 pub path: Option<String>,
1810 pub sha: Option<String>,
1811 pub size: Option<i64>,
1812 #[serde(rename = "type")]
1813 pub r#type: Option<String>,
1814 #[serde(deserialize_with = "crate::none_if_blank_url")]
1815 pub url: Option<url::Url>,
1816}
1817
1818#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1820pub struct GitHook {
1821 pub content: Option<String>,
1822 pub is_active: Option<bool>,
1823 pub name: Option<String>,
1824}
1825
1826impl_from_response!(GitHook);
1827
1828#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1829pub struct GitObject {
1830 pub sha: Option<String>,
1831 #[serde(rename = "type")]
1832 pub r#type: Option<String>,
1833 #[serde(deserialize_with = "crate::none_if_blank_url")]
1834 pub url: Option<url::Url>,
1835}
1836
1837#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1839pub struct GitTreeResponse {
1840 pub page: Option<i64>,
1841 pub sha: Option<String>,
1842 pub total_count: Option<i64>,
1843 pub tree: Option<Vec<GitEntry>>,
1844 pub truncated: Option<bool>,
1845 #[serde(deserialize_with = "crate::none_if_blank_url")]
1846 pub url: Option<url::Url>,
1847}
1848
1849impl_from_response!(GitTreeResponse);
1850
1851#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1853pub struct GitignoreTemplateInfo {
1854 pub name: Option<String>,
1855 pub source: Option<String>,
1856}
1857
1858impl_from_response!(GitignoreTemplateInfo);
1859
1860#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1862pub struct Hook {
1863 pub active: Option<bool>,
1864 pub authorization_header: Option<String>,
1865 pub branch_filter: Option<String>,
1866 pub config: Option<BTreeMap<String, String>>,
1868 pub content_type: Option<String>,
1869 #[serde(with = "time::serde::rfc3339::option")]
1870 pub created_at: Option<time::OffsetDateTime>,
1871 pub events: Option<Vec<String>>,
1872 pub id: Option<i64>,
1873 pub metadata: Option<serde_json::Value>,
1874 #[serde(rename = "type")]
1875 pub r#type: Option<String>,
1876 #[serde(with = "time::serde::rfc3339::option")]
1877 pub updated_at: Option<time::OffsetDateTime>,
1878 #[serde(deserialize_with = "crate::none_if_blank_url")]
1879 pub url: Option<url::Url>,
1880}
1881
1882impl_from_response!(Hook);
1883
1884#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1886pub struct Identity {
1887 pub email: Option<String>,
1888 pub name: Option<String>,
1889}
1890
1891#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1893pub struct InternalTracker {
1894 pub allow_only_contributors_to_track_time: Option<bool>,
1896 pub enable_issue_dependencies: Option<bool>,
1898 pub enable_time_tracker: Option<bool>,
1900}
1901
1902#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1904pub struct Issue {
1905 pub assets: Option<Vec<Attachment>>,
1906 pub assignee: Option<User>,
1907 pub assignees: Option<Vec<User>>,
1908 pub body: Option<String>,
1909 #[serde(with = "time::serde::rfc3339::option")]
1910 pub closed_at: Option<time::OffsetDateTime>,
1911 pub comments: Option<i64>,
1912 #[serde(with = "time::serde::rfc3339::option")]
1913 pub created_at: Option<time::OffsetDateTime>,
1914 #[serde(with = "time::serde::rfc3339::option")]
1915 pub due_date: Option<time::OffsetDateTime>,
1916 #[serde(deserialize_with = "crate::none_if_blank_url")]
1917 pub html_url: Option<url::Url>,
1918 pub id: Option<i64>,
1919 pub is_locked: Option<bool>,
1920 pub labels: Option<Vec<Label>>,
1921 pub milestone: Option<Milestone>,
1922 pub number: Option<i64>,
1923 pub original_author: Option<String>,
1924 pub original_author_id: Option<i64>,
1925 pub pin_order: Option<i64>,
1926 pub pull_request: Option<PullRequestMeta>,
1927 #[serde(rename = "ref")]
1928 pub r#ref: Option<String>,
1929 pub repository: Option<RepositoryMeta>,
1930 pub state: Option<StateType>,
1931 pub title: Option<String>,
1932 #[serde(with = "time::serde::rfc3339::option")]
1933 pub updated_at: Option<time::OffsetDateTime>,
1934 #[serde(deserialize_with = "crate::none_if_blank_url")]
1935 pub url: Option<url::Url>,
1936 pub user: Option<User>,
1937}
1938
1939impl_from_response!(Issue);
1940
1941#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1942pub struct IssueConfig {
1943 pub blank_issues_enabled: Option<bool>,
1944 pub contact_links: Option<Vec<IssueConfigContactLink>>,
1945}
1946
1947impl_from_response!(IssueConfig);
1948
1949#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1950pub struct IssueConfigContactLink {
1951 pub about: Option<String>,
1952 pub name: Option<String>,
1953 #[serde(deserialize_with = "crate::none_if_blank_url")]
1954 pub url: Option<url::Url>,
1955}
1956
1957#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1958pub struct IssueConfigValidation {
1959 pub message: Option<String>,
1960 pub valid: Option<bool>,
1961}
1962
1963impl_from_response!(IssueConfigValidation);
1964
1965#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1967pub struct IssueDeadline {
1968 #[serde(with = "time::serde::rfc3339::option")]
1969 pub due_date: Option<time::OffsetDateTime>,
1970}
1971
1972impl_from_response!(IssueDeadline);
1973
1974#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
1976pub struct IssueFormField {
1977 pub attributes: Option<BTreeMap<String, serde_json::Value>>,
1978 pub id: Option<String>,
1979 #[serde(rename = "type")]
1980 pub r#type: Option<IssueFormFieldType>,
1981 pub validations: Option<BTreeMap<String, serde_json::Value>>,
1982 pub visible: Option<Vec<String>>,
1983}
1984
1985#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
1986pub enum IssueFormFieldType {
1987 #[serde(rename = "markdown")]
1988 Markdown,
1989 #[serde(rename = "textarea")]
1990 Textarea,
1991 #[serde(rename = "input")]
1992 Input,
1993 #[serde(rename = "dropdown")]
1994 Dropdown,
1995 #[serde(rename = "checkboxes")]
1996 Checkboxes,
1997}
1998#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2000pub struct IssueLabelsOption {
2001 pub labels: Option<Vec<serde_json::Value>>,
2005 #[serde(with = "time::serde::rfc3339::option")]
2006 pub updated_at: Option<time::OffsetDateTime>,
2007}
2008
2009#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2011pub struct IssueMeta {
2012 pub index: Option<i64>,
2013 pub owner: Option<String>,
2014 pub repo: Option<String>,
2015}
2016
2017#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2019pub struct IssueTemplate {
2020 pub about: Option<String>,
2021 pub body: Option<Vec<IssueFormField>>,
2022 pub content: Option<String>,
2023 pub file_name: Option<String>,
2024 pub labels: Option<Vec<String>>,
2025 pub name: Option<String>,
2026 #[serde(rename = "ref")]
2027 pub r#ref: Option<String>,
2028 pub title: Option<String>,
2029}
2030
2031impl_from_response!(IssueTemplate);
2032
2033#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2035pub struct Label {
2036 pub color: Option<String>,
2037 pub description: Option<String>,
2038 pub exclusive: Option<bool>,
2039 pub id: Option<i64>,
2040 pub is_archived: Option<bool>,
2041 pub name: Option<String>,
2042 #[serde(deserialize_with = "crate::none_if_blank_url")]
2043 pub url: Option<url::Url>,
2044}
2045
2046impl_from_response!(Label);
2047
2048#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2050pub struct LabelTemplate {
2051 pub color: Option<String>,
2052 pub description: Option<String>,
2053 pub exclusive: Option<bool>,
2054 pub name: Option<String>,
2055}
2056
2057impl_from_response!(LabelTemplate);
2058
2059#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2061pub struct LicenseTemplateInfo {
2062 pub body: Option<String>,
2063 pub implementation: Option<String>,
2064 pub key: Option<String>,
2065 pub name: Option<String>,
2066 #[serde(deserialize_with = "crate::none_if_blank_url")]
2067 pub url: Option<url::Url>,
2068}
2069
2070impl_from_response!(LicenseTemplateInfo);
2071
2072#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2074pub struct LicensesTemplateListEntry {
2075 pub key: Option<String>,
2076 pub name: Option<String>,
2077 #[serde(deserialize_with = "crate::none_if_blank_url")]
2078 pub url: Option<url::Url>,
2079}
2080
2081impl_from_response!(LicensesTemplateListEntry);
2082
2083#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2085pub struct ListActionRunResponse {
2086 pub total_count: Option<i64>,
2087 pub workflow_runs: Option<Vec<ActionRun>>,
2088}
2089
2090impl_from_response!(ListActionRunResponse);
2091
2092#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2094pub struct MarkdownOption {
2095 #[serde(rename = "Context")]
2101 pub context: Option<String>,
2102 #[serde(rename = "Mode")]
2108 pub mode: Option<String>,
2109 #[serde(rename = "Text")]
2115 pub text: Option<String>,
2116 #[serde(rename = "Wiki")]
2122 pub wiki: Option<bool>,
2123}
2124
2125#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2127pub struct MarkupOption {
2128 #[serde(rename = "BranchPath")]
2134 pub branch_path: Option<String>,
2135 #[serde(rename = "Context")]
2141 pub context: Option<String>,
2142 #[serde(rename = "FilePath")]
2148 pub file_path: Option<String>,
2149 #[serde(rename = "Mode")]
2155 pub mode: Option<String>,
2156 #[serde(rename = "Text")]
2162 pub text: Option<String>,
2163 #[serde(rename = "Wiki")]
2169 pub wiki: Option<bool>,
2170}
2171
2172#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2174pub struct MergePullRequestOption {
2175 #[serde(rename = "Do")]
2176 pub r#do: MergePullRequestOptionDo,
2177 #[serde(rename = "MergeCommitID")]
2178 pub merge_commit_id: Option<String>,
2179 #[serde(rename = "MergeMessageField")]
2180 pub merge_message_field: Option<String>,
2181 #[serde(rename = "MergeTitleField")]
2182 pub merge_title_field: Option<String>,
2183 pub delete_branch_after_merge: Option<bool>,
2184 pub force_merge: Option<bool>,
2185 pub head_commit_id: Option<String>,
2186 pub merge_when_checks_succeed: Option<bool>,
2187}
2188
2189#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2190pub enum MergePullRequestOptionDo {
2191 #[serde(rename = "merge")]
2192 Merge,
2193 #[serde(rename = "rebase")]
2194 Rebase,
2195 #[serde(rename = "rebase-merge")]
2196 RebaseMerge,
2197 #[serde(rename = "squash")]
2198 Squash,
2199 #[serde(rename = "fast-forward-only")]
2200 FastForwardOnly,
2201 #[serde(rename = "manually-merged")]
2202 ManuallyMerged,
2203}
2204#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2208pub struct MigrateRepoOptions {
2209 pub auth_password: Option<String>,
2210 pub auth_token: Option<String>,
2211 pub auth_username: Option<String>,
2212 pub clone_addr: String,
2213 pub description: Option<String>,
2214 pub issues: Option<bool>,
2215 pub labels: Option<bool>,
2216 pub lfs: Option<bool>,
2217 pub lfs_endpoint: Option<String>,
2218 pub milestones: Option<bool>,
2219 pub mirror: Option<bool>,
2220 pub mirror_interval: Option<String>,
2221 pub private: Option<bool>,
2222 pub pull_requests: Option<bool>,
2223 pub releases: Option<bool>,
2224 pub repo_name: String,
2225 pub repo_owner: Option<String>,
2227 pub service: Option<MigrateRepoOptionsService>,
2228 pub uid: Option<i64>,
2230 pub wiki: Option<bool>,
2231}
2232
2233#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2234pub enum MigrateRepoOptionsService {
2235 #[serde(rename = "git")]
2236 Git,
2237 #[serde(rename = "github")]
2238 Github,
2239 #[serde(rename = "gitea")]
2240 Gitea,
2241 #[serde(rename = "gitlab")]
2242 Gitlab,
2243 #[serde(rename = "gogs")]
2244 Gogs,
2245 #[serde(rename = "onedev")]
2246 Onedev,
2247 #[serde(rename = "gitbucket")]
2248 Gitbucket,
2249 #[serde(rename = "codebase")]
2250 Codebase,
2251}
2252#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2254pub struct Milestone {
2255 #[serde(with = "time::serde::rfc3339::option")]
2256 pub closed_at: Option<time::OffsetDateTime>,
2257 pub closed_issues: Option<i64>,
2258 #[serde(with = "time::serde::rfc3339::option")]
2259 pub created_at: Option<time::OffsetDateTime>,
2260 pub description: Option<String>,
2261 #[serde(with = "time::serde::rfc3339::option")]
2262 pub due_on: Option<time::OffsetDateTime>,
2263 pub id: Option<i64>,
2264 pub open_issues: Option<i64>,
2265 pub state: Option<StateType>,
2266 pub title: Option<String>,
2267 #[serde(with = "time::serde::rfc3339::option")]
2268 pub updated_at: Option<time::OffsetDateTime>,
2269}
2270
2271impl_from_response!(Milestone);
2272
2273#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2275pub struct NewIssuePinsAllowed {
2276 pub issues: Option<bool>,
2277 pub pull_requests: Option<bool>,
2278}
2279
2280impl_from_response!(NewIssuePinsAllowed);
2281
2282#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2284pub struct NodeInfo {
2285 pub metadata: Option<BTreeMap<String, serde_json::Value>>,
2286 #[serde(rename = "openRegistrations")]
2287 pub open_registrations: Option<bool>,
2288 pub protocols: Option<Vec<String>>,
2289 pub services: Option<NodeInfoServices>,
2290 pub software: Option<NodeInfoSoftware>,
2291 pub usage: Option<NodeInfoUsage>,
2292 pub version: Option<String>,
2293}
2294
2295impl_from_response!(NodeInfo);
2296
2297#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2299pub struct NodeInfoServices {
2300 pub inbound: Option<Vec<String>>,
2301 pub outbound: Option<Vec<String>>,
2302}
2303
2304#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2306pub struct NodeInfoSoftware {
2307 pub homepage: Option<String>,
2308 pub name: Option<String>,
2309 pub repository: Option<String>,
2310 pub version: Option<String>,
2311}
2312
2313#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2315pub struct NodeInfoUsage {
2316 #[serde(rename = "localComments")]
2317 pub local_comments: Option<i64>,
2318 #[serde(rename = "localPosts")]
2319 pub local_posts: Option<i64>,
2320 pub users: Option<NodeInfoUsageUsers>,
2321}
2322
2323#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2325pub struct NodeInfoUsageUsers {
2326 #[serde(rename = "activeHalfyear")]
2327 pub active_halfyear: Option<i64>,
2328 #[serde(rename = "activeMonth")]
2329 pub active_month: Option<i64>,
2330 pub total: Option<i64>,
2331}
2332
2333#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2335pub struct Note {
2336 pub commit: Option<Commit>,
2337 pub message: Option<String>,
2338}
2339
2340impl_from_response!(Note);
2341
2342#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2343pub struct NoteOptions {
2344 pub message: Option<String>,
2345}
2346
2347#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2349pub struct NotificationCount {
2350 pub new: Option<i64>,
2351}
2352
2353impl_from_response!(NotificationCount);
2354
2355#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2357pub struct NotificationSubject {
2358 #[serde(deserialize_with = "crate::none_if_blank_url")]
2359 pub html_url: Option<url::Url>,
2360 #[serde(deserialize_with = "crate::none_if_blank_url")]
2361 pub latest_comment_html_url: Option<url::Url>,
2362 #[serde(deserialize_with = "crate::none_if_blank_url")]
2363 pub latest_comment_url: Option<url::Url>,
2364 pub state: Option<StateType>,
2365 pub title: Option<String>,
2366 #[serde(rename = "type")]
2367 pub r#type: Option<NotifySubjectType>,
2368 #[serde(deserialize_with = "crate::none_if_blank_url")]
2369 pub url: Option<url::Url>,
2370}
2371
2372#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2374pub struct NotificationThread {
2375 pub id: Option<i64>,
2376 pub pinned: Option<bool>,
2377 pub repository: Option<Repository>,
2378 pub subject: Option<NotificationSubject>,
2379 pub unread: Option<bool>,
2380 #[serde(with = "time::serde::rfc3339::option")]
2381 pub updated_at: Option<time::OffsetDateTime>,
2382 #[serde(deserialize_with = "crate::none_if_blank_url")]
2383 pub url: Option<url::Url>,
2384}
2385
2386impl_from_response!(NotificationThread);
2387
2388#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2391pub enum NotifySubjectType {
2392 #[serde(rename = "Issue")]
2393 Issue,
2394 #[serde(rename = "Pull")]
2395 Pull,
2396 #[serde(rename = "Commit")]
2397 Commit,
2398 #[serde(rename = "Repository")]
2399 Repository,
2400}
2401#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2402pub struct OAuth2Application {
2403 pub client_id: Option<String>,
2404 pub client_secret: Option<String>,
2405 pub confidential_client: Option<bool>,
2406 #[serde(with = "time::serde::rfc3339::option")]
2407 pub created: Option<time::OffsetDateTime>,
2408 pub id: Option<i64>,
2409 pub name: Option<String>,
2410 pub redirect_uris: Option<Vec<String>>,
2411}
2412
2413impl_from_response!(OAuth2Application);
2414
2415#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
2418pub enum ObjectFormatName {
2419 #[serde(rename = "sha1")]
2420 Sha1,
2421 #[serde(rename = "sha256")]
2422 Sha256,
2423}
2424#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2426pub struct Organization {
2427 #[serde(deserialize_with = "crate::none_if_blank_url")]
2428 pub avatar_url: Option<url::Url>,
2429 pub description: Option<String>,
2430 pub email: Option<String>,
2431 pub full_name: Option<String>,
2432 pub id: Option<i64>,
2433 pub location: Option<String>,
2434 pub name: Option<String>,
2435 pub repo_admin_change_team_access: Option<bool>,
2436 pub username: Option<String>,
2438 pub visibility: Option<String>,
2439 pub website: Option<String>,
2440}
2441
2442impl_from_response!(Organization);
2443
2444#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2446pub struct OrganizationPermissions {
2447 pub can_create_repository: Option<bool>,
2448 pub can_read: Option<bool>,
2449 pub can_write: Option<bool>,
2450 pub is_admin: Option<bool>,
2451 pub is_owner: Option<bool>,
2452}
2453
2454impl_from_response!(OrganizationPermissions);
2455
2456#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2458pub struct PRBranchInfo {
2459 pub label: Option<String>,
2460 #[serde(rename = "ref")]
2461 pub r#ref: Option<String>,
2462 pub repo: Option<Repository>,
2463 pub repo_id: Option<i64>,
2464 pub sha: Option<String>,
2465}
2466
2467#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2469pub struct Package {
2470 #[serde(with = "time::serde::rfc3339::option")]
2471 pub created_at: Option<time::OffsetDateTime>,
2472 pub creator: Option<User>,
2473 #[serde(deserialize_with = "crate::none_if_blank_url")]
2474 pub html_url: Option<url::Url>,
2475 pub id: Option<i64>,
2476 pub name: Option<String>,
2477 pub owner: Option<User>,
2478 pub repository: Option<Repository>,
2479 #[serde(rename = "type")]
2480 pub r#type: Option<String>,
2481 pub version: Option<String>,
2482}
2483
2484impl_from_response!(Package);
2485
2486#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2488pub struct PackageFile {
2489 #[serde(rename = "Size")]
2490 pub size: Option<i64>,
2491 pub id: Option<i64>,
2492 pub md5: Option<String>,
2493 pub name: Option<String>,
2494 pub sha1: Option<String>,
2495 pub sha256: Option<String>,
2496 pub sha512: Option<String>,
2497}
2498
2499impl_from_response!(PackageFile);
2500
2501#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2503pub struct PayloadCommit {
2504 pub added: Option<Vec<String>>,
2505 pub author: Option<PayloadUser>,
2506 pub committer: Option<PayloadUser>,
2507 pub id: Option<String>,
2509 pub message: Option<String>,
2510 pub modified: Option<Vec<String>>,
2511 pub removed: Option<Vec<String>>,
2512 #[serde(with = "time::serde::rfc3339::option")]
2513 pub timestamp: Option<time::OffsetDateTime>,
2514 #[serde(deserialize_with = "crate::none_if_blank_url")]
2515 pub url: Option<url::Url>,
2516 pub verification: Option<PayloadCommitVerification>,
2517}
2518
2519#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2521pub struct PayloadCommitVerification {
2522 pub payload: Option<String>,
2523 pub reason: Option<String>,
2524 pub signature: Option<String>,
2525 pub signer: Option<PayloadUser>,
2526 pub verified: Option<bool>,
2527}
2528
2529#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2531pub struct PayloadUser {
2532 pub email: Option<String>,
2533 pub name: Option<String>,
2535 pub username: Option<String>,
2536}
2537
2538#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2540pub struct Permission {
2541 pub admin: Option<bool>,
2542 pub pull: Option<bool>,
2543 pub push: Option<bool>,
2544}
2545
2546#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2548pub struct PublicKey {
2549 #[serde(with = "time::serde::rfc3339::option")]
2550 pub created_at: Option<time::OffsetDateTime>,
2551 pub fingerprint: Option<String>,
2552 pub id: Option<i64>,
2553 pub key: Option<String>,
2554 pub key_type: Option<String>,
2555 pub read_only: Option<bool>,
2556 pub title: Option<String>,
2557 #[serde(deserialize_with = "crate::none_if_blank_url")]
2558 pub url: Option<url::Url>,
2559 pub user: Option<User>,
2560}
2561
2562impl_from_response!(PublicKey);
2563
2564#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2566pub struct PullRequest {
2567 pub additions: Option<i64>,
2568 pub allow_maintainer_edit: Option<bool>,
2569 pub assignee: Option<User>,
2570 pub assignees: Option<Vec<User>>,
2571 pub base: Option<PRBranchInfo>,
2572 pub body: Option<String>,
2573 pub changed_files: Option<i64>,
2574 #[serde(with = "time::serde::rfc3339::option")]
2575 pub closed_at: Option<time::OffsetDateTime>,
2576 pub comments: Option<i64>,
2577 #[serde(with = "time::serde::rfc3339::option")]
2578 pub created_at: Option<time::OffsetDateTime>,
2579 pub deletions: Option<i64>,
2580 #[serde(deserialize_with = "crate::none_if_blank_url")]
2581 pub diff_url: Option<url::Url>,
2582 pub draft: Option<bool>,
2583 #[serde(with = "time::serde::rfc3339::option")]
2584 pub due_date: Option<time::OffsetDateTime>,
2585 pub flow: Option<i64>,
2586 pub head: Option<PRBranchInfo>,
2587 #[serde(deserialize_with = "crate::none_if_blank_url")]
2588 pub html_url: Option<url::Url>,
2589 pub id: Option<i64>,
2590 pub is_locked: Option<bool>,
2591 pub labels: Option<Vec<Label>>,
2592 pub merge_base: Option<String>,
2593 pub merge_commit_sha: Option<String>,
2594 pub mergeable: Option<bool>,
2595 pub merged: Option<bool>,
2596 #[serde(with = "time::serde::rfc3339::option")]
2597 pub merged_at: Option<time::OffsetDateTime>,
2598 pub merged_by: Option<User>,
2599 pub milestone: Option<Milestone>,
2600 pub number: Option<i64>,
2601 #[serde(deserialize_with = "crate::none_if_blank_url")]
2602 pub patch_url: Option<url::Url>,
2603 pub pin_order: Option<i64>,
2604 #[serde(deserialize_with = "crate::requested_reviewers_ignore_null")]
2605 pub requested_reviewers: Option<Vec<User>>,
2606 pub requested_reviewers_teams: Option<Vec<Team>>,
2607 pub review_comments: Option<i64>,
2609 pub state: Option<StateType>,
2610 pub title: Option<String>,
2611 #[serde(with = "time::serde::rfc3339::option")]
2612 pub updated_at: Option<time::OffsetDateTime>,
2613 #[serde(deserialize_with = "crate::none_if_blank_url")]
2614 pub url: Option<url::Url>,
2615 pub user: Option<User>,
2616}
2617
2618impl_from_response!(PullRequest);
2619
2620#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2622pub struct PullRequestMeta {
2623 pub draft: Option<bool>,
2624 #[serde(deserialize_with = "crate::none_if_blank_url")]
2625 pub html_url: Option<url::Url>,
2626 pub merged: Option<bool>,
2627 #[serde(with = "time::serde::rfc3339::option")]
2628 pub merged_at: Option<time::OffsetDateTime>,
2629}
2630
2631#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2633pub struct PullReview {
2634 pub body: Option<String>,
2635 pub comments_count: Option<i64>,
2636 pub commit_id: Option<String>,
2637 pub dismissed: Option<bool>,
2638 #[serde(deserialize_with = "crate::none_if_blank_url")]
2639 pub html_url: Option<url::Url>,
2640 pub id: Option<i64>,
2641 pub official: Option<bool>,
2642 #[serde(deserialize_with = "crate::none_if_blank_url")]
2643 pub pull_request_url: Option<url::Url>,
2644 pub stale: Option<bool>,
2645 pub state: Option<String>,
2646 #[serde(with = "time::serde::rfc3339::option")]
2647 pub submitted_at: Option<time::OffsetDateTime>,
2648 pub team: Option<Team>,
2649 #[serde(with = "time::serde::rfc3339::option")]
2650 pub updated_at: Option<time::OffsetDateTime>,
2651 pub user: Option<User>,
2652}
2653
2654impl_from_response!(PullReview);
2655
2656#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2658pub struct PullReviewComment {
2659 pub body: Option<String>,
2660 pub commit_id: Option<String>,
2661 #[serde(with = "time::serde::rfc3339::option")]
2662 pub created_at: Option<time::OffsetDateTime>,
2663 pub diff_hunk: Option<String>,
2664 #[serde(deserialize_with = "crate::none_if_blank_url")]
2665 pub html_url: Option<url::Url>,
2666 pub id: Option<i64>,
2667 pub original_commit_id: Option<String>,
2668 pub original_position: Option<u64>,
2669 pub path: Option<String>,
2670 pub position: Option<u64>,
2671 pub pull_request_review_id: Option<i64>,
2672 #[serde(deserialize_with = "crate::none_if_blank_url")]
2673 pub pull_request_url: Option<url::Url>,
2674 pub resolver: Option<User>,
2675 #[serde(with = "time::serde::rfc3339::option")]
2676 pub updated_at: Option<time::OffsetDateTime>,
2677 pub user: Option<User>,
2678}
2679
2680impl_from_response!(PullReviewComment);
2681
2682#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2684pub struct PullReviewRequestOptions {
2685 pub reviewers: Option<Vec<String>>,
2686 pub team_reviewers: Option<Vec<String>>,
2687}
2688
2689#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2691pub struct PushMirror {
2692 pub branch_filter: Option<String>,
2693 #[serde(with = "time::serde::rfc3339::option")]
2694 pub created: Option<time::OffsetDateTime>,
2695 pub interval: Option<String>,
2696 pub last_error: Option<String>,
2697 #[serde(with = "time::serde::rfc3339::option")]
2698 pub last_update: Option<time::OffsetDateTime>,
2699 pub public_key: Option<String>,
2700 pub remote_address: Option<String>,
2701 pub remote_name: Option<String>,
2702 pub repo_name: Option<String>,
2703 pub sync_on_commit: Option<bool>,
2704}
2705
2706impl_from_response!(PushMirror);
2707
2708#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2710pub struct QuotaGroup {
2711 pub name: Option<String>,
2713 pub rules: Option<Vec<QuotaRuleInfo>>,
2715}
2716
2717impl_from_response!(QuotaGroup);
2718
2719#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2721pub struct QuotaInfo {
2722 pub groups: Option<Vec<QuotaGroup>>,
2723 pub used: Option<QuotaUsed>,
2724}
2725
2726impl_from_response!(QuotaInfo);
2727
2728#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2730pub struct QuotaRuleInfo {
2731 pub limit: Option<i64>,
2733 pub name: Option<String>,
2735 pub subjects: Option<Vec<String>>,
2737}
2738
2739impl_from_response!(QuotaRuleInfo);
2740
2741#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2743pub struct QuotaUsed {
2744 pub size: Option<QuotaUsedSize>,
2745}
2746
2747#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2749pub struct QuotaUsedArtifact {
2750 #[serde(deserialize_with = "crate::none_if_blank_url")]
2751 pub html_url: Option<url::Url>,
2753 pub name: Option<String>,
2755 pub size: Option<i64>,
2757}
2758
2759impl_from_response!(QuotaUsedArtifact);
2760
2761#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2763pub struct QuotaUsedAttachment {
2764 #[serde(deserialize_with = "crate::none_if_blank_url")]
2765 pub api_url: Option<url::Url>,
2767 pub contained_in: Option<QuotaUsedAttachmentContainedIn>,
2769 pub name: Option<String>,
2771 pub size: Option<i64>,
2773}
2774
2775impl_from_response!(QuotaUsedAttachment);
2776
2777#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2779pub struct QuotaUsedAttachmentContainedIn {
2780 #[serde(deserialize_with = "crate::none_if_blank_url")]
2781 pub api_url: Option<url::Url>,
2783 #[serde(deserialize_with = "crate::none_if_blank_url")]
2784 pub html_url: Option<url::Url>,
2786}
2787
2788#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2790pub struct QuotaUsedPackage {
2791 #[serde(deserialize_with = "crate::none_if_blank_url")]
2792 pub html_url: Option<url::Url>,
2794 pub name: Option<String>,
2796 pub size: Option<i64>,
2798 #[serde(rename = "type")]
2800 pub r#type: Option<String>,
2801 pub version: Option<String>,
2803}
2804
2805impl_from_response!(QuotaUsedPackage);
2806
2807#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2809pub struct QuotaUsedSize {
2810 pub assets: Option<QuotaUsedSizeAssets>,
2811 pub git: Option<QuotaUsedSizeGit>,
2812 pub repos: Option<QuotaUsedSizeRepos>,
2813}
2814
2815#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2817pub struct QuotaUsedSizeAssets {
2818 pub artifacts: Option<i64>,
2820 pub attachments: Option<QuotaUsedSizeAssetsAttachments>,
2821 pub packages: Option<QuotaUsedSizeAssetsPackages>,
2822}
2823
2824#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2826pub struct QuotaUsedSizeAssetsAttachments {
2827 pub issues: Option<i64>,
2829 pub releases: Option<i64>,
2831}
2832
2833#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2835pub struct QuotaUsedSizeAssetsPackages {
2836 pub all: Option<i64>,
2838}
2839
2840#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2842pub struct QuotaUsedSizeGit {
2843 #[serde(rename = "LFS")]
2845 pub lfs: Option<i64>,
2846}
2847
2848#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2850pub struct QuotaUsedSizeRepos {
2851 pub private: Option<i64>,
2853 pub public: Option<i64>,
2855}
2856
2857#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2859pub struct Reaction {
2860 pub content: Option<String>,
2861 #[serde(with = "time::serde::rfc3339::option")]
2862 pub created_at: Option<time::OffsetDateTime>,
2863 pub user: Option<User>,
2864}
2865
2866impl_from_response!(Reaction);
2867
2868#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2869pub struct Reference {
2870 pub object: Option<GitObject>,
2871 #[serde(rename = "ref")]
2872 pub r#ref: Option<String>,
2873 #[serde(deserialize_with = "crate::none_if_blank_url")]
2874 pub url: Option<url::Url>,
2875}
2876
2877impl_from_response!(Reference);
2878
2879#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2881pub struct RegistrationToken {
2882 pub token: Option<String>,
2883}
2884
2885impl_from_response!(RegistrationToken);
2886
2887#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2889pub struct Release {
2890 pub archive_download_count: Option<TagArchiveDownloadCount>,
2891 pub assets: Option<Vec<Attachment>>,
2892 pub author: Option<User>,
2893 pub body: Option<String>,
2894 #[serde(with = "time::serde::rfc3339::option")]
2895 pub created_at: Option<time::OffsetDateTime>,
2896 pub draft: Option<bool>,
2897 pub hide_archive_links: Option<bool>,
2898 #[serde(deserialize_with = "crate::none_if_blank_url")]
2899 pub html_url: Option<url::Url>,
2900 pub id: Option<i64>,
2901 pub name: Option<String>,
2902 pub prerelease: Option<bool>,
2903 #[serde(with = "time::serde::rfc3339::option")]
2904 pub published_at: Option<time::OffsetDateTime>,
2905 pub tag_name: Option<String>,
2906 #[serde(deserialize_with = "crate::none_if_blank_url")]
2907 pub tarball_url: Option<url::Url>,
2908 pub target_commitish: Option<String>,
2909 #[serde(deserialize_with = "crate::none_if_blank_url")]
2910 pub upload_url: Option<url::Url>,
2911 #[serde(deserialize_with = "crate::none_if_blank_url")]
2912 pub url: Option<url::Url>,
2913 #[serde(deserialize_with = "crate::none_if_blank_url")]
2914 pub zipball_url: Option<url::Url>,
2915}
2916
2917impl_from_response!(Release);
2918
2919#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2921pub struct RenameOrgOption {
2922 pub new_name: String,
2924}
2925
2926#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2928pub struct RenameUserOption {
2929 pub new_username: String,
2931}
2932
2933#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2935pub struct ReplaceFlagsOption {
2936 pub flags: Option<Vec<String>>,
2937}
2938
2939#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2941pub struct RepoCollaboratorPermission {
2942 pub permission: Option<String>,
2943 pub role_name: Option<String>,
2944 pub user: Option<User>,
2945}
2946
2947impl_from_response!(RepoCollaboratorPermission);
2948
2949#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2950pub struct RepoCommit {
2951 pub author: Option<CommitUser>,
2952 pub committer: Option<CommitUser>,
2953 pub message: Option<String>,
2954 pub tree: Option<CommitMeta>,
2955 #[serde(deserialize_with = "crate::none_if_blank_url")]
2956 pub url: Option<url::Url>,
2957 pub verification: Option<PayloadCommitVerification>,
2958}
2959
2960#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2962pub struct RepoTopicOptions {
2963 pub topics: Option<Vec<String>>,
2965}
2966
2967#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2969pub struct RepoTransfer {
2970 pub doer: Option<User>,
2971 pub recipient: Option<User>,
2972 pub teams: Option<Vec<Team>>,
2973}
2974
2975#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
2977pub struct Repository {
2978 pub allow_fast_forward_only_merge: Option<bool>,
2979 pub allow_merge_commits: Option<bool>,
2980 pub allow_rebase: Option<bool>,
2981 pub allow_rebase_explicit: Option<bool>,
2982 pub allow_rebase_update: Option<bool>,
2983 pub allow_squash_merge: Option<bool>,
2984 pub archived: Option<bool>,
2985 #[serde(with = "time::serde::rfc3339::option")]
2986 pub archived_at: Option<time::OffsetDateTime>,
2987 #[serde(deserialize_with = "crate::none_if_blank_url")]
2988 pub avatar_url: Option<url::Url>,
2989 #[serde(deserialize_with = "crate::none_if_blank_url")]
2990 pub clone_url: Option<url::Url>,
2991 #[serde(with = "time::serde::rfc3339::option")]
2992 pub created_at: Option<time::OffsetDateTime>,
2993 pub default_allow_maintainer_edit: Option<bool>,
2994 pub default_branch: Option<String>,
2995 pub default_delete_branch_after_merge: Option<bool>,
2996 pub default_merge_style: Option<DefaultMergeStyle>,
2997 pub default_update_style: Option<String>,
2998 pub description: Option<String>,
2999 pub empty: Option<bool>,
3000 pub external_tracker: Option<ExternalTracker>,
3001 pub external_wiki: Option<ExternalWiki>,
3002 pub fork: Option<bool>,
3003 pub forks_count: Option<i64>,
3004 pub full_name: Option<String>,
3005 pub globally_editable_wiki: Option<bool>,
3006 pub has_actions: Option<bool>,
3007 pub has_issues: Option<bool>,
3008 pub has_packages: Option<bool>,
3009 pub has_projects: Option<bool>,
3010 pub has_pull_requests: Option<bool>,
3011 pub has_releases: Option<bool>,
3012 pub has_wiki: Option<bool>,
3013 #[serde(deserialize_with = "crate::none_if_blank_url")]
3014 pub html_url: Option<url::Url>,
3015 pub id: Option<i64>,
3016 pub ignore_whitespace_conflicts: Option<bool>,
3017 pub internal: Option<bool>,
3018 pub internal_tracker: Option<InternalTracker>,
3019 pub language: Option<String>,
3020 #[serde(deserialize_with = "crate::none_if_blank_url")]
3021 pub languages_url: Option<url::Url>,
3022 pub link: Option<String>,
3023 pub mirror: Option<bool>,
3024 pub mirror_interval: Option<String>,
3025 #[serde(with = "time::serde::rfc3339::option")]
3026 pub mirror_updated: Option<time::OffsetDateTime>,
3027 pub name: Option<String>,
3028 pub object_format_name: Option<ObjectFormatName>,
3029 pub open_issues_count: Option<i64>,
3030 pub open_pr_counter: Option<i64>,
3031 #[serde(deserialize_with = "crate::none_if_blank_url")]
3032 pub original_url: Option<url::Url>,
3033 pub owner: Option<User>,
3034 pub parent: Option<Box<Repository>>,
3035 pub permissions: Option<Permission>,
3036 pub private: Option<bool>,
3037 pub release_counter: Option<i64>,
3038 pub repo_transfer: Option<RepoTransfer>,
3039 pub size: Option<i64>,
3040 #[serde(deserialize_with = "crate::deserialize_optional_ssh_url")]
3041 pub ssh_url: Option<url::Url>,
3042 pub stars_count: Option<i64>,
3043 pub template: Option<bool>,
3044 pub topics: Option<Vec<String>>,
3045 #[serde(with = "time::serde::rfc3339::option")]
3046 pub updated_at: Option<time::OffsetDateTime>,
3047 #[serde(deserialize_with = "crate::none_if_blank_url")]
3048 pub url: Option<url::Url>,
3049 pub watchers_count: Option<i64>,
3050 pub website: Option<String>,
3051 pub wiki_branch: Option<String>,
3052}
3053
3054impl_from_response!(Repository);
3055
3056#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3058pub struct RepositoryMeta {
3059 pub full_name: Option<String>,
3060 pub id: Option<i64>,
3061 pub name: Option<String>,
3062 pub owner: Option<String>,
3063}
3064
3065#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3067pub struct SearchResults {
3068 pub data: Option<Vec<Repository>>,
3069 pub ok: Option<bool>,
3070}
3071
3072impl_from_response!(SearchResults);
3073
3074#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3076pub struct Secret {
3077 #[serde(with = "time::serde::rfc3339::option")]
3078 pub created_at: Option<time::OffsetDateTime>,
3079 pub name: Option<String>,
3081}
3082
3083impl_from_response!(Secret);
3084
3085#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3087pub struct ServerVersion {
3088 pub version: Option<String>,
3089}
3090
3091impl_from_response!(ServerVersion);
3092
3093#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3095pub struct SetUserQuotaGroupsOptions {
3096 pub groups: Vec<String>,
3098}
3099
3100#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
3103pub enum StateType {
3104 #[serde(rename = "open")]
3105 Open,
3106 #[serde(rename = "closed")]
3107 Closed,
3108}
3109#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3111pub struct StopWatch {
3112 #[serde(with = "time::serde::rfc3339::option")]
3113 pub created: Option<time::OffsetDateTime>,
3114 pub duration: Option<String>,
3115 pub issue_index: Option<i64>,
3116 pub issue_title: Option<String>,
3117 pub repo_name: Option<String>,
3118 pub repo_owner_name: Option<String>,
3119 pub seconds: Option<i64>,
3120}
3121
3122impl_from_response!(StopWatch);
3123
3124#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3126pub struct SubmitPullReviewOptions {
3127 pub body: Option<String>,
3128 pub event: Option<String>,
3129}
3130
3131#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3133pub struct SyncForkInfo {
3134 pub allowed: Option<bool>,
3135 pub base_commit: Option<String>,
3136 pub commits_behind: Option<i64>,
3137 pub fork_commit: Option<String>,
3138}
3139
3140impl_from_response!(SyncForkInfo);
3141
3142#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3144pub struct Tag {
3145 pub archive_download_count: Option<TagArchiveDownloadCount>,
3146 pub commit: Option<CommitMeta>,
3147 pub id: Option<String>,
3148 pub message: Option<String>,
3149 pub name: Option<String>,
3150 #[serde(deserialize_with = "crate::none_if_blank_url")]
3151 pub tarball_url: Option<url::Url>,
3152 #[serde(deserialize_with = "crate::none_if_blank_url")]
3153 pub zipball_url: Option<url::Url>,
3154}
3155
3156impl_from_response!(Tag);
3157
3158#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3160pub struct TagArchiveDownloadCount {
3161 pub tar_gz: Option<i64>,
3162 pub zip: Option<i64>,
3163}
3164
3165#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3167pub struct TagProtection {
3168 #[serde(with = "time::serde::rfc3339::option")]
3169 pub created_at: Option<time::OffsetDateTime>,
3170 pub id: Option<i64>,
3171 pub name_pattern: Option<String>,
3172 #[serde(with = "time::serde::rfc3339::option")]
3173 pub updated_at: Option<time::OffsetDateTime>,
3174 pub whitelist_teams: Option<Vec<String>>,
3175 pub whitelist_usernames: Option<Vec<String>>,
3176}
3177
3178impl_from_response!(TagProtection);
3179
3180#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3182pub struct Team {
3183 pub can_create_org_repo: Option<bool>,
3184 pub description: Option<String>,
3185 pub id: Option<i64>,
3186 pub includes_all_repositories: Option<bool>,
3187 pub name: Option<String>,
3188 pub organization: Option<Organization>,
3189 pub permission: Option<TeamPermission>,
3190 pub units: Option<Vec<String>>,
3191 pub units_map: Option<BTreeMap<String, String>>,
3192}
3193
3194impl_from_response!(Team);
3195
3196#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
3197pub enum TeamPermission {
3198 #[serde(rename = "none")]
3199 None,
3200 #[serde(rename = "read")]
3201 Read,
3202 #[serde(rename = "write")]
3203 Write,
3204 #[serde(rename = "admin")]
3205 Admin,
3206 #[serde(rename = "owner")]
3207 Owner,
3208}
3209#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3211pub struct TimelineComment {
3212 pub assignee: Option<User>,
3213 pub assignee_team: Option<Team>,
3214 pub body: Option<String>,
3215 #[serde(with = "time::serde::rfc3339::option")]
3216 pub created_at: Option<time::OffsetDateTime>,
3217 pub dependent_issue: Option<Issue>,
3218 #[serde(deserialize_with = "crate::none_if_blank_url")]
3219 pub html_url: Option<url::Url>,
3220 pub id: Option<i64>,
3221 #[serde(deserialize_with = "crate::none_if_blank_url")]
3222 pub issue_url: Option<url::Url>,
3223 pub label: Option<Label>,
3224 pub milestone: Option<Milestone>,
3225 pub new_ref: Option<String>,
3226 pub new_title: Option<String>,
3227 pub old_milestone: Option<Milestone>,
3228 pub old_project_id: Option<i64>,
3229 pub old_ref: Option<String>,
3230 pub old_title: Option<String>,
3231 pub project_id: Option<i64>,
3232 #[serde(deserialize_with = "crate::none_if_blank_url")]
3233 pub pull_request_url: Option<url::Url>,
3234 pub ref_action: Option<String>,
3235 pub ref_comment: Option<Comment>,
3236 pub ref_commit_sha: Option<String>,
3238 pub ref_issue: Option<Issue>,
3239 pub removed_assignee: Option<bool>,
3241 pub resolve_doer: Option<User>,
3242 pub review_id: Option<i64>,
3243 pub tracked_time: Option<TrackedTime>,
3244 #[serde(rename = "type")]
3245 pub r#type: Option<String>,
3246 #[serde(with = "time::serde::rfc3339::option")]
3247 pub updated_at: Option<time::OffsetDateTime>,
3248 pub user: Option<User>,
3249}
3250
3251impl_from_response!(TimelineComment);
3252
3253#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3255pub struct TopicName {
3256 pub topics: Option<Vec<String>>,
3257}
3258
3259impl_from_response!(TopicName);
3260
3261#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3263pub struct TopicResponse {
3264 #[serde(with = "time::serde::rfc3339::option")]
3265 pub created: Option<time::OffsetDateTime>,
3266 pub id: Option<i64>,
3267 pub repo_count: Option<i64>,
3268 pub topic_name: Option<String>,
3269 #[serde(with = "time::serde::rfc3339::option")]
3270 pub updated: Option<time::OffsetDateTime>,
3271}
3272
3273#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3275pub struct TrackedTime {
3276 #[serde(with = "time::serde::rfc3339::option")]
3277 pub created: Option<time::OffsetDateTime>,
3278 pub id: Option<i64>,
3279 pub issue: Option<Issue>,
3280 pub issue_id: Option<i64>,
3282 pub time: Option<i64>,
3284 pub user_id: Option<i64>,
3286 pub user_name: Option<String>,
3287}
3288
3289impl_from_response!(TrackedTime);
3290
3291#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3293pub struct TransferRepoOption {
3294 pub new_owner: String,
3295 pub team_ids: Option<Vec<i64>>,
3297}
3298
3299#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3301pub struct UpdateBranchRepoOption {
3302 pub name: String,
3304}
3305
3306#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3310pub struct UpdateFileOptions {
3311 pub author: Option<Identity>,
3312 pub branch: Option<String>,
3314 pub committer: Option<Identity>,
3315 pub content: String,
3317 pub dates: Option<CommitDateOptions>,
3318 pub from_path: Option<String>,
3320 pub message: Option<String>,
3322 pub new_branch: Option<String>,
3324 pub sha: String,
3326 pub signoff: Option<bool>,
3328}
3329
3330#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3332pub struct UpdateRepoAvatarOption {
3333 pub image: Option<String>,
3335}
3336
3337#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3339pub struct UpdateUserAvatarOption {
3340 pub image: Option<String>,
3342}
3343
3344#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3346pub struct UpdateVariableOption {
3347 pub name: Option<String>,
3349 pub value: String,
3351}
3352
3353#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3355pub struct User {
3356 pub active: Option<bool>,
3358 #[serde(deserialize_with = "crate::none_if_blank_url")]
3359 pub avatar_url: Option<url::Url>,
3361 #[serde(with = "time::serde::rfc3339::option")]
3362 pub created: Option<time::OffsetDateTime>,
3363 pub description: Option<String>,
3365 pub email: Option<String>,
3366 pub followers_count: Option<i64>,
3368 pub following_count: Option<i64>,
3369 pub full_name: Option<String>,
3371 #[serde(deserialize_with = "crate::none_if_blank_url")]
3372 pub html_url: Option<url::Url>,
3374 pub id: Option<i64>,
3376 pub is_admin: Option<bool>,
3378 pub language: Option<String>,
3380 #[serde(with = "time::serde::rfc3339::option")]
3381 pub last_login: Option<time::OffsetDateTime>,
3382 pub location: Option<String>,
3384 pub login: Option<String>,
3386 pub login_name: Option<String>,
3388 pub prohibit_login: Option<bool>,
3390 pub pronouns: Option<String>,
3392 pub restricted: Option<bool>,
3394 pub source_id: Option<i64>,
3396 pub starred_repos_count: Option<i64>,
3397 pub visibility: Option<String>,
3399 pub website: Option<String>,
3401}
3402
3403impl_from_response!(User);
3404
3405#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3407pub struct UserHeatmapData {
3408 pub contributions: Option<i64>,
3409 pub timestamp: Option<i64>,
3410}
3411
3412impl_from_response!(UserHeatmapData);
3413
3414#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3416pub struct UserSettings {
3417 pub description: Option<String>,
3418 pub diff_view_style: Option<String>,
3419 pub enable_repo_unit_hints: Option<bool>,
3420 pub full_name: Option<String>,
3421 pub hide_activity: Option<bool>,
3422 pub hide_email: Option<bool>,
3424 pub hide_pronouns: Option<bool>,
3425 pub language: Option<String>,
3426 pub location: Option<String>,
3427 pub pronouns: Option<String>,
3428 pub theme: Option<String>,
3429 pub website: Option<String>,
3430}
3431
3432impl_from_response!(UserSettings);
3433
3434#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3436pub struct UserSettingsOptions {
3437 pub description: Option<String>,
3438 pub diff_view_style: Option<String>,
3439 pub enable_repo_unit_hints: Option<bool>,
3440 pub full_name: Option<String>,
3441 pub hide_activity: Option<bool>,
3442 pub hide_email: Option<bool>,
3444 pub hide_pronouns: Option<bool>,
3445 pub language: Option<String>,
3446 pub location: Option<String>,
3447 pub pronouns: Option<String>,
3448 pub theme: Option<String>,
3449 pub website: Option<String>,
3450}
3451
3452#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3454pub struct VerifyGPGKeyOption {
3455 pub armored_signature: Option<String>,
3456 pub key_id: String,
3458}
3459
3460#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3462pub struct WatchInfo {
3463 #[serde(with = "time::serde::rfc3339::option")]
3464 pub created_at: Option<time::OffsetDateTime>,
3465 pub ignored: Option<bool>,
3466 pub reason: Option<serde_json::Value>,
3467 #[serde(deserialize_with = "crate::none_if_blank_url")]
3468 pub repository_url: Option<url::Url>,
3469 pub subscribed: Option<bool>,
3470 #[serde(deserialize_with = "crate::none_if_blank_url")]
3471 pub url: Option<url::Url>,
3472}
3473
3474impl_from_response!(WatchInfo);
3475
3476#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3478pub struct WikiCommit {
3479 pub author: Option<CommitUser>,
3480 pub commiter: Option<CommitUser>,
3481 pub message: Option<String>,
3482 pub sha: Option<String>,
3483}
3484
3485#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3487pub struct WikiCommitList {
3488 pub commits: Option<Vec<WikiCommit>>,
3489 pub count: Option<i64>,
3490}
3491
3492impl_from_response!(WikiCommitList);
3493
3494#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3496pub struct WikiPage {
3497 pub commit_count: Option<i64>,
3498 pub content_base64: Option<String>,
3500 pub footer: Option<String>,
3501 #[serde(deserialize_with = "crate::none_if_blank_url")]
3502 pub html_url: Option<url::Url>,
3503 pub last_commit: Option<WikiCommit>,
3504 pub sidebar: Option<String>,
3505 pub sub_url: Option<String>,
3506 pub title: Option<String>,
3507}
3508
3509impl_from_response!(WikiPage);
3510
3511#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
3513pub struct WikiPageMetaData {
3514 #[serde(deserialize_with = "crate::none_if_blank_url")]
3515 pub html_url: Option<url::Url>,
3516 pub last_commit: Option<WikiCommit>,
3517 pub sub_url: Option<String>,
3518 pub title: Option<String>,
3519}
3520
3521impl_from_response!(WikiPageMetaData);
3522
3523pub struct AccessTokenListHeaders {
3524 pub x_total_count: Option<i64>,
3525}
3526
3527impl TryFrom<&reqwest::header::HeaderMap> for AccessTokenListHeaders {
3528 type Error = StructureError;
3529
3530 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3531 let x_total_count = map
3532 .get("x-total-count")
3533 .map(|s| -> Result<_, _> {
3534 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3535 s.parse::<i64>()
3536 .map_err(|_| StructureError::HeaderParseFailed)
3537 })
3538 .transpose()?;
3539 Ok(Self { x_total_count })
3540 }
3541}
3542
3543impl crate::sealed::Sealed for AccessTokenListHeaders {}
3544impl crate::CountHeader for AccessTokenListHeaders {
3545 fn count(&self) -> Option<usize> {
3546 self.x_total_count.map(|x| x as usize)
3547 }
3548}
3549
3550pub struct ActivityFeedsListHeaders {
3551 pub x_total_count: Option<i64>,
3552}
3553
3554impl TryFrom<&reqwest::header::HeaderMap> for ActivityFeedsListHeaders {
3555 type Error = StructureError;
3556
3557 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3558 let x_total_count = map
3559 .get("x-total-count")
3560 .map(|s| -> Result<_, _> {
3561 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3562 s.parse::<i64>()
3563 .map_err(|_| StructureError::HeaderParseFailed)
3564 })
3565 .transpose()?;
3566 Ok(Self { x_total_count })
3567 }
3568}
3569
3570impl crate::sealed::Sealed for ActivityFeedsListHeaders {}
3571impl crate::CountHeader for ActivityFeedsListHeaders {
3572 fn count(&self) -> Option<usize> {
3573 self.x_total_count.map(|x| x as usize)
3574 }
3575}
3576
3577pub struct BlockedUserListHeaders {
3578 pub x_total_count: Option<i64>,
3579}
3580
3581impl TryFrom<&reqwest::header::HeaderMap> for BlockedUserListHeaders {
3582 type Error = StructureError;
3583
3584 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3585 let x_total_count = map
3586 .get("x-total-count")
3587 .map(|s| -> Result<_, _> {
3588 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3589 s.parse::<i64>()
3590 .map_err(|_| StructureError::HeaderParseFailed)
3591 })
3592 .transpose()?;
3593 Ok(Self { x_total_count })
3594 }
3595}
3596
3597impl crate::sealed::Sealed for BlockedUserListHeaders {}
3598impl crate::CountHeader for BlockedUserListHeaders {
3599 fn count(&self) -> Option<usize> {
3600 self.x_total_count.map(|x| x as usize)
3601 }
3602}
3603
3604pub struct BranchListHeaders {
3605 pub x_total_count: Option<i64>,
3606}
3607
3608impl TryFrom<&reqwest::header::HeaderMap> for BranchListHeaders {
3609 type Error = StructureError;
3610
3611 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3612 let x_total_count = map
3613 .get("x-total-count")
3614 .map(|s| -> Result<_, _> {
3615 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3616 s.parse::<i64>()
3617 .map_err(|_| StructureError::HeaderParseFailed)
3618 })
3619 .transpose()?;
3620 Ok(Self { x_total_count })
3621 }
3622}
3623
3624impl crate::sealed::Sealed for BranchListHeaders {}
3625impl crate::CountHeader for BranchListHeaders {
3626 fn count(&self) -> Option<usize> {
3627 self.x_total_count.map(|x| x as usize)
3628 }
3629}
3630
3631pub struct ChangedFileListHeaders {
3632 pub x_total_count: Option<i64>,
3633}
3634
3635impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders {
3636 type Error = StructureError;
3637
3638 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3639 let x_total_count = map
3640 .get("x-total-count")
3641 .map(|s| -> Result<_, _> {
3642 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3643 s.parse::<i64>()
3644 .map_err(|_| StructureError::HeaderParseFailed)
3645 })
3646 .transpose()?;
3647 Ok(Self { x_total_count })
3648 }
3649}
3650
3651impl crate::sealed::Sealed for ChangedFileListHeaders {}
3652impl crate::CountHeader for ChangedFileListHeaders {
3653 fn count(&self) -> Option<usize> {
3654 self.x_total_count.map(|x| x as usize)
3655 }
3656}
3657
3658pub struct ChangedFileListWithPaginationHeaders {
3659 pub x_has_more: Option<bool>,
3660 pub x_page: Option<i64>,
3661 pub x_page_count: Option<i64>,
3662 pub x_per_page: Option<i64>,
3663 pub x_total_count: Option<i64>,
3664}
3665
3666impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListWithPaginationHeaders {
3667 type Error = StructureError;
3668
3669 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3670 let x_has_more = map
3671 .get("x-hasmore")
3672 .map(|s| -> Result<_, _> {
3673 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3674 s.parse::<bool>()
3675 .map_err(|_| StructureError::HeaderParseFailed)
3676 })
3677 .transpose()?;
3678 let x_page = map
3679 .get("x-page")
3680 .map(|s| -> Result<_, _> {
3681 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3682 s.parse::<i64>()
3683 .map_err(|_| StructureError::HeaderParseFailed)
3684 })
3685 .transpose()?;
3686 let x_page_count = map
3687 .get("x-pagecount")
3688 .map(|s| -> Result<_, _> {
3689 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3690 s.parse::<i64>()
3691 .map_err(|_| StructureError::HeaderParseFailed)
3692 })
3693 .transpose()?;
3694 let x_per_page = map
3695 .get("x-perpage")
3696 .map(|s| -> Result<_, _> {
3697 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3698 s.parse::<i64>()
3699 .map_err(|_| StructureError::HeaderParseFailed)
3700 })
3701 .transpose()?;
3702 let x_total_count = map
3703 .get("x-total-count")
3704 .map(|s| -> Result<_, _> {
3705 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3706 s.parse::<i64>()
3707 .map_err(|_| StructureError::HeaderParseFailed)
3708 })
3709 .transpose()?;
3710 Ok(Self {
3711 x_has_more,
3712 x_page,
3713 x_page_count,
3714 x_per_page,
3715 x_total_count,
3716 })
3717 }
3718}
3719
3720impl crate::sealed::Sealed for ChangedFileListWithPaginationHeaders {}
3721impl crate::CountHeader for ChangedFileListWithPaginationHeaders {
3722 fn count(&self) -> Option<usize> {
3723 self.x_total_count.map(|x| x as usize)
3724 }
3725}
3726
3727pub struct CombinedStatusHeaders {
3728 pub x_total_count: Option<i64>,
3729}
3730
3731impl TryFrom<&reqwest::header::HeaderMap> for CombinedStatusHeaders {
3732 type Error = StructureError;
3733
3734 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3735 let x_total_count = map
3736 .get("x-total-count")
3737 .map(|s| -> Result<_, _> {
3738 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3739 s.parse::<i64>()
3740 .map_err(|_| StructureError::HeaderParseFailed)
3741 })
3742 .transpose()?;
3743 Ok(Self { x_total_count })
3744 }
3745}
3746
3747impl crate::sealed::Sealed for CombinedStatusHeaders {}
3748impl crate::CountHeader for CombinedStatusHeaders {
3749 fn count(&self) -> Option<usize> {
3750 self.x_total_count.map(|x| x as usize)
3751 }
3752}
3753
3754pub struct CommentListHeaders {
3755 pub x_total_count: Option<i64>,
3756}
3757
3758impl TryFrom<&reqwest::header::HeaderMap> for CommentListHeaders {
3759 type Error = StructureError;
3760
3761 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3762 let x_total_count = map
3763 .get("x-total-count")
3764 .map(|s| -> Result<_, _> {
3765 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3766 s.parse::<i64>()
3767 .map_err(|_| StructureError::HeaderParseFailed)
3768 })
3769 .transpose()?;
3770 Ok(Self { x_total_count })
3771 }
3772}
3773
3774impl crate::sealed::Sealed for CommentListHeaders {}
3775impl crate::CountHeader for CommentListHeaders {
3776 fn count(&self) -> Option<usize> {
3777 self.x_total_count.map(|x| x as usize)
3778 }
3779}
3780
3781pub struct CommitListHeaders {
3782 pub x_has_more: Option<bool>,
3783 pub x_total_count: Option<i64>,
3784}
3785
3786impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders {
3787 type Error = StructureError;
3788
3789 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3790 let x_has_more = map
3791 .get("x-hasmore")
3792 .map(|s| -> Result<_, _> {
3793 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3794 s.parse::<bool>()
3795 .map_err(|_| StructureError::HeaderParseFailed)
3796 })
3797 .transpose()?;
3798 let x_total_count = map
3799 .get("x-total-count")
3800 .map(|s| -> Result<_, _> {
3801 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3802 s.parse::<i64>()
3803 .map_err(|_| StructureError::HeaderParseFailed)
3804 })
3805 .transpose()?;
3806 Ok(Self {
3807 x_has_more,
3808 x_total_count,
3809 })
3810 }
3811}
3812
3813impl crate::sealed::Sealed for CommitListHeaders {}
3814impl crate::CountHeader for CommitListHeaders {
3815 fn count(&self) -> Option<usize> {
3816 self.x_total_count.map(|x| x as usize)
3817 }
3818}
3819
3820pub struct CommitStatusListHeaders {
3821 pub x_total_count: Option<i64>,
3822}
3823
3824impl TryFrom<&reqwest::header::HeaderMap> for CommitStatusListHeaders {
3825 type Error = StructureError;
3826
3827 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3828 let x_total_count = map
3829 .get("x-total-count")
3830 .map(|s| -> Result<_, _> {
3831 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3832 s.parse::<i64>()
3833 .map_err(|_| StructureError::HeaderParseFailed)
3834 })
3835 .transpose()?;
3836 Ok(Self { x_total_count })
3837 }
3838}
3839
3840impl crate::sealed::Sealed for CommitStatusListHeaders {}
3841impl crate::CountHeader for CommitStatusListHeaders {
3842 fn count(&self) -> Option<usize> {
3843 self.x_total_count.map(|x| x as usize)
3844 }
3845}
3846
3847pub struct CronListHeaders {
3848 pub x_total_count: Option<i64>,
3849}
3850
3851impl TryFrom<&reqwest::header::HeaderMap> for CronListHeaders {
3852 type Error = StructureError;
3853
3854 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3855 let x_total_count = map
3856 .get("x-total-count")
3857 .map(|s| -> Result<_, _> {
3858 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3859 s.parse::<i64>()
3860 .map_err(|_| StructureError::HeaderParseFailed)
3861 })
3862 .transpose()?;
3863 Ok(Self { x_total_count })
3864 }
3865}
3866
3867impl crate::sealed::Sealed for CronListHeaders {}
3868impl crate::CountHeader for CronListHeaders {
3869 fn count(&self) -> Option<usize> {
3870 self.x_total_count.map(|x| x as usize)
3871 }
3872}
3873
3874pub struct DeployKeyListHeaders {
3875 pub x_total_count: Option<i64>,
3876}
3877
3878impl TryFrom<&reqwest::header::HeaderMap> for DeployKeyListHeaders {
3879 type Error = StructureError;
3880
3881 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3882 let x_total_count = map
3883 .get("x-total-count")
3884 .map(|s| -> Result<_, _> {
3885 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3886 s.parse::<i64>()
3887 .map_err(|_| StructureError::HeaderParseFailed)
3888 })
3889 .transpose()?;
3890 Ok(Self { x_total_count })
3891 }
3892}
3893
3894impl crate::sealed::Sealed for DeployKeyListHeaders {}
3895impl crate::CountHeader for DeployKeyListHeaders {
3896 fn count(&self) -> Option<usize> {
3897 self.x_total_count.map(|x| x as usize)
3898 }
3899}
3900
3901pub struct GpgKeyListHeaders {
3902 pub x_total_count: Option<i64>,
3903}
3904
3905impl TryFrom<&reqwest::header::HeaderMap> for GpgKeyListHeaders {
3906 type Error = StructureError;
3907
3908 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3909 let x_total_count = map
3910 .get("x-total-count")
3911 .map(|s| -> Result<_, _> {
3912 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3913 s.parse::<i64>()
3914 .map_err(|_| StructureError::HeaderParseFailed)
3915 })
3916 .transpose()?;
3917 Ok(Self { x_total_count })
3918 }
3919}
3920
3921impl crate::sealed::Sealed for GpgKeyListHeaders {}
3922impl crate::CountHeader for GpgKeyListHeaders {
3923 fn count(&self) -> Option<usize> {
3924 self.x_total_count.map(|x| x as usize)
3925 }
3926}
3927
3928pub struct HookListHeaders {
3929 pub x_total_count: Option<i64>,
3930}
3931
3932impl TryFrom<&reqwest::header::HeaderMap> for HookListHeaders {
3933 type Error = StructureError;
3934
3935 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3936 let x_total_count = map
3937 .get("x-total-count")
3938 .map(|s| -> Result<_, _> {
3939 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3940 s.parse::<i64>()
3941 .map_err(|_| StructureError::HeaderParseFailed)
3942 })
3943 .transpose()?;
3944 Ok(Self { x_total_count })
3945 }
3946}
3947
3948impl crate::sealed::Sealed for HookListHeaders {}
3949impl crate::CountHeader for HookListHeaders {
3950 fn count(&self) -> Option<usize> {
3951 self.x_total_count.map(|x| x as usize)
3952 }
3953}
3954
3955pub struct IssueListHeaders {
3956 pub x_total_count: Option<i64>,
3957}
3958
3959impl TryFrom<&reqwest::header::HeaderMap> for IssueListHeaders {
3960 type Error = StructureError;
3961
3962 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3963 let x_total_count = map
3964 .get("x-total-count")
3965 .map(|s| -> Result<_, _> {
3966 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3967 s.parse::<i64>()
3968 .map_err(|_| StructureError::HeaderParseFailed)
3969 })
3970 .transpose()?;
3971 Ok(Self { x_total_count })
3972 }
3973}
3974
3975impl crate::sealed::Sealed for IssueListHeaders {}
3976impl crate::CountHeader for IssueListHeaders {
3977 fn count(&self) -> Option<usize> {
3978 self.x_total_count.map(|x| x as usize)
3979 }
3980}
3981
3982pub struct LabelListHeaders {
3983 pub x_total_count: Option<i64>,
3984}
3985
3986impl TryFrom<&reqwest::header::HeaderMap> for LabelListHeaders {
3987 type Error = StructureError;
3988
3989 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
3990 let x_total_count = map
3991 .get("x-total-count")
3992 .map(|s| -> Result<_, _> {
3993 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
3994 s.parse::<i64>()
3995 .map_err(|_| StructureError::HeaderParseFailed)
3996 })
3997 .transpose()?;
3998 Ok(Self { x_total_count })
3999 }
4000}
4001
4002impl crate::sealed::Sealed for LabelListHeaders {}
4003impl crate::CountHeader for LabelListHeaders {
4004 fn count(&self) -> Option<usize> {
4005 self.x_total_count.map(|x| x as usize)
4006 }
4007}
4008
4009pub struct MilestoneListHeaders {
4010 pub x_total_count: Option<i64>,
4011}
4012
4013impl TryFrom<&reqwest::header::HeaderMap> for MilestoneListHeaders {
4014 type Error = StructureError;
4015
4016 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4017 let x_total_count = map
4018 .get("x-total-count")
4019 .map(|s| -> Result<_, _> {
4020 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4021 s.parse::<i64>()
4022 .map_err(|_| StructureError::HeaderParseFailed)
4023 })
4024 .transpose()?;
4025 Ok(Self { x_total_count })
4026 }
4027}
4028
4029impl crate::sealed::Sealed for MilestoneListHeaders {}
4030impl crate::CountHeader for MilestoneListHeaders {
4031 fn count(&self) -> Option<usize> {
4032 self.x_total_count.map(|x| x as usize)
4033 }
4034}
4035
4036pub struct NotificationThreadListHeaders {
4037 pub x_total_count: Option<i64>,
4038}
4039
4040impl TryFrom<&reqwest::header::HeaderMap> for NotificationThreadListHeaders {
4041 type Error = StructureError;
4042
4043 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4044 let x_total_count = map
4045 .get("x-total-count")
4046 .map(|s| -> Result<_, _> {
4047 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4048 s.parse::<i64>()
4049 .map_err(|_| StructureError::HeaderParseFailed)
4050 })
4051 .transpose()?;
4052 Ok(Self { x_total_count })
4053 }
4054}
4055
4056impl crate::sealed::Sealed for NotificationThreadListHeaders {}
4057impl crate::CountHeader for NotificationThreadListHeaders {
4058 fn count(&self) -> Option<usize> {
4059 self.x_total_count.map(|x| x as usize)
4060 }
4061}
4062
4063pub struct OAuth2ApplicationListHeaders {
4064 pub x_total_count: Option<i64>,
4065}
4066
4067impl TryFrom<&reqwest::header::HeaderMap> for OAuth2ApplicationListHeaders {
4068 type Error = StructureError;
4069
4070 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4071 let x_total_count = map
4072 .get("x-total-count")
4073 .map(|s| -> Result<_, _> {
4074 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4075 s.parse::<i64>()
4076 .map_err(|_| StructureError::HeaderParseFailed)
4077 })
4078 .transpose()?;
4079 Ok(Self { x_total_count })
4080 }
4081}
4082
4083impl crate::sealed::Sealed for OAuth2ApplicationListHeaders {}
4084impl crate::CountHeader for OAuth2ApplicationListHeaders {
4085 fn count(&self) -> Option<usize> {
4086 self.x_total_count.map(|x| x as usize)
4087 }
4088}
4089
4090pub struct OrganizationListHeaders {
4091 pub x_total_count: Option<i64>,
4092}
4093
4094impl TryFrom<&reqwest::header::HeaderMap> for OrganizationListHeaders {
4095 type Error = StructureError;
4096
4097 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4098 let x_total_count = map
4099 .get("x-total-count")
4100 .map(|s| -> Result<_, _> {
4101 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4102 s.parse::<i64>()
4103 .map_err(|_| StructureError::HeaderParseFailed)
4104 })
4105 .transpose()?;
4106 Ok(Self { x_total_count })
4107 }
4108}
4109
4110impl crate::sealed::Sealed for OrganizationListHeaders {}
4111impl crate::CountHeader for OrganizationListHeaders {
4112 fn count(&self) -> Option<usize> {
4113 self.x_total_count.map(|x| x as usize)
4114 }
4115}
4116
4117pub struct PackageListHeaders {
4118 pub x_total_count: Option<i64>,
4119}
4120
4121impl TryFrom<&reqwest::header::HeaderMap> for PackageListHeaders {
4122 type Error = StructureError;
4123
4124 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4125 let x_total_count = map
4126 .get("x-total-count")
4127 .map(|s| -> Result<_, _> {
4128 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4129 s.parse::<i64>()
4130 .map_err(|_| StructureError::HeaderParseFailed)
4131 })
4132 .transpose()?;
4133 Ok(Self { x_total_count })
4134 }
4135}
4136
4137impl crate::sealed::Sealed for PackageListHeaders {}
4138impl crate::CountHeader for PackageListHeaders {
4139 fn count(&self) -> Option<usize> {
4140 self.x_total_count.map(|x| x as usize)
4141 }
4142}
4143
4144pub struct PublicKeyListHeaders {
4145 pub x_total_count: Option<i64>,
4146}
4147
4148impl TryFrom<&reqwest::header::HeaderMap> for PublicKeyListHeaders {
4149 type Error = StructureError;
4150
4151 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4152 let x_total_count = map
4153 .get("x-total-count")
4154 .map(|s| -> Result<_, _> {
4155 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4156 s.parse::<i64>()
4157 .map_err(|_| StructureError::HeaderParseFailed)
4158 })
4159 .transpose()?;
4160 Ok(Self { x_total_count })
4161 }
4162}
4163
4164impl crate::sealed::Sealed for PublicKeyListHeaders {}
4165impl crate::CountHeader for PublicKeyListHeaders {
4166 fn count(&self) -> Option<usize> {
4167 self.x_total_count.map(|x| x as usize)
4168 }
4169}
4170
4171pub struct PullRequestListHeaders {
4172 pub x_total_count: Option<i64>,
4173}
4174
4175impl TryFrom<&reqwest::header::HeaderMap> for PullRequestListHeaders {
4176 type Error = StructureError;
4177
4178 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4179 let x_total_count = map
4180 .get("x-total-count")
4181 .map(|s| -> Result<_, _> {
4182 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4183 s.parse::<i64>()
4184 .map_err(|_| StructureError::HeaderParseFailed)
4185 })
4186 .transpose()?;
4187 Ok(Self { x_total_count })
4188 }
4189}
4190
4191impl crate::sealed::Sealed for PullRequestListHeaders {}
4192impl crate::CountHeader for PullRequestListHeaders {
4193 fn count(&self) -> Option<usize> {
4194 self.x_total_count.map(|x| x as usize)
4195 }
4196}
4197
4198pub struct PullReviewListHeaders {
4199 pub x_total_count: Option<i64>,
4200}
4201
4202impl TryFrom<&reqwest::header::HeaderMap> for PullReviewListHeaders {
4203 type Error = StructureError;
4204
4205 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4206 let x_total_count = map
4207 .get("x-total-count")
4208 .map(|s| -> Result<_, _> {
4209 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4210 s.parse::<i64>()
4211 .map_err(|_| StructureError::HeaderParseFailed)
4212 })
4213 .transpose()?;
4214 Ok(Self { x_total_count })
4215 }
4216}
4217
4218impl crate::sealed::Sealed for PullReviewListHeaders {}
4219impl crate::CountHeader for PullReviewListHeaders {
4220 fn count(&self) -> Option<usize> {
4221 self.x_total_count.map(|x| x as usize)
4222 }
4223}
4224
4225pub struct PushMirrorListHeaders {
4226 pub x_total_count: Option<i64>,
4227}
4228
4229impl TryFrom<&reqwest::header::HeaderMap> for PushMirrorListHeaders {
4230 type Error = StructureError;
4231
4232 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4233 let x_total_count = map
4234 .get("x-total-count")
4235 .map(|s| -> Result<_, _> {
4236 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4237 s.parse::<i64>()
4238 .map_err(|_| StructureError::HeaderParseFailed)
4239 })
4240 .transpose()?;
4241 Ok(Self { x_total_count })
4242 }
4243}
4244
4245impl crate::sealed::Sealed for PushMirrorListHeaders {}
4246impl crate::CountHeader for PushMirrorListHeaders {
4247 fn count(&self) -> Option<usize> {
4248 self.x_total_count.map(|x| x as usize)
4249 }
4250}
4251
4252pub struct QuotaUsedArtifactListHeaders {
4253 pub x_total_count: Option<i64>,
4254}
4255
4256impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedArtifactListHeaders {
4257 type Error = StructureError;
4258
4259 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4260 let x_total_count = map
4261 .get("x-total-count")
4262 .map(|s| -> Result<_, _> {
4263 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4264 s.parse::<i64>()
4265 .map_err(|_| StructureError::HeaderParseFailed)
4266 })
4267 .transpose()?;
4268 Ok(Self { x_total_count })
4269 }
4270}
4271
4272impl crate::sealed::Sealed for QuotaUsedArtifactListHeaders {}
4273impl crate::CountHeader for QuotaUsedArtifactListHeaders {
4274 fn count(&self) -> Option<usize> {
4275 self.x_total_count.map(|x| x as usize)
4276 }
4277}
4278
4279pub struct QuotaUsedAttachmentListHeaders {
4280 pub x_total_count: Option<i64>,
4281}
4282
4283impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedAttachmentListHeaders {
4284 type Error = StructureError;
4285
4286 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4287 let x_total_count = map
4288 .get("x-total-count")
4289 .map(|s| -> Result<_, _> {
4290 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4291 s.parse::<i64>()
4292 .map_err(|_| StructureError::HeaderParseFailed)
4293 })
4294 .transpose()?;
4295 Ok(Self { x_total_count })
4296 }
4297}
4298
4299impl crate::sealed::Sealed for QuotaUsedAttachmentListHeaders {}
4300impl crate::CountHeader for QuotaUsedAttachmentListHeaders {
4301 fn count(&self) -> Option<usize> {
4302 self.x_total_count.map(|x| x as usize)
4303 }
4304}
4305
4306pub struct QuotaUsedPackageListHeaders {
4307 pub x_total_count: Option<i64>,
4308}
4309
4310impl TryFrom<&reqwest::header::HeaderMap> for QuotaUsedPackageListHeaders {
4311 type Error = StructureError;
4312
4313 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4314 let x_total_count = map
4315 .get("x-total-count")
4316 .map(|s| -> Result<_, _> {
4317 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4318 s.parse::<i64>()
4319 .map_err(|_| StructureError::HeaderParseFailed)
4320 })
4321 .transpose()?;
4322 Ok(Self { x_total_count })
4323 }
4324}
4325
4326impl crate::sealed::Sealed for QuotaUsedPackageListHeaders {}
4327impl crate::CountHeader for QuotaUsedPackageListHeaders {
4328 fn count(&self) -> Option<usize> {
4329 self.x_total_count.map(|x| x as usize)
4330 }
4331}
4332
4333pub struct ReactionListHeaders {
4334 pub x_total_count: Option<i64>,
4335}
4336
4337impl TryFrom<&reqwest::header::HeaderMap> for ReactionListHeaders {
4338 type Error = StructureError;
4339
4340 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4341 let x_total_count = map
4342 .get("x-total-count")
4343 .map(|s| -> Result<_, _> {
4344 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4345 s.parse::<i64>()
4346 .map_err(|_| StructureError::HeaderParseFailed)
4347 })
4348 .transpose()?;
4349 Ok(Self { x_total_count })
4350 }
4351}
4352
4353impl crate::sealed::Sealed for ReactionListHeaders {}
4354impl crate::CountHeader for ReactionListHeaders {
4355 fn count(&self) -> Option<usize> {
4356 self.x_total_count.map(|x| x as usize)
4357 }
4358}
4359
4360pub struct ReleaseListHeaders {
4361 pub x_total_count: Option<i64>,
4362}
4363
4364impl TryFrom<&reqwest::header::HeaderMap> for ReleaseListHeaders {
4365 type Error = StructureError;
4366
4367 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4368 let x_total_count = map
4369 .get("x-total-count")
4370 .map(|s| -> Result<_, _> {
4371 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4372 s.parse::<i64>()
4373 .map_err(|_| StructureError::HeaderParseFailed)
4374 })
4375 .transpose()?;
4376 Ok(Self { x_total_count })
4377 }
4378}
4379
4380impl crate::sealed::Sealed for ReleaseListHeaders {}
4381impl crate::CountHeader for ReleaseListHeaders {
4382 fn count(&self) -> Option<usize> {
4383 self.x_total_count.map(|x| x as usize)
4384 }
4385}
4386
4387pub struct RepositoryListHeaders {
4388 pub x_total_count: Option<i64>,
4389}
4390
4391impl TryFrom<&reqwest::header::HeaderMap> for RepositoryListHeaders {
4392 type Error = StructureError;
4393
4394 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4395 let x_total_count = map
4396 .get("x-total-count")
4397 .map(|s| -> Result<_, _> {
4398 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4399 s.parse::<i64>()
4400 .map_err(|_| StructureError::HeaderParseFailed)
4401 })
4402 .transpose()?;
4403 Ok(Self { x_total_count })
4404 }
4405}
4406
4407impl crate::sealed::Sealed for RepositoryListHeaders {}
4408impl crate::CountHeader for RepositoryListHeaders {
4409 fn count(&self) -> Option<usize> {
4410 self.x_total_count.map(|x| x as usize)
4411 }
4412}
4413
4414pub struct SecretListHeaders {
4415 pub x_total_count: Option<i64>,
4416}
4417
4418impl TryFrom<&reqwest::header::HeaderMap> for SecretListHeaders {
4419 type Error = StructureError;
4420
4421 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4422 let x_total_count = map
4423 .get("x-total-count")
4424 .map(|s| -> Result<_, _> {
4425 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4426 s.parse::<i64>()
4427 .map_err(|_| StructureError::HeaderParseFailed)
4428 })
4429 .transpose()?;
4430 Ok(Self { x_total_count })
4431 }
4432}
4433
4434impl crate::sealed::Sealed for SecretListHeaders {}
4435impl crate::CountHeader for SecretListHeaders {
4436 fn count(&self) -> Option<usize> {
4437 self.x_total_count.map(|x| x as usize)
4438 }
4439}
4440
4441pub struct StopWatchListHeaders {
4442 pub x_total_count: Option<i64>,
4443}
4444
4445impl TryFrom<&reqwest::header::HeaderMap> for StopWatchListHeaders {
4446 type Error = StructureError;
4447
4448 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4449 let x_total_count = map
4450 .get("x-total-count")
4451 .map(|s| -> Result<_, _> {
4452 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4453 s.parse::<i64>()
4454 .map_err(|_| StructureError::HeaderParseFailed)
4455 })
4456 .transpose()?;
4457 Ok(Self { x_total_count })
4458 }
4459}
4460
4461impl crate::sealed::Sealed for StopWatchListHeaders {}
4462impl crate::CountHeader for StopWatchListHeaders {
4463 fn count(&self) -> Option<usize> {
4464 self.x_total_count.map(|x| x as usize)
4465 }
4466}
4467
4468pub struct TagListHeaders {
4469 pub x_total_count: Option<i64>,
4470}
4471
4472impl TryFrom<&reqwest::header::HeaderMap> for TagListHeaders {
4473 type Error = StructureError;
4474
4475 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4476 let x_total_count = map
4477 .get("x-total-count")
4478 .map(|s| -> Result<_, _> {
4479 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4480 s.parse::<i64>()
4481 .map_err(|_| StructureError::HeaderParseFailed)
4482 })
4483 .transpose()?;
4484 Ok(Self { x_total_count })
4485 }
4486}
4487
4488impl crate::sealed::Sealed for TagListHeaders {}
4489impl crate::CountHeader for TagListHeaders {
4490 fn count(&self) -> Option<usize> {
4491 self.x_total_count.map(|x| x as usize)
4492 }
4493}
4494
4495pub struct TeamListHeaders {
4496 pub x_total_count: Option<i64>,
4497}
4498
4499impl TryFrom<&reqwest::header::HeaderMap> for TeamListHeaders {
4500 type Error = StructureError;
4501
4502 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4503 let x_total_count = map
4504 .get("x-total-count")
4505 .map(|s| -> Result<_, _> {
4506 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4507 s.parse::<i64>()
4508 .map_err(|_| StructureError::HeaderParseFailed)
4509 })
4510 .transpose()?;
4511 Ok(Self { x_total_count })
4512 }
4513}
4514
4515impl crate::sealed::Sealed for TeamListHeaders {}
4516impl crate::CountHeader for TeamListHeaders {
4517 fn count(&self) -> Option<usize> {
4518 self.x_total_count.map(|x| x as usize)
4519 }
4520}
4521
4522pub struct TimelineListHeaders {
4523 pub x_total_count: Option<i64>,
4524}
4525
4526impl TryFrom<&reqwest::header::HeaderMap> for TimelineListHeaders {
4527 type Error = StructureError;
4528
4529 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4530 let x_total_count = map
4531 .get("x-total-count")
4532 .map(|s| -> Result<_, _> {
4533 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4534 s.parse::<i64>()
4535 .map_err(|_| StructureError::HeaderParseFailed)
4536 })
4537 .transpose()?;
4538 Ok(Self { x_total_count })
4539 }
4540}
4541
4542impl crate::sealed::Sealed for TimelineListHeaders {}
4543impl crate::CountHeader for TimelineListHeaders {
4544 fn count(&self) -> Option<usize> {
4545 self.x_total_count.map(|x| x as usize)
4546 }
4547}
4548
4549pub struct TrackedTimeListHeaders {
4550 pub x_total_count: Option<i64>,
4551}
4552
4553impl TryFrom<&reqwest::header::HeaderMap> for TrackedTimeListHeaders {
4554 type Error = StructureError;
4555
4556 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4557 let x_total_count = map
4558 .get("x-total-count")
4559 .map(|s| -> Result<_, _> {
4560 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4561 s.parse::<i64>()
4562 .map_err(|_| StructureError::HeaderParseFailed)
4563 })
4564 .transpose()?;
4565 Ok(Self { x_total_count })
4566 }
4567}
4568
4569impl crate::sealed::Sealed for TrackedTimeListHeaders {}
4570impl crate::CountHeader for TrackedTimeListHeaders {
4571 fn count(&self) -> Option<usize> {
4572 self.x_total_count.map(|x| x as usize)
4573 }
4574}
4575
4576pub struct UserListHeaders {
4577 pub x_total_count: Option<i64>,
4578}
4579
4580impl TryFrom<&reqwest::header::HeaderMap> for UserListHeaders {
4581 type Error = StructureError;
4582
4583 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4584 let x_total_count = map
4585 .get("x-total-count")
4586 .map(|s| -> Result<_, _> {
4587 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4588 s.parse::<i64>()
4589 .map_err(|_| StructureError::HeaderParseFailed)
4590 })
4591 .transpose()?;
4592 Ok(Self { x_total_count })
4593 }
4594}
4595
4596impl crate::sealed::Sealed for UserListHeaders {}
4597impl crate::CountHeader for UserListHeaders {
4598 fn count(&self) -> Option<usize> {
4599 self.x_total_count.map(|x| x as usize)
4600 }
4601}
4602
4603pub struct VariableListHeaders {
4604 pub x_total_count: Option<i64>,
4605}
4606
4607impl TryFrom<&reqwest::header::HeaderMap> for VariableListHeaders {
4608 type Error = StructureError;
4609
4610 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4611 let x_total_count = map
4612 .get("x-total-count")
4613 .map(|s| -> Result<_, _> {
4614 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4615 s.parse::<i64>()
4616 .map_err(|_| StructureError::HeaderParseFailed)
4617 })
4618 .transpose()?;
4619 Ok(Self { x_total_count })
4620 }
4621}
4622
4623impl crate::sealed::Sealed for VariableListHeaders {}
4624impl crate::CountHeader for VariableListHeaders {
4625 fn count(&self) -> Option<usize> {
4626 self.x_total_count.map(|x| x as usize)
4627 }
4628}
4629
4630pub struct WikiCommitListHeaders {
4631 pub x_total_count: Option<i64>,
4632}
4633
4634impl TryFrom<&reqwest::header::HeaderMap> for WikiCommitListHeaders {
4635 type Error = StructureError;
4636
4637 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4638 let x_total_count = map
4639 .get("x-total-count")
4640 .map(|s| -> Result<_, _> {
4641 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4642 s.parse::<i64>()
4643 .map_err(|_| StructureError::HeaderParseFailed)
4644 })
4645 .transpose()?;
4646 Ok(Self { x_total_count })
4647 }
4648}
4649
4650impl crate::sealed::Sealed for WikiCommitListHeaders {}
4651impl crate::CountHeader for WikiCommitListHeaders {
4652 fn count(&self) -> Option<usize> {
4653 self.x_total_count.map(|x| x as usize)
4654 }
4655}
4656
4657pub struct WikiPageListHeaders {
4658 pub x_total_count: Option<i64>,
4659}
4660
4661impl TryFrom<&reqwest::header::HeaderMap> for WikiPageListHeaders {
4662 type Error = StructureError;
4663
4664 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4665 let x_total_count = map
4666 .get("x-total-count")
4667 .map(|s| -> Result<_, _> {
4668 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4669 s.parse::<i64>()
4670 .map_err(|_| StructureError::HeaderParseFailed)
4671 })
4672 .transpose()?;
4673 Ok(Self { x_total_count })
4674 }
4675}
4676
4677impl crate::sealed::Sealed for WikiPageListHeaders {}
4678impl crate::CountHeader for WikiPageListHeaders {
4679 fn count(&self) -> Option<usize> {
4680 self.x_total_count.map(|x| x as usize)
4681 }
4682}
4683
4684pub struct QuotaExceededHeaders {
4685 pub message: Option<String>,
4686 pub user_id: Option<i64>,
4687 pub username: Option<String>,
4688}
4689
4690impl TryFrom<&reqwest::header::HeaderMap> for QuotaExceededHeaders {
4691 type Error = StructureError;
4692
4693 fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
4694 let message = map
4695 .get("message")
4696 .map(|s| -> Result<_, _> {
4697 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4698 Ok::<_, StructureError>(s.to_string())
4699 })
4700 .transpose()?;
4701 let user_id = map
4702 .get("user_id")
4703 .map(|s| -> Result<_, _> {
4704 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4705 s.parse::<i64>()
4706 .map_err(|_| StructureError::HeaderParseFailed)
4707 })
4708 .transpose()?;
4709 let username = map
4710 .get("username")
4711 .map(|s| -> Result<_, _> {
4712 let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
4713 Ok::<_, StructureError>(s.to_string())
4714 })
4715 .transpose()?;
4716 Ok(Self {
4717 message,
4718 user_id,
4719 username,
4720 })
4721 }
4722}
4723
4724#[derive(Debug, Clone, PartialEq, Default)]
4725pub struct AdminSearchEmailsQuery {
4726 pub q: Option<String>,
4728}
4729
4730impl AdminSearchEmailsQuery {
4731 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4732 let mut list = Vec::new();
4733 if let Some(q) = self.q {
4734 list.push(("q", q));
4735 }
4736
4737 list
4738 }
4739}
4740
4741#[derive(Debug, Clone, PartialEq, Default)]
4742pub struct AdminSearchRunJobsQuery {
4743 pub labels: Option<String>,
4745}
4746
4747impl AdminSearchRunJobsQuery {
4748 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4749 let mut list = Vec::new();
4750 if let Some(labels) = self.labels {
4751 list.push(("labels", labels));
4752 }
4753
4754 list
4755 }
4756}
4757
4758#[derive(Debug, Clone, PartialEq, Default)]
4759pub struct AdminUnadoptedListQuery {
4760 pub pattern: Option<String>,
4762}
4763
4764impl AdminUnadoptedListQuery {
4765 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4766 let mut list = Vec::new();
4767 if let Some(pattern) = self.pattern {
4768 list.push(("pattern", pattern));
4769 }
4770
4771 list
4772 }
4773}
4774
4775#[derive(Debug, Clone, PartialEq, Default)]
4776pub struct AdminSearchUsersQuery {
4777 pub source_id: Option<i64>,
4779 pub login_name: Option<String>,
4781 pub sort: Option<AdminSearchUsersQuerySort>,
4783}
4784
4785impl AdminSearchUsersQuery {
4786 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4787 let mut list = Vec::new();
4788 if let Some(source_id) = self.source_id {
4789 list.push(("source_id", source_id.to_string()));
4790 }
4791 if let Some(login_name) = self.login_name {
4792 list.push(("login_name", login_name));
4793 }
4794 if let Some(sort) = self.sort {
4795 list.push(("sort", sort.as_str().to_string()));
4796 }
4797
4798 list
4799 }
4800}
4801
4802#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
4803pub enum AdminSearchUsersQuerySort {
4804 #[serde(rename = "oldest")]
4805 Oldest,
4806 #[serde(rename = "newest")]
4807 Newest,
4808 #[serde(rename = "alphabetically")]
4809 Alphabetically,
4810 #[serde(rename = "reversealphabetically")]
4811 Reversealphabetically,
4812 #[serde(rename = "recentupdate")]
4813 Recentupdate,
4814 #[serde(rename = "leastupdate")]
4815 Leastupdate,
4816}
4817
4818impl AdminSearchUsersQuerySort {
4819 fn as_str(&self) -> &'static str {
4820 match self {
4821 AdminSearchUsersQuerySort::Oldest => "oldest",
4822 AdminSearchUsersQuerySort::Newest => "newest",
4823 AdminSearchUsersQuerySort::Alphabetically => "alphabetically",
4824 AdminSearchUsersQuerySort::Reversealphabetically => "reversealphabetically",
4825 AdminSearchUsersQuerySort::Recentupdate => "recentupdate",
4826 AdminSearchUsersQuerySort::Leastupdate => "leastupdate",
4827 }
4828 }
4829}
4830#[derive(Debug, Clone, PartialEq, Default)]
4831pub struct AdminDeleteUserQuery {
4832 pub purge: Option<bool>,
4834}
4835
4836impl AdminDeleteUserQuery {
4837 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4838 let mut list = Vec::new();
4839 if let Some(purge) = self.purge {
4840 list.push(("purge", purge.to_string()));
4841 }
4842
4843 list
4844 }
4845}
4846
4847#[derive(Debug, Clone, PartialEq, Default)]
4848pub struct NotifyGetListQuery {
4849 pub all: Option<bool>,
4851 pub status_types: Option<Vec<String>>,
4853 pub subject_type: Option<Vec<NotifyGetListQuerySubjectType>>,
4855 pub since: Option<time::OffsetDateTime>,
4857 pub before: Option<time::OffsetDateTime>,
4859}
4860
4861impl NotifyGetListQuery {
4862 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4863 let mut list = Vec::new();
4864 if let Some(all) = self.all {
4865 list.push(("all", all.to_string()));
4866 }
4867 if let Some(status_types) = self.status_types {
4868 if !status_types.is_empty() {
4869 for item in status_types {
4870 list.push(("status-types", item.to_string()));
4871 }
4872 }
4873 }
4874 if let Some(subject_type) = self.subject_type {
4875 if !subject_type.is_empty() {
4876 for item in subject_type {
4877 list.push(("subject-type", item.as_str().to_string()));
4878 }
4879 }
4880 }
4881 if let Some(since) = self.since {
4882 list.push((
4883 "since",
4884 since
4885 .format(&time::format_description::well_known::Rfc3339)
4886 .unwrap(),
4887 ));
4888 }
4889 if let Some(before) = self.before {
4890 list.push((
4891 "before",
4892 before
4893 .format(&time::format_description::well_known::Rfc3339)
4894 .unwrap(),
4895 ));
4896 }
4897
4898 list
4899 }
4900}
4901
4902#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
4903pub enum NotifyGetListQuerySubjectType {
4904 #[serde(rename = "issue")]
4905 Issue,
4906 #[serde(rename = "pull")]
4907 Pull,
4908 #[serde(rename = "repository")]
4909 Repository,
4910}
4911
4912impl NotifyGetListQuerySubjectType {
4913 fn as_str(&self) -> &'static str {
4914 match self {
4915 NotifyGetListQuerySubjectType::Issue => "issue",
4916 NotifyGetListQuerySubjectType::Pull => "pull",
4917 NotifyGetListQuerySubjectType::Repository => "repository",
4918 }
4919 }
4920}
4921#[derive(Debug, Clone, PartialEq, Default)]
4922pub struct NotifyReadListQuery {
4923 pub last_read_at: Option<time::OffsetDateTime>,
4925 pub all: Option<bool>,
4927 pub status_types: Option<Vec<String>>,
4929 pub to_status: Option<String>,
4931}
4932
4933impl NotifyReadListQuery {
4934 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4935 let mut list = Vec::new();
4936 if let Some(last_read_at) = self.last_read_at {
4937 list.push((
4938 "last_read_at",
4939 last_read_at
4940 .format(&time::format_description::well_known::Rfc3339)
4941 .unwrap(),
4942 ));
4943 }
4944 if let Some(all) = self.all {
4945 list.push(("all", all.to_string()));
4946 }
4947 if let Some(status_types) = self.status_types {
4948 if !status_types.is_empty() {
4949 for item in status_types {
4950 list.push(("status-types", item.to_string()));
4951 }
4952 }
4953 }
4954 if let Some(to_status) = self.to_status {
4955 list.push(("to-status", to_status));
4956 }
4957
4958 list
4959 }
4960}
4961
4962#[derive(Debug, Clone, PartialEq, Default)]
4963pub struct NotifyReadThreadQuery {
4964 pub to_status: Option<String>,
4966}
4967
4968impl NotifyReadThreadQuery {
4969 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4970 let mut list = Vec::new();
4971 if let Some(to_status) = self.to_status {
4972 list.push(("to-status", to_status));
4973 }
4974
4975 list
4976 }
4977}
4978
4979#[derive(Debug, Clone, PartialEq, Default)]
4980pub struct OrgSearchRunJobsQuery {
4981 pub labels: Option<String>,
4983}
4984
4985impl OrgSearchRunJobsQuery {
4986 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
4987 let mut list = Vec::new();
4988 if let Some(labels) = self.labels {
4989 list.push(("labels", labels));
4990 }
4991
4992 list
4993 }
4994}
4995
4996#[derive(Debug, Clone, PartialEq, Default)]
4997pub struct OrgListActivityFeedsQuery {
4998 pub date: Option<time::Date>,
5000}
5001
5002impl OrgListActivityFeedsQuery {
5003 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5004 let mut list = Vec::new();
5005 if let Some(date) = self.date {
5006 list.push(("date", date.to_string()));
5007 }
5008
5009 list
5010 }
5011}
5012
5013#[derive(Debug, Clone, PartialEq, Default)]
5014pub struct OrgListLabelsQuery {
5015 pub sort: Option<OrgListLabelsQuerySort>,
5017}
5018
5019impl OrgListLabelsQuery {
5020 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5021 let mut list = Vec::new();
5022 if let Some(sort) = self.sort {
5023 list.push(("sort", sort.as_str().to_string()));
5024 }
5025
5026 list
5027 }
5028}
5029
5030#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5031pub enum OrgListLabelsQuerySort {
5032 #[serde(rename = "mostissues")]
5033 Mostissues,
5034 #[serde(rename = "leastissues")]
5035 Leastissues,
5036 #[serde(rename = "reversealphabetically")]
5037 Reversealphabetically,
5038}
5039
5040impl OrgListLabelsQuerySort {
5041 fn as_str(&self) -> &'static str {
5042 match self {
5043 OrgListLabelsQuerySort::Mostissues => "mostissues",
5044 OrgListLabelsQuerySort::Leastissues => "leastissues",
5045 OrgListLabelsQuerySort::Reversealphabetically => "reversealphabetically",
5046 }
5047 }
5048}
5049#[derive(Debug, Clone, PartialEq)]
5050pub struct OrgCheckQuotaQuery {
5051 pub subject: String,
5053}
5054
5055impl OrgCheckQuotaQuery {
5056 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5057 let mut list = Vec::new();
5058 let subject = self.subject;
5059 list.push(("subject", subject));
5060
5061 list
5062 }
5063}
5064
5065#[derive(Debug, Clone, PartialEq, Default)]
5066pub struct TeamSearchQuery {
5067 pub q: Option<String>,
5069 pub include_desc: Option<bool>,
5071}
5072
5073impl TeamSearchQuery {
5074 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5075 let mut list = Vec::new();
5076 if let Some(q) = self.q {
5077 list.push(("q", q));
5078 }
5079 if let Some(include_desc) = self.include_desc {
5080 list.push(("include_desc", include_desc.to_string()));
5081 }
5082
5083 list
5084 }
5085}
5086#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
5087pub struct TeamSearchResults {
5088 pub data: Option<Vec<Team>>,
5089 pub ok: Option<bool>,
5090}
5091
5092impl_from_response!(TeamSearchResults);
5093
5094#[derive(Debug, Clone, PartialEq, Default)]
5095pub struct ListPackagesQuery {
5096 pub r#type: Option<ListPackagesQueryType>,
5098 pub q: Option<String>,
5100}
5101
5102impl ListPackagesQuery {
5103 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5104 let mut list = Vec::new();
5105 if let Some(r#type) = self.r#type {
5106 list.push(("type", r#type.as_str().to_string()));
5107 }
5108 if let Some(q) = self.q {
5109 list.push(("q", q));
5110 }
5111
5112 list
5113 }
5114}
5115
5116#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5117pub enum ListPackagesQueryType {
5118 #[serde(rename = "alpine")]
5119 Alpine,
5120 #[serde(rename = "cargo")]
5121 Cargo,
5122 #[serde(rename = "chef")]
5123 Chef,
5124 #[serde(rename = "composer")]
5125 Composer,
5126 #[serde(rename = "conan")]
5127 Conan,
5128 #[serde(rename = "conda")]
5129 Conda,
5130 #[serde(rename = "container")]
5131 Container,
5132 #[serde(rename = "cran")]
5133 Cran,
5134 #[serde(rename = "debian")]
5135 Debian,
5136 #[serde(rename = "generic")]
5137 Generic,
5138 #[serde(rename = "go")]
5139 Go,
5140 #[serde(rename = "helm")]
5141 Helm,
5142 #[serde(rename = "maven")]
5143 Maven,
5144 #[serde(rename = "npm")]
5145 Npm,
5146 #[serde(rename = "nuget")]
5147 Nuget,
5148 #[serde(rename = "pub")]
5149 Pub,
5150 #[serde(rename = "pypi")]
5151 Pypi,
5152 #[serde(rename = "rpm")]
5153 Rpm,
5154 #[serde(rename = "rubygems")]
5155 Rubygems,
5156 #[serde(rename = "swift")]
5157 Swift,
5158 #[serde(rename = "vagrant")]
5159 Vagrant,
5160}
5161
5162impl ListPackagesQueryType {
5163 fn as_str(&self) -> &'static str {
5164 match self {
5165 ListPackagesQueryType::Alpine => "alpine",
5166 ListPackagesQueryType::Cargo => "cargo",
5167 ListPackagesQueryType::Chef => "chef",
5168 ListPackagesQueryType::Composer => "composer",
5169 ListPackagesQueryType::Conan => "conan",
5170 ListPackagesQueryType::Conda => "conda",
5171 ListPackagesQueryType::Container => "container",
5172 ListPackagesQueryType::Cran => "cran",
5173 ListPackagesQueryType::Debian => "debian",
5174 ListPackagesQueryType::Generic => "generic",
5175 ListPackagesQueryType::Go => "go",
5176 ListPackagesQueryType::Helm => "helm",
5177 ListPackagesQueryType::Maven => "maven",
5178 ListPackagesQueryType::Npm => "npm",
5179 ListPackagesQueryType::Nuget => "nuget",
5180 ListPackagesQueryType::Pub => "pub",
5181 ListPackagesQueryType::Pypi => "pypi",
5182 ListPackagesQueryType::Rpm => "rpm",
5183 ListPackagesQueryType::Rubygems => "rubygems",
5184 ListPackagesQueryType::Swift => "swift",
5185 ListPackagesQueryType::Vagrant => "vagrant",
5186 }
5187 }
5188}
5189#[derive(Debug, Clone, PartialEq, Default)]
5190pub struct IssueSearchIssuesQuery {
5191 pub state: Option<IssueSearchIssuesQueryState>,
5193 pub labels: Option<String>,
5195 pub milestones: Option<String>,
5197 pub q: Option<String>,
5199 pub priority_repo_id: Option<i64>,
5201 pub r#type: Option<IssueSearchIssuesQueryType>,
5203 pub since: Option<time::OffsetDateTime>,
5205 pub before: Option<time::OffsetDateTime>,
5207 pub assigned: Option<bool>,
5209 pub created: Option<bool>,
5211 pub mentioned: Option<bool>,
5213 pub review_requested: Option<bool>,
5215 pub reviewed: Option<bool>,
5217 pub owner: Option<String>,
5219 pub team: Option<String>,
5221 pub sort: Option<IssueSearchIssuesQuerySort>,
5223}
5224
5225impl IssueSearchIssuesQuery {
5226 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5227 let mut list = Vec::new();
5228 if let Some(state) = self.state {
5229 list.push(("state", state.as_str().to_string()));
5230 }
5231 if let Some(labels) = self.labels {
5232 list.push(("labels", labels));
5233 }
5234 if let Some(milestones) = self.milestones {
5235 list.push(("milestones", milestones));
5236 }
5237 if let Some(q) = self.q {
5238 list.push(("q", q));
5239 }
5240 if let Some(priority_repo_id) = self.priority_repo_id {
5241 list.push(("priority_repo_id", priority_repo_id.to_string()));
5242 }
5243 if let Some(r#type) = self.r#type {
5244 list.push(("type", r#type.as_str().to_string()));
5245 }
5246 if let Some(since) = self.since {
5247 list.push((
5248 "since",
5249 since
5250 .format(&time::format_description::well_known::Rfc3339)
5251 .unwrap(),
5252 ));
5253 }
5254 if let Some(before) = self.before {
5255 list.push((
5256 "before",
5257 before
5258 .format(&time::format_description::well_known::Rfc3339)
5259 .unwrap(),
5260 ));
5261 }
5262 if let Some(assigned) = self.assigned {
5263 list.push(("assigned", assigned.to_string()));
5264 }
5265 if let Some(created) = self.created {
5266 list.push(("created", created.to_string()));
5267 }
5268 if let Some(mentioned) = self.mentioned {
5269 list.push(("mentioned", mentioned.to_string()));
5270 }
5271 if let Some(review_requested) = self.review_requested {
5272 list.push(("review_requested", review_requested.to_string()));
5273 }
5274 if let Some(reviewed) = self.reviewed {
5275 list.push(("reviewed", reviewed.to_string()));
5276 }
5277 if let Some(owner) = self.owner {
5278 list.push(("owner", owner));
5279 }
5280 if let Some(team) = self.team {
5281 list.push(("team", team));
5282 }
5283 if let Some(sort) = self.sort {
5284 list.push(("sort", sort.as_str().to_string()));
5285 }
5286
5287 list
5288 }
5289}
5290
5291#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5292pub enum IssueSearchIssuesQueryState {
5293 #[serde(rename = "open")]
5294 Open,
5295 #[serde(rename = "closed")]
5296 Closed,
5297 #[serde(rename = "all")]
5298 All,
5299}
5300
5301impl IssueSearchIssuesQueryState {
5302 fn as_str(&self) -> &'static str {
5303 match self {
5304 IssueSearchIssuesQueryState::Open => "open",
5305 IssueSearchIssuesQueryState::Closed => "closed",
5306 IssueSearchIssuesQueryState::All => "all",
5307 }
5308 }
5309}
5310
5311#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5312pub enum IssueSearchIssuesQueryType {
5313 #[serde(rename = "issues")]
5314 Issues,
5315 #[serde(rename = "pulls")]
5316 Pulls,
5317}
5318
5319impl IssueSearchIssuesQueryType {
5320 fn as_str(&self) -> &'static str {
5321 match self {
5322 IssueSearchIssuesQueryType::Issues => "issues",
5323 IssueSearchIssuesQueryType::Pulls => "pulls",
5324 }
5325 }
5326}
5327
5328#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5329pub enum IssueSearchIssuesQuerySort {
5330 #[serde(rename = "relevance")]
5331 Relevance,
5332 #[serde(rename = "latest")]
5333 Latest,
5334 #[serde(rename = "oldest")]
5335 Oldest,
5336 #[serde(rename = "recentupdate")]
5337 Recentupdate,
5338 #[serde(rename = "leastupdate")]
5339 Leastupdate,
5340 #[serde(rename = "mostcomment")]
5341 Mostcomment,
5342 #[serde(rename = "leastcomment")]
5343 Leastcomment,
5344 #[serde(rename = "nearduedate")]
5345 Nearduedate,
5346 #[serde(rename = "farduedate")]
5347 Farduedate,
5348}
5349
5350impl IssueSearchIssuesQuerySort {
5351 fn as_str(&self) -> &'static str {
5352 match self {
5353 IssueSearchIssuesQuerySort::Relevance => "relevance",
5354 IssueSearchIssuesQuerySort::Latest => "latest",
5355 IssueSearchIssuesQuerySort::Oldest => "oldest",
5356 IssueSearchIssuesQuerySort::Recentupdate => "recentupdate",
5357 IssueSearchIssuesQuerySort::Leastupdate => "leastupdate",
5358 IssueSearchIssuesQuerySort::Mostcomment => "mostcomment",
5359 IssueSearchIssuesQuerySort::Leastcomment => "leastcomment",
5360 IssueSearchIssuesQuerySort::Nearduedate => "nearduedate",
5361 IssueSearchIssuesQuerySort::Farduedate => "farduedate",
5362 }
5363 }
5364}
5365#[derive(Debug, Clone, PartialEq, Default)]
5366pub struct RepoSearchQuery {
5367 pub q: Option<String>,
5369 pub topic: Option<bool>,
5371 pub include_desc: Option<bool>,
5373 pub uid: Option<i64>,
5375 pub priority_owner_id: Option<i64>,
5377 pub team_id: Option<i64>,
5379 pub starred_by: Option<i64>,
5381 pub private: Option<bool>,
5383 pub is_private: Option<bool>,
5385 pub template: Option<bool>,
5387 pub archived: Option<bool>,
5389 pub mode: Option<String>,
5391 pub exclusive: Option<bool>,
5393 pub sort: Option<RepoSearchQuerySort>,
5395 pub order: Option<RepoSearchQueryOrder>,
5397}
5398
5399impl RepoSearchQuery {
5400 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5401 let mut list = Vec::new();
5402 if let Some(q) = self.q {
5403 list.push(("q", q));
5404 }
5405 if let Some(topic) = self.topic {
5406 list.push(("topic", topic.to_string()));
5407 }
5408 if let Some(include_desc) = self.include_desc {
5409 list.push(("includeDesc", include_desc.to_string()));
5410 }
5411 if let Some(uid) = self.uid {
5412 list.push(("uid", uid.to_string()));
5413 }
5414 if let Some(priority_owner_id) = self.priority_owner_id {
5415 list.push(("priority_owner_id", priority_owner_id.to_string()));
5416 }
5417 if let Some(team_id) = self.team_id {
5418 list.push(("team_id", team_id.to_string()));
5419 }
5420 if let Some(starred_by) = self.starred_by {
5421 list.push(("starredBy", starred_by.to_string()));
5422 }
5423 if let Some(private) = self.private {
5424 list.push(("private", private.to_string()));
5425 }
5426 if let Some(is_private) = self.is_private {
5427 list.push(("is_private", is_private.to_string()));
5428 }
5429 if let Some(template) = self.template {
5430 list.push(("template", template.to_string()));
5431 }
5432 if let Some(archived) = self.archived {
5433 list.push(("archived", archived.to_string()));
5434 }
5435 if let Some(mode) = self.mode {
5436 list.push(("mode", mode));
5437 }
5438 if let Some(exclusive) = self.exclusive {
5439 list.push(("exclusive", exclusive.to_string()));
5440 }
5441 if let Some(sort) = self.sort {
5442 list.push(("sort", sort.as_str().to_string()));
5443 }
5444 if let Some(order) = self.order {
5445 list.push(("order", order.as_str().to_string()));
5446 }
5447
5448 list
5449 }
5450}
5451
5452#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5453pub enum RepoSearchQuerySort {
5454 #[serde(rename = "alpha")]
5455 Alpha,
5456 #[serde(rename = "created")]
5457 Created,
5458 #[serde(rename = "updated")]
5459 Updated,
5460 #[serde(rename = "size")]
5461 Size,
5462 #[serde(rename = "git_size")]
5463 GitSize,
5464 #[serde(rename = "lfs_size")]
5465 LfsSize,
5466 #[serde(rename = "id")]
5467 Id,
5468 #[serde(rename = "stars")]
5469 Stars,
5470 #[serde(rename = "forks")]
5471 Forks,
5472}
5473
5474impl RepoSearchQuerySort {
5475 fn as_str(&self) -> &'static str {
5476 match self {
5477 RepoSearchQuerySort::Alpha => "alpha",
5478 RepoSearchQuerySort::Created => "created",
5479 RepoSearchQuerySort::Updated => "updated",
5480 RepoSearchQuerySort::Size => "size",
5481 RepoSearchQuerySort::GitSize => "git_size",
5482 RepoSearchQuerySort::LfsSize => "lfs_size",
5483 RepoSearchQuerySort::Id => "id",
5484 RepoSearchQuerySort::Stars => "stars",
5485 RepoSearchQuerySort::Forks => "forks",
5486 }
5487 }
5488}
5489
5490#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5491pub enum RepoSearchQueryOrder {
5492 #[serde(rename = "asc")]
5493 Asc,
5494 #[serde(rename = "desc")]
5495 Desc,
5496}
5497
5498impl RepoSearchQueryOrder {
5499 fn as_str(&self) -> &'static str {
5500 match self {
5501 RepoSearchQueryOrder::Asc => "asc",
5502 RepoSearchQueryOrder::Desc => "desc",
5503 }
5504 }
5505}
5506#[derive(Debug, Clone, PartialEq, Default)]
5507pub struct RepoSearchRunJobsQuery {
5508 pub labels: Option<String>,
5510}
5511
5512impl RepoSearchRunJobsQuery {
5513 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5514 let mut list = Vec::new();
5515 if let Some(labels) = self.labels {
5516 list.push(("labels", labels));
5517 }
5518
5519 list
5520 }
5521}
5522
5523#[derive(Debug, Clone, PartialEq, Default)]
5524pub struct ListActionRunsQuery {
5525 pub event: Option<Vec<String>>,
5527 pub status: Option<Vec<ListActionRunsQueryStatus>>,
5529 pub run_number: Option<i64>,
5531 pub head_sha: Option<String>,
5533}
5534
5535impl ListActionRunsQuery {
5536 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5537 let mut list = Vec::new();
5538 if let Some(event) = self.event {
5539 if !event.is_empty() {
5540 let mut s = String::new();
5541 for (i, item) in event.iter().enumerate() {
5542 s.push_str(item);
5543 if i < event.len() - 1 {
5544 s.push(',')
5545 }
5546 }
5547 list.push(("event", s));
5548 }
5549 }
5550 if let Some(status) = self.status {
5551 if !status.is_empty() {
5552 let mut s = String::new();
5553 for (i, item) in status.iter().enumerate() {
5554 s.push_str(item.as_str());
5555 if i < status.len() - 1 {
5556 s.push(',')
5557 }
5558 }
5559 list.push(("status", s));
5560 }
5561 }
5562 if let Some(run_number) = self.run_number {
5563 list.push(("run_number", run_number.to_string()));
5564 }
5565 if let Some(head_sha) = self.head_sha {
5566 list.push(("head_sha", head_sha));
5567 }
5568
5569 list
5570 }
5571}
5572
5573#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5574pub enum ListActionRunsQueryStatus {
5575 #[serde(rename = "unknown")]
5576 Unknown,
5577 #[serde(rename = "waiting")]
5578 Waiting,
5579 #[serde(rename = "running")]
5580 Running,
5581 #[serde(rename = "success")]
5582 Success,
5583 #[serde(rename = "failure")]
5584 Failure,
5585 #[serde(rename = "cancelled")]
5586 Cancelled,
5587 #[serde(rename = "skipped")]
5588 Skipped,
5589 #[serde(rename = "blocked")]
5590 Blocked,
5591}
5592
5593impl ListActionRunsQueryStatus {
5594 fn as_str(&self) -> &'static str {
5595 match self {
5596 ListActionRunsQueryStatus::Unknown => "unknown",
5597 ListActionRunsQueryStatus::Waiting => "waiting",
5598 ListActionRunsQueryStatus::Running => "running",
5599 ListActionRunsQueryStatus::Success => "success",
5600 ListActionRunsQueryStatus::Failure => "failure",
5601 ListActionRunsQueryStatus::Cancelled => "cancelled",
5602 ListActionRunsQueryStatus::Skipped => "skipped",
5603 ListActionRunsQueryStatus::Blocked => "blocked",
5604 }
5605 }
5606}
5607#[derive(Debug, Clone, PartialEq, Default)]
5608pub struct RepoListActivityFeedsQuery {
5609 pub date: Option<time::Date>,
5611}
5612
5613impl RepoListActivityFeedsQuery {
5614 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5615 let mut list = Vec::new();
5616 if let Some(date) = self.date {
5617 list.push(("date", date.to_string()));
5618 }
5619
5620 list
5621 }
5622}
5623
5624#[derive(Debug, Clone, PartialEq, Default)]
5625pub struct RepoGetAllCommitsQuery {
5626 pub sha: Option<String>,
5628 pub path: Option<String>,
5630 pub stat: Option<bool>,
5632 pub verification: Option<bool>,
5634 pub files: Option<bool>,
5636 pub not: Option<String>,
5638}
5639
5640impl RepoGetAllCommitsQuery {
5641 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5642 let mut list = Vec::new();
5643 if let Some(sha) = self.sha {
5644 list.push(("sha", sha));
5645 }
5646 if let Some(path) = self.path {
5647 list.push(("path", path));
5648 }
5649 if let Some(stat) = self.stat {
5650 list.push(("stat", stat.to_string()));
5651 }
5652 if let Some(verification) = self.verification {
5653 list.push(("verification", verification.to_string()));
5654 }
5655 if let Some(files) = self.files {
5656 list.push(("files", files.to_string()));
5657 }
5658 if let Some(not) = self.not {
5659 list.push(("not", not));
5660 }
5661
5662 list
5663 }
5664}
5665
5666#[derive(Debug, Clone, PartialEq, Default)]
5667pub struct RepoListStatusesByRefQuery {
5668 pub sort: Option<RepoListStatusesByRefQuerySort>,
5670 pub state: Option<RepoListStatusesByRefQueryState>,
5672}
5673
5674impl RepoListStatusesByRefQuery {
5675 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5676 let mut list = Vec::new();
5677 if let Some(sort) = self.sort {
5678 list.push(("sort", sort.as_str().to_string()));
5679 }
5680 if let Some(state) = self.state {
5681 list.push(("state", state.as_str().to_string()));
5682 }
5683
5684 list
5685 }
5686}
5687
5688#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5689pub enum RepoListStatusesByRefQuerySort {
5690 #[serde(rename = "oldest")]
5691 Oldest,
5692 #[serde(rename = "recentupdate")]
5693 Recentupdate,
5694 #[serde(rename = "leastupdate")]
5695 Leastupdate,
5696 #[serde(rename = "leastindex")]
5697 Leastindex,
5698 #[serde(rename = "highestindex")]
5699 Highestindex,
5700}
5701
5702impl RepoListStatusesByRefQuerySort {
5703 fn as_str(&self) -> &'static str {
5704 match self {
5705 RepoListStatusesByRefQuerySort::Oldest => "oldest",
5706 RepoListStatusesByRefQuerySort::Recentupdate => "recentupdate",
5707 RepoListStatusesByRefQuerySort::Leastupdate => "leastupdate",
5708 RepoListStatusesByRefQuerySort::Leastindex => "leastindex",
5709 RepoListStatusesByRefQuerySort::Highestindex => "highestindex",
5710 }
5711 }
5712}
5713
5714#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5715pub enum RepoListStatusesByRefQueryState {
5716 #[serde(rename = "pending")]
5717 Pending,
5718 #[serde(rename = "success")]
5719 Success,
5720 #[serde(rename = "error")]
5721 Error,
5722 #[serde(rename = "failure")]
5723 Failure,
5724 #[serde(rename = "warning")]
5725 Warning,
5726}
5727
5728impl RepoListStatusesByRefQueryState {
5729 fn as_str(&self) -> &'static str {
5730 match self {
5731 RepoListStatusesByRefQueryState::Pending => "pending",
5732 RepoListStatusesByRefQueryState::Success => "success",
5733 RepoListStatusesByRefQueryState::Error => "error",
5734 RepoListStatusesByRefQueryState::Failure => "failure",
5735 RepoListStatusesByRefQueryState::Warning => "warning",
5736 }
5737 }
5738}
5739#[derive(Debug, Clone, PartialEq, Default)]
5740pub struct RepoGetContentsListQuery {
5741 pub r#ref: Option<String>,
5743}
5744
5745impl RepoGetContentsListQuery {
5746 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5747 let mut list = Vec::new();
5748 if let Some(r#ref) = self.r#ref {
5749 list.push(("ref", r#ref));
5750 }
5751
5752 list
5753 }
5754}
5755
5756#[derive(Debug, Clone, PartialEq, Default)]
5757pub struct RepoGetContentsQuery {
5758 pub r#ref: Option<String>,
5760}
5761
5762impl RepoGetContentsQuery {
5763 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5764 let mut list = Vec::new();
5765 if let Some(r#ref) = self.r#ref {
5766 list.push(("ref", r#ref));
5767 }
5768
5769 list
5770 }
5771}
5772
5773#[derive(Debug, Clone, PartialEq, Default)]
5774pub struct RepoGetEditorConfigQuery {
5775 pub r#ref: Option<String>,
5777}
5778
5779impl RepoGetEditorConfigQuery {
5780 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5781 let mut list = Vec::new();
5782 if let Some(r#ref) = self.r#ref {
5783 list.push(("ref", r#ref));
5784 }
5785
5786 list
5787 }
5788}
5789
5790#[derive(Debug, Clone, PartialEq)]
5791pub struct GetBlobsQuery {
5792 pub shas: String,
5794}
5795
5796impl GetBlobsQuery {
5797 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5798 let mut list = Vec::new();
5799 let shas = self.shas;
5800 list.push(("shas", shas));
5801
5802 list
5803 }
5804}
5805
5806#[derive(Debug, Clone, PartialEq, Default)]
5807pub struct RepoGetSingleCommitQuery {
5808 pub stat: Option<bool>,
5810 pub verification: Option<bool>,
5812 pub files: Option<bool>,
5814}
5815
5816impl RepoGetSingleCommitQuery {
5817 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5818 let mut list = Vec::new();
5819 if let Some(stat) = self.stat {
5820 list.push(("stat", stat.to_string()));
5821 }
5822 if let Some(verification) = self.verification {
5823 list.push(("verification", verification.to_string()));
5824 }
5825 if let Some(files) = self.files {
5826 list.push(("files", files.to_string()));
5827 }
5828
5829 list
5830 }
5831}
5832
5833#[derive(Debug, Clone, PartialEq, Default)]
5834pub struct RepoGetNoteQuery {
5835 pub verification: Option<bool>,
5837 pub files: Option<bool>,
5839}
5840
5841impl RepoGetNoteQuery {
5842 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5843 let mut list = Vec::new();
5844 if let Some(verification) = self.verification {
5845 list.push(("verification", verification.to_string()));
5846 }
5847 if let Some(files) = self.files {
5848 list.push(("files", files.to_string()));
5849 }
5850
5851 list
5852 }
5853}
5854
5855#[derive(Debug, Clone, PartialEq, Default)]
5856pub struct GetTreeQuery {
5857 pub recursive: Option<bool>,
5859 pub per_page: Option<u32>,
5861}
5862
5863impl GetTreeQuery {
5864 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5865 let mut list = Vec::new();
5866 if let Some(recursive) = self.recursive {
5867 list.push(("recursive", recursive.to_string()));
5868 }
5869 if let Some(per_page) = self.per_page {
5870 list.push(("per_page", per_page.to_string()));
5871 }
5872
5873 list
5874 }
5875}
5876
5877#[derive(Debug, Clone, PartialEq, Default)]
5878pub struct RepoTestHookQuery {
5879 pub r#ref: Option<String>,
5881}
5882
5883impl RepoTestHookQuery {
5884 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5885 let mut list = Vec::new();
5886 if let Some(r#ref) = self.r#ref {
5887 list.push(("ref", r#ref));
5888 }
5889
5890 list
5891 }
5892}
5893
5894#[derive(Debug, Clone, PartialEq, Default)]
5895pub struct IssueListIssuesQuery {
5896 pub state: Option<IssueListIssuesQueryState>,
5898 pub labels: Option<String>,
5900 pub q: Option<String>,
5902 pub r#type: Option<IssueListIssuesQueryType>,
5904 pub milestones: Option<String>,
5906 pub since: Option<time::OffsetDateTime>,
5908 pub before: Option<time::OffsetDateTime>,
5910 pub created_by: Option<String>,
5912 pub assigned_by: Option<String>,
5914 pub mentioned_by: Option<String>,
5916 pub sort: Option<IssueListIssuesQuerySort>,
5918}
5919
5920impl IssueListIssuesQuery {
5921 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
5922 let mut list = Vec::new();
5923 if let Some(state) = self.state {
5924 list.push(("state", state.as_str().to_string()));
5925 }
5926 if let Some(labels) = self.labels {
5927 list.push(("labels", labels));
5928 }
5929 if let Some(q) = self.q {
5930 list.push(("q", q));
5931 }
5932 if let Some(r#type) = self.r#type {
5933 list.push(("type", r#type.as_str().to_string()));
5934 }
5935 if let Some(milestones) = self.milestones {
5936 list.push(("milestones", milestones));
5937 }
5938 if let Some(since) = self.since {
5939 list.push((
5940 "since",
5941 since
5942 .format(&time::format_description::well_known::Rfc3339)
5943 .unwrap(),
5944 ));
5945 }
5946 if let Some(before) = self.before {
5947 list.push((
5948 "before",
5949 before
5950 .format(&time::format_description::well_known::Rfc3339)
5951 .unwrap(),
5952 ));
5953 }
5954 if let Some(created_by) = self.created_by {
5955 list.push(("created_by", created_by));
5956 }
5957 if let Some(assigned_by) = self.assigned_by {
5958 list.push(("assigned_by", assigned_by));
5959 }
5960 if let Some(mentioned_by) = self.mentioned_by {
5961 list.push(("mentioned_by", mentioned_by));
5962 }
5963 if let Some(sort) = self.sort {
5964 list.push(("sort", sort.as_str().to_string()));
5965 }
5966
5967 list
5968 }
5969}
5970
5971#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5972pub enum IssueListIssuesQueryState {
5973 #[serde(rename = "closed")]
5974 Closed,
5975 #[serde(rename = "open")]
5976 Open,
5977 #[serde(rename = "all")]
5978 All,
5979}
5980
5981impl IssueListIssuesQueryState {
5982 fn as_str(&self) -> &'static str {
5983 match self {
5984 IssueListIssuesQueryState::Closed => "closed",
5985 IssueListIssuesQueryState::Open => "open",
5986 IssueListIssuesQueryState::All => "all",
5987 }
5988 }
5989}
5990
5991#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
5992pub enum IssueListIssuesQueryType {
5993 #[serde(rename = "issues")]
5994 Issues,
5995 #[serde(rename = "pulls")]
5996 Pulls,
5997}
5998
5999impl IssueListIssuesQueryType {
6000 fn as_str(&self) -> &'static str {
6001 match self {
6002 IssueListIssuesQueryType::Issues => "issues",
6003 IssueListIssuesQueryType::Pulls => "pulls",
6004 }
6005 }
6006}
6007
6008#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6009pub enum IssueListIssuesQuerySort {
6010 #[serde(rename = "relevance")]
6011 Relevance,
6012 #[serde(rename = "latest")]
6013 Latest,
6014 #[serde(rename = "oldest")]
6015 Oldest,
6016 #[serde(rename = "recentupdate")]
6017 Recentupdate,
6018 #[serde(rename = "leastupdate")]
6019 Leastupdate,
6020 #[serde(rename = "mostcomment")]
6021 Mostcomment,
6022 #[serde(rename = "leastcomment")]
6023 Leastcomment,
6024 #[serde(rename = "nearduedate")]
6025 Nearduedate,
6026 #[serde(rename = "farduedate")]
6027 Farduedate,
6028}
6029
6030impl IssueListIssuesQuerySort {
6031 fn as_str(&self) -> &'static str {
6032 match self {
6033 IssueListIssuesQuerySort::Relevance => "relevance",
6034 IssueListIssuesQuerySort::Latest => "latest",
6035 IssueListIssuesQuerySort::Oldest => "oldest",
6036 IssueListIssuesQuerySort::Recentupdate => "recentupdate",
6037 IssueListIssuesQuerySort::Leastupdate => "leastupdate",
6038 IssueListIssuesQuerySort::Mostcomment => "mostcomment",
6039 IssueListIssuesQuerySort::Leastcomment => "leastcomment",
6040 IssueListIssuesQuerySort::Nearduedate => "nearduedate",
6041 IssueListIssuesQuerySort::Farduedate => "farduedate",
6042 }
6043 }
6044}
6045#[derive(Debug, Clone, PartialEq, Default)]
6046pub struct IssueGetRepoCommentsQuery {
6047 pub since: Option<time::OffsetDateTime>,
6049 pub before: Option<time::OffsetDateTime>,
6051}
6052
6053impl IssueGetRepoCommentsQuery {
6054 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6055 let mut list = Vec::new();
6056 if let Some(since) = self.since {
6057 list.push((
6058 "since",
6059 since
6060 .format(&time::format_description::well_known::Rfc3339)
6061 .unwrap(),
6062 ));
6063 }
6064 if let Some(before) = self.before {
6065 list.push((
6066 "before",
6067 before
6068 .format(&time::format_description::well_known::Rfc3339)
6069 .unwrap(),
6070 ));
6071 }
6072
6073 list
6074 }
6075}
6076
6077#[derive(Debug, Clone, PartialEq, Default)]
6078pub struct IssueCreateIssueCommentAttachmentQuery {
6079 pub name: Option<String>,
6081 pub updated_at: Option<time::OffsetDateTime>,
6083}
6084
6085impl IssueCreateIssueCommentAttachmentQuery {
6086 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6087 let mut list = Vec::new();
6088 if let Some(name) = self.name {
6089 list.push(("name", name));
6090 }
6091 if let Some(updated_at) = self.updated_at {
6092 list.push((
6093 "updated_at",
6094 updated_at
6095 .format(&time::format_description::well_known::Rfc3339)
6096 .unwrap(),
6097 ));
6098 }
6099
6100 list
6101 }
6102}
6103
6104#[derive(Debug, Clone, PartialEq, Default)]
6105pub struct IssueCreateIssueAttachmentQuery {
6106 pub name: Option<String>,
6108 pub updated_at: Option<time::OffsetDateTime>,
6110}
6111
6112impl IssueCreateIssueAttachmentQuery {
6113 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6114 let mut list = Vec::new();
6115 if let Some(name) = self.name {
6116 list.push(("name", name));
6117 }
6118 if let Some(updated_at) = self.updated_at {
6119 list.push((
6120 "updated_at",
6121 updated_at
6122 .format(&time::format_description::well_known::Rfc3339)
6123 .unwrap(),
6124 ));
6125 }
6126
6127 list
6128 }
6129}
6130
6131#[derive(Debug, Clone, PartialEq, Default)]
6132pub struct IssueGetCommentsQuery {
6133 pub since: Option<time::OffsetDateTime>,
6135 pub before: Option<time::OffsetDateTime>,
6137}
6138
6139impl IssueGetCommentsQuery {
6140 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6141 let mut list = Vec::new();
6142 if let Some(since) = self.since {
6143 list.push((
6144 "since",
6145 since
6146 .format(&time::format_description::well_known::Rfc3339)
6147 .unwrap(),
6148 ));
6149 }
6150 if let Some(before) = self.before {
6151 list.push((
6152 "before",
6153 before
6154 .format(&time::format_description::well_known::Rfc3339)
6155 .unwrap(),
6156 ));
6157 }
6158
6159 list
6160 }
6161}
6162
6163#[derive(Debug, Clone, PartialEq, Default)]
6164pub struct IssueGetCommentsAndTimelineQuery {
6165 pub since: Option<time::OffsetDateTime>,
6167 pub before: Option<time::OffsetDateTime>,
6169}
6170
6171impl IssueGetCommentsAndTimelineQuery {
6172 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6173 let mut list = Vec::new();
6174 if let Some(since) = self.since {
6175 list.push((
6176 "since",
6177 since
6178 .format(&time::format_description::well_known::Rfc3339)
6179 .unwrap(),
6180 ));
6181 }
6182 if let Some(before) = self.before {
6183 list.push((
6184 "before",
6185 before
6186 .format(&time::format_description::well_known::Rfc3339)
6187 .unwrap(),
6188 ));
6189 }
6190
6191 list
6192 }
6193}
6194
6195#[derive(Debug, Clone, PartialEq, Default)]
6196pub struct IssueTrackedTimesQuery {
6197 pub user: Option<String>,
6199 pub since: Option<time::OffsetDateTime>,
6201 pub before: Option<time::OffsetDateTime>,
6203}
6204
6205impl IssueTrackedTimesQuery {
6206 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6207 let mut list = Vec::new();
6208 if let Some(user) = self.user {
6209 list.push(("user", user));
6210 }
6211 if let Some(since) = self.since {
6212 list.push((
6213 "since",
6214 since
6215 .format(&time::format_description::well_known::Rfc3339)
6216 .unwrap(),
6217 ));
6218 }
6219 if let Some(before) = self.before {
6220 list.push((
6221 "before",
6222 before
6223 .format(&time::format_description::well_known::Rfc3339)
6224 .unwrap(),
6225 ));
6226 }
6227
6228 list
6229 }
6230}
6231
6232#[derive(Debug, Clone, PartialEq, Default)]
6233pub struct RepoListKeysQuery {
6234 pub key_id: Option<u32>,
6236 pub fingerprint: Option<String>,
6238}
6239
6240impl RepoListKeysQuery {
6241 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6242 let mut list = Vec::new();
6243 if let Some(key_id) = self.key_id {
6244 list.push(("key_id", key_id.to_string()));
6245 }
6246 if let Some(fingerprint) = self.fingerprint {
6247 list.push(("fingerprint", fingerprint));
6248 }
6249
6250 list
6251 }
6252}
6253
6254#[derive(Debug, Clone, PartialEq, Default)]
6255pub struct IssueListLabelsQuery {
6256 pub sort: Option<IssueListLabelsQuerySort>,
6258}
6259
6260impl IssueListLabelsQuery {
6261 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6262 let mut list = Vec::new();
6263 if let Some(sort) = self.sort {
6264 list.push(("sort", sort.as_str().to_string()));
6265 }
6266
6267 list
6268 }
6269}
6270
6271#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6272pub enum IssueListLabelsQuerySort {
6273 #[serde(rename = "mostissues")]
6274 Mostissues,
6275 #[serde(rename = "leastissues")]
6276 Leastissues,
6277 #[serde(rename = "reversealphabetically")]
6278 Reversealphabetically,
6279}
6280
6281impl IssueListLabelsQuerySort {
6282 fn as_str(&self) -> &'static str {
6283 match self {
6284 IssueListLabelsQuerySort::Mostissues => "mostissues",
6285 IssueListLabelsQuerySort::Leastissues => "leastissues",
6286 IssueListLabelsQuerySort::Reversealphabetically => "reversealphabetically",
6287 }
6288 }
6289}
6290#[derive(Debug, Clone, PartialEq, Default)]
6291pub struct RepoGetRawFileOrLfsQuery {
6292 pub r#ref: Option<String>,
6294}
6295
6296impl RepoGetRawFileOrLfsQuery {
6297 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6298 let mut list = Vec::new();
6299 if let Some(r#ref) = self.r#ref {
6300 list.push(("ref", r#ref));
6301 }
6302
6303 list
6304 }
6305}
6306
6307#[derive(Debug, Clone, PartialEq, Default)]
6308pub struct IssueGetMilestonesListQuery {
6309 pub state: Option<String>,
6311 pub name: Option<String>,
6313}
6314
6315impl IssueGetMilestonesListQuery {
6316 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6317 let mut list = Vec::new();
6318 if let Some(state) = self.state {
6319 list.push(("state", state));
6320 }
6321 if let Some(name) = self.name {
6322 list.push(("name", name));
6323 }
6324
6325 list
6326 }
6327}
6328
6329#[derive(Debug, Clone, PartialEq, Default)]
6330pub struct NotifyGetRepoListQuery {
6331 pub all: Option<bool>,
6333 pub status_types: Option<Vec<String>>,
6335 pub subject_type: Option<Vec<NotifyGetRepoListQuerySubjectType>>,
6337 pub since: Option<time::OffsetDateTime>,
6339 pub before: Option<time::OffsetDateTime>,
6341}
6342
6343impl NotifyGetRepoListQuery {
6344 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6345 let mut list = Vec::new();
6346 if let Some(all) = self.all {
6347 list.push(("all", all.to_string()));
6348 }
6349 if let Some(status_types) = self.status_types {
6350 if !status_types.is_empty() {
6351 for item in status_types {
6352 list.push(("status-types", item.to_string()));
6353 }
6354 }
6355 }
6356 if let Some(subject_type) = self.subject_type {
6357 if !subject_type.is_empty() {
6358 for item in subject_type {
6359 list.push(("subject-type", item.as_str().to_string()));
6360 }
6361 }
6362 }
6363 if let Some(since) = self.since {
6364 list.push((
6365 "since",
6366 since
6367 .format(&time::format_description::well_known::Rfc3339)
6368 .unwrap(),
6369 ));
6370 }
6371 if let Some(before) = self.before {
6372 list.push((
6373 "before",
6374 before
6375 .format(&time::format_description::well_known::Rfc3339)
6376 .unwrap(),
6377 ));
6378 }
6379
6380 list
6381 }
6382}
6383
6384#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6385pub enum NotifyGetRepoListQuerySubjectType {
6386 #[serde(rename = "issue")]
6387 Issue,
6388 #[serde(rename = "pull")]
6389 Pull,
6390 #[serde(rename = "repository")]
6391 Repository,
6392}
6393
6394impl NotifyGetRepoListQuerySubjectType {
6395 fn as_str(&self) -> &'static str {
6396 match self {
6397 NotifyGetRepoListQuerySubjectType::Issue => "issue",
6398 NotifyGetRepoListQuerySubjectType::Pull => "pull",
6399 NotifyGetRepoListQuerySubjectType::Repository => "repository",
6400 }
6401 }
6402}
6403#[derive(Debug, Clone, PartialEq, Default)]
6404pub struct NotifyReadRepoListQuery {
6405 pub all: Option<bool>,
6407 pub status_types: Option<Vec<String>>,
6409 pub to_status: Option<String>,
6411 pub last_read_at: Option<time::OffsetDateTime>,
6413}
6414
6415impl NotifyReadRepoListQuery {
6416 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6417 let mut list = Vec::new();
6418 if let Some(all) = self.all {
6419 list.push(("all", all.to_string()));
6420 }
6421 if let Some(status_types) = self.status_types {
6422 if !status_types.is_empty() {
6423 for item in status_types {
6424 list.push(("status-types", item.to_string()));
6425 }
6426 }
6427 }
6428 if let Some(to_status) = self.to_status {
6429 list.push(("to-status", to_status));
6430 }
6431 if let Some(last_read_at) = self.last_read_at {
6432 list.push((
6433 "last_read_at",
6434 last_read_at
6435 .format(&time::format_description::well_known::Rfc3339)
6436 .unwrap(),
6437 ));
6438 }
6439
6440 list
6441 }
6442}
6443
6444#[derive(Debug, Clone, PartialEq, Default)]
6445pub struct RepoListPullRequestsQuery {
6446 pub state: Option<RepoListPullRequestsQueryState>,
6448 pub sort: Option<RepoListPullRequestsQuerySort>,
6450 pub milestone: Option<i64>,
6452 pub labels: Option<Vec<i64>>,
6454 pub poster: Option<String>,
6456}
6457
6458impl RepoListPullRequestsQuery {
6459 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6460 let mut list = Vec::new();
6461 if let Some(state) = self.state {
6462 list.push(("state", state.as_str().to_string()));
6463 }
6464 if let Some(sort) = self.sort {
6465 list.push(("sort", sort.as_str().to_string()));
6466 }
6467 if let Some(milestone) = self.milestone {
6468 list.push(("milestone", milestone.to_string()));
6469 }
6470 if let Some(labels) = self.labels {
6471 if !labels.is_empty() {
6472 for item in labels {
6473 list.push(("labels", format!("{item}")));
6474 }
6475 }
6476 }
6477 if let Some(poster) = self.poster {
6478 list.push(("poster", poster));
6479 }
6480
6481 list
6482 }
6483}
6484
6485#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6486pub enum RepoListPullRequestsQueryState {
6487 #[serde(rename = "open")]
6488 Open,
6489 #[serde(rename = "closed")]
6490 Closed,
6491 #[serde(rename = "all")]
6492 All,
6493}
6494
6495impl RepoListPullRequestsQueryState {
6496 fn as_str(&self) -> &'static str {
6497 match self {
6498 RepoListPullRequestsQueryState::Open => "open",
6499 RepoListPullRequestsQueryState::Closed => "closed",
6500 RepoListPullRequestsQueryState::All => "all",
6501 }
6502 }
6503}
6504
6505#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6506pub enum RepoListPullRequestsQuerySort {
6507 #[serde(rename = "oldest")]
6508 Oldest,
6509 #[serde(rename = "recentupdate")]
6510 Recentupdate,
6511 #[serde(rename = "recentclose")]
6512 Recentclose,
6513 #[serde(rename = "leastupdate")]
6514 Leastupdate,
6515 #[serde(rename = "mostcomment")]
6516 Mostcomment,
6517 #[serde(rename = "leastcomment")]
6518 Leastcomment,
6519 #[serde(rename = "priority")]
6520 Priority,
6521}
6522
6523impl RepoListPullRequestsQuerySort {
6524 fn as_str(&self) -> &'static str {
6525 match self {
6526 RepoListPullRequestsQuerySort::Oldest => "oldest",
6527 RepoListPullRequestsQuerySort::Recentupdate => "recentupdate",
6528 RepoListPullRequestsQuerySort::Recentclose => "recentclose",
6529 RepoListPullRequestsQuerySort::Leastupdate => "leastupdate",
6530 RepoListPullRequestsQuerySort::Mostcomment => "mostcomment",
6531 RepoListPullRequestsQuerySort::Leastcomment => "leastcomment",
6532 RepoListPullRequestsQuerySort::Priority => "priority",
6533 }
6534 }
6535}
6536#[derive(Debug, Clone, PartialEq, Default)]
6537pub struct RepoDownloadPullDiffOrPatchQuery {
6538 pub binary: Option<bool>,
6540}
6541
6542impl RepoDownloadPullDiffOrPatchQuery {
6543 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6544 let mut list = Vec::new();
6545 if let Some(binary) = self.binary {
6546 list.push(("binary", binary.to_string()));
6547 }
6548
6549 list
6550 }
6551}
6552
6553#[derive(Debug, Clone, PartialEq, Default)]
6554pub struct RepoGetPullRequestCommitsQuery {
6555 pub verification: Option<bool>,
6557 pub files: Option<bool>,
6559}
6560
6561impl RepoGetPullRequestCommitsQuery {
6562 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6563 let mut list = Vec::new();
6564 if let Some(verification) = self.verification {
6565 list.push(("verification", verification.to_string()));
6566 }
6567 if let Some(files) = self.files {
6568 list.push(("files", files.to_string()));
6569 }
6570
6571 list
6572 }
6573}
6574
6575#[derive(Debug, Clone, PartialEq, Default)]
6576pub struct RepoGetPullRequestFilesQuery {
6577 pub skip_to: Option<String>,
6579 pub whitespace: Option<RepoGetPullRequestFilesQueryWhitespace>,
6581}
6582
6583impl RepoGetPullRequestFilesQuery {
6584 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6585 let mut list = Vec::new();
6586 if let Some(skip_to) = self.skip_to {
6587 list.push(("skip-to", skip_to));
6588 }
6589 if let Some(whitespace) = self.whitespace {
6590 list.push(("whitespace", whitespace.as_str().to_string()));
6591 }
6592
6593 list
6594 }
6595}
6596
6597#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6598pub enum RepoGetPullRequestFilesQueryWhitespace {
6599 #[serde(rename = "ignore-all")]
6600 IgnoreAll,
6601 #[serde(rename = "ignore-change")]
6602 IgnoreChange,
6603 #[serde(rename = "ignore-eol")]
6604 IgnoreEol,
6605 #[serde(rename = "show-all")]
6606 ShowAll,
6607}
6608
6609impl RepoGetPullRequestFilesQueryWhitespace {
6610 fn as_str(&self) -> &'static str {
6611 match self {
6612 RepoGetPullRequestFilesQueryWhitespace::IgnoreAll => "ignore-all",
6613 RepoGetPullRequestFilesQueryWhitespace::IgnoreChange => "ignore-change",
6614 RepoGetPullRequestFilesQueryWhitespace::IgnoreEol => "ignore-eol",
6615 RepoGetPullRequestFilesQueryWhitespace::ShowAll => "show-all",
6616 }
6617 }
6618}
6619#[derive(Debug, Clone, PartialEq, Default)]
6620pub struct RepoUpdatePullRequestQuery {
6621 pub style: Option<RepoUpdatePullRequestQueryStyle>,
6623}
6624
6625impl RepoUpdatePullRequestQuery {
6626 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6627 let mut list = Vec::new();
6628 if let Some(style) = self.style {
6629 list.push(("style", style.as_str().to_string()));
6630 }
6631
6632 list
6633 }
6634}
6635
6636#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6637pub enum RepoUpdatePullRequestQueryStyle {
6638 #[serde(rename = "merge")]
6639 Merge,
6640 #[serde(rename = "rebase")]
6641 Rebase,
6642}
6643
6644impl RepoUpdatePullRequestQueryStyle {
6645 fn as_str(&self) -> &'static str {
6646 match self {
6647 RepoUpdatePullRequestQueryStyle::Merge => "merge",
6648 RepoUpdatePullRequestQueryStyle::Rebase => "rebase",
6649 }
6650 }
6651}
6652#[derive(Debug, Clone, PartialEq, Default)]
6653pub struct RepoGetRawFileQuery {
6654 pub r#ref: Option<String>,
6656}
6657
6658impl RepoGetRawFileQuery {
6659 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6660 let mut list = Vec::new();
6661 if let Some(r#ref) = self.r#ref {
6662 list.push(("ref", r#ref));
6663 }
6664
6665 list
6666 }
6667}
6668
6669#[derive(Debug, Clone, PartialEq, Default)]
6670pub struct RepoListReleasesQuery {
6671 pub draft: Option<bool>,
6673 pub pre_release: Option<bool>,
6675 pub q: Option<String>,
6677}
6678
6679impl RepoListReleasesQuery {
6680 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6681 let mut list = Vec::new();
6682 if let Some(draft) = self.draft {
6683 list.push(("draft", draft.to_string()));
6684 }
6685 if let Some(pre_release) = self.pre_release {
6686 list.push(("pre-release", pre_release.to_string()));
6687 }
6688 if let Some(q) = self.q {
6689 list.push(("q", q));
6690 }
6691
6692 list
6693 }
6694}
6695
6696#[derive(Debug, Clone, PartialEq, Default)]
6697pub struct RepoCreateReleaseAttachmentQuery {
6698 pub name: Option<String>,
6700}
6701
6702impl RepoCreateReleaseAttachmentQuery {
6703 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6704 let mut list = Vec::new();
6705 if let Some(name) = self.name {
6706 list.push(("name", name));
6707 }
6708
6709 list
6710 }
6711}
6712
6713#[derive(Debug, Clone, PartialEq, Default)]
6714pub struct RepoListStatusesQuery {
6715 pub sort: Option<RepoListStatusesQuerySort>,
6717 pub state: Option<RepoListStatusesQueryState>,
6719}
6720
6721impl RepoListStatusesQuery {
6722 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6723 let mut list = Vec::new();
6724 if let Some(sort) = self.sort {
6725 list.push(("sort", sort.as_str().to_string()));
6726 }
6727 if let Some(state) = self.state {
6728 list.push(("state", state.as_str().to_string()));
6729 }
6730
6731 list
6732 }
6733}
6734
6735#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6736pub enum RepoListStatusesQuerySort {
6737 #[serde(rename = "oldest")]
6738 Oldest,
6739 #[serde(rename = "recentupdate")]
6740 Recentupdate,
6741 #[serde(rename = "leastupdate")]
6742 Leastupdate,
6743 #[serde(rename = "leastindex")]
6744 Leastindex,
6745 #[serde(rename = "highestindex")]
6746 Highestindex,
6747}
6748
6749impl RepoListStatusesQuerySort {
6750 fn as_str(&self) -> &'static str {
6751 match self {
6752 RepoListStatusesQuerySort::Oldest => "oldest",
6753 RepoListStatusesQuerySort::Recentupdate => "recentupdate",
6754 RepoListStatusesQuerySort::Leastupdate => "leastupdate",
6755 RepoListStatusesQuerySort::Leastindex => "leastindex",
6756 RepoListStatusesQuerySort::Highestindex => "highestindex",
6757 }
6758 }
6759}
6760
6761#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6762pub enum RepoListStatusesQueryState {
6763 #[serde(rename = "pending")]
6764 Pending,
6765 #[serde(rename = "success")]
6766 Success,
6767 #[serde(rename = "error")]
6768 Error,
6769 #[serde(rename = "failure")]
6770 Failure,
6771 #[serde(rename = "warning")]
6772 Warning,
6773}
6774
6775impl RepoListStatusesQueryState {
6776 fn as_str(&self) -> &'static str {
6777 match self {
6778 RepoListStatusesQueryState::Pending => "pending",
6779 RepoListStatusesQueryState::Success => "success",
6780 RepoListStatusesQueryState::Error => "error",
6781 RepoListStatusesQueryState::Failure => "failure",
6782 RepoListStatusesQueryState::Warning => "warning",
6783 }
6784 }
6785}
6786#[derive(Debug, Clone, PartialEq, Default)]
6787pub struct RepoTrackedTimesQuery {
6788 pub user: Option<String>,
6790 pub since: Option<time::OffsetDateTime>,
6792 pub before: Option<time::OffsetDateTime>,
6794}
6795
6796impl RepoTrackedTimesQuery {
6797 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6798 let mut list = Vec::new();
6799 if let Some(user) = self.user {
6800 list.push(("user", user));
6801 }
6802 if let Some(since) = self.since {
6803 list.push((
6804 "since",
6805 since
6806 .format(&time::format_description::well_known::Rfc3339)
6807 .unwrap(),
6808 ));
6809 }
6810 if let Some(before) = self.before {
6811 list.push((
6812 "before",
6813 before
6814 .format(&time::format_description::well_known::Rfc3339)
6815 .unwrap(),
6816 ));
6817 }
6818
6819 list
6820 }
6821}
6822
6823#[derive(Debug, Clone, PartialEq, Default)]
6824pub struct OrgListTeamActivityFeedsQuery {
6825 pub date: Option<time::Date>,
6827}
6828
6829impl OrgListTeamActivityFeedsQuery {
6830 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6831 let mut list = Vec::new();
6832 if let Some(date) = self.date {
6833 list.push(("date", date.to_string()));
6834 }
6835
6836 list
6837 }
6838}
6839
6840#[derive(Debug, Clone, PartialEq)]
6841pub struct TopicSearchQuery {
6842 pub q: String,
6844}
6845
6846impl TopicSearchQuery {
6847 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6848 let mut list = Vec::new();
6849 let q = self.q;
6850 list.push(("q", q));
6851
6852 list
6853 }
6854}
6855#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
6856pub struct TopicSearchResults {
6857 pub topics: Option<Vec<TopicResponse>>,
6858}
6859
6860impl_from_response!(TopicSearchResults);
6861
6862#[derive(Debug, Clone, PartialEq, Default)]
6863pub struct UserSearchRunJobsQuery {
6864 pub labels: Option<String>,
6866}
6867
6868impl UserSearchRunJobsQuery {
6869 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6870 let mut list = Vec::new();
6871 if let Some(labels) = self.labels {
6872 list.push(("labels", labels));
6873 }
6874
6875 list
6876 }
6877}
6878
6879#[derive(Debug, Clone, PartialEq, Default)]
6880pub struct UserCurrentListKeysQuery {
6881 pub fingerprint: Option<String>,
6883}
6884
6885impl UserCurrentListKeysQuery {
6886 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6887 let mut list = Vec::new();
6888 if let Some(fingerprint) = self.fingerprint {
6889 list.push(("fingerprint", fingerprint));
6890 }
6891
6892 list
6893 }
6894}
6895
6896#[derive(Debug, Clone, PartialEq)]
6897pub struct UserCheckQuotaQuery {
6898 pub subject: String,
6900}
6901
6902impl UserCheckQuotaQuery {
6903 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6904 let mut list = Vec::new();
6905 let subject = self.subject;
6906 list.push(("subject", subject));
6907
6908 list
6909 }
6910}
6911
6912#[derive(Debug, Clone, PartialEq, Default)]
6913pub struct UserCurrentListReposQuery {
6914 pub order_by: Option<UserCurrentListReposQueryOrderBy>,
6916}
6917
6918impl UserCurrentListReposQuery {
6919 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
6920 let mut list = Vec::new();
6921 if let Some(order_by) = self.order_by {
6922 list.push(("order_by", order_by.as_str().to_string()));
6923 }
6924
6925 list
6926 }
6927}
6928
6929#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
6930pub enum UserCurrentListReposQueryOrderBy {
6931 #[serde(rename = "name")]
6932 Name,
6933 #[serde(rename = "id")]
6934 Id,
6935 #[serde(rename = "newest")]
6936 Newest,
6937 #[serde(rename = "oldest")]
6938 Oldest,
6939 #[serde(rename = "recentupdate")]
6940 Recentupdate,
6941 #[serde(rename = "leastupdate")]
6942 Leastupdate,
6943 #[serde(rename = "reversealphabetically")]
6944 Reversealphabetically,
6945 #[serde(rename = "alphabetically")]
6946 Alphabetically,
6947 #[serde(rename = "reversesize")]
6948 Reversesize,
6949 #[serde(rename = "size")]
6950 Size,
6951 #[serde(rename = "reversegitsize")]
6952 Reversegitsize,
6953 #[serde(rename = "gitsize")]
6954 Gitsize,
6955 #[serde(rename = "reverselfssize")]
6956 Reverselfssize,
6957 #[serde(rename = "lfssize")]
6958 Lfssize,
6959 #[serde(rename = "moststars")]
6960 Moststars,
6961 #[serde(rename = "feweststars")]
6962 Feweststars,
6963 #[serde(rename = "mostforks")]
6964 Mostforks,
6965 #[serde(rename = "fewestforks")]
6966 Fewestforks,
6967}
6968
6969impl UserCurrentListReposQueryOrderBy {
6970 fn as_str(&self) -> &'static str {
6971 match self {
6972 UserCurrentListReposQueryOrderBy::Name => "name",
6973 UserCurrentListReposQueryOrderBy::Id => "id",
6974 UserCurrentListReposQueryOrderBy::Newest => "newest",
6975 UserCurrentListReposQueryOrderBy::Oldest => "oldest",
6976 UserCurrentListReposQueryOrderBy::Recentupdate => "recentupdate",
6977 UserCurrentListReposQueryOrderBy::Leastupdate => "leastupdate",
6978 UserCurrentListReposQueryOrderBy::Reversealphabetically => "reversealphabetically",
6979 UserCurrentListReposQueryOrderBy::Alphabetically => "alphabetically",
6980 UserCurrentListReposQueryOrderBy::Reversesize => "reversesize",
6981 UserCurrentListReposQueryOrderBy::Size => "size",
6982 UserCurrentListReposQueryOrderBy::Reversegitsize => "reversegitsize",
6983 UserCurrentListReposQueryOrderBy::Gitsize => "gitsize",
6984 UserCurrentListReposQueryOrderBy::Reverselfssize => "reverselfssize",
6985 UserCurrentListReposQueryOrderBy::Lfssize => "lfssize",
6986 UserCurrentListReposQueryOrderBy::Moststars => "moststars",
6987 UserCurrentListReposQueryOrderBy::Feweststars => "feweststars",
6988 UserCurrentListReposQueryOrderBy::Mostforks => "mostforks",
6989 UserCurrentListReposQueryOrderBy::Fewestforks => "fewestforks",
6990 }
6991 }
6992}
6993#[derive(Debug, Clone, PartialEq, Default)]
6994pub struct UserCurrentTrackedTimesQuery {
6995 pub since: Option<time::OffsetDateTime>,
6997 pub before: Option<time::OffsetDateTime>,
6999}
7000
7001impl UserCurrentTrackedTimesQuery {
7002 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7003 let mut list = Vec::new();
7004 if let Some(since) = self.since {
7005 list.push((
7006 "since",
7007 since
7008 .format(&time::format_description::well_known::Rfc3339)
7009 .unwrap(),
7010 ));
7011 }
7012 if let Some(before) = self.before {
7013 list.push((
7014 "before",
7015 before
7016 .format(&time::format_description::well_known::Rfc3339)
7017 .unwrap(),
7018 ));
7019 }
7020
7021 list
7022 }
7023}
7024
7025#[derive(Debug, Clone, PartialEq, Default)]
7026pub struct UserSearchQuery {
7027 pub q: Option<String>,
7029 pub uid: Option<i64>,
7031 pub sort: Option<UserSearchQuerySort>,
7033}
7034
7035impl UserSearchQuery {
7036 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7037 let mut list = Vec::new();
7038 if let Some(q) = self.q {
7039 list.push(("q", q));
7040 }
7041 if let Some(uid) = self.uid {
7042 list.push(("uid", uid.to_string()));
7043 }
7044 if let Some(sort) = self.sort {
7045 list.push(("sort", sort.as_str().to_string()));
7046 }
7047
7048 list
7049 }
7050}
7051
7052#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
7053pub enum UserSearchQuerySort {
7054 #[serde(rename = "oldest")]
7055 Oldest,
7056 #[serde(rename = "newest")]
7057 Newest,
7058 #[serde(rename = "alphabetically")]
7059 Alphabetically,
7060 #[serde(rename = "reversealphabetically")]
7061 Reversealphabetically,
7062 #[serde(rename = "recentupdate")]
7063 Recentupdate,
7064 #[serde(rename = "leastupdate")]
7065 Leastupdate,
7066}
7067
7068impl UserSearchQuerySort {
7069 fn as_str(&self) -> &'static str {
7070 match self {
7071 UserSearchQuerySort::Oldest => "oldest",
7072 UserSearchQuerySort::Newest => "newest",
7073 UserSearchQuerySort::Alphabetically => "alphabetically",
7074 UserSearchQuerySort::Reversealphabetically => "reversealphabetically",
7075 UserSearchQuerySort::Recentupdate => "recentupdate",
7076 UserSearchQuerySort::Leastupdate => "leastupdate",
7077 }
7078 }
7079}
7080#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
7081pub struct UserSearchResults {
7082 pub data: Option<Vec<User>>,
7083 pub ok: Option<bool>,
7084}
7085
7086impl_from_response!(UserSearchResults);
7087
7088#[derive(Debug, Clone, PartialEq, Default)]
7089pub struct UserListActivityFeedsQuery {
7090 pub only_performed_by: Option<bool>,
7092 pub date: Option<time::Date>,
7094}
7095
7096impl UserListActivityFeedsQuery {
7097 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7098 let mut list = Vec::new();
7099 if let Some(only_performed_by) = self.only_performed_by {
7100 list.push(("only-performed-by", only_performed_by.to_string()));
7101 }
7102 if let Some(date) = self.date {
7103 list.push(("date", date.to_string()));
7104 }
7105
7106 list
7107 }
7108}
7109
7110#[derive(Debug, Clone, PartialEq, Default)]
7111pub struct UserListKeysQuery {
7112 pub fingerprint: Option<String>,
7114}
7115
7116impl UserListKeysQuery {
7117 pub(crate) fn into_list(self) -> Vec<(&'static str, String)> {
7118 let mut list = Vec::new();
7119 if let Some(fingerprint) = self.fingerprint {
7120 list.push(("fingerprint", fingerprint));
7121 }
7122
7123 list
7124 }
7125}