warframe_client/models/
reward.rs

1/*
2 * WarframeStat.us API
3 *
4 * Simple API for data from the game Warframe. [Parser Docs](https://wfcd.github.io/warframe-worldstate-parser/) [Items Types](https://github.com/WFCD/warframe-items/blob/master/index.d.ts) 
5 *
6 * The version of the OpenAPI document: 2.0.8
7 * Contact: tobiah@protonmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Reward {
16    /// Items that have a quantity attached
17    #[serde(rename = "countedItems")]
18    pub counted_items: Vec<models::RewardCountedItemsInner>,
19    /// thumbnail URL
20    #[serde(rename = "thumbnail")]
21    pub thumbnail: String,
22    /// RGB value as an int assigned to this reward
23    #[serde(rename = "color")]
24    pub color: f64,
25    /// Amount of credits awarded
26    #[serde(rename = "credits")]
27    pub credits: i32,
28    /// string representation of the reward
29    #[serde(rename = "asString")]
30    pub as_string: String,
31    /// Items' names possible to be won
32    #[serde(rename = "items")]
33    pub items: Vec<String>,
34    /// formatted string describing all included items
35    #[serde(rename = "itemString")]
36    pub item_string: String,
37}
38
39impl Reward {
40    pub fn new(counted_items: Vec<models::RewardCountedItemsInner>, thumbnail: String, color: f64, credits: i32, as_string: String, items: Vec<String>, item_string: String) -> Reward {
41        Reward {
42            counted_items,
43            thumbnail,
44            color,
45            credits,
46            as_string,
47            items,
48            item_string,
49        }
50    }
51}
52