Skip to main content

nominal_api/conjure/objects/ingest/api/
resolve_streaming_session_request.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 ResolveStreamingSessionRequest {
16    #[builder(
17        default,
18        custom(
19            type = impl
20            Into<Option<super::StreamingSessionSource>>,
21            convert = |v|v.into().map(Box::new)
22        )
23    )]
24    #[serde(rename = "source", skip_serializing_if = "Option::is_none", default)]
25    source: Option<Box<super::StreamingSessionSource>>,
26}
27impl ResolveStreamingSessionRequest {
28    /// Constructs a new instance of the type.
29    #[inline]
30    pub fn new() -> Self {
31        Self::builder().build()
32    }
33    /// The source attribution for this streaming session. Each unique source gets
34    /// its own in-progress session per dataset. If absent, the session is unattributed.
35    #[inline]
36    pub fn source(&self) -> Option<&super::StreamingSessionSource> {
37        self.source.as_ref().map(|o| &**o)
38    }
39}