jira_api_v2/models/
worklog.rs

1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Worklog : Details of a worklog.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Worklog {
17    /// The URL of the worklog item.
18    #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
19    pub param_self: Option<String>,
20    /// Details of the user who created the worklog.
21    #[serde(rename = "author", skip_serializing_if = "Option::is_none")]
22    pub author: Option<Box<models::UserDetails>>,
23    /// Details of the user who last updated the worklog.
24    #[serde(rename = "updateAuthor", skip_serializing_if = "Option::is_none")]
25    pub update_author: Option<Box<models::UserDetails>>,
26    /// A comment about the worklog. Optional when creating or updating a worklog.
27    #[serde(rename = "comment", skip_serializing_if = "Option::is_none")]
28    pub comment: Option<String>,
29    /// The datetime on which the worklog was created.
30    #[serde(rename = "created", skip_serializing_if = "Option::is_none")]
31    pub created: Option<String>,
32    /// The datetime on which the worklog was last updated.
33    #[serde(rename = "updated", skip_serializing_if = "Option::is_none")]
34    pub updated: Option<String>,
35    /// Details about any restrictions in the visibility of the worklog. Optional when creating or updating a worklog.
36    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
37    pub visibility: Option<models::Visibility>,
38    /// The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a worklog.
39    #[serde(rename = "started", skip_serializing_if = "Option::is_none")]
40    pub started: Option<String>,
41    /// The time spent working on the issue as days (\\#d), hours (\\#h), or minutes (\\#m or \\#). Required when creating a worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if `timeSpentSecond` is provided.
42    #[serde(rename = "timeSpent", skip_serializing_if = "Option::is_none")]
43    pub time_spent: Option<String>,
44    /// The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. Optional when updating a worklog. Cannot be provided if `timeSpent` is provided.
45    #[serde(rename = "timeSpentSeconds", skip_serializing_if = "Option::is_none")]
46    pub time_spent_seconds: Option<i64>,
47    /// The ID of the worklog record.
48    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
49    pub id: Option<String>,
50    /// The ID of the issue this worklog is for.
51    #[serde(rename = "issueId", skip_serializing_if = "Option::is_none")]
52    pub issue_id: Option<String>,
53    /// Details of properties for the worklog. Optional when creating or updating a worklog.
54    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
55    pub properties: Option<Vec<models::EntityProperty>>,
56}
57
58impl Worklog {
59    /// Details of a worklog.
60    pub fn new() -> Worklog {
61        Worklog {
62            param_self: None,
63            author: None,
64            update_author: None,
65            comment: None,
66            created: None,
67            updated: None,
68            visibility: None,
69            started: None,
70            time_spent: None,
71            time_spent_seconds: None,
72            id: None,
73            issue_id: None,
74            properties: None,
75        }
76    }
77}
78