use crate::StructureError;
use std::collections::BTreeMap;
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct APIError {
pub message: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AccessToken {
pub id: Option<u64>,
pub name: Option<String>,
pub scopes: Option<Vec<String>>,
pub sha1: Option<String>,
pub token_last_eight: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Activity {
pub act_user: Option<User>,
pub act_user_id: Option<u64>,
pub comment: Option<Comment>,
pub comment_id: Option<u64>,
pub content: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub is_private: Option<bool>,
pub op_type: Option<String>,
pub ref_name: Option<String>,
pub repo: Option<Repository>,
pub repo_id: Option<u64>,
pub user_id: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ActivityPub {
#[serde(rename = "@context")]
pub context: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AddCollaboratorOption {
pub permission: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AddTimeOption {
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub time: u64,
pub user_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AnnotatedTag {
pub message: Option<String>,
pub object: Option<AnnotatedTagObject>,
pub sha: Option<String>,
pub tag: Option<String>,
pub tagger: Option<CommitUser>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub verification: Option<PayloadCommitVerification>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct AnnotatedTagObject {
pub sha: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Attachment {
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub browser_download_url: Option<url::Url>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub download_count: Option<u64>,
pub id: Option<u64>,
pub name: Option<String>,
pub size: Option<u64>,
pub uuid: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BlockedUser {
pub block_id: Option<u64>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Branch {
pub commit: Option<PayloadCommit>,
pub effective_branch_protection_name: Option<String>,
pub enable_status_check: Option<bool>,
pub name: Option<String>,
pub protected: Option<bool>,
pub required_approvals: Option<u64>,
pub status_check_contexts: Option<Vec<String>>,
pub user_can_merge: Option<bool>,
pub user_can_push: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct BranchProtection {
pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
pub block_on_outdated_branch: Option<bool>,
pub block_on_rejected_reviews: Option<bool>,
pub branch_name: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub dismiss_stale_approvals: Option<bool>,
pub enable_approvals_whitelist: Option<bool>,
pub enable_merge_whitelist: Option<bool>,
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
pub push_whitelist_deploy_keys: Option<bool>,
pub push_whitelist_teams: Option<Vec<String>>,
pub push_whitelist_usernames: Option<Vec<String>>,
pub require_signed_commits: Option<bool>,
pub required_approvals: Option<u64>,
pub rule_name: Option<String>,
pub status_check_contexts: Option<Vec<String>>,
pub unprotected_file_patterns: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ChangeFileOperation {
pub content: Option<String>,
pub from_path: Option<String>,
pub operation: ChangeFileOperationOperation,
pub path: String,
pub sha: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum ChangeFileOperationOperation {
#[serde(rename = "create")]
Create,
#[serde(rename = "update")]
Update,
#[serde(rename = "delete")]
Delete,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ChangeFilesOptions {
pub author: Option<Identity>,
pub branch: Option<String>,
pub committer: Option<Identity>,
pub dates: Option<CommitDateOptions>,
pub files: Vec<ChangeFileOperation>,
pub message: Option<String>,
pub new_branch: Option<String>,
pub signoff: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ChangedFile {
pub additions: Option<u64>,
pub changes: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub contents_url: Option<url::Url>,
pub deletions: Option<u64>,
pub filename: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub previous_filename: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub raw_url: Option<url::Url>,
pub status: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CombinedStatus {
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub commit_url: Option<url::Url>,
pub repository: Option<Repository>,
pub sha: Option<String>,
pub state: Option<String>,
pub statuses: Option<Vec<CommitStatus>>,
pub total_count: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Comment {
pub assets: Option<Vec<Attachment>>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub issue_url: Option<url::Url>,
pub original_author: Option<String>,
pub original_author_id: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub pull_request_url: Option<url::Url>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Commit {
pub author: Option<User>,
pub commit: Option<RepoCommit>,
pub committer: Option<User>,
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub files: Option<Vec<CommitAffectedFiles>>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub parents: Option<Vec<CommitMeta>>,
pub sha: Option<String>,
pub stats: Option<CommitStats>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitAffectedFiles {
pub filename: Option<String>,
pub status: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitDateOptions {
#[serde(with = "time::serde::rfc3339::option")]
pub author: Option<time::OffsetDateTime>,
#[serde(with = "time::serde::rfc3339::option")]
pub committer: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitMeta {
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub sha: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitStats {
pub additions: Option<u64>,
pub deletions: Option<u64>,
pub total: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitStatus {
pub context: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub creator: Option<User>,
pub description: Option<String>,
pub id: Option<u64>,
pub status: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub target_url: Option<url::Url>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitStatusState {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CommitUser {
pub date: Option<String>,
pub email: Option<String>,
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ContentsResponse {
#[serde(rename = "_links")]
pub links: Option<FileLinksResponse>,
pub content: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub download_url: Option<url::Url>,
pub encoding: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub git_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub last_commit_sha: Option<String>,
pub name: Option<String>,
pub path: Option<String>,
pub sha: Option<String>,
pub size: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub submodule_git_url: Option<url::Url>,
pub target: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateAccessTokenOption {
pub name: String,
pub scopes: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateBranchProtectionOption {
pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
pub block_on_outdated_branch: Option<bool>,
pub block_on_rejected_reviews: Option<bool>,
pub branch_name: Option<String>,
pub dismiss_stale_approvals: Option<bool>,
pub enable_approvals_whitelist: Option<bool>,
pub enable_merge_whitelist: Option<bool>,
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
pub push_whitelist_deploy_keys: Option<bool>,
pub push_whitelist_teams: Option<Vec<String>>,
pub push_whitelist_usernames: Option<Vec<String>>,
pub require_signed_commits: Option<bool>,
pub required_approvals: Option<u64>,
pub rule_name: Option<String>,
pub status_check_contexts: Option<Vec<String>>,
pub unprotected_file_patterns: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateBranchRepoOption {
pub new_branch_name: String,
pub old_branch_name: Option<String>,
pub old_ref_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateEmailOption {
pub emails: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateFileOptions {
pub author: Option<Identity>,
pub branch: Option<String>,
pub committer: Option<Identity>,
pub content: String,
pub dates: Option<CommitDateOptions>,
pub message: Option<String>,
pub new_branch: Option<String>,
pub signoff: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateForkOption {
pub name: Option<String>,
pub organization: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateGPGKeyOption {
pub armored_public_key: String,
pub armored_signature: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateHookOption {
pub active: Option<bool>,
pub authorization_header: Option<String>,
pub branch_filter: Option<String>,
pub config: CreateHookOptionConfig,
pub events: Option<Vec<String>>,
#[serde(rename = "type")]
pub r#type: CreateHookOptionType,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum CreateHookOptionType {
#[serde(rename = "forgejo")]
Forgejo,
#[serde(rename = "dingtalk")]
Dingtalk,
#[serde(rename = "discord")]
Discord,
#[serde(rename = "gitea")]
Gitea,
#[serde(rename = "gogs")]
Gogs,
#[serde(rename = "msteams")]
Msteams,
#[serde(rename = "slack")]
Slack,
#[serde(rename = "telegram")]
Telegram,
#[serde(rename = "feishu")]
Feishu,
#[serde(rename = "wechatwork")]
Wechatwork,
#[serde(rename = "packagist")]
Packagist,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateHookOptionConfig {
pub content_type: String,
pub url: url::Url,
#[serde(flatten)]
pub additional: BTreeMap<String, String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateIssueCommentOption {
pub body: String,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateIssueOption {
pub assignee: Option<String>,
pub assignees: Option<Vec<String>>,
pub body: Option<String>,
pub closed: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
pub labels: Option<Vec<u64>>,
pub milestone: Option<u64>,
#[serde(rename = "ref")]
pub r#ref: Option<String>,
pub title: String,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateKeyOption {
pub key: String,
pub read_only: Option<bool>,
pub title: String,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateLabelOption {
pub color: String,
pub description: Option<String>,
pub exclusive: Option<bool>,
pub is_archived: Option<bool>,
pub name: String,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateMilestoneOption {
pub description: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_on: Option<time::OffsetDateTime>,
pub state: Option<CreateMilestoneOptionState>,
pub title: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum CreateMilestoneOptionState {
#[serde(rename = "open")]
Open,
#[serde(rename = "closed")]
Closed,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateOAuth2ApplicationOptions {
pub confidential_client: Option<bool>,
pub name: Option<String>,
pub redirect_uris: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateOrUpdateSecretOption {
pub data: String,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateOrgOption {
pub description: Option<String>,
pub email: Option<String>,
pub full_name: Option<String>,
pub location: Option<String>,
pub repo_admin_change_team_access: Option<bool>,
pub username: String,
pub visibility: Option<CreateOrgOptionVisibility>,
pub website: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum CreateOrgOptionVisibility {
#[serde(rename = "public")]
Public,
#[serde(rename = "limited")]
Limited,
#[serde(rename = "private")]
Private,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreatePullRequestOption {
pub assignee: Option<String>,
pub assignees: Option<Vec<String>>,
pub base: Option<String>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
pub head: Option<String>,
pub labels: Option<Vec<u64>>,
pub milestone: Option<u64>,
pub title: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreatePullReviewComment {
pub body: Option<String>,
pub new_position: Option<u64>,
pub old_position: Option<u64>,
pub path: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreatePullReviewCommentOptions {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreatePullReviewOptions {
pub body: Option<String>,
pub comments: Option<Vec<CreatePullReviewComment>>,
pub commit_id: Option<String>,
pub event: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreatePushMirrorOption {
pub interval: Option<String>,
pub remote_address: Option<String>,
pub remote_password: Option<String>,
pub remote_username: Option<String>,
pub sync_on_commit: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateReleaseOption {
pub body: Option<String>,
pub draft: Option<bool>,
pub name: Option<String>,
pub prerelease: Option<bool>,
pub tag_name: String,
pub target_commitish: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateRepoOption {
pub auto_init: Option<bool>,
pub default_branch: Option<String>,
pub description: Option<String>,
pub gitignores: Option<String>,
pub issue_labels: Option<String>,
pub license: Option<String>,
pub name: String,
pub object_format_name: Option<ObjectFormatName>,
pub private: Option<bool>,
pub readme: Option<String>,
pub template: Option<bool>,
pub trust_model: Option<CreateRepoOptionTrustModel>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum CreateRepoOptionTrustModel {
#[serde(rename = "default")]
Default,
#[serde(rename = "collaborator")]
Collaborator,
#[serde(rename = "committer")]
Committer,
#[serde(rename = "collaboratorcommitter")]
Collaboratorcommitter,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateStatusOption {
pub context: Option<String>,
pub description: Option<String>,
pub state: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub target_url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateTagOption {
pub message: Option<String>,
pub tag_name: String,
pub target: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateTeamOption {
pub can_create_org_repo: Option<bool>,
pub description: Option<String>,
pub includes_all_repositories: Option<bool>,
pub name: String,
pub permission: Option<CreateTeamOptionPermission>,
pub units: Option<Vec<String>>,
pub units_map: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum CreateTeamOptionPermission {
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Write,
#[serde(rename = "admin")]
Admin,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateUserOption {
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub email: String,
pub full_name: Option<String>,
pub login_name: Option<String>,
pub must_change_password: Option<bool>,
pub password: Option<String>,
pub restricted: Option<bool>,
pub send_notify: Option<bool>,
pub source_id: Option<u64>,
pub username: String,
pub visibility: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct CreateWikiPageOptions {
pub content_base64: Option<String>,
pub message: Option<String>,
pub title: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Cron {
pub exec_times: Option<u64>,
pub name: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub next: Option<time::OffsetDateTime>,
#[serde(with = "time::serde::rfc3339::option")]
pub prev: Option<time::OffsetDateTime>,
pub schedule: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum DefaultMergeStyle {
#[serde(rename = "merge")]
Merge,
#[serde(rename = "rebase")]
Rebase,
#[serde(rename = "rebase-merge")]
RebaseMerge,
#[serde(rename = "squash")]
Squash,
#[serde(rename = "fast-forward-only")]
FastForwardOnly,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct DeleteEmailOption {
pub emails: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct DeleteFileOptions {
pub author: Option<Identity>,
pub branch: Option<String>,
pub committer: Option<Identity>,
pub dates: Option<CommitDateOptions>,
pub message: Option<String>,
pub new_branch: Option<String>,
pub sha: String,
pub signoff: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct DeleteLabelsOption {
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct DeployKey {
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub fingerprint: Option<String>,
pub id: Option<u64>,
pub key: Option<String>,
pub key_id: Option<u64>,
pub read_only: Option<bool>,
pub repository: Option<Repository>,
pub title: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct DismissPullReviewOptions {
pub message: Option<String>,
pub priors: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditAttachmentOptions {
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditBranchProtectionOption {
pub apply_to_admins: Option<bool>,
pub approvals_whitelist_teams: Option<Vec<String>>,
pub approvals_whitelist_username: Option<Vec<String>>,
pub block_on_official_review_requests: Option<bool>,
pub block_on_outdated_branch: Option<bool>,
pub block_on_rejected_reviews: Option<bool>,
pub dismiss_stale_approvals: Option<bool>,
pub enable_approvals_whitelist: Option<bool>,
pub enable_merge_whitelist: Option<bool>,
pub enable_push: Option<bool>,
pub enable_push_whitelist: Option<bool>,
pub enable_status_check: Option<bool>,
pub ignore_stale_approvals: Option<bool>,
pub merge_whitelist_teams: Option<Vec<String>>,
pub merge_whitelist_usernames: Option<Vec<String>>,
pub protected_file_patterns: Option<String>,
pub push_whitelist_deploy_keys: Option<bool>,
pub push_whitelist_teams: Option<Vec<String>>,
pub push_whitelist_usernames: Option<Vec<String>>,
pub require_signed_commits: Option<bool>,
pub required_approvals: Option<u64>,
pub status_check_contexts: Option<Vec<String>>,
pub unprotected_file_patterns: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditDeadlineOption {
#[serde(with = "time::serde::rfc3339")]
pub due_date: time::OffsetDateTime,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditGitHookOption {
pub content: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditHookOption {
pub active: Option<bool>,
pub authorization_header: Option<String>,
pub branch_filter: Option<String>,
pub config: Option<BTreeMap<String, String>>,
pub events: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditIssueCommentOption {
pub body: String,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditIssueOption {
pub assignee: Option<String>,
pub assignees: Option<Vec<String>>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
pub milestone: Option<u64>,
#[serde(rename = "ref")]
pub r#ref: Option<String>,
pub state: Option<String>,
pub title: Option<String>,
pub unset_due_date: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditLabelOption {
pub color: Option<String>,
pub description: Option<String>,
pub exclusive: Option<bool>,
pub is_archived: Option<bool>,
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditMilestoneOption {
pub description: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_on: Option<time::OffsetDateTime>,
pub state: Option<String>,
pub title: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditOrgOption {
pub description: Option<String>,
pub email: Option<String>,
pub full_name: Option<String>,
pub location: Option<String>,
pub repo_admin_change_team_access: Option<bool>,
pub visibility: Option<EditOrgOptionVisibility>,
pub website: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum EditOrgOptionVisibility {
#[serde(rename = "public")]
Public,
#[serde(rename = "limited")]
Limited,
#[serde(rename = "private")]
Private,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditPullRequestOption {
pub allow_maintainer_edit: Option<bool>,
pub assignee: Option<String>,
pub assignees: Option<Vec<String>>,
pub base: Option<String>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
pub labels: Option<Vec<u64>>,
pub milestone: Option<u64>,
pub state: Option<String>,
pub title: Option<String>,
pub unset_due_date: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditReactionOption {
pub content: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditReleaseOption {
pub body: Option<String>,
pub draft: Option<bool>,
pub name: Option<String>,
pub prerelease: Option<bool>,
pub tag_name: Option<String>,
pub target_commitish: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditRepoOption {
pub allow_fast_forward_only_merge: Option<bool>,
pub allow_manual_merge: Option<bool>,
pub allow_merge_commits: Option<bool>,
pub allow_rebase: Option<bool>,
pub allow_rebase_explicit: Option<bool>,
pub allow_rebase_update: Option<bool>,
pub allow_squash_merge: Option<bool>,
pub archived: Option<bool>,
pub autodetect_manual_merge: Option<bool>,
pub default_allow_maintainer_edit: Option<bool>,
pub default_branch: Option<String>,
pub default_delete_branch_after_merge: Option<bool>,
pub default_merge_style: Option<DefaultMergeStyle>,
pub description: Option<String>,
pub enable_prune: Option<bool>,
pub external_tracker: Option<ExternalTracker>,
pub external_wiki: Option<ExternalWiki>,
pub has_actions: Option<bool>,
pub has_issues: Option<bool>,
pub has_packages: Option<bool>,
pub has_projects: Option<bool>,
pub has_pull_requests: Option<bool>,
pub has_releases: Option<bool>,
pub has_wiki: Option<bool>,
pub ignore_whitespace_conflicts: Option<bool>,
pub internal_tracker: Option<InternalTracker>,
pub mirror_interval: Option<String>,
pub name: Option<String>,
pub private: Option<bool>,
pub template: Option<bool>,
pub website: Option<String>,
pub wiki_branch: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditTeamOption {
pub can_create_org_repo: Option<bool>,
pub description: Option<String>,
pub includes_all_repositories: Option<bool>,
pub name: String,
pub permission: Option<EditTeamOptionPermission>,
pub units: Option<Vec<String>>,
pub units_map: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum EditTeamOptionPermission {
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Write,
#[serde(rename = "admin")]
Admin,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct EditUserOption {
pub active: Option<bool>,
pub admin: Option<bool>,
pub allow_create_organization: Option<bool>,
pub allow_git_hook: Option<bool>,
pub allow_import_local: Option<bool>,
pub description: Option<String>,
pub email: Option<String>,
pub full_name: Option<String>,
pub location: Option<String>,
pub login_name: String,
pub max_repo_creation: Option<u64>,
pub must_change_password: Option<bool>,
pub password: Option<String>,
pub prohibit_login: Option<bool>,
pub pronouns: Option<String>,
pub restricted: Option<bool>,
pub source_id: u64,
pub visibility: Option<String>,
pub website: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Email {
pub email: Option<String>,
pub primary: Option<bool>,
pub user_id: Option<u64>,
pub username: Option<String>,
pub verified: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ExternalTracker {
pub external_tracker_format: Option<String>,
pub external_tracker_regexp_pattern: Option<String>,
pub external_tracker_style: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub external_tracker_url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ExternalWiki {
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub external_wiki_url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FileCommitResponse {
pub author: Option<CommitUser>,
pub committer: Option<CommitUser>,
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub message: Option<String>,
pub parents: Option<Vec<CommitMeta>>,
pub sha: Option<String>,
pub tree: Option<CommitMeta>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FileDeleteResponse {
pub commit: Option<FileCommitResponse>,
pub content: Option<serde_json::Value>,
pub verification: Option<PayloadCommitVerification>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FileLinksResponse {
pub git: Option<String>,
pub html: Option<String>,
#[serde(rename = "self")]
pub this: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FileResponse {
pub commit: Option<FileCommitResponse>,
pub content: Option<ContentsResponse>,
pub verification: Option<PayloadCommitVerification>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FilesResponse {
pub commit: Option<FileCommitResponse>,
pub files: Option<Vec<ContentsResponse>>,
pub verification: Option<PayloadCommitVerification>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GPGKey {
pub can_certify: Option<bool>,
pub can_encrypt_comms: Option<bool>,
pub can_encrypt_storage: Option<bool>,
pub can_sign: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub emails: Option<Vec<GPGKeyEmail>>,
#[serde(with = "time::serde::rfc3339::option")]
pub expires_at: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub key_id: Option<String>,
pub primary_key_id: Option<String>,
pub public_key: Option<String>,
pub subkeys: Option<Vec<GPGKey>>,
pub verified: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GPGKeyEmail {
pub email: Option<String>,
pub verified: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GeneralAPISettings {
pub default_git_trees_per_page: Option<u64>,
pub default_max_blob_size: Option<u64>,
pub default_paging_num: Option<u64>,
pub max_response_items: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GeneralAttachmentSettings {
pub allowed_types: Option<String>,
pub enabled: Option<bool>,
pub max_files: Option<u64>,
pub max_size: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GeneralRepoSettings {
pub forks_disabled: Option<bool>,
pub http_git_disabled: Option<bool>,
pub lfs_disabled: Option<bool>,
pub migrations_disabled: Option<bool>,
pub mirrors_disabled: Option<bool>,
pub stars_disabled: Option<bool>,
pub time_tracking_disabled: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GeneralUISettings {
pub allowed_reactions: Option<Vec<String>>,
pub custom_emojis: Option<Vec<String>>,
pub default_theme: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GenerateRepoOption {
pub avatar: Option<bool>,
pub default_branch: Option<String>,
pub description: Option<String>,
pub git_content: Option<bool>,
pub git_hooks: Option<bool>,
pub labels: Option<bool>,
pub name: String,
pub owner: String,
pub private: Option<bool>,
pub protected_branch: Option<bool>,
pub topics: Option<bool>,
pub webhooks: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GitBlobResponse {
pub content: Option<String>,
pub encoding: Option<String>,
pub sha: Option<String>,
pub size: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GitEntry {
pub mode: Option<String>,
pub path: Option<String>,
pub sha: Option<String>,
pub size: Option<u64>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GitHook {
pub content: Option<String>,
pub is_active: Option<bool>,
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GitObject {
pub sha: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GitTreeResponse {
pub page: Option<u64>,
pub sha: Option<String>,
pub total_count: Option<u64>,
pub tree: Option<Vec<GitEntry>>,
pub truncated: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct GitignoreTemplateInfo {
pub name: Option<String>,
pub source: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Hook {
pub active: Option<bool>,
pub authorization_header: Option<String>,
pub branch_filter: Option<String>,
pub config: Option<BTreeMap<String, String>>,
pub content_type: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub events: Option<Vec<String>>,
pub id: Option<u64>,
pub metadata: Option<serde_json::Value>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Identity {
pub email: Option<String>,
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct InternalTracker {
pub allow_only_contributors_to_track_time: Option<bool>,
pub enable_issue_dependencies: Option<bool>,
pub enable_time_tracker: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Issue {
pub assets: Option<Vec<Attachment>>,
pub assignee: Option<User>,
pub assignees: Option<Vec<User>>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub closed_at: Option<time::OffsetDateTime>,
pub comments: Option<u64>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub is_locked: Option<bool>,
pub labels: Option<Vec<Label>>,
pub milestone: Option<Milestone>,
pub number: Option<u64>,
pub original_author: Option<String>,
pub original_author_id: Option<u64>,
pub pin_order: Option<u64>,
pub pull_request: Option<PullRequestMeta>,
#[serde(rename = "ref")]
pub r#ref: Option<String>,
pub repository: Option<RepositoryMeta>,
pub state: Option<StateType>,
pub title: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueConfig {
pub blank_issues_enabled: Option<bool>,
pub contact_links: Option<Vec<IssueConfigContactLink>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueConfigContactLink {
pub about: Option<String>,
pub name: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueConfigValidation {
pub message: Option<String>,
pub valid: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueDeadline {
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueFormField {
pub attributes: Option<BTreeMap<String, serde_json::Value>>,
pub id: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
pub validations: Option<BTreeMap<String, serde_json::Value>>,
pub visible: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueFormFieldType {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueFormFieldVisible {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueLabelsOption {
pub labels: Option<Vec<u64>>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueMeta {
pub index: Option<u64>,
pub owner: Option<String>,
pub repo: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct IssueTemplate {
pub about: Option<String>,
pub body: Option<Vec<IssueFormField>>,
pub content: Option<String>,
pub file_name: Option<String>,
pub labels: Option<Vec<String>>,
pub name: Option<String>,
#[serde(rename = "ref")]
pub r#ref: Option<String>,
pub title: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Label {
pub color: Option<String>,
pub description: Option<String>,
pub exclusive: Option<bool>,
pub id: Option<u64>,
pub is_archived: Option<bool>,
pub name: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct LabelTemplate {
pub color: Option<String>,
pub description: Option<String>,
pub exclusive: Option<bool>,
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct LicenseTemplateInfo {
pub body: Option<String>,
pub implementation: Option<String>,
pub key: Option<String>,
pub name: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct LicensesTemplateListEntry {
pub key: Option<String>,
pub name: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct MarkdownOption {
#[serde(rename = "Context")]
pub context: Option<String>,
#[serde(rename = "Mode")]
pub mode: Option<String>,
#[serde(rename = "Text")]
pub text: Option<String>,
#[serde(rename = "Wiki")]
pub wiki: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct MarkupOption {
#[serde(rename = "Context")]
pub context: Option<String>,
#[serde(rename = "FilePath")]
pub file_path: Option<String>,
#[serde(rename = "Mode")]
pub mode: Option<String>,
#[serde(rename = "Text")]
pub text: Option<String>,
#[serde(rename = "Wiki")]
pub wiki: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct MergePullRequestOption {
#[serde(rename = "Do")]
pub r#do: MergePullRequestOptionDo,
#[serde(rename = "MergeCommitID")]
pub merge_commit_id: Option<String>,
#[serde(rename = "MergeMessageField")]
pub merge_message_field: Option<String>,
#[serde(rename = "MergeTitleField")]
pub merge_title_field: Option<String>,
pub delete_branch_after_merge: Option<bool>,
pub force_merge: Option<bool>,
pub head_commit_id: Option<String>,
pub merge_when_checks_succeed: Option<bool>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum MergePullRequestOptionDo {
#[serde(rename = "merge")]
Merge,
#[serde(rename = "rebase")]
Rebase,
#[serde(rename = "rebase-merge")]
RebaseMerge,
#[serde(rename = "squash")]
Squash,
#[serde(rename = "fast-forward-only")]
FastForwardOnly,
#[serde(rename = "manually-merged")]
ManuallyMerged,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct MigrateRepoOptions {
pub auth_password: Option<String>,
pub auth_token: Option<String>,
pub auth_username: Option<String>,
pub clone_addr: String,
pub description: Option<String>,
pub issues: Option<bool>,
pub labels: Option<bool>,
pub lfs: Option<bool>,
pub lfs_endpoint: Option<String>,
pub milestones: Option<bool>,
pub mirror: Option<bool>,
pub mirror_interval: Option<String>,
pub private: Option<bool>,
pub pull_requests: Option<bool>,
pub releases: Option<bool>,
pub repo_name: String,
pub repo_owner: Option<String>,
pub service: Option<MigrateRepoOptionsService>,
pub uid: Option<u64>,
pub wiki: Option<bool>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum MigrateRepoOptionsService {
#[serde(rename = "git")]
Git,
#[serde(rename = "github")]
Github,
#[serde(rename = "gitea")]
Gitea,
#[serde(rename = "gitlab")]
Gitlab,
#[serde(rename = "gogs")]
Gogs,
#[serde(rename = "onedev")]
Onedev,
#[serde(rename = "gitbucket")]
Gitbucket,
#[serde(rename = "codebase")]
Codebase,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Milestone {
#[serde(with = "time::serde::rfc3339::option")]
pub closed_at: Option<time::OffsetDateTime>,
pub closed_issues: Option<u64>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub description: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_on: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub open_issues: Option<u64>,
pub state: Option<StateType>,
pub title: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NewIssuePinsAllowed {
pub issues: Option<bool>,
pub pull_requests: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NodeInfo {
pub metadata: Option<BTreeMap<String, serde_json::Value>>,
#[serde(rename = "openRegistrations")]
pub open_registrations: Option<bool>,
pub protocols: Option<Vec<String>>,
pub services: Option<NodeInfoServices>,
pub software: Option<NodeInfoSoftware>,
pub usage: Option<NodeInfoUsage>,
pub version: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NodeInfoServices {
pub inbound: Option<Vec<String>>,
pub outbound: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NodeInfoSoftware {
pub homepage: Option<String>,
pub name: Option<String>,
pub repository: Option<String>,
pub version: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NodeInfoUsage {
#[serde(rename = "localComments")]
pub local_comments: Option<u64>,
#[serde(rename = "localPosts")]
pub local_posts: Option<u64>,
pub users: Option<NodeInfoUsageUsers>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NodeInfoUsageUsers {
#[serde(rename = "activeHalfyear")]
pub active_halfyear: Option<u64>,
#[serde(rename = "activeMonth")]
pub active_month: Option<u64>,
pub total: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Note {
pub commit: Option<Commit>,
pub message: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NotificationCount {
pub new: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NotificationSubject {
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub latest_comment_html_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub latest_comment_url: Option<url::Url>,
pub state: Option<StateType>,
pub title: Option<String>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NotificationThread {
pub id: Option<u64>,
pub pinned: Option<bool>,
pub repository: Option<Repository>,
pub subject: Option<NotificationSubject>,
pub unread: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct NotifySubjectType {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct OAuth2Application {
pub client_id: Option<String>,
pub client_secret: Option<String>,
pub confidential_client: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub name: Option<String>,
pub redirect_uris: Option<Vec<String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum ObjectFormatName {
#[serde(rename = "sha1")]
Sha1,
#[serde(rename = "sha256")]
Sha256,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Organization {
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub avatar_url: Option<url::Url>,
pub description: Option<String>,
pub email: Option<String>,
pub full_name: Option<String>,
pub id: Option<u64>,
pub location: Option<String>,
pub name: Option<String>,
pub repo_admin_change_team_access: Option<bool>,
pub username: Option<String>,
pub visibility: Option<String>,
pub website: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct OrganizationPermissions {
pub can_create_repository: Option<bool>,
pub can_read: Option<bool>,
pub can_write: Option<bool>,
pub is_admin: Option<bool>,
pub is_owner: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PRBranchInfo {
pub label: Option<String>,
#[serde(rename = "ref")]
pub r#ref: Option<String>,
pub repo: Option<Repository>,
pub repo_id: Option<u64>,
pub sha: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Package {
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub creator: Option<User>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub name: Option<String>,
pub owner: Option<User>,
pub repository: Option<Repository>,
#[serde(rename = "type")]
pub r#type: Option<String>,
pub version: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PackageFile {
#[serde(rename = "Size")]
pub size: Option<u64>,
pub id: Option<u64>,
pub md5: Option<String>,
pub name: Option<String>,
pub sha1: Option<String>,
pub sha256: Option<String>,
pub sha512: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PayloadCommit {
pub added: Option<Vec<String>>,
pub author: Option<PayloadUser>,
pub committer: Option<PayloadUser>,
pub id: Option<String>,
pub message: Option<String>,
pub modified: Option<Vec<String>>,
pub removed: Option<Vec<String>>,
#[serde(with = "time::serde::rfc3339::option")]
pub timestamp: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub verification: Option<PayloadCommitVerification>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PayloadCommitVerification {
pub payload: Option<String>,
pub reason: Option<String>,
pub signature: Option<String>,
pub signer: Option<PayloadUser>,
pub verified: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PayloadUser {
pub email: Option<String>,
pub name: Option<String>,
pub username: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Permission {
pub admin: Option<bool>,
pub pull: Option<bool>,
pub push: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PublicKey {
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub fingerprint: Option<String>,
pub id: Option<u64>,
pub key: Option<String>,
pub key_type: Option<String>,
pub read_only: Option<bool>,
pub title: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PullRequest {
pub allow_maintainer_edit: Option<bool>,
pub assignee: Option<User>,
pub assignees: Option<Vec<User>>,
pub base: Option<PRBranchInfo>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub closed_at: Option<time::OffsetDateTime>,
pub comments: Option<u64>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub diff_url: Option<url::Url>,
#[serde(with = "time::serde::rfc3339::option")]
pub due_date: Option<time::OffsetDateTime>,
pub head: Option<PRBranchInfo>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub is_locked: Option<bool>,
pub labels: Option<Vec<Label>>,
pub merge_base: Option<String>,
pub merge_commit_sha: Option<String>,
pub mergeable: Option<bool>,
pub merged: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub merged_at: Option<time::OffsetDateTime>,
pub merged_by: Option<User>,
pub milestone: Option<Milestone>,
pub number: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub patch_url: Option<url::Url>,
pub pin_order: Option<u64>,
pub requested_reviewers: Option<Vec<User>>,
pub state: Option<StateType>,
pub title: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PullRequestMeta {
pub draft: Option<bool>,
pub merged: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub merged_at: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PullReview {
pub body: Option<String>,
pub comments_count: Option<u64>,
pub commit_id: Option<String>,
pub dismissed: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub official: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub pull_request_url: Option<url::Url>,
pub stale: Option<bool>,
pub state: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub submitted_at: Option<time::OffsetDateTime>,
pub team: Option<Team>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PullReviewComment {
pub body: Option<String>,
pub commit_id: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub diff_hunk: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub original_commit_id: Option<String>,
pub original_position: Option<u32>,
pub path: Option<String>,
pub position: Option<u32>,
pub pull_request_review_id: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub pull_request_url: Option<url::Url>,
pub resolver: Option<User>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PullReviewRequestOptions {
pub reviewers: Option<Vec<String>>,
pub team_reviewers: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct PushMirror {
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub interval: Option<String>,
pub last_error: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub last_update: Option<time::OffsetDateTime>,
pub remote_address: Option<String>,
pub remote_name: Option<String>,
pub repo_name: Option<String>,
pub sync_on_commit: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Reaction {
pub content: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Reference {
pub object: Option<GitObject>,
#[serde(rename = "ref")]
pub r#ref: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Release {
pub assets: Option<Vec<Attachment>>,
pub author: Option<User>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub draft: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub name: Option<String>,
pub prerelease: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub published_at: Option<time::OffsetDateTime>,
pub tag_name: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub tarball_url: Option<url::Url>,
pub target_commitish: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub upload_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub zipball_url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RenameUserOption {
pub new_username: String,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ReplaceFlagsOption {
pub flags: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RepoCollaboratorPermission {
pub permission: Option<String>,
pub role_name: Option<String>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RepoCommit {
pub author: Option<CommitUser>,
pub committer: Option<CommitUser>,
pub message: Option<String>,
pub tree: Option<CommitMeta>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub verification: Option<PayloadCommitVerification>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RepoTopicOptions {
pub topics: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RepoTransfer {
pub doer: Option<User>,
pub recipient: Option<User>,
pub teams: Option<Vec<Team>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Repository {
pub allow_fast_forward_only_merge: Option<bool>,
pub allow_merge_commits: Option<bool>,
pub allow_rebase: Option<bool>,
pub allow_rebase_explicit: Option<bool>,
pub allow_rebase_update: Option<bool>,
pub allow_squash_merge: Option<bool>,
pub archived: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub archived_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub avatar_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub clone_url: Option<url::Url>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub default_allow_maintainer_edit: Option<bool>,
pub default_branch: Option<String>,
pub default_delete_branch_after_merge: Option<bool>,
pub default_merge_style: Option<DefaultMergeStyle>,
pub description: Option<String>,
pub empty: Option<bool>,
pub external_tracker: Option<ExternalTracker>,
pub external_wiki: Option<ExternalWiki>,
pub fork: Option<bool>,
pub forks_count: Option<u64>,
pub full_name: Option<String>,
pub has_actions: Option<bool>,
pub has_issues: Option<bool>,
pub has_packages: Option<bool>,
pub has_projects: Option<bool>,
pub has_pull_requests: Option<bool>,
pub has_releases: Option<bool>,
pub has_wiki: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
pub ignore_whitespace_conflicts: Option<bool>,
pub internal: Option<bool>,
pub internal_tracker: Option<InternalTracker>,
pub language: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub languages_url: Option<url::Url>,
pub link: Option<String>,
pub mirror: Option<bool>,
pub mirror_interval: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub mirror_updated: Option<time::OffsetDateTime>,
pub name: Option<String>,
pub object_format_name: Option<ObjectFormatName>,
pub open_issues_count: Option<u64>,
pub open_pr_counter: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub original_url: Option<url::Url>,
pub owner: Option<User>,
pub parent: Option<Box<Repository>>,
pub permissions: Option<Permission>,
pub private: Option<bool>,
pub release_counter: Option<u64>,
pub repo_transfer: Option<RepoTransfer>,
pub size: Option<u64>,
#[serde(deserialize_with = "crate::deserialize_optional_ssh_url")]
pub ssh_url: Option<url::Url>,
pub stars_count: Option<u64>,
pub template: Option<bool>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
pub watchers_count: Option<u64>,
pub website: Option<String>,
pub wiki_branch: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct RepositoryMeta {
pub full_name: Option<String>,
pub id: Option<u64>,
pub name: Option<String>,
pub owner: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ReviewStateType {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct SearchResults {
pub data: Option<Vec<Repository>>,
pub ok: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Secret {
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct ServerVersion {
pub version: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum StateType {
#[serde(rename = "open")]
Open,
#[serde(rename = "closed")]
Closed,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct StopWatch {
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub duration: Option<String>,
pub issue_index: Option<u64>,
pub issue_title: Option<String>,
pub repo_name: Option<String>,
pub repo_owner_name: Option<String>,
pub seconds: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct SubmitPullReviewOptions {
pub body: Option<String>,
pub event: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Tag {
pub commit: Option<CommitMeta>,
pub id: Option<String>,
pub message: Option<String>,
pub name: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub tarball_url: Option<url::Url>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub zipball_url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct Team {
pub can_create_org_repo: Option<bool>,
pub description: Option<String>,
pub id: Option<u64>,
pub includes_all_repositories: Option<bool>,
pub name: Option<String>,
pub organization: Option<Organization>,
pub permission: Option<TeamPermission>,
pub units: Option<Vec<String>>,
pub units_map: Option<BTreeMap<String, String>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum TeamPermission {
#[serde(rename = "none")]
None,
#[serde(rename = "read")]
Read,
#[serde(rename = "write")]
Write,
#[serde(rename = "admin")]
Admin,
#[serde(rename = "owner")]
Owner,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TimeStamp {}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TimelineComment {
pub assignee: Option<User>,
pub assignee_team: Option<Team>,
pub body: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub dependent_issue: Option<Issue>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub id: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub issue_url: Option<url::Url>,
pub label: Option<Label>,
pub milestone: Option<Milestone>,
pub new_ref: Option<String>,
pub new_title: Option<String>,
pub old_milestone: Option<Milestone>,
pub old_project_id: Option<u64>,
pub old_ref: Option<String>,
pub old_title: Option<String>,
pub project_id: Option<u64>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub pull_request_url: Option<url::Url>,
pub ref_action: Option<String>,
pub ref_comment: Option<Comment>,
pub ref_commit_sha: Option<String>,
pub ref_issue: Option<Issue>,
pub removed_assignee: Option<bool>,
pub resolve_doer: Option<User>,
pub review_id: Option<u64>,
pub tracked_time: Option<TrackedTime>,
#[serde(rename = "type")]
pub r#type: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated_at: Option<time::OffsetDateTime>,
pub user: Option<User>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TopicName {
pub topics: Option<Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TopicResponse {
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub repo_count: Option<u64>,
pub topic_name: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub updated: Option<time::OffsetDateTime>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TrackedTime {
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub id: Option<u64>,
pub issue: Option<Issue>,
pub issue_id: Option<u64>,
pub time: Option<u64>,
pub user_id: Option<u64>,
pub user_name: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TransferRepoOption {
pub new_owner: String,
pub team_ids: Option<Vec<u64>>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UpdateFileOptions {
pub author: Option<Identity>,
pub branch: Option<String>,
pub committer: Option<Identity>,
pub content: String,
pub dates: Option<CommitDateOptions>,
pub from_path: Option<String>,
pub message: Option<String>,
pub new_branch: Option<String>,
pub sha: String,
pub signoff: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UpdateRepoAvatarOption {
pub image: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UpdateUserAvatarOption {
pub image: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct User {
pub active: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub avatar_url: Option<url::Url>,
#[serde(with = "time::serde::rfc3339::option")]
pub created: Option<time::OffsetDateTime>,
pub description: Option<String>,
pub email: Option<String>,
pub followers_count: Option<u64>,
pub following_count: Option<u64>,
pub full_name: Option<String>,
pub id: Option<u64>,
pub is_admin: Option<bool>,
pub language: Option<String>,
#[serde(with = "time::serde::rfc3339::option")]
pub last_login: Option<time::OffsetDateTime>,
pub location: Option<String>,
pub login: Option<String>,
pub login_name: Option<String>,
pub prohibit_login: Option<bool>,
pub pronouns: Option<String>,
pub restricted: Option<bool>,
pub starred_repos_count: Option<u64>,
pub visibility: Option<String>,
pub website: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UserHeatmapData {
pub contributions: Option<u64>,
pub timestamp: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UserSettings {
pub description: Option<String>,
pub diff_view_style: Option<String>,
pub enable_repo_unit_hints: Option<bool>,
pub full_name: Option<String>,
pub hide_activity: Option<bool>,
pub hide_email: Option<bool>,
pub language: Option<String>,
pub location: Option<String>,
pub pronouns: Option<String>,
pub theme: Option<String>,
pub website: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UserSettingsOptions {
pub description: Option<String>,
pub diff_view_style: Option<String>,
pub enable_repo_unit_hints: Option<bool>,
pub full_name: Option<String>,
pub hide_activity: Option<bool>,
pub hide_email: Option<bool>,
pub language: Option<String>,
pub location: Option<String>,
pub pronouns: Option<String>,
pub theme: Option<String>,
pub website: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct WatchInfo {
#[serde(with = "time::serde::rfc3339::option")]
pub created_at: Option<time::OffsetDateTime>,
pub ignored: Option<bool>,
pub reason: Option<serde_json::Value>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub repository_url: Option<url::Url>,
pub subscribed: Option<bool>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub url: Option<url::Url>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct WikiCommit {
pub author: Option<CommitUser>,
pub commiter: Option<CommitUser>,
pub message: Option<String>,
pub sha: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct WikiCommitList {
pub commits: Option<Vec<WikiCommit>>,
pub count: Option<u64>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct WikiPage {
pub commit_count: Option<u64>,
pub content_base64: Option<String>,
pub footer: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub last_commit: Option<WikiCommit>,
pub sidebar: Option<String>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub sub_url: Option<url::Url>,
pub title: Option<String>,
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct WikiPageMetaData {
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub html_url: Option<url::Url>,
pub last_commit: Option<WikiCommit>,
#[serde(deserialize_with = "crate::none_if_blank_url")]
pub sub_url: Option<url::Url>,
pub title: Option<String>,
}
pub struct ChangedFileListHeaders {
pub x_has_more: Option<bool>,
pub x_page: Option<u64>,
pub x_page_count: Option<u64>,
pub x_per_page: Option<u64>,
pub x_total_count: Option<u64>,
}
impl TryFrom<&reqwest::header::HeaderMap> for ChangedFileListHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let x_has_more = map
.get("X-HasMore")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<bool>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_page = map
.get("X-Page")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_page_count = map
.get("X-PageCount")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_per_page = map
.get("X-PerPage")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_total_count = map
.get("X-Total-Count")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
Ok(Self {
x_has_more,
x_page,
x_page_count,
x_per_page,
x_total_count,
})
}
}
pub struct CommitListHeaders {
pub x_has_more: Option<bool>,
pub x_page: Option<u64>,
pub x_page_count: Option<u64>,
pub x_per_page: Option<u64>,
pub x_total: Option<u64>,
}
impl TryFrom<&reqwest::header::HeaderMap> for CommitListHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let x_has_more = map
.get("X-HasMore")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<bool>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_page = map
.get("X-Page")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_page_count = map
.get("X-PageCount")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_per_page = map
.get("X-PerPage")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
let x_total = map
.get("X-Total")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
s.parse::<u64>()
.map_err(|_| StructureError::HeaderParseFailed)
})
.transpose()?;
Ok(Self {
x_has_more,
x_page,
x_page_count,
x_per_page,
x_total,
})
}
}
pub struct RegistrationTokenHeaders {
pub token: Option<String>,
}
impl TryFrom<&reqwest::header::HeaderMap> for RegistrationTokenHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let token = map
.get("token")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
Ok(Self { token })
}
}
pub struct ErrorHeaders {
pub message: Option<String>,
pub url: Option<String>,
}
impl TryFrom<&reqwest::header::HeaderMap> for ErrorHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let message = map
.get("message")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
let url = map
.get("url")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
Ok(Self { message, url })
}
}
pub struct ForbiddenHeaders {
pub message: Option<String>,
pub url: Option<String>,
}
impl TryFrom<&reqwest::header::HeaderMap> for ForbiddenHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let message = map
.get("message")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
let url = map
.get("url")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
Ok(Self { message, url })
}
}
pub struct InvalidTopicsErrorHeaders {
pub invalid_topics: Option<Vec<String>>,
pub message: Option<String>,
}
impl TryFrom<&reqwest::header::HeaderMap> for InvalidTopicsErrorHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let invalid_topics = map
.get("invalidTopics")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.split(",").map(|s| s.to_string()).collect::<Vec<_>>())
})
.transpose()?;
let message = map
.get("message")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
Ok(Self {
invalid_topics,
message,
})
}
}
pub struct RepoArchivedErrorHeaders {
pub message: Option<String>,
pub url: Option<String>,
}
impl TryFrom<&reqwest::header::HeaderMap> for RepoArchivedErrorHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let message = map
.get("message")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
let url = map
.get("url")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
Ok(Self { message, url })
}
}
pub struct ValidationErrorHeaders {
pub message: Option<String>,
pub url: Option<String>,
}
impl TryFrom<&reqwest::header::HeaderMap> for ValidationErrorHeaders {
type Error = StructureError;
fn try_from(map: &reqwest::header::HeaderMap) -> Result<Self, Self::Error> {
let message = map
.get("message")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
let url = map
.get("url")
.map(|s| -> Result<_, _> {
let s = s.to_str().map_err(|_| StructureError::HeaderNotAscii)?;
Ok(s.to_string())
})
.transpose()?;
Ok(Self { message, url })
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminCronListQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for AdminCronListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminGetAllEmailsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for AdminGetAllEmailsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminSearchEmailsQuery {
pub q: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for AdminSearchEmailsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminListHooksQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for AdminListHooksQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminGetAllOrgsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for AdminGetAllOrgsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminUnadoptedListQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
pub pattern: Option<String>,
}
impl std::fmt::Display for AdminUnadoptedListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
if let Some(pattern) = &self.pattern {
write!(f, "pattern={pattern}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminSearchUsersQuery {
pub source_id: Option<u64>,
pub login_name: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for AdminSearchUsersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(source_id) = &self.source_id {
write!(f, "source_id={source_id}&")?;
}
if let Some(login_name) = &self.login_name {
write!(f, "login_name={login_name}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct AdminDeleteUserQuery {
pub purge: Option<bool>,
}
impl std::fmt::Display for AdminDeleteUserQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(purge) = &self.purge {
write!(f, "purge={purge}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct NotifyGetListQuery {
pub all: Option<bool>,
pub status_types: Option<Vec<String>>,
pub subject_type: Option<Vec<NotifyGetListQuerySubjectType>>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for NotifyGetListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(all) = &self.all {
write!(f, "all={all}&")?;
}
if let Some(status_types) = &self.status_types {
if !status_types.is_empty() {
for item in status_types {
write!(f, "status-types=")?;
write!(f, "{item}")?;
write!(f, "&")?;
}
}
}
if let Some(subject_type) = &self.subject_type {
if !subject_type.is_empty() {
for item in subject_type {
write!(f, "subject-type=")?;
write!(f, "{}", item.as_str())?;
write!(f, "&")?;
}
}
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum NotifyGetListQuerySubjectType {
#[serde(rename = "issue")]
Issue,
#[serde(rename = "pull")]
Pull,
#[serde(rename = "commit")]
Commit,
#[serde(rename = "repository")]
Repository,
}
impl NotifyGetListQuerySubjectType {
fn as_str(&self) -> &'static str {
match self {
NotifyGetListQuerySubjectType::Issue => "issue",
NotifyGetListQuerySubjectType::Pull => "pull",
NotifyGetListQuerySubjectType::Commit => "commit",
NotifyGetListQuerySubjectType::Repository => "repository",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct NotifyReadListQuery {
pub last_read_at: Option<time::OffsetDateTime>,
pub all: Option<String>,
pub status_types: Option<Vec<String>>,
pub to_status: Option<String>,
}
impl std::fmt::Display for NotifyReadListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(last_read_at) = &self.last_read_at {
write!(
f,
"last_read_at={field_name}&",
field_name = last_read_at
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(all) = &self.all {
write!(f, "all={all}&")?;
}
if let Some(status_types) = &self.status_types {
if !status_types.is_empty() {
for item in status_types {
write!(f, "status-types=")?;
write!(f, "{item}")?;
write!(f, "&")?;
}
}
}
if let Some(to_status) = &self.to_status {
write!(f, "to-status={to_status}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct NotifyReadThreadQuery {
pub to_status: Option<String>,
}
impl std::fmt::Display for NotifyReadThreadQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(to_status) = &self.to_status {
write!(f, "to-status={to_status}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgGetAllQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgGetAllQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListActionsSecretsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListActionsSecretsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListActivityFeedsQuery {
pub date: Option<time::Date>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListActivityFeedsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(date) = &self.date {
write!(
f,
"date={field_name}&",
field_name = date
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListHooksQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListHooksQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListLabelsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListLabelsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListBlockedUsersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListBlockedUsersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListMembersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListMembersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListPublicMembersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListPublicMembersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListReposQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListReposQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListTeamsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListTeamsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct TeamSearchQuery {
pub q: Option<String>,
pub include_desc: Option<bool>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for TeamSearchQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
if let Some(include_desc) = &self.include_desc {
write!(f, "include_desc={include_desc}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct TeamSearchResponse {
pub data: Option<Vec<Team>>,
pub ok: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ListPackagesQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
pub r#type: Option<ListPackagesQueryType>,
pub q: Option<String>,
}
impl std::fmt::Display for ListPackagesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
if let Some(r#type) = &self.r#type {
write!(f, "type={}&", r#type.as_str())?;
}
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum ListPackagesQueryType {
#[serde(rename = "alpine")]
Alpine,
#[serde(rename = "cargo")]
Cargo,
#[serde(rename = "chef")]
Chef,
#[serde(rename = "composer")]
Composer,
#[serde(rename = "conan")]
Conan,
#[serde(rename = "conda")]
Conda,
#[serde(rename = "container")]
Container,
#[serde(rename = "cran")]
Cran,
#[serde(rename = "debian")]
Debian,
#[serde(rename = "generic")]
Generic,
#[serde(rename = "go")]
Go,
#[serde(rename = "helm")]
Helm,
#[serde(rename = "maven")]
Maven,
#[serde(rename = "npm")]
Npm,
#[serde(rename = "nuget")]
Nuget,
#[serde(rename = "pub")]
Pub,
#[serde(rename = "pypi")]
Pypi,
#[serde(rename = "rpm")]
Rpm,
#[serde(rename = "rubygems")]
Rubygems,
#[serde(rename = "swift")]
Swift,
#[serde(rename = "vagrant")]
Vagrant,
}
impl ListPackagesQueryType {
fn as_str(&self) -> &'static str {
match self {
ListPackagesQueryType::Alpine => "alpine",
ListPackagesQueryType::Cargo => "cargo",
ListPackagesQueryType::Chef => "chef",
ListPackagesQueryType::Composer => "composer",
ListPackagesQueryType::Conan => "conan",
ListPackagesQueryType::Conda => "conda",
ListPackagesQueryType::Container => "container",
ListPackagesQueryType::Cran => "cran",
ListPackagesQueryType::Debian => "debian",
ListPackagesQueryType::Generic => "generic",
ListPackagesQueryType::Go => "go",
ListPackagesQueryType::Helm => "helm",
ListPackagesQueryType::Maven => "maven",
ListPackagesQueryType::Npm => "npm",
ListPackagesQueryType::Nuget => "nuget",
ListPackagesQueryType::Pub => "pub",
ListPackagesQueryType::Pypi => "pypi",
ListPackagesQueryType::Rpm => "rpm",
ListPackagesQueryType::Rubygems => "rubygems",
ListPackagesQueryType::Swift => "swift",
ListPackagesQueryType::Vagrant => "vagrant",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueSearchIssuesQuery {
pub state: Option<String>,
pub labels: Option<String>,
pub milestones: Option<String>,
pub q: Option<String>,
pub priority_repo_id: Option<u64>,
pub r#type: Option<String>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub assigned: Option<bool>,
pub created: Option<bool>,
pub mentioned: Option<bool>,
pub review_requested: Option<bool>,
pub reviewed: Option<bool>,
pub owner: Option<String>,
pub team: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueSearchIssuesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(state) = &self.state {
write!(f, "state={state}&")?;
}
if let Some(labels) = &self.labels {
write!(f, "labels={labels}&")?;
}
if let Some(milestones) = &self.milestones {
write!(f, "milestones={milestones}&")?;
}
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
if let Some(priority_repo_id) = &self.priority_repo_id {
write!(f, "priority_repo_id={priority_repo_id}&")?;
}
if let Some(r#type) = &self.r#type {
write!(f, "type={type}&")?;
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(assigned) = &self.assigned {
write!(f, "assigned={assigned}&")?;
}
if let Some(created) = &self.created {
write!(f, "created={created}&")?;
}
if let Some(mentioned) = &self.mentioned {
write!(f, "mentioned={mentioned}&")?;
}
if let Some(review_requested) = &self.review_requested {
write!(f, "review_requested={review_requested}&")?;
}
if let Some(reviewed) = &self.reviewed {
write!(f, "reviewed={reviewed}&")?;
}
if let Some(owner) = &self.owner {
write!(f, "owner={owner}&")?;
}
if let Some(team) = &self.team {
write!(f, "team={team}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoSearchQuery {
pub q: Option<String>,
pub topic: Option<bool>,
pub include_desc: Option<bool>,
pub uid: Option<u64>,
pub priority_owner_id: Option<u64>,
pub team_id: Option<u64>,
pub starred_by: Option<u64>,
pub private: Option<bool>,
pub is_private: Option<bool>,
pub template: Option<bool>,
pub archived: Option<bool>,
pub mode: Option<String>,
pub exclusive: Option<bool>,
pub sort: Option<String>,
pub order: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoSearchQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
if let Some(topic) = &self.topic {
write!(f, "topic={topic}&")?;
}
if let Some(include_desc) = &self.include_desc {
write!(f, "includeDesc={include_desc}&")?;
}
if let Some(uid) = &self.uid {
write!(f, "uid={uid}&")?;
}
if let Some(priority_owner_id) = &self.priority_owner_id {
write!(f, "priority_owner_id={priority_owner_id}&")?;
}
if let Some(team_id) = &self.team_id {
write!(f, "team_id={team_id}&")?;
}
if let Some(starred_by) = &self.starred_by {
write!(f, "starredBy={starred_by}&")?;
}
if let Some(private) = &self.private {
write!(f, "private={private}&")?;
}
if let Some(is_private) = &self.is_private {
write!(f, "is_private={is_private}&")?;
}
if let Some(template) = &self.template {
write!(f, "template={template}&")?;
}
if let Some(archived) = &self.archived {
write!(f, "archived={archived}&")?;
}
if let Some(mode) = &self.mode {
write!(f, "mode={mode}&")?;
}
if let Some(exclusive) = &self.exclusive {
write!(f, "exclusive={exclusive}&")?;
}
if let Some(sort) = &self.sort {
write!(f, "sort={sort}&")?;
}
if let Some(order) = &self.order {
write!(f, "order={order}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListActivityFeedsQuery {
pub date: Option<time::Date>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListActivityFeedsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(date) = &self.date {
write!(
f,
"date={field_name}&",
field_name = date
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListBranchesQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListBranchesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListCollaboratorsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListCollaboratorsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetAllCommitsQuery {
pub sha: Option<String>,
pub path: Option<String>,
pub stat: Option<bool>,
pub verification: Option<bool>,
pub files: Option<bool>,
pub page: Option<u32>,
pub limit: Option<u32>,
pub not: Option<String>,
}
impl std::fmt::Display for RepoGetAllCommitsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(sha) = &self.sha {
write!(f, "sha={sha}&")?;
}
if let Some(path) = &self.path {
write!(f, "path={path}&")?;
}
if let Some(stat) = &self.stat {
write!(f, "stat={stat}&")?;
}
if let Some(verification) = &self.verification {
write!(f, "verification={verification}&")?;
}
if let Some(files) = &self.files {
write!(f, "files={files}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
if let Some(not) = &self.not {
write!(f, "not={not}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetCombinedStatusByRefQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoGetCombinedStatusByRefQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListStatusesByRefQuery {
pub sort: Option<RepoListStatusesByRefQuerySort>,
pub state: Option<RepoListStatusesByRefQueryState>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListStatusesByRefQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(sort) = &self.sort {
write!(f, "sort={}&", sort.as_str())?;
}
if let Some(state) = &self.state {
write!(f, "state={}&", state.as_str())?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoListStatusesByRefQuerySort {
#[serde(rename = "oldest")]
Oldest,
#[serde(rename = "recentupdate")]
Recentupdate,
#[serde(rename = "leastupdate")]
Leastupdate,
#[serde(rename = "leastindex")]
Leastindex,
#[serde(rename = "highestindex")]
Highestindex,
}
impl RepoListStatusesByRefQuerySort {
fn as_str(&self) -> &'static str {
match self {
RepoListStatusesByRefQuerySort::Oldest => "oldest",
RepoListStatusesByRefQuerySort::Recentupdate => "recentupdate",
RepoListStatusesByRefQuerySort::Leastupdate => "leastupdate",
RepoListStatusesByRefQuerySort::Leastindex => "leastindex",
RepoListStatusesByRefQuerySort::Highestindex => "highestindex",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoListStatusesByRefQueryState {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "success")]
Success,
#[serde(rename = "error")]
Error,
#[serde(rename = "failure")]
Failure,
#[serde(rename = "warning")]
Warning,
}
impl RepoListStatusesByRefQueryState {
fn as_str(&self) -> &'static str {
match self {
RepoListStatusesByRefQueryState::Pending => "pending",
RepoListStatusesByRefQueryState::Success => "success",
RepoListStatusesByRefQueryState::Error => "error",
RepoListStatusesByRefQueryState::Failure => "failure",
RepoListStatusesByRefQueryState::Warning => "warning",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetContentsListQuery {
pub r#ref: Option<String>,
}
impl std::fmt::Display for RepoGetContentsListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(r#ref) = &self.r#ref {
write!(f, "ref={ref}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetContentsQuery {
pub r#ref: Option<String>,
}
impl std::fmt::Display for RepoGetContentsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(r#ref) = &self.r#ref {
write!(f, "ref={ref}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetEditorConfigQuery {
pub r#ref: Option<String>,
}
impl std::fmt::Display for RepoGetEditorConfigQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(r#ref) = &self.r#ref {
write!(f, "ref={ref}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct ListForksQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for ListForksQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetSingleCommitQuery {
pub stat: Option<bool>,
pub verification: Option<bool>,
pub files: Option<bool>,
}
impl std::fmt::Display for RepoGetSingleCommitQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(stat) = &self.stat {
write!(f, "stat={stat}&")?;
}
if let Some(verification) = &self.verification {
write!(f, "verification={verification}&")?;
}
if let Some(files) = &self.files {
write!(f, "files={files}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetNoteQuery {
pub verification: Option<bool>,
pub files: Option<bool>,
}
impl std::fmt::Display for RepoGetNoteQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(verification) = &self.verification {
write!(f, "verification={verification}&")?;
}
if let Some(files) = &self.files {
write!(f, "files={files}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct GetTreeQuery {
pub recursive: Option<bool>,
pub page: Option<u32>,
pub per_page: Option<u32>,
}
impl std::fmt::Display for GetTreeQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(recursive) = &self.recursive {
write!(f, "recursive={recursive}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(per_page) = &self.per_page {
write!(f, "per_page={per_page}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListHooksQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListHooksQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoTestHookQuery {
pub r#ref: Option<String>,
}
impl std::fmt::Display for RepoTestHookQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(r#ref) = &self.r#ref {
write!(f, "ref={ref}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueListIssuesQuery {
pub state: Option<IssueListIssuesQueryState>,
pub labels: Option<String>,
pub q: Option<String>,
pub r#type: Option<IssueListIssuesQueryType>,
pub milestones: Option<String>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub created_by: Option<String>,
pub assigned_by: Option<String>,
pub mentioned_by: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueListIssuesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(state) = &self.state {
write!(f, "state={}&", state.as_str())?;
}
if let Some(labels) = &self.labels {
write!(f, "labels={labels}&")?;
}
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
if let Some(r#type) = &self.r#type {
write!(f, "type={}&", r#type.as_str())?;
}
if let Some(milestones) = &self.milestones {
write!(f, "milestones={milestones}&")?;
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(created_by) = &self.created_by {
write!(f, "created_by={created_by}&")?;
}
if let Some(assigned_by) = &self.assigned_by {
write!(f, "assigned_by={assigned_by}&")?;
}
if let Some(mentioned_by) = &self.mentioned_by {
write!(f, "mentioned_by={mentioned_by}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum IssueListIssuesQueryState {
#[serde(rename = "closed")]
Closed,
#[serde(rename = "open")]
Open,
#[serde(rename = "all")]
All,
}
impl IssueListIssuesQueryState {
fn as_str(&self) -> &'static str {
match self {
IssueListIssuesQueryState::Closed => "closed",
IssueListIssuesQueryState::Open => "open",
IssueListIssuesQueryState::All => "all",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum IssueListIssuesQueryType {
#[serde(rename = "issues")]
Issues,
#[serde(rename = "pulls")]
Pulls,
}
impl IssueListIssuesQueryType {
fn as_str(&self) -> &'static str {
match self {
IssueListIssuesQueryType::Issues => "issues",
IssueListIssuesQueryType::Pulls => "pulls",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueGetRepoCommentsQuery {
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueGetRepoCommentsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueCreateIssueCommentAttachmentQuery {
pub name: Option<String>,
pub updated_at: Option<time::OffsetDateTime>,
}
impl std::fmt::Display for IssueCreateIssueCommentAttachmentQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(name) = &self.name {
write!(f, "name={name}&")?;
}
if let Some(updated_at) = &self.updated_at {
write!(
f,
"updated_at={field_name}&",
field_name = updated_at
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueCreateIssueAttachmentQuery {
pub name: Option<String>,
pub updated_at: Option<time::OffsetDateTime>,
}
impl std::fmt::Display for IssueCreateIssueAttachmentQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(name) = &self.name {
write!(f, "name={name}&")?;
}
if let Some(updated_at) = &self.updated_at {
write!(
f,
"updated_at={field_name}&",
field_name = updated_at
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueListBlocksQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueListBlocksQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueGetCommentsQuery {
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
}
impl std::fmt::Display for IssueGetCommentsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueListIssueDependenciesQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueListIssueDependenciesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueGetIssueReactionsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueGetIssueReactionsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueSubscriptionsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueSubscriptionsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueGetCommentsAndTimelineQuery {
pub since: Option<time::OffsetDateTime>,
pub page: Option<u32>,
pub limit: Option<u32>,
pub before: Option<time::OffsetDateTime>,
}
impl std::fmt::Display for IssueGetCommentsAndTimelineQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueTrackedTimesQuery {
pub user: Option<String>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueTrackedTimesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(user) = &self.user {
write!(f, "user={user}&")?;
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListKeysQuery {
pub key_id: Option<u32>,
pub fingerprint: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListKeysQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(key_id) = &self.key_id {
write!(f, "key_id={key_id}&")?;
}
if let Some(fingerprint) = &self.fingerprint {
write!(f, "fingerprint={fingerprint}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueListLabelsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueListLabelsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetRawFileOrLfsQuery {
pub r#ref: Option<String>,
}
impl std::fmt::Display for RepoGetRawFileOrLfsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(r#ref) = &self.r#ref {
write!(f, "ref={ref}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct IssueGetMilestonesListQuery {
pub state: Option<String>,
pub name: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for IssueGetMilestonesListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(state) = &self.state {
write!(f, "state={state}&")?;
}
if let Some(name) = &self.name {
write!(f, "name={name}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct NotifyGetRepoListQuery {
pub all: Option<bool>,
pub status_types: Option<Vec<String>>,
pub subject_type: Option<Vec<NotifyGetRepoListQuerySubjectType>>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for NotifyGetRepoListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(all) = &self.all {
write!(f, "all={all}&")?;
}
if let Some(status_types) = &self.status_types {
if !status_types.is_empty() {
for item in status_types {
write!(f, "status-types=")?;
write!(f, "{item}")?;
write!(f, "&")?;
}
}
}
if let Some(subject_type) = &self.subject_type {
if !subject_type.is_empty() {
for item in subject_type {
write!(f, "subject-type=")?;
write!(f, "{}", item.as_str())?;
write!(f, "&")?;
}
}
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum NotifyGetRepoListQuerySubjectType {
#[serde(rename = "issue")]
Issue,
#[serde(rename = "pull")]
Pull,
#[serde(rename = "commit")]
Commit,
#[serde(rename = "repository")]
Repository,
}
impl NotifyGetRepoListQuerySubjectType {
fn as_str(&self) -> &'static str {
match self {
NotifyGetRepoListQuerySubjectType::Issue => "issue",
NotifyGetRepoListQuerySubjectType::Pull => "pull",
NotifyGetRepoListQuerySubjectType::Commit => "commit",
NotifyGetRepoListQuerySubjectType::Repository => "repository",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct NotifyReadRepoListQuery {
pub all: Option<String>,
pub status_types: Option<Vec<String>>,
pub to_status: Option<String>,
pub last_read_at: Option<time::OffsetDateTime>,
}
impl std::fmt::Display for NotifyReadRepoListQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(all) = &self.all {
write!(f, "all={all}&")?;
}
if let Some(status_types) = &self.status_types {
if !status_types.is_empty() {
for item in status_types {
write!(f, "status-types=")?;
write!(f, "{item}")?;
write!(f, "&")?;
}
}
}
if let Some(to_status) = &self.to_status {
write!(f, "to-status={to_status}&")?;
}
if let Some(last_read_at) = &self.last_read_at {
write!(
f,
"last_read_at={field_name}&",
field_name = last_read_at
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListPullRequestsQuery {
pub state: Option<RepoListPullRequestsQueryState>,
pub sort: Option<RepoListPullRequestsQuerySort>,
pub milestone: Option<u64>,
pub labels: Option<Vec<u64>>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListPullRequestsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(state) = &self.state {
write!(f, "state={}&", state.as_str())?;
}
if let Some(sort) = &self.sort {
write!(f, "sort={}&", sort.as_str())?;
}
if let Some(milestone) = &self.milestone {
write!(f, "milestone={milestone}&")?;
}
if let Some(labels) = &self.labels {
if !labels.is_empty() {
for item in labels {
write!(f, "labels=")?;
write!(f, "{item}")?;
write!(f, "&")?;
}
}
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoListPullRequestsQueryState {
#[serde(rename = "closed")]
Closed,
#[serde(rename = "open")]
Open,
#[serde(rename = "all")]
All,
}
impl RepoListPullRequestsQueryState {
fn as_str(&self) -> &'static str {
match self {
RepoListPullRequestsQueryState::Closed => "closed",
RepoListPullRequestsQueryState::Open => "open",
RepoListPullRequestsQueryState::All => "all",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoListPullRequestsQuerySort {
#[serde(rename = "oldest")]
Oldest,
#[serde(rename = "recentupdate")]
Recentupdate,
#[serde(rename = "leastupdate")]
Leastupdate,
#[serde(rename = "mostcomment")]
Mostcomment,
#[serde(rename = "leastcomment")]
Leastcomment,
#[serde(rename = "priority")]
Priority,
}
impl RepoListPullRequestsQuerySort {
fn as_str(&self) -> &'static str {
match self {
RepoListPullRequestsQuerySort::Oldest => "oldest",
RepoListPullRequestsQuerySort::Recentupdate => "recentupdate",
RepoListPullRequestsQuerySort::Leastupdate => "leastupdate",
RepoListPullRequestsQuerySort::Mostcomment => "mostcomment",
RepoListPullRequestsQuerySort::Leastcomment => "leastcomment",
RepoListPullRequestsQuerySort::Priority => "priority",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoDownloadPullDiffOrPatchQuery {
pub binary: Option<bool>,
}
impl std::fmt::Display for RepoDownloadPullDiffOrPatchQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(binary) = &self.binary {
write!(f, "binary={binary}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetPullRequestCommitsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
pub verification: Option<bool>,
pub files: Option<bool>,
}
impl std::fmt::Display for RepoGetPullRequestCommitsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
if let Some(verification) = &self.verification {
write!(f, "verification={verification}&")?;
}
if let Some(files) = &self.files {
write!(f, "files={files}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetPullRequestFilesQuery {
pub skip_to: Option<String>,
pub whitespace: Option<RepoGetPullRequestFilesQueryWhitespace>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoGetPullRequestFilesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(skip_to) = &self.skip_to {
write!(f, "skip-to={skip_to}&")?;
}
if let Some(whitespace) = &self.whitespace {
write!(f, "whitespace={}&", whitespace.as_str())?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoGetPullRequestFilesQueryWhitespace {
#[serde(rename = "ignore-all")]
IgnoreAll,
#[serde(rename = "ignore-change")]
IgnoreChange,
#[serde(rename = "ignore-eol")]
IgnoreEol,
#[serde(rename = "show-all")]
ShowAll,
}
impl RepoGetPullRequestFilesQueryWhitespace {
fn as_str(&self) -> &'static str {
match self {
RepoGetPullRequestFilesQueryWhitespace::IgnoreAll => "ignore-all",
RepoGetPullRequestFilesQueryWhitespace::IgnoreChange => "ignore-change",
RepoGetPullRequestFilesQueryWhitespace::IgnoreEol => "ignore-eol",
RepoGetPullRequestFilesQueryWhitespace::ShowAll => "show-all",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListPullReviewsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListPullReviewsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoUpdatePullRequestQuery {
pub style: Option<RepoUpdatePullRequestQueryStyle>,
}
impl std::fmt::Display for RepoUpdatePullRequestQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(style) = &self.style {
write!(f, "style={}&", style.as_str())?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoUpdatePullRequestQueryStyle {
#[serde(rename = "merge")]
Merge,
#[serde(rename = "rebase")]
Rebase,
}
impl RepoUpdatePullRequestQueryStyle {
fn as_str(&self) -> &'static str {
match self {
RepoUpdatePullRequestQueryStyle::Merge => "merge",
RepoUpdatePullRequestQueryStyle::Rebase => "rebase",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListPushMirrorsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListPushMirrorsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetRawFileQuery {
pub r#ref: Option<String>,
}
impl std::fmt::Display for RepoGetRawFileQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(r#ref) = &self.r#ref {
write!(f, "ref={ref}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListReleasesQuery {
pub draft: Option<bool>,
pub pre_release: Option<bool>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListReleasesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(draft) = &self.draft {
write!(f, "draft={draft}&")?;
}
if let Some(pre_release) = &self.pre_release {
write!(f, "pre-release={pre_release}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoCreateReleaseAttachmentQuery {
pub name: Option<String>,
}
impl std::fmt::Display for RepoCreateReleaseAttachmentQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(name) = &self.name {
write!(f, "name={name}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListStargazersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListStargazersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListStatusesQuery {
pub sort: Option<RepoListStatusesQuerySort>,
pub state: Option<RepoListStatusesQueryState>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListStatusesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(sort) = &self.sort {
write!(f, "sort={}&", sort.as_str())?;
}
if let Some(state) = &self.state {
write!(f, "state={}&", state.as_str())?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoListStatusesQuerySort {
#[serde(rename = "oldest")]
Oldest,
#[serde(rename = "recentupdate")]
Recentupdate,
#[serde(rename = "leastupdate")]
Leastupdate,
#[serde(rename = "leastindex")]
Leastindex,
#[serde(rename = "highestindex")]
Highestindex,
}
impl RepoListStatusesQuerySort {
fn as_str(&self) -> &'static str {
match self {
RepoListStatusesQuerySort::Oldest => "oldest",
RepoListStatusesQuerySort::Recentupdate => "recentupdate",
RepoListStatusesQuerySort::Leastupdate => "leastupdate",
RepoListStatusesQuerySort::Leastindex => "leastindex",
RepoListStatusesQuerySort::Highestindex => "highestindex",
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
pub enum RepoListStatusesQueryState {
#[serde(rename = "pending")]
Pending,
#[serde(rename = "success")]
Success,
#[serde(rename = "error")]
Error,
#[serde(rename = "failure")]
Failure,
#[serde(rename = "warning")]
Warning,
}
impl RepoListStatusesQueryState {
fn as_str(&self) -> &'static str {
match self {
RepoListStatusesQueryState::Pending => "pending",
RepoListStatusesQueryState::Success => "success",
RepoListStatusesQueryState::Error => "error",
RepoListStatusesQueryState::Failure => "failure",
RepoListStatusesQueryState::Warning => "warning",
}
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListSubscribersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListSubscribersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListTagsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListTagsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoTrackedTimesQuery {
pub user: Option<String>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoTrackedTimesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(user) = &self.user {
write!(f, "user={user}&")?;
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoListTopicsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoListTopicsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetWikiPagesQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for RepoGetWikiPagesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct RepoGetWikiPageRevisionsQuery {
pub page: Option<u32>,
}
impl std::fmt::Display for RepoGetWikiPageRevisionsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListTeamActivityFeedsQuery {
pub date: Option<time::Date>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListTeamActivityFeedsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(date) = &self.date {
write!(
f,
"date={field_name}&",
field_name = date
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListTeamMembersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListTeamMembersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListTeamReposQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListTeamReposQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq)]
pub struct TopicSearchQuery {
pub q: String,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for TopicSearchQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let q = &self.q;
write!(f, "q={q}&")?;
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserGetOAuth2ApplicationsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserGetOAuth2ApplicationsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListFollowersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListFollowersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListFollowingQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListFollowingQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListGpgKeysQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListGpgKeysQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListHooksQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListHooksQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListKeysQuery {
pub fingerprint: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListKeysQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(fingerprint) = &self.fingerprint {
write!(f, "fingerprint={fingerprint}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListBlockedUsersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListBlockedUsersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListCurrentUserOrgsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListCurrentUserOrgsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListReposQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListReposQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListStarredQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListStarredQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserGetStopWatchesQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserGetStopWatchesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentListSubscriptionsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserCurrentListSubscriptionsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListTeamsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListTeamsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserCurrentTrackedTimesQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
pub since: Option<time::OffsetDateTime>,
pub before: Option<time::OffsetDateTime>,
}
impl std::fmt::Display for UserCurrentTrackedTimesQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
if let Some(since) = &self.since {
write!(
f,
"since={field_name}&",
field_name = since
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(before) = &self.before {
write!(
f,
"before={field_name}&",
field_name = before
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserSearchQuery {
pub q: Option<String>,
pub uid: Option<u64>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserSearchQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(q) = &self.q {
write!(f, "q={q}&")?;
}
if let Some(uid) = &self.uid {
write!(f, "uid={uid}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct UserSearchResponse {
pub data: Option<Vec<User>>,
pub ok: Option<bool>,
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListActivityFeedsQuery {
pub only_performed_by: Option<bool>,
pub date: Option<time::Date>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListActivityFeedsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(only_performed_by) = &self.only_performed_by {
write!(f, "only-performed-by={only_performed_by}&")?;
}
if let Some(date) = &self.date {
write!(
f,
"date={field_name}&",
field_name = date
.format(&time::format_description::well_known::Rfc3339)
.unwrap()
)?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListFollowersQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListFollowersQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListFollowingQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListFollowingQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListGpgKeysQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListGpgKeysQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListKeysQuery {
pub fingerprint: Option<String>,
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListKeysQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(fingerprint) = &self.fingerprint {
write!(f, "fingerprint={fingerprint}&")?;
}
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct OrgListUserOrgsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for OrgListUserOrgsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListReposQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListReposQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListStarredQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListStarredQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserListSubscriptionsQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserListSubscriptionsQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}
#[derive(Debug, Clone, PartialEq, Default)]
pub struct UserGetTokensQuery {
pub page: Option<u32>,
pub limit: Option<u32>,
}
impl std::fmt::Display for UserGetTokensQuery {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(page) = &self.page {
write!(f, "page={page}&")?;
}
if let Some(limit) = &self.limit {
write!(f, "limit={limit}&")?;
}
Ok(())
}
}