fireblocks_sdk/models/swap_provider.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 SwapProvider {
16 /// The ID of the provider
17 #[serde(rename = "id")]
18 pub id: String,
19 /// Name of the provider
20 #[serde(rename = "name")]
21 pub name: String,
22 /// List of supported protocols. Protocols are specific per provider
23 #[serde(rename = "protocols")]
24 pub protocols: Vec<models::SwapProviderProtocolsEnum>,
25 #[serde(rename = "category")]
26 pub category: models::ProviderCategoryEnum,
27 /// Indicates whether the terms of service are required for the provider. if
28 /// `true`, the user must approve the terms of service before using the
29 /// provider. otherwise, `termsOfServiceUrl` and `isTermsOfServiceApproved`
30 /// are not shown under the provider data.
31 #[serde(rename = "isTermsApprovalRequired")]
32 pub is_terms_approval_required: bool,
33 /// URL to the terms of service
34 #[serde(rename = "termsOfServiceUrl", skip_serializing_if = "Option::is_none")]
35 pub terms_of_service_url: Option<String>,
36 /// Indicates whether the terms of service are approved by the user
37 #[serde(
38 rename = "isTermsOfServiceApproved",
39 skip_serializing_if = "Option::is_none"
40 )]
41 pub is_terms_of_service_approved: Option<bool>,
42}
43
44impl SwapProvider {
45 pub fn new(
46 id: String,
47 name: String,
48 protocols: Vec<models::SwapProviderProtocolsEnum>,
49 category: models::ProviderCategoryEnum,
50 is_terms_approval_required: bool,
51 ) -> SwapProvider {
52 SwapProvider {
53 id,
54 name,
55 protocols,
56 category,
57 is_terms_approval_required,
58 terms_of_service_url: None,
59 is_terms_of_service_approved: None,
60 }
61 }
62}