Skip to main content

nominal_api/conjure/errors/persistent/compute/api/
polling_only_computation.rs

1/// The requested compute contains nodes that support streaming but only via polling (not WebSocket).
2/// The frontend should use polling mode (HTTP requests) instead of WebSocket streaming for this query.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct PollingOnlyComputation {
18    #[builder(
19        default,
20        set(
21            item(
22                type = super::super::super::super::super::objects::persistent::compute::api::PollingOnlyComputationType
23            )
24        )
25    )]
26    #[serde(
27        rename = "pollingOnlyTypes",
28        skip_serializing_if = "std::collections::BTreeSet::is_empty",
29        default
30    )]
31    polling_only_types: std::collections::BTreeSet<
32        super::super::super::super::super::objects::persistent::compute::api::PollingOnlyComputationType,
33    >,
34}
35impl PollingOnlyComputation {
36    /// Constructs a new instance of the type.
37    #[inline]
38    pub fn new() -> Self {
39        Self::builder().build()
40    }
41    #[inline]
42    pub fn polling_only_types(
43        &self,
44    ) -> &std::collections::BTreeSet<
45        super::super::super::super::super::objects::persistent::compute::api::PollingOnlyComputationType,
46    > {
47        &self.polling_only_types
48    }
49}
50impl conjure_error::ErrorType for PollingOnlyComputation {
51    #[inline]
52    fn code() -> conjure_error::ErrorCode {
53        conjure_error::ErrorCode::InvalidArgument
54    }
55    #[inline]
56    fn name() -> &'static str {
57        "PersistentCompute:PollingOnlyComputation"
58    }
59    #[inline]
60    fn safe_args() -> &'static [&'static str] {
61        &["pollingOnlyTypes"]
62    }
63}