#![warn(missing_docs)]
use std::collections::HashMap;
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct AccountInfo0209 {
pub _account_id: Option<u64>,
pub name: Option<String>,
pub email: Option<String>,
pub username: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct AccountInfo0213 {
pub _account_id: Option<u64>,
pub name: Option<String>,
pub email: Option<String>,
pub secondary_emails: Option<Vec<String>>,
pub username: Option<String>,
pub _more_accounts: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum AccountInfo {
Gerrit0209(AccountInfo0209),
Gerrit0213(AccountInfo0213),
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ActionInfo {
pub method: Option<String>,
pub label: Option<String>,
pub title: Option<String>,
pub enabled: Option<String>,
}
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub enum ChangeInfoChangeStatus {
NEW,
MERGED,
ABANDONED,
DRAFT,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct LabelInfo {
pub optional: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ChangeMessageInfo0209 {
pub id: String,
pub author: Option<AccountInfo0209>,
pub date: String,
pub message: String,
pub _revision_number: Option<u16>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ChangeMessageInfo0213 {
pub id: String,
pub author: Option<AccountInfo>,
pub date: String,
pub message: String,
pub tag: Option<String>,
pub _revision_number: Option<u16>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct FetchInfo {
pub url: String,
#[serde(rename="ref")] pub reference: String,
pub commands: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct GitPersonInfo {
pub name: String,
pub email: String,
pub date: String,
pub tz: i32,
}
#[allow(missing_docs)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct CommitInfoParents {
pub commit: String,
pub author: Option<GitPersonInfo>,
pub committer: Option<GitPersonInfo>,
pub subject: String,
pub message: Option<String>,
pub web_links: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct CommitInfo {
pub commit: Option<String>,
pub parents: Option<Vec<CommitInfoParents>>,
pub author: Option<GitPersonInfo>,
pub committer: Option<GitPersonInfo>,
pub subject: Option<String>,
pub message: Option<String>,
pub web_links: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct FileInfo0209 {
pub status: Option<String>,
pub binary: Option<bool>,
pub old_path: Option<String>,
pub lines_inserted: Option<u64>,
pub lines_deleted: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct FileInfo0213 {
pub status: Option<String>,
pub binary: Option<bool>,
pub old_path: Option<String>,
pub lines_inserted: Option<u64>,
pub lines_deleted: Option<String>,
pub size_delta: u64,
pub size: u64,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum FileInfo {
Gerrit0209(FileInfo0209),
Gerrit0213(FileInfo0213),
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct RevisionInfo0209 {
pub draft: Option<bool>,
pub has_draft_comments: Option<bool>,
pub _number: u64,
pub fetch: HashMap<String, FetchInfo>,
pub commit: Option<CommitInfo>,
pub files: Option<HashMap<String, FileInfo0209>>,
pub actions: Option<HashMap<String, ActionInfo>>,
}
#[allow(non_camel_case_types)]
#[allow(missing_docs)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub enum RevisionInfoChangeKind0213 {
#[allow(missing_docs)]
REWORK,
#[allow(missing_docs)]
TRIVIAL_REBASE,
#[allow(missing_docs)]
MERGE_FIRST_PARENT_UPDATE,
#[allow(missing_docs)]
NO_CODE_CHANGE,
#[allow(missing_docs)]
NO_CHANGE,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct RevisionInfo0213 {
pub draft: Option<bool>,
pub kind: RevisionInfoChangeKind0213,
pub _number: u64,
pub created: String,
pub uploader: AccountInfo,
#[serde(rename="ref")] pub reference: String,
pub fetch: HashMap<String, FetchInfo>,
pub commit: Option<CommitInfo>,
pub files: Option<FileInfo0213>,
pub actions: Option<HashMap<String, ActionInfo>>,
pub reviewed: Option<bool>,
#[serde(rename="messageWithFooter")] pub message_with_footer: Option<String>,
pub push_certificate: Option<PushCertificateInfo>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum RevisionInfo {
Gerrit0209(Box<RevisionInfo0209>),
Gerrit0213(Box<RevisionInfo0213>),
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct PushCertificateInfo {
pub certificate: String,
pub key: GpgKeyInfo,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct GpgKeyInfo {
pub id: Option<String>,
pub fingerprint: Option<String>,
pub user_ids: String,
pub key: String,
pub status: Option<String>,
pub problems: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ProblemInfo {
pub message: String,
pub status: Option<String>,
pub outcome: Option<String>,
}
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug, Clone)]
pub enum ProjectInfo_ProjectState {
ACTIVE,
READONLY,
HIDDEN,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct WebLinkInfo {
pub name: String,
pub url: String,
pub image_url: String,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ProjectInfo {
pub name: Option<String>,
pub id: String,
pub parent: Option<String>,
pub description: Option<String>,
pub state: Option<ProjectInfo_ProjectState>,
pub branches: Option<HashMap<String, String>>,
pub web_links: Option<Vec<WebLinkInfo>>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ReviewerUpdateInfo0209 {
pub updated: String,
pub updated_by: AccountInfo0209,
pub reviewer: AccountInfo0209,
pub state: ReviewerState,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ReviewerUpdateInfo0213 {
pub updated: String,
pub updated_by: AccountInfo0213,
pub reviewer: AccountInfo0213,
pub state: ReviewerState,
}
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReviewerState {
REVIEWER,
CC,
REMOVED,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct ChangeInfo0209 {
pub kind: String,
pub id: String,
pub project: String,
pub branch: String,
pub topic: Option<String>,
pub change_id: String,
pub subject: String,
pub status: ChangeInfoChangeStatus,
pub created: String,
pub updated: String,
pub starred: Option<bool>,
pub reviewed: Option<bool>,
pub mergeable: Option<bool>,
pub insertions: u16,
pub deletions: u16,
pub _sortkey: String,
pub _number: u64,
pub owner: AccountInfo0209,
pub actions: Option<ActionInfo>,
pub labels: Option<LabelInfo>,
pub permitted_labels: Option<HashMap<String, LabelInfo>>,
pub removable_reviewers: Option<Vec<AccountInfo0209>>,
pub messages: Option<HashMap<String, ChangeMessageInfo0209>>,
pub current_revision: Option<String>,
pub revisions: Option<HashMap<String, RevisionInfo0209>>,
pub _more_changes: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct ChangeInfo0213 {
pub id: String,
pub project: String,
pub branch: String,
pub topic: Option<String>,
pub change_id: String,
pub subject: String,
pub status: ChangeInfoChangeStatus,
pub created: String,
pub updated: String,
pub submitted: Option<String>,
pub starred: Option<bool>,
pub stars: Option<Vec<String>>,
pub reviewed: Option<bool>,
pub submit_type: Option<String>,
pub mergeable: Option<bool>,
pub insertions: u16,
pub deletions: u16,
pub _number: u64,
pub owner: AccountInfo0213,
pub action: Option<Vec<ActionInfo>>,
pub labels: Option<HashMap<String, LabelInfo>>,
pub permitted_labels: Option<HashMap<String, LabelInfo>>,
pub removeable_reviewers: Option<Vec<AccountInfo>>,
pub reviewers: Option<HashMap<ReviewerState, AccountInfo0213>>,
pub reviewer_updates: Option<Vec<ReviewerUpdateInfo0213>>,
pub messages: Option<HashMap<String, ChangeMessageInfo0213>>,
pub current_revision: Option<String>,
pub revisions: Option<HashMap<String, RevisionInfo0213>>,
pub _more_changes: Option<bool>,
pub problems: Option<Vec<ProblemInfo>>,
pub hashtags: Option<Vec<String>>,
pub submittable: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum ChangeInfo {
Gerrit0209(ChangeInfo0209),
Gerrit0213(ChangeInfo0213),
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ChangeInput {
pub project: String,
pub branch: String,
pub subject: String,
pub topic: Option<String>,
pub status: Option<String>,
pub base_change: Option<String>,
pub new_branch: Option<bool>,
pub merge: Option<MergeInput>,
}
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct MergeInput {
pub source: String,
pub strategy: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct ReviewerInfo0209 {
pub _account_id: Option<u64>,
pub name: Option<String>,
pub email: Option<String>,
pub username: Option<String>,
kind: String,
pub approvals: ReviewerInfoApprovals,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct ReviewerInfo0213 {
pub _account_id: Option<u64>,
pub name: Option<String>,
pub email: Option<String>,
pub secondary_emails: Option<Vec<String>>,
pub username: Option<String>,
pub _more_accounts: Option<String>,
pub approvals: ReviewerInfoApprovals,
}
#[derive(Deserialize, Serialize, Debug, Clone, Default)]
#[serde(deny_unknown_fields)]
pub struct ReviewerInfoApprovals {
#[serde(rename="Verified")]
pub verified: Option<i64>,
#[serde(rename="Code-Review")]
pub codereview: Option<i64>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum ReviewerInfo {
Gerrit0209(ReviewerInfo0209),
Gerrit0213(ReviewerInfo0213),
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct AddReviewerResult0209 {
pub reviewers: Option<Vec<ReviewerInfo0209>>,
pub error: Option<String>,
pub confirm: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct AddReviewerResult0213 {
pub input: String,
pub reviewers: Option<Vec<ReviewerInfo0213>>,
pub ccs: Option<Vec<ReviewerInfo>>,
pub error: Option<String>,
pub confirm: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum AddReviewerResult {
Gerrit0209(AddReviewerResult0209),
Gerrit0213(AddReviewerResult0213),
}
#[derive(Deserialize, Serialize, Debug, Clone, Default)]
pub struct ReviewerInput0209 {
pub reviewer: String,
pub confirmed: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone, Default)]
#[serde(deny_unknown_fields)]
pub struct ReviewerInput0213 {
pub reviewer: String,
pub state: Option<ReviewerState>,
pub confirmed: Option<bool>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum ReviewerInput {
Gerrit0209(ReviewerInput0209),
Gerrit0213(ReviewerInput0213),
}
#[derive(Deserialize, Serialize, Debug)]
pub struct AbandonInput0209 {
pub message: Option<String>,
}
#[allow(non_camel_case_types)]
#[derive(Deserialize, Serialize, Debug)]
pub enum AbandonInputNotify0213 {
NONE,
OWNER,
OWNER_REVIEWERS,
ALL,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct AbandonInput0213 {
pub message: Option<String>,
pub notify: Option<AbandonInputNotify0213>,
}
#[derive(Deserialize, Serialize, Debug)]
#[serde(untagged)]
pub enum AbandonInput {
Gerrit0209(AbandonInput0209),
Gerrit0213(AbandonInput0213),
}
#[derive(Deserialize, Serialize, Debug)]
pub struct RestoreInput {
pub message: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct CommentRange {
pub start_line: u64,
pub start_character: u64,
pub end_line: u64,
pub end_character: u64,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct CommentInput0209 {
pub kind: Option<String>,
pub id: Option<String>,
pub path: Option<String>,
pub side: Option<String>,
pub line: Option<u64>,
pub range: Option<CommentRange>,
pub in_reply_to: Option<String>,
pub updated: Option<String>,
pub message: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct ReviewInput0209 {
pub message: Option<String>,
pub labels: Option<HashMap<String, i8>>,
pub comments: Option<HashMap<String, CommentInput0209>>,
pub struct_labels: Option<bool>,
pub drafts: Option<String>,
pub notify: Option<String>,
pub on_behalf_of: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct CommentInput0213 {
pub id: Option<String>,
pub path: Option<String>,
pub side: Option<String>,
pub line: Option<String>,
pub range: Option<CommentRange>,
pub in_reply_to: Option<String>,
pub updated: Option<String>,
pub message: Option<String>,
pub tag: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(deny_unknown_fields)]
pub struct ReviewInput0213 {
pub message: Option<String>,
pub tag: Option<String>,
pub labels: Option<HashMap<String, i8>>,
pub comments: Option<CommentInput0213>,
pub strict_labels: Option<bool>,
pub drafts: Option<String>,
pub notify: Option<String>,
pub omit_duplicate_comments: Option<bool>,
pub on_behalf_of: Option<String>,
}
#[derive(Deserialize, Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum ReviewInput {
Gerrit0209(Box<ReviewInput0209>),
Gerrit0213(Box<ReviewInput0213>),
}
#[derive(Deserialize, Serialize, Debug, Clone)]
pub struct ReviewInfo {
pub labels: HashMap<String, i8>,
}