/*
* Zernio API
*
* API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
*
* The version of the OpenAPI document: 1.96.1
* 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 Profile).
#[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
}
}