fireblocks_sdk/models/
contract_method_config_v2.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/// ContractMethodConfigV2 : Contract method configuration
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContractMethodConfigV2 {
17    #[serde(rename = "methodCalls")]
18    pub method_calls: Vec<String>,
19    /// Operator for method calls
20    #[serde(rename = "operator")]
21    pub operator: Operator,
22    /// Payload suffix for method calls
23    #[serde(rename = "payloadSuffix", skip_serializing_if = "Option::is_none")]
24    pub payload_suffix: Option<String>,
25}
26
27impl ContractMethodConfigV2 {
28    /// Contract method configuration
29    pub fn new(method_calls: Vec<String>, operator: Operator) -> ContractMethodConfigV2 {
30        ContractMethodConfigV2 {
31            method_calls,
32            operator,
33            payload_suffix: None,
34        }
35    }
36}
37/// Operator for method calls
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum Operator {
40    #[serde(rename = "EITHER")]
41    Either,
42    #[serde(rename = "EXACT")]
43    Exact,
44}
45
46impl Default for Operator {
47    fn default() -> Operator {
48        Self::Either
49    }
50}