Skip to main content

canton_api_client/models/
js_interface_view.rs

1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * This specification version fixes the API inconsistencies where certain fields marked as required in the spec are in fact optional. If you use code generation tool based on this file, you might need to adjust the existing application code to handle those fields as optional. If you do not want to change your client code, continue using the OpenAPI specification from the previous Canton 3.4 patch release. MINIMUM_CANTON_VERSION=3.4.12
5 *
6 * The version of the OpenAPI document: 3.4.12-SNAPSHOT
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// JsInterfaceView : View of a create event matched by an interface filter.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct JsInterfaceView {
17    /// The interface implemented by the matched event. The identifier uses the package-id reference format.  Required
18    #[serde(rename = "interfaceId")]
19    pub interface_id: String,
20    #[serde(rename = "viewStatus")]
21    pub view_status: Box<models::JsStatus>,
22    /// The value of the interface's view method on this event. Set if it was requested in the ``InterfaceFilter`` and it could be successfully computed.  Optional
23    #[serde(rename = "viewValue", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub view_value: Option<Option<serde_json::Value>>,
25}
26
27impl JsInterfaceView {
28    /// View of a create event matched by an interface filter.
29    pub fn new(interface_id: String, view_status: models::JsStatus) -> JsInterfaceView {
30        JsInterfaceView {
31            interface_id,
32            view_status: Box::new(view_status),
33            view_value: None,
34        }
35    }
36}
37