fireblocks-sdk 2025.10.17

Rust implementation of the Fireblocks SDK
Documentation
// 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,
        }
    }
}