//! All entities of a gerrit instance //! //! The entities are documented on gerrit site on //! . //! //! **NOTICE**: Only current needed entities are here reflected. #![warn(missing_docs)] use std::collections::HashMap; /// The `AccountInfo` entity contains information about an account #[derive(Deserialize, Serialize, Debug, Clone)] pub struct AccountInfo { /// The numeric ID of the account /// V02.09 pub _account_id: Option, /// The full name of the user. /// Only set if detailed account information is requested /// V02.09 pub name: Option, /// The email address the user prefers to be contacted through. /// Only set if detailed account information is requested /// V02.09 pub email: Option, /// The username of the user. /// Only set if detailed account information is requested /// V02.09 pub username: Option, /// A list of the secondary email addresses of the user. Only set for account queries when the /// ALL_EMAILS option is set. /// V02.13 pub secondary_emails: Option>, /// Whether the query would deliver more results if not limited. Only set on the last account /// that is returned. /// V02.13 pub _more_accounts: Option, } /// The `ActionInfo` entity describes a REST API call the client can make to manipulate a resource. /// These are frequently implemented by plugins and may be discovered at runtime. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ActionInfo { /// HTTP method to use with the action. Most actions use POST, PUT or DELETE to cause state /// changes. pub method: Option, /// Short title to display to a user describing the action. In the Gerrit web interface the /// label is used as the text on the button presented in the UI. pub label: Option, /// Longer text to display describing the action. In a web UI this should be the title /// attribute of the element, displaying when the user hovers the mouse. pub title: Option, /// If true the action is permitted at this time and the caller is likely allowed to execute /// it. This may change if state is updated at the server or permissions are modified. Not /// present if false. pub enabled: Option, } /// `ChangeInfo` helper variant to present a status of a change #[allow(non_camel_case_types)] #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] pub enum ChangeInfoChangeStatus { /// new change NEW, /// change is merged MERGED, /// change is abandoned ABANDONED, /// its a draft change DRAFT, } /// The `LabelInfo` entity contains information about a label on a change, always corresponding to /// the current patch set. /// /// There are two options that control the contents of `LabelInfo`: `LABELS` and `DETAILED_LABELS`. /// /// * For a quick summary of the state of labels, use `LABELS`. /// * For detailed information about labels, including exact numeric votes for all users and the /// allowed range of votes for the current user, use `DETAILED_LABELS`. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct LabelInfo { /// Whether the label is optional. Optional means the label may be set, but it’s neither /// necessary for submission nor does it block submission if set. pub optional: Option, } /// The `ChangeMessageInfo` entity contains information about a message attached to a change. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ChangeMessageInfo { /// The ID of the message. /// V02.09 pub id: String, /// Author of the message as an AccountInfo entity. /// Unset if written by the Gerrit system. /// V02.09 pub author: Option, /// The timestamp this message was posted. /// V02.09 pub date: String, /// The text left by the user. /// V02.09 pub message: String, /// Value of the tag field from ReviewInput set while posting the review. NOTE: To apply /// different tags on on different votes/comments multiple invocations of the REST call are /// required. /// V02.13 pub tag: Option, /// Which patchset (if any) generated this message. /// V02.09 pub _revision_number: Option, } /// The `FetchInfo` entity contains information about how to fetch a patch set via a certain /// protocol. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct FetchInfo { /// The URL of the project. pub url: String, /// The ref of the patch set. #[serde(rename="ref")] // "ref" is a keyword pub reference: String, /// The download commands for this patch set as a map that maps the command names to the /// commands. /// Only set if download commands are requested. pub commands: Option>, } impl FetchInfo { /// simplify `FetchInfo::reference` /// /// Strip 'refs/changes' and the two grouping numbers in reference of FetchInfo. /// Eg: `refs/changes/85/225285/1` -> `225285/1` /// /// # Examples /// /// ```rust /// # use libgerrit::entities::FetchInfo; /// let fi = FetchInfo { /// url: "http://localhost/blah".into(), /// reference: "refs/changes/85/225285/1".into(), /// commands: None, /// }; /// assert_eq!("225285/1", fi.get_reference_string()); /// ``` pub fn get_reference_string(&self) -> &str { &self.reference.trim_left_matches("refs/changes/")[3..] } } /// The `GitPersonInfo` entity contains information about the author/committer of a commit. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct GitPersonInfo { /// The name of the author/committer. pub name: String, /// The email address of the author/committer. pub email: String, /// The timestamp of when this identity was constructed. pub date: String, /// The timezone offset from UTC of when this identity was constructed. pub tz: i32, } /// `CommitInfoParents`, same as `CommitInfo` but commit is string #[allow(missing_docs)] #[derive(Deserialize, Serialize, Debug, Clone)] pub struct CommitInfoParents { pub commit: String, pub author: Option, pub committer: Option, pub subject: String, pub message: Option, pub web_links: Option, } /// The `CommitInfo` entity contains information about a commit. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct CommitInfo { /// The commit ID. Not set if included in a RevisionInfo entity that is contained in a map /// which has the commit ID as key. pub commit: Option, /// The parent commits of this commit as a list of CommitInfo entities. In each parent only the /// commit and subject fields are populated. pub parents: Option>, /// The author of the commit as a GitPersonInfo entity. pub author: Option, /// The committer of the commit as a GitPersonInfo entity. pub committer: Option, /// The subject of the commit (header line of the commit message). pub subject: Option, /// The commit message. pub message: Option, /// Links to the commit in external sites as a list of WebLinkInfo entities. pub web_links: Option, } /// The `FileInfo` entity contains information about a file in a patch set. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct FileInfo { /// The status of the file ("A"=Added, "D"=Deleted, "R"=Renamed, "C"=Copied, "W"=Rewritten). /// Not set if the file was Modified ("M"). /// V02.09 pub status: Option, /// Whether the file is binary. /// V02.09 pub binary: Option, /// The old file path. /// Only set if the file was renamed or copied. /// V02.09 pub old_path: Option, /// Number of inserted lines. /// Not set for binary files or if no lines were inserted. /// V02.09 pub lines_inserted: Option, /// Number of deleted lines. /// Not set for binary files or if no lines were deleted. /// V02.09 pub lines_deleted: Option, /// Number of bytes by which the file size increased/decreased. /// V02.13 pub size_delta: Option, /// File size in bytes. /// V02.13 pub size: Option, } /// V02.13 #[allow(non_camel_case_types)] #[allow(missing_docs)] #[derive(Deserialize, Serialize, Debug, Clone)] pub enum RevisionInfoChangeKind { #[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, } /// The `RevisionInfo` entity contains information about a patch set. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct RevisionInfo { /// Whether the patch set is a draft. /// V02.09 pub draft: Option, /// The change kind. Valid values are REWORK, TRIVIAL_REBASE, MERGE_FIRST_PARENT_UPDATE, /// NO_CODE_CHANGE, and NO_CHANGE. /// V02.13 pub kind: Option, /// Whether the patch set has one or more draft comments by the calling user. Only set if draft /// comments is requested. /// V02.09 pub has_draft_comments: Option, /// The patch set number. /// V02.09 pub _number: u64, /// The timestamp of when the patch set was created. /// V02.13 pub created: Option, /// Information about how to fetch this patch set. The fetch information is provided as a map /// that maps the protocol name ("git", "http", "ssh") to FetchInfo entities. /// V02.09 pub fetch: HashMap, /// The uploader of the patch set as an AccountInfo entity. /// V02.13 pub uploader: Option, /// The Git reference for the patch set. /// V02.13 #[serde(rename="ref")] // "ref" is a keyword pub reference: Option, /// The commit of the patch set as `CommitInfo` entity. /// V02.09 pub commit: Option, /// The files of the patch set as a map that maps the file names to `FileInfo` entities. /// V02.09 pub files: Option>, /// Actions the caller might be able to perform on this revision. The information is a map of /// view name to ActionInfo entities. /// V02.09 pub actions: Option>, /// Indicates whether the caller is authenticated and has commented on the current revision. /// Only set if REVIEWED option is requested. /// V02.13 pub reviewed: Option, /// If the COMMIT_FOOTERS option is requested and this is the current patch set, contains the /// full commit message with Gerrit-specific commit footers, as if this revision were submitted /// using the Cherry Pick submit type. /// V02.13 #[serde(rename="messageWithFooter")] // "ref" is a keyword pub message_with_footer: Option, /// If the PUSH_CERTIFICATES option is requested, contains the push certificate provided by the /// user when uploading this patch set as a PushCertificateInfo entity. This field is always /// set if the option is requested; if no push certificate was provided, it is set to an empty /// object. /// V02.13 pub push_certificate: Option, } /// The `PushCertificateInfo` entity contains information about a push certificate provided when /// the user pushed for review with git push --signed HEAD:refs/for/. Only used when signed /// push is enabled on the server. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct PushCertificateInfo { /// Signed certificate payload and GPG signature block. pub certificate: String, /// Information about the key that signed the push, along with any problems found while /// checking the signature or the key itself, as a GpgKeyInfo entity. pub key: GpgKeyInfo, } /// The `GpgKeyInfo` entity contains information about a GPG public key. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct GpgKeyInfo { /// The 8-char hex GPG key ID. pub id: Option, /// The 40-char (plus spaces) hex GPG key fingerprint. pub fingerprint: Option, /// OpenPGP User IDs associated with the public key. pub user_ids: String, /// ASCII armored public key material. pub key: String, /// The result of server-side checks on the key; one of BAD, OK, or TRUSTED. BAD keys have /// serious problems and should not be used. If a key is OK, inspecting only that key found no /// problems, but the system does not fully trust the key’s origin. A `TRUSTED key is valid, /// and the system knows enough about the key and its origin to trust it. pub status: Option, /// A list of human-readable problem strings found in the course of checking whether the key is /// valid and trusted. pub problems: Option, } /// The `ProblemInfo` entity contains a description of a potential consistency problem with a change. /// These are not related to the code review process, but rather indicate some inconsistency in /// Gerrit’s database or repository metadata related to the enclosing change. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ProblemInfo { /// Plaintext message describing the problem with the change. pub message: String, /// The status of fixing the problem (FIXED, FIX_FAILED). Only set if a fix was attempted. pub status: Option, /// If status is set, an additional plaintext message describing the outcome of the fix. pub outcome: Option, } /// `ProjectInfo` helper variant to present a status of a project #[allow(non_camel_case_types)] #[derive(Deserialize, Serialize, Debug, Clone)] pub enum ProjectInfo_ProjectState { /// The project is active ACTIVE, /// Project is read only, noch anges possible READONLY, /// project is hidden HIDDEN, } /// The `WebLinkInfo` entity describes a link to an external site. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct WebLinkInfo { /// The link name. pub name: String, /// The link URL. pub url: String, /// URL to the icon of the link. pub image_url: String, } /// The `ProjectInfo` entity contains information about a project. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ProjectInfo { /// The name of the project. Not set if returned in a map where the project name is used as map /// key. pub name: Option, /// The URL encoded project name. pub id: String, /// The name of the parent project. /// ?- if the parent project is not visible ( is a number which is increased for each /// non-visible project). pub parent: Option, /// The description of the project. pub description: Option, /// ACTIVE, READ_ONLY or HIDDEN. pub state: Option, /// Map of branch names to HEAD revisions. pub branches: Option>, /// Links to the project in external sites as a list of WebLinkInfo entries. pub web_links: Option>, } /// The `ReviewerUpdateInfo` entity contains information about updates to change’s reviewers set. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ReviewerUpdateInfo { /// Timestamp of the update. /// V02.09 pub updated: String, /// The account which modified state of the reviewer in question as AccountInfo entity. /// V02.09 pub updated_by: AccountInfo, /// The reviewer account added or removed from the change as an AccountInfo entity. /// V02.09 pub reviewer: AccountInfo, /// The reviewer state, one of REVIEWER, CC or REMOVED. /// V02.09 pub state: ReviewerState, } /// The reviewers as a map that maps a reviewer state to a list of `AccountInfo` entities. Possible /// reviewer states are REVIEWER, CC and REMOVED. /// Only set if detailed labels are requested #[allow(non_camel_case_types)] #[derive(Deserialize, Serialize, Debug, Clone, PartialEq, Eq, Hash)] pub enum ReviewerState { /// Users with at least one non-zero vote on the change. REVIEWER, /// Users that were added to the change, but have not voted. CC, /// Users that were previously reviewers on the change, but have been removed. REMOVED, } /// The `ChangeInfo` entity contains information about a change. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ChangeInfo { /// gerritcodereview#change /// V02.09 pub kind: Option, /// The ID of the change in the format "~~", where project, branch /// and Change-Id are URL encoded. For branch the refs/heads/ prefix is omitted. /// V02.09 pub id: String, /// The name of the project /// V02.09 pub project: String, /// The name of the target branch. /// The refs/heads/ prefix is omitted. /// V02.09 pub branch: String, /// The topic to which this change belongs. /// V02.09 pub topic: Option, /// The Change-Id of the change. /// V02.09 pub change_id: String, /// The subject of the change (header line of the commit message). /// V02.09 pub subject: String, /// The status of the change (NEW, SUBMITTED, MERGED, ABANDONED, DRAFT). /// V02.09 pub status: ChangeInfoChangeStatus, /// The timestamp of when the change was created. /// V02.09 pub created: String, /// The timestamp of when the change was last updated. /// V02.09 pub updated: String, /// The timestamp of when the change was submitted. /// V02.13 pub submitted: Option, /// Whether the calling user has starred this change. not set if false /// V02.09 pub starred: Option, /// A list of star labels that are applied by the calling user to this change. The labels are /// lexicographically sorted. /// V02.13 pub stars: Option>, /// Whether the change was reviewed by the calling user. Only set if reviewed is requested. not /// set if false /// V02.09 pub reviewed: Option, /// The submit type of the change. /// Not set for merged changes. /// V02.13 pub submit_type: Option, /// Whether the change is mergeable. /// Not set for merged changes. /// V02.09 pub mergeable: Option, /// Number of inserted lines. /// V02.09 pub insertions: u16, /// Number of deleted lines. /// V02.09 pub deletions: u16, /// The sortkey of the change. /// V02.09, not in V02.13 pub _sortkey: Option, /// The legacy numeric ID of the change. /// V02.09 pub _number: u64, /// The owner of the change as an AccountInfo entity. /// V02.09 pub owner: AccountInfo, /// Actions the caller might be able to perform on this revision. The information is a map of /// view name to ActionInfo entities. /// V02.09 pub action: Option, /// Actions the caller might be able to perform on this revision. The information is a map of /// view name to ActionInfo entities. /// V02.13 pub actions: Option>, /// The labels of the change as a map that maps the label names to LabelInfo entries. /// Only set if labels or detailed labels are requested. /// V02.09 pub labels: Option, /// A map of the permitted labels that maps a label name to the list of values that are allowed /// for that label. /// Only set if detailed labels are requested. /// V02.09 pub permitted_labels: Option>>, /// The reviewers that can be removed by the calling user as a list of AccountInfo entities. /// Only set if detailed labels are requested. /// V02.09 pub removable_reviewers: Option>, /// The reviewers as a map that maps a reviewer state to a list of AccountInfo entities. /// Possible reviewer states are REVIEWER, CC and REMOVED. /// REVIEWER: Users with at least one non-zero vote on the change. /// CC: Users that were added to the change, but have not voted. /// REMOVED: Users that were previously reviewers on the change, but have been removed. /// Only set if detailed labels are requested. /// V02.13 pub reviewers: Option>, /// Updates to reviewers set for the change as ReviewerUpdateInfo entities. Only set if /// reviewer updates are requested and if NoteDb is enabled. /// V02.13 pub reviewer_updates: Option>, /// Messages associated with the change as a list of ChangeMessageInfo entities. /// Only set if messages are requested. /// V02.09 pub messages: Option>, /// The commit ID of the current patch set of this change. /// Only set if the current revision is requested or if all revisions are requested. /// V02.09 pub current_revision: Option, /// All patch sets of this change as a map that maps the commit ID of the patch set to a /// RevisionInfo entity. /// Only set if the current revision is requested (in which case it will only contain a key for /// the current revision) or if all revisions are requested. /// V02.09 pub revisions: Option>, /// Whether the query would deliver more results if not limited. /// Only set on either the last or the first change that is returned. /// V02.09 pub _more_changes: Option, /// A list of ProblemInfo entities describing potential problems with this change. Only set if /// CHECK is set. /// V02.13 pub problems: Option>, // this fields are undocumented but returned from gerrit server // * https://bugs.chromium.org/p/gerrit/issues/detail?id=4629 // * https://gerrit-review.googlesource.com/#/c/92152/2/Documentation/rest-api-changes.txt /// Not documented /// V02.13 pub hashtags: Option>, /// Not documented /// V02.13 pub submittable: Option, } /// The `ChangeInput` entity contains information about creating a new change. #[derive(Serialize, Deserialize, Debug, Clone)] pub struct ChangeInput { /// The name of the project. pub project: String, /// The name of the target branch. /// The refs/heads/ prefix is omitted. pub branch: String, /// The subject of the change (header line of the commit message). pub subject: String, /// The topic to which this change belongs. pub topic: Option, /// The status of the change (only NEW and DRAFT accepted here). // TODO: Only NEW and DRAFT allowed pub status: Option, /// A {change-id} that identifies the base change for a create change operation. pub base_change: Option, /// Allow creating a new branch when set to true. pub new_branch: Option, /// The detail of a merge commit as a MergeInput entity. /// (optiional) pub merge: Option, } /// The `MergeInput` entity contains information about the merge #[derive(Serialize, Deserialize, Debug, Clone)] pub struct MergeInput { /// The source to merge from, e.g. a complete or abbreviated commit SHA-1, a complete reference /// name, a short reference name under refs/heads, refs/tags, or refs/remotes namespace, etc. pub source: String, /// The strategy of the merge, can be recursive, resolve, simple-two-way-in-core, ours or /// theirs, default will use project settings. // TODO: only recursive, resolve, simple-two-way-in-core, ours or theirs allowed pub strategy: Option, } /// The `ReviewerInfo` entity contains information about a reviewer and its votes on a change. /// /// `ReviewerInfo` has the same fields as `AccountInfo` and includes detailed account information. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ReviewerInfo { /// The numeric ID of the account /// V02.09 pub _account_id: Option, /// The full name of the user. /// Only set if detailed account information is requested /// V02.09 pub name: Option, /// The email address the user prefers to be contacted through. /// Only set if detailed account information is requested /// V02.09 pub email: Option, /// A list of the secondary email addresses of the user. Only set for account queries when the /// ALL_EMAILS option is set. /// V02.13 pub secondary_emails: Option>, /// The username of the user. /// Only set if detailed account information is requested /// V02.09 pub username: Option, /// Whether the query would deliver more results if not limited. Only set on the last account /// that is returned. /// V02.13 pub _more_accounts: Option, /// gerritcodereview#reviewer /// V02.09 kind: Option, /// The approvals of the reviewer as a map that maps the label names to the approval values /// ("-2", "-1", "0", "+1", "+2") /// V02.09 pub approvals: HashMap, } /// The `AddReviewerResult` entity describes the result of adding a reviewer to a change. #[derive(Deserialize, Serialize, Debug, Clone)] pub struct AddReviewerResult { /// Value of the reviewer field from ReviewerInput set while adding the reviewer /// V02.13 pub input: Option, /// The newly added reviewers as a list of ReviewerInfo entities /// V02.09 pub reviewers: Option>, /// The newly CCed accounts as a list of ReviewerInfo entities. This field will only appear if /// the requested state for the reviewer was CC **and** NoteDb is enabled on the server /// V02.13 pub ccs: Option>, /// Error message explaining why the reviewer could not be added. /// If a group was specified in the input and an error is returned, it means that none of the /// members were added as reviewer. /// V02.09 pub error: Option, /// Whether adding the reviewer requires confirmation /// V02.09 pub confirm: Option, } /// The `ReviewerInput` entity contains information for adding a reviewer to a change. #[derive(Deserialize, Serialize, Debug, Clone, Default)] pub struct ReviewerInput { /// The ID of one account that should be added as reviewer or the ID of one group for which all /// members should be added as reviewers. /// If an ID identifies both an account and a group, only the account is added as reviewer to /// the change. /// V02.09 pub reviewer: String, /// Add reviewer in this state. Possible reviewer states are REVIEWER and CC. If not given, /// defaults to REVIEWER. /// V02.13 pub state: Option, /// Whether adding the reviewer is confirmed. /// The Gerrit server may be configured to require a confirmation when adding a group as /// reviewer that has many members. /// V02.09 pub confirmed: Option, } /// Abandon notifications to ... /// V02.13 #[allow(non_camel_case_types)] #[derive(Deserialize, Serialize, Debug)] pub enum AbandonInputNotify { /// Noone NONE, /// only owner OWNER, /// owner and reviewer OWNER_REVIEWERS, /// to all ALL, } /// The `AbandonInput` entity contains information for abandoning a change #[derive(Deserialize, Serialize, Debug)] pub struct AbandonInput { /// Message to be added as review comment to the change when abandoning the change. /// V02.09 pub message: Option, /// Notify handling that defines to whom email notifications should be sent after the change is /// abandoned. /// Allowed values are NONE, OWNER, OWNER_REVIEWERS and ALL. /// If not set, the default is ALL. /// V02.13 pub notify: Option, } /// The `RestoreInput` entity contains information for restoring a change. #[derive(Deserialize, Serialize, Debug)] pub struct RestoreInput { /// Message to be added as review comment to the change when restoring the change. pub message: Option, } /// The `CommentRange` entity describes the range of an inline comment #[derive(Deserialize, Serialize, Debug, Clone)] pub struct CommentRange { /// The start line number of the range pub start_line: u64, /// The character position in the start line. pub start_character: u64, /// The end line number of the range pub end_line: u64, /// The character position in the end line pub end_character: u64, } /// The `CommentInput` entity contains information for creating an inline comment #[derive(Deserialize, Serialize, Debug, Clone)] pub struct CommentInput { /// Must be gerritcodereview#comment if provided. /// V02.09 pub kind: Option, /// The URL encoded UUID of the comment if an existing draft comment should be updated. /// V02.09 pub id: Option, /// The path of the file for which the inline comment should be added. /// Doesn’t need to be set if contained in a map where the key is the file path. /// V02.09 pub path: Option, /// The side on which the comment should be added. /// Allowed values are REVISION and PARENT. /// If not set, the default is REVISION. /// V02.09 pub side: Option, /// The number of the line for which the comment should be added. /// 0 if it is a file comment. /// If neither line nor range is set, a file comment is added. /// If range is set, this should equal the end line of the range. /// V02.09 pub line: Option, /// The range of the comment as a CommentRange entity. /// V02.09 pub range: Option, /// The URL encoded UUID of the comment to which this comment is a reply. /// V02.09 pub in_reply_to: Option, /// The timestamp of this comment. /// Accepted but ignored. /// V02.09 pub updated: Option, /// The comment message. /// If not set and an existing draft comment is updated, the existing draft comment is deleted. /// V02.09 pub message: Option, /// Value of the tag field. Only allowed on draft comment /// inputs; for published comments, use the tag field in /// link#review-input[ReviewInput] /// V02.13 pub tag: Option, } /// The `ReviewInput` entity contains information for adding a review to a revision #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ReviewInput { /// The message to be added as review comment. /// V02.09 pub message: Option, /// The votes that should be added to the revision as a map that maps the label names to the /// voting values. /// V02.09 pub labels: Option>, /// The comments that should be added as a map that maps a file path to a list of CommentInput /// entities. /// V02.09 pub comments: Option>, /// Whether all labels are required to be within the user’s permitted ranges based on access /// controls. /// If true, attempting to use a label not granted to the user will fail the entire modify /// operation early. /// If false, the operation will execute anyway, but the proposed labels will be modified to be /// the "best" value allowed by the access controls. /// V02.09 pub strict_labels: Option, /// Draft handling that defines how draft comments are handled that are already in the database /// but that were not also described in this input. /// Allowed values are DELETE, PUBLISH and KEEP. /// If not set, the default is DELETE. /// V02.09 pub drafts: Option, /// Notify handling that defines to whom email notifications should be sent after the review is /// stored. /// Allowed values are NONE, OWNER, OWNER_REVIEWERS and ALL. /// If not set, the default is ALL. /// V02.09 pub notify: Option, /// {account-id} the review should be posted on behalf of. To use this option the caller must /// have been granted labelAs-NAME permission for all keys of labels. /// V02.09 pub on_behalf_of: Option, /// Apply this tag to the review comment message, votes, and inline comments. Tags may be used /// by CI or other automated systems to distinguish them from human reviews. Comments with /// specific tag values can be filtered out in the web UI. /// V02.13 pub tag: Option, /// If true, comments with the same content at the same place will be omitted /// V02.13 pub omit_duplicate_comments: Option, } /// The `ReviewInfo` entity contains information about a review #[derive(Deserialize, Serialize, Debug, Clone)] pub struct ReviewInfo { /// The labels of the review as a map that maps the label names to the voting values. pub labels: HashMap, }