fireblocks-sdk 2.1.0

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 AbiFunction {
    /// The name of the contract function as it appears in the ABI
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The state mutability of the contract function as it appears in the ABI
    #[serde(rename = "stateMutability", skip_serializing_if = "Option::is_none")]
    pub state_mutability: Option<StateMutability>,
    /// The type if the function
    #[serde(rename = "type")]
    pub r#type: Type,
    /// The parameters that this function/constructor posses
    #[serde(rename = "inputs")]
    pub inputs: Vec<models::Parameter>,
    /// The parameters that this 'read' function returns
    #[serde(rename = "outputs", skip_serializing_if = "Option::is_none")]
    pub outputs: Option<Vec<models::Parameter>>,
    /// The documentation of this function (if has any)
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
}

impl AbiFunction {
    pub fn new(r#type: Type, inputs: Vec<models::Parameter>) -> AbiFunction {
        AbiFunction {
            name: None,
            state_mutability: None,
            r#type,
            inputs,
            outputs: None,
            description: None,
        }
    }
}
/// The state mutability of the contract function as it appears in the ABI
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StateMutability {
    #[serde(rename = "pure")]
    Pure,
    #[serde(rename = "view")]
    View,
    #[serde(rename = "nonpayable")]
    Nonpayable,
    #[serde(rename = "payable")]
    Payable,
}

impl Default for StateMutability {
    fn default() -> StateMutability {
        Self::Pure
    }
}
/// The type if the function
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "function")]
    Function,
    #[serde(rename = "constructor")]
    Constructor,
}

impl Default for Type {
    fn default() -> Type {
        Self::Function
    }
}