amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for CustomerFeedback
 *
 * The Selling Partner API for Customer Feedback (Customer Feedback API) provides information about customer reviews and returns at both the item and browse node level.
 *
 * The version of the OpenAPI document: 2024-06-01
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// ItemReviewTopic : Details of item review topic.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ItemReviewTopic {
    /// The name of the item review topic.
    #[serde(rename = "topic")]
    pub topic: String,
    #[serde(rename = "asinMetrics")]
    pub asin_metrics: Box<models::customer_feedback_2024_06_01::ItemReviewTopicMetrics>,
    #[serde(rename = "parentAsinMetrics", skip_serializing_if = "Option::is_none")]
    pub parent_asin_metrics: Option<Box<models::customer_feedback_2024_06_01::ItemReviewTopicMetrics>>,
    #[serde(rename = "browseNodeMetrics", skip_serializing_if = "Option::is_none")]
    pub browse_node_metrics: Option<Box<models::customer_feedback_2024_06_01::ItemReviewBrowseNodeMetrics>>,
    #[serde(rename = "childAsinMetrics", skip_serializing_if = "Option::is_none")]
    pub child_asin_metrics: Option<Box<models::customer_feedback_2024_06_01::ChildAsinMetrics>>,
    /// A list of up to three snippets from reviews that contain the topic. This value is `null` if there aren't enough review snippets for the topic.
    #[serde(rename = "reviewSnippets", skip_serializing_if = "Option::is_none")]
    pub review_snippets: Option<Vec<String>>,
    /// A list of up to five top subtopics for the topic. The percentage of customer reviews that mention the subtopic determine the topic's placement in the list. This value is `null` if there are no subtopics.
    #[serde(rename = "subtopics", skip_serializing_if = "Option::is_none")]
    pub subtopics: Option<Vec<models::customer_feedback_2024_06_01::ItemReviewSubtopic>>,
}

impl ItemReviewTopic {
    /// Details of item review topic.
    pub fn new(topic: String, asin_metrics: models::customer_feedback_2024_06_01::ItemReviewTopicMetrics) -> ItemReviewTopic {
        ItemReviewTopic {
            topic,
            asin_metrics: Box::new(asin_metrics),
            parent_asin_metrics: None,
            browse_node_metrics: None,
            child_asin_metrics: None,
            review_snippets: None,
            subtopics: None,
        }
    }
}