jacquard_api/network_slices/slice/
get_jetstream_logs.rs1#[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 #[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
39pub 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
54pub 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 pub trait State: sealed::Sealed {}
77 pub struct Empty(());
79 impl sealed::Sealed for Empty {}
80 impl State for Empty {}
81 #[allow(non_camel_case_types)]
83 pub mod members {}
84}
85
86pub 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 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 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 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
114 self._fields.0 = value.into();
115 self
116 }
117 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 pub fn slice(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
127 self._fields.1 = value.into();
128 self
129 }
130 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 pub fn build(self) -> GetJetstreamLogs<'a> {
143 GetJetstreamLogs {
144 limit: self._fields.0,
145 slice: self._fields.1,
146 }
147 }
148}