fireblocks_sdk/models/
token_link_dto.rs

1// Fireblocks API
2//
3// Fireblocks provides a suite of applications to manage digital asset operations and a complete development platform to build your business on the blockchain.  - Visit our website for more information: [Fireblocks Website](https://fireblocks.com) - Visit our developer docs: [Fireblocks DevPortal](https://developers.fireblocks.com)
4//
5// The version of the OpenAPI document: 1.8.0
6// Contact: developers@fireblocks.com
7// Generated by: https://openapi-generator.tech
8
9use {
10    crate::models,
11    serde::{Deserialize, Serialize},
12};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TokenLinkDto {
16    /// The token link id
17    #[serde(rename = "id")]
18    pub id: String,
19    /// The token status
20    #[serde(rename = "status")]
21    pub status: Status,
22    /// The type of token
23    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
24    pub r#type: Option<Type>,
25    /// The Fireblocks' reference id
26    #[serde(rename = "refId", skip_serializing_if = "Option::is_none")]
27    pub ref_id: Option<String>,
28    /// The token display name. If was not provided, would be taken from the
29    /// contract template
30    #[serde(rename = "displayName", skip_serializing_if = "Option::is_none")]
31    pub display_name: Option<String>,
32    #[serde(rename = "tokenMetadata", skip_serializing_if = "Option::is_none")]
33    pub token_metadata: Option<models::TokenLinkDtoTokenMetadata>,
34}
35
36impl TokenLinkDto {
37    pub fn new(id: String, status: Status) -> TokenLinkDto {
38        TokenLinkDto {
39            id,
40            status,
41            r#type: None,
42            ref_id: None,
43            display_name: None,
44            token_metadata: None,
45        }
46    }
47}
48/// The token status
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Status {
51    #[serde(rename = "PENDING")]
52    Pending,
53    #[serde(rename = "COMPLETED")]
54    Completed,
55}
56
57impl Default for Status {
58    fn default() -> Status {
59        Self::Pending
60    }
61}
62/// The type of token
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum Type {
65    #[serde(rename = "FUNGIBLE_TOKEN")]
66    FungibleToken,
67    #[serde(rename = "NON_FUNGIBLE_TOKEN")]
68    NonFungibleToken,
69    #[serde(rename = "TOKEN_UTILITY")]
70    TokenUtility,
71    #[serde(rename = "TOKEN_EXTENSION")]
72    TokenExtension,
73}
74
75impl Default for Type {
76    fn default() -> Type {
77        Self::FungibleToken
78    }
79}