Skip to main content

nominal_api/conjure/objects/persistent/compute/api/
subscription_update_message.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct SubscriptionUpdateMessage {
13    #[serde(rename = "subscriptionId")]
14    subscription_id: super::SubscriptionId,
15    #[builder(custom(type = super::SubscriptionUpdate, convert = Box::new))]
16    #[serde(rename = "update")]
17    update: Box<super::SubscriptionUpdate>,
18}
19impl SubscriptionUpdateMessage {
20    /// Constructs a new instance of the type.
21    #[inline]
22    pub fn new(
23        subscription_id: super::SubscriptionId,
24        update: super::SubscriptionUpdate,
25    ) -> Self {
26        Self::builder().subscription_id(subscription_id).update(update).build()
27    }
28    #[inline]
29    pub fn subscription_id(&self) -> super::SubscriptionId {
30        self.subscription_id
31    }
32    #[inline]
33    pub fn update(&self) -> &super::SubscriptionUpdate {
34        &*self.update
35    }
36}