Skip to main content

hanzo_client/models/
issue_view.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct IssueView {
16    /// Assignee is who holds the work — an IAM username, or the login of the FIRST assignee when a forge issue has several. Absent when nobody holds it, which is exactly the state a claim needs.
17    #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
18    pub assignee: Option<String>,
19    /// CreatedAt is when the item was opened, in unix seconds. 0 when the source gave no parseable timestamp.
20    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
21    pub created_at: Option<i32>,
22    /// Description is the body, markdown as its author wrote it. Absent when empty.
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// DueAt is when the work is due, in unix seconds; absent means no due date. A forge row takes it from its MILESTONE's due date, since a forge issue has no deadline of its own. Never before StartAt, and never past 2200-01-01.
26    #[serde(rename = "dueAt", skip_serializing_if = "Option::is_none")]
27    pub due_at: Option<i32>,
28    /// ExtRef anchors the item to something outside the todo — a mirrored issue (\"github:owner/repo#123\"), a pushed PR branch, or a record on another plane. It is the idempotency key the mirror upsert matches on. Absent when the item has no external origin.
29    #[serde(rename = "extRef", skip_serializing_if = "Option::is_none")]
30    pub ext_ref: Option<String>,
31    /// ID is the work item's opaque handle, and it is NOT how you address it — ProjectKey plus Number is. Its shape says which source answered: a forge issue's is the forge's own numeric id in decimal, an index row's a minted \"issue_\" id.
32    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
33    pub id: Option<String>,
34    /// Identifier is the human handle, \"<key>#<number>\" — the board and the number on it, joined. ONE spelling whichever source answered, because a list where forge rows read cli#1 and index rows read OPS-3 is two products in one list.
35    #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")]
36    pub identifier: Option<String>,
37    /// Kind is what the item IS: issue, pr or epic. Set once at create and never changed, so a row does not migrate between surfaces. Deliberately not \"task\" — that word is the async plane (contract.go).
38    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
39    pub kind: Option<String>,
40    /// Labels are the item's remaining tags, with the status and priority labels lifted OUT — a column that stayed here would render twice, once as the card's column and once as a chip on the card. Always present; empty is [].
41    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
42    pub labels: Option<Vec<String>>,
43    /// Number is the item's number ON ITS BOARD, from 1 and monotonic there — the forge's own issue number for a forge row, allocated inside the create transaction for an index row so it cannot race. Unique per board, never across the org.
44    #[serde(rename = "number", skip_serializing_if = "Option::is_none")]
45    pub number: Option<i32>,
46    /// Priority is urgent, high, medium, low or none. Also a label on a forge row. Never empty: \"none\" when nothing names one, so callers compare a value rather than test for absence.
47    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
48    pub priority: Option<String>,
49    /// ProjectKey is the board this item is on: the repository name for a forge issue, the index board's key otherwise. With Number it is the item's address in every other route.
50    #[serde(rename = "projectKey", skip_serializing_if = "Option::is_none")]
51    pub project_key: Option<String>,
52    /// Repo is the git repository the item is bound to, so a repository's Issues and PRs tabs are filters over this one table. Absent when the item is not repo-bound.
53    #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
54    pub repo: Option<String>,
55    /// Source is which surface OPENED it: team, git, crm, helpdesk, cms or agent. Also set once. It is the ORIGIN, not the subject — source=helpdesk is an engineering issue opened from a support escalation, not a support ticket.
56    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
57    pub source: Option<String>,
58    /// StartAt is when the work starts, in unix seconds; absent means unscheduled. A forge row takes it from when the issue was opened, but only once the issue has a due date — an interval needs both ends.
59    #[serde(rename = "startAt", skip_serializing_if = "Option::is_none")]
60    pub start_at: Option<i32>,
61    /// Status is the board column: backlog, todo, in_progress, done or canceled, and nothing else. On a forge row it is read off a LABEL, so relabelling in the forge web UI moves the card here and vice versa — and a CLOSED forge issue reads done whatever its labels say. Never empty: \"backlog\" when nothing names a column.
62    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
63    pub status: Option<String>,
64    /// Title is the item's one-line summary.
65    #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
66    pub title: Option<String>,
67    /// UpdatedAt is when it last changed, in unix seconds.
68    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
69    pub updated_at: Option<i32>,
70}
71
72impl IssueView {
73    pub fn new() -> IssueView {
74        IssueView {
75            assignee: None,
76            created_at: None,
77            description: None,
78            due_at: None,
79            ext_ref: None,
80            id: None,
81            identifier: None,
82            kind: None,
83            labels: None,
84            number: None,
85            priority: None,
86            project_key: None,
87            repo: None,
88            source: None,
89            start_at: None,
90            status: None,
91            title: None,
92            updated_at: None,
93        }
94    }
95}
96