figma_api/models/reaction.rs
1/*
2 * Figma API
3 *
4 * 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).
5 *
6 * The version of the OpenAPI document: 0.31.0
7 * Contact: support@figma.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Reaction : A reaction left by a user.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Reaction {
17 /// The user who left the reaction.
18 #[serde(rename = "user")]
19 pub user: Box<models::User>,
20 /// The emoji type of reaction as shortcode (e.g. `:heart:`, `:+1::skin-tone-2:`). The list of accepted emoji shortcodes can be found in [this file](https://raw.githubusercontent.com/missive/emoji-mart/main/packages/emoji-mart-data/sets/14/native.json) under the top-level emojis and aliases fields, with optional skin tone modifiers when applicable.
21 #[serde(rename = "emoji")]
22 pub emoji: String,
23 /// The UTC ISO 8601 time at which the reaction was left.
24 #[serde(rename = "created_at")]
25 pub created_at: String,
26}
27
28impl Reaction {
29 /// A reaction left by a user.
30 pub fn new(user: models::User, emoji: String, created_at: String) -> Reaction {
31 Reaction {
32 user: Box::new(user),
33 emoji,
34 created_at,
35 }
36 }
37}
38