app_store_server_library/models/
platform.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Deserialize, Serialize, Hash, PartialEq, Eq)]
7#[serde(from = "i64", into = "i64")]
8pub enum Platform {
9 Undeclared,
10 Apple,
11 NonApple,
12
13 NotSupported(i64),
16}
17
18impl From<i64> for Platform {
19 fn from(value: i64) -> Self {
20 match value {
21 0 => Platform::Undeclared,
22 1 => Platform::Apple,
23 2 => Platform::NonApple,
24 other => Platform::NotSupported(other),
25 }
26 }
27}
28
29impl From<Platform> for i64 {
30 fn from(value: Platform) -> Self {
31 match value {
32 Platform::Undeclared => 0,
33 Platform::Apple => 1,
34 Platform::NonApple => 2,
35 Platform::NotSupported(other) => other,
36 }
37 }
38}