1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* Figma API
*
* This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api). Note: we are releasing the OpenAPI specification as a beta given the large surface area and complexity of the REST API. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues).
*
* The version of the OpenAPI document: 0.31.0
* Contact: support@figma.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Comment : A comment or reply left by a user.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Comment {
/// Unique identifier for comment.
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "client_meta")]
pub client_meta: Box<models::CommentClientMeta>,
/// The file in which the comment lives
#[serde(rename = "file_key")]
pub file_key: String,
/// If present, the id of the comment to which this is the reply
#[serde(rename = "parent_id", skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
/// The user who left the comment
#[serde(rename = "user")]
pub user: Box<models::User>,
/// The UTC ISO 8601 time at which the comment was left
#[serde(rename = "created_at")]
pub created_at: String,
/// If set, the UTC ISO 8601 time the comment was resolved
#[serde(rename = "resolved_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub resolved_at: Option<Option<String>>,
/// The content of the comment
#[serde(rename = "message")]
pub message: String,
/// Only set for top level comments. The number displayed with the comment in the UI
#[serde(rename = "order_id", deserialize_with = "Option::deserialize")]
pub order_id: Option<String>,
/// An array of reactions to the comment
#[serde(rename = "reactions")]
pub reactions: Vec<models::Reaction>,
}
impl Comment {
/// A comment or reply left by a user.
pub fn new(id: String, client_meta: models::CommentClientMeta, file_key: String, user: models::User, created_at: String, message: String, order_id: Option<String>, reactions: Vec<models::Reaction>) -> Comment {
Comment {
id,
client_meta: Box::new(client_meta),
file_key,
parent_id: None,
user: Box::new(user),
created_at,
resolved_at: None,
message,
order_id,
reactions,
}
}
}