Skip to main content

nominal_api/conjure/objects/event/
events_histogram_bucket.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct EventsHistogramBucket {
16    #[builder(custom(type = super::super::api::Timestamp, convert = Box::new))]
17    #[serde(rename = "startInclusive")]
18    start_inclusive: Box<super::super::api::Timestamp>,
19    #[builder(custom(type = super::super::api::Timestamp, convert = Box::new))]
20    #[serde(rename = "endExclusive")]
21    end_exclusive: Box<super::super::api::Timestamp>,
22    #[serde(rename = "count")]
23    count: i32,
24}
25impl EventsHistogramBucket {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new(
29        start_inclusive: super::super::api::Timestamp,
30        end_exclusive: super::super::api::Timestamp,
31        count: i32,
32    ) -> Self {
33        Self::builder()
34            .start_inclusive(start_inclusive)
35            .end_exclusive(end_exclusive)
36            .count(count)
37            .build()
38    }
39    #[inline]
40    pub fn start_inclusive(&self) -> &super::super::api::Timestamp {
41        &*self.start_inclusive
42    }
43    #[inline]
44    pub fn end_exclusive(&self) -> &super::super::api::Timestamp {
45        &*self.end_exclusive
46    }
47    #[inline]
48    pub fn count(&self) -> i32 {
49        self.count
50    }
51}