Skip to main content

canton_api_client/models/
duration.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Duration {
16    #[serde(rename = "seconds")]
17    pub seconds: i64,
18    #[serde(rename = "nanos")]
19    pub nanos: i32,
20    /// This field is automatically added as part of protobuf to json mapping
21    #[serde(rename = "unknownFields", skip_serializing_if = "Option::is_none")]
22    pub unknown_fields: Option<String>,
23}
24
25impl Duration {
26    pub fn new(seconds: i64, nanos: i32) -> Duration {
27        Duration {
28            seconds,
29            nanos,
30            unknown_fields: None,
31        }
32    }
33}
34