canton_api_client/models/js_interface_view.rs
1/*
2 * JSON Ledger API HTTP endpoints
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 3.3.0-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 sucessfully 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