static_valorant_api/models/
contract.rs1use serde::Deserialize;
2use uuid::Uuid;
3
4#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct Contract {
7 pub uuid: Uuid,
8 pub display_name: String,
9 pub display_icon: Option<String>,
10 pub ship_it: bool,
11 #[serde(rename = "useLevelVPCostOverride")]
12 pub use_level_vp_cost_override: bool,
13 #[serde(rename = "levelVPCostOverride")]
14 pub level_vp_cost_override: i64,
15 pub free_reward_schedule_uuid: Uuid,
16 pub content: ContractContent,
17 pub asset_path: String,
18}
19
20#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
21#[serde(rename_all = "camelCase")]
22pub struct ContractContent {
23 pub relation_type: Option<ContractContentRelationType>,
24 pub relation_uuid: Option<Uuid>,
25 pub chapters: Vec<ContractContentChapter>,
26 pub premium_reward_schedule_uuid: Option<Uuid>,
27 #[serde(rename = "premiumVPCost")]
28 pub premium_vp_cost: i64,
29}
30
31#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
32#[serde(rename_all = "PascalCase")]
33pub enum ContractContentRelationType {
34 Agent,
35 Event,
36 Season,
37}
38
39#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
40#[serde(rename_all = "camelCase")]
41pub struct ContractContentChapter {
42 pub is_epilogue: bool,
43 pub levels: Vec<ContractContentChapterLevel>,
44 pub free_rewards: Option<Vec<ContractContentChapterReward>>,
45}
46
47#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
48#[serde(rename_all = "camelCase")]
49pub struct ContractContentChapterLevel {
50 pub reward: ContractContentChapterReward,
51 pub xp: u64,
52 pub vp_cost: u64,
53 #[serde(rename = "isPurchasableWithVP")]
54 pub is_purchasable_with_vp: bool,
55 pub dough_cost: u64,
56 pub is_purchasable_with_dough: bool,
57}
58
59#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
60#[serde(rename_all = "camelCase")]
61pub struct ContractContentChapterReward {
62 pub r#type: ContractContentChapterRewardType,
63 pub uuid: Uuid,
64 pub amount: u64,
65 pub is_highlighted: bool,
66}
67
68#[derive(Deserialize, Debug, Clone, PartialEq, Hash, Eq)]
69#[serde(rename_all = "PascalCase")]
70pub enum ContractContentChapterRewardType {
71 Currency,
72 EquippableCharmLevel,
73 EquippableSkinLevel,
74 PlayerCard,
75 Spray,
76 Title,
77}