canton-api-client 3.3.0-0.1.2

Canton Ledger API rust client
Documentation
/*
 * JSON Ledger API HTTP endpoints
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 3.3.0-SNAPSHOT
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// JsInterfaceView : View of a create event matched by an interface filter.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct JsInterfaceView {
    /// The interface implemented by the matched event. The identifier uses the package-id reference format.  Required
    #[serde(rename = "interfaceId")]
    pub interface_id: String,
    #[serde(rename = "viewStatus")]
    pub view_status: Box<models::JsStatus>,
    /// The value of the interface's view method on this event. Set if it was requested in the ``InterfaceFilter`` and it could be sucessfully computed. Optional
    #[serde(rename = "viewValue", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub view_value: Option<Option<serde_json::Value>>,
}

impl JsInterfaceView {
    /// View of a create event matched by an interface filter.
    pub fn new(interface_id: String, view_status: models::JsStatus) -> JsInterfaceView {
        JsInterfaceView {
            interface_id,
            view_status: Box::new(view_status),
            view_value: None,
        }
    }
}