Skip to main content

jacquard_api/network_slices/slice/
get_jetstream_logs.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.getJetstreamLogs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[allow(unused_imports)]
9use alloc::collections::BTreeMap;
10
11#[allow(unused_imports)]
12use core::marker::PhantomData;
13use jacquard_common::CowStr;
14use jacquard_derive::{IntoStatic, lexicon};
15use serde::{Serialize, Deserialize};
16use crate::network_slices::slice::get_job_logs::LogEntry;
17
18#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
19#[serde(rename_all = "camelCase")]
20pub struct GetJetstreamLogs<'a> {
21    ///Defaults to `100`. Min: 1. Max: 1000.
22    #[serde(default = "_default_limit")]
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub limit: Option<i64>,
25    #[serde(skip_serializing_if = "Option::is_none")]
26    #[serde(borrow)]
27    pub slice: Option<CowStr<'a>>,
28}
29
30
31#[lexicon]
32#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
33#[serde(rename_all = "camelCase")]
34pub struct GetJetstreamLogsOutput<'a> {
35    #[serde(borrow)]
36    pub logs: Vec<LogEntry<'a>>,
37}
38
39/// Response type for network.slices.slice.getJetstreamLogs
40pub struct GetJetstreamLogsResponse;
41impl jacquard_common::xrpc::XrpcResp for GetJetstreamLogsResponse {
42    const NSID: &'static str = "network.slices.slice.getJetstreamLogs";
43    const ENCODING: &'static str = "application/json";
44    type Output<'de> = GetJetstreamLogsOutput<'de>;
45    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
46}
47
48impl<'a> jacquard_common::xrpc::XrpcRequest for GetJetstreamLogs<'a> {
49    const NSID: &'static str = "network.slices.slice.getJetstreamLogs";
50    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
51    type Response = GetJetstreamLogsResponse;
52}
53
54/// Endpoint type for network.slices.slice.getJetstreamLogs
55pub struct GetJetstreamLogsRequest;
56impl jacquard_common::xrpc::XrpcEndpoint for GetJetstreamLogsRequest {
57    const PATH: &'static str = "/xrpc/network.slices.slice.getJetstreamLogs";
58    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
59    type Request<'de> = GetJetstreamLogs<'de>;
60    type Response = GetJetstreamLogsResponse;
61}
62
63fn _default_limit() -> Option<i64> {
64    Some(100i64)
65}
66
67pub mod get_jetstream_logs_state {
68
69    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
70    #[allow(unused)]
71    use ::core::marker::PhantomData;
72    mod sealed {
73        pub trait Sealed {}
74    }
75    /// State trait tracking which required fields have been set
76    pub trait State: sealed::Sealed {}
77    /// Empty state - all required fields are unset
78    pub struct Empty(());
79    impl sealed::Sealed for Empty {}
80    impl State for Empty {}
81    /// Marker types for field names
82    #[allow(non_camel_case_types)]
83    pub mod members {}
84}
85
86/// Builder for constructing an instance of this type
87pub struct GetJetstreamLogsBuilder<'a, S: get_jetstream_logs_state::State> {
88    _state: PhantomData<fn() -> S>,
89    _fields: (Option<i64>, Option<CowStr<'a>>),
90    _lifetime: PhantomData<&'a ()>,
91}
92
93impl<'a> GetJetstreamLogs<'a> {
94    /// Create a new builder for this type
95    pub fn new() -> GetJetstreamLogsBuilder<'a, get_jetstream_logs_state::Empty> {
96        GetJetstreamLogsBuilder::new()
97    }
98}
99
100impl<'a> GetJetstreamLogsBuilder<'a, get_jetstream_logs_state::Empty> {
101    /// Create a new builder with all fields unset
102    pub fn new() -> Self {
103        GetJetstreamLogsBuilder {
104            _state: PhantomData,
105            _fields: (None, None),
106            _lifetime: PhantomData,
107        }
108    }
109}
110
111impl<'a, S: get_jetstream_logs_state::State> GetJetstreamLogsBuilder<'a, S> {
112    /// Set the `limit` field (optional)
113    pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
114        self._fields.0 = value.into();
115        self
116    }
117    /// Set the `limit` field to an Option value (optional)
118    pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
119        self._fields.0 = value;
120        self
121    }
122}
123
124impl<'a, S: get_jetstream_logs_state::State> GetJetstreamLogsBuilder<'a, S> {
125    /// Set the `slice` field (optional)
126    pub fn slice(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
127        self._fields.1 = value.into();
128        self
129    }
130    /// Set the `slice` field to an Option value (optional)
131    pub fn maybe_slice(mut self, value: Option<CowStr<'a>>) -> Self {
132        self._fields.1 = value;
133        self
134    }
135}
136
137impl<'a, S> GetJetstreamLogsBuilder<'a, S>
138where
139    S: get_jetstream_logs_state::State,
140{
141    /// Build the final struct
142    pub fn build(self) -> GetJetstreamLogs<'a> {
143        GetJetstreamLogs {
144            limit: self._fields.0,
145            slice: self._fields.1,
146        }
147    }
148}