1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Fireblocks API
//
// 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)
//
// The version of the OpenAPI document: 1.8.0
// Contact: developers@fireblocks.com
// Generated by: https://openapi-generator.tech
use {
crate::models,
serde::{Deserialize, Serialize},
};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SwapProvider {
/// The ID of the provider
#[serde(rename = "id")]
pub id: String,
/// Name of the provider
#[serde(rename = "name")]
pub name: String,
/// List of supported protocols. Protocols are specific per provider
#[serde(rename = "protocols")]
pub protocols: Vec<models::SwapProviderProtocolsEnum>,
#[serde(rename = "category")]
pub category: models::ProviderCategoryEnum,
/// Indicates whether the terms of service are required for the provider. if
/// `true`, the user must approve the terms of service before using the
/// provider. otherwise, `termsOfServiceUrl` and `isTermsOfServiceApproved`
/// are not shown under the provider data.
#[serde(rename = "isTermsApprovalRequired")]
pub is_terms_approval_required: bool,
/// URL to the terms of service
#[serde(rename = "termsOfServiceUrl", skip_serializing_if = "Option::is_none")]
pub terms_of_service_url: Option<String>,
/// Indicates whether the terms of service are approved by the user
#[serde(
rename = "isTermsOfServiceApproved",
skip_serializing_if = "Option::is_none"
)]
pub is_terms_of_service_approved: Option<bool>,
}
impl SwapProvider {
pub fn new(
id: String,
name: String,
protocols: Vec<models::SwapProviderProtocolsEnum>,
category: models::ProviderCategoryEnum,
is_terms_approval_required: bool,
) -> SwapProvider {
SwapProvider {
id,
name,
protocols,
category,
is_terms_approval_required,
terms_of_service_url: None,
is_terms_of_service_approved: None,
}
}
}