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 WriteAbiFunction {
    #[serde(rename = "stateMutability")]
    pub state_mutability: StateMutability,
    #[serde(rename = "outputs", skip_serializing_if = "Option::is_none")]
    pub outputs: Option<Vec<models::Parameter>>,
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    #[serde(rename = "inputs")]
    pub inputs: Vec<models::ParameterWithValue>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
}

impl WriteAbiFunction {
    pub fn new(
        state_mutability: StateMutability,
        r#type: Type,
        inputs: Vec<models::ParameterWithValue>,
    ) -> WriteAbiFunction {
        WriteAbiFunction {
            state_mutability,
            outputs: None,
            r#type,
            name: None,
            inputs,
            description: None,
        }
    }
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StateMutability {
    #[serde(rename = "payable")]
    Payable,
    #[serde(rename = "nonpayable")]
    Nonpayable,
}

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

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