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
66
67
68
69
70
71
72
73
74
/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
*
* The version of the OpenAPI document: 1.0.4
* Contact: support@zernio.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// ReviewWebhookReview : Review data shared by review.new and review.updated payloads.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReviewWebhookReview {
/// Platform review ID (e.g. \"accounts/123/locations/456/reviews/789\" for Google Business).
#[serde(rename = "id")]
pub id: String,
/// Platform the review originated on. Currently Google Business Profile only.
#[serde(rename = "platform")]
pub platform: Platform,
/// Star rating the reviewer gave.
#[serde(rename = "rating")]
pub rating: i32,
/// Review text content. May be empty if the reviewer left only a rating.
#[serde(rename = "text")]
pub text: String,
#[serde(rename = "reviewer")]
pub reviewer: Box<models::ReviewWebhookReviewReviewer>,
#[serde(rename = "createdAt")]
pub created_at: String,
/// Whether the connected account has replied to this review.
#[serde(rename = "hasReply")]
pub has_reply: bool,
#[serde(rename = "reply", skip_serializing_if = "Option::is_none")]
pub reply: Option<Box<models::ReviewWebhookReviewReply>>,
}
impl ReviewWebhookReview {
/// Review data shared by review.new and review.updated payloads.
pub fn new(
id: String,
platform: Platform,
rating: i32,
text: String,
reviewer: models::ReviewWebhookReviewReviewer,
created_at: String,
has_reply: bool,
) -> ReviewWebhookReview {
ReviewWebhookReview {
id,
platform,
rating,
text,
reviewer: Box::new(reviewer),
created_at,
has_reply,
reply: None,
}
}
}
/// Platform the review originated on. Currently Google Business Profile only.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Platform {
#[serde(rename = "googlebusiness")]
Googlebusiness,
}
impl Default for Platform {
fn default() -> Platform {
Self::Googlebusiness
}
}