#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct LogEntry<'a> {
pub created_at: jacquard_common::types::string::Datetime,
pub id: i64,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub job_id: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(borrow)]
pub level: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub log_type: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub message: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub metadata: std::option::Option<jacquard_common::types::value::Data<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub slice_uri: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub user_did: std::option::Option<jacquard_common::types::string::Did<'a>>,
}
pub mod log_entry_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
type CreatedAt;
type Level;
type Message;
type LogType;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type CreatedAt = Unset;
type Level = Unset;
type Message = Unset;
type LogType = Unset;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Id = Set<members::id>;
type CreatedAt = S::CreatedAt;
type Level = S::Level;
type Message = S::Message;
type LogType = S::LogType;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Id = S::Id;
type CreatedAt = Set<members::created_at>;
type Level = S::Level;
type Message = S::Message;
type LogType = S::LogType;
}
pub struct SetLevel<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLevel<S> {}
impl<S: State> State for SetLevel<S> {
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Level = Set<members::level>;
type Message = S::Message;
type LogType = S::LogType;
}
pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMessage<S> {}
impl<S: State> State for SetMessage<S> {
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Level = S::Level;
type Message = Set<members::message>;
type LogType = S::LogType;
}
pub struct SetLogType<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLogType<S> {}
impl<S: State> State for SetLogType<S> {
type Id = S::Id;
type CreatedAt = S::CreatedAt;
type Level = S::Level;
type Message = S::Message;
type LogType = Set<members::log_type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct created_at(());
pub struct level(());
pub struct message(());
pub struct log_type(());
}
}
pub struct LogEntryBuilder<'a, S: log_entry_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::Did<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> LogEntry<'a> {
pub fn new() -> LogEntryBuilder<'a, log_entry_state::Empty> {
LogEntryBuilder::new()
}
}
impl<'a> LogEntryBuilder<'a, log_entry_state::Empty> {
pub fn new() -> Self {
LogEntryBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LogEntryBuilder<'a, S>
where
S: log_entry_state::State,
S::CreatedAt: log_entry_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> LogEntryBuilder<'a, log_entry_state::SetCreatedAt<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
LogEntryBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LogEntryBuilder<'a, S>
where
S: log_entry_state::State,
S::Id: log_entry_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<i64>,
) -> LogEntryBuilder<'a, log_entry_state::SetId<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
LogEntryBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: log_entry_state::State> LogEntryBuilder<'a, S> {
pub fn job_id(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_job_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.2 = value;
self
}
}
impl<'a, S> LogEntryBuilder<'a, S>
where
S: log_entry_state::State,
S::Level: log_entry_state::IsUnset,
{
pub fn level(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> LogEntryBuilder<'a, log_entry_state::SetLevel<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
LogEntryBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LogEntryBuilder<'a, S>
where
S: log_entry_state::State,
S::LogType: log_entry_state::IsUnset,
{
pub fn log_type(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> LogEntryBuilder<'a, log_entry_state::SetLogType<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
LogEntryBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LogEntryBuilder<'a, S>
where
S: log_entry_state::State,
S::Message: log_entry_state::IsUnset,
{
pub fn message(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> LogEntryBuilder<'a, log_entry_state::SetMessage<S>> {
self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into());
LogEntryBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: log_entry_state::State> LogEntryBuilder<'a, S> {
pub fn metadata(
mut self,
value: impl Into<Option<jacquard_common::types::value::Data<'a>>>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_metadata(
mut self,
value: Option<jacquard_common::types::value::Data<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: log_entry_state::State> LogEntryBuilder<'a, S> {
pub fn slice_uri(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_slice_uri(
mut self,
value: Option<jacquard_common::CowStr<'a>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: log_entry_state::State> LogEntryBuilder<'a, S> {
pub fn user_did(
mut self,
value: impl Into<Option<jacquard_common::types::string::Did<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_user_did(
mut self,
value: Option<jacquard_common::types::string::Did<'a>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S> LogEntryBuilder<'a, S>
where
S: log_entry_state::State,
S::Id: log_entry_state::IsSet,
S::CreatedAt: log_entry_state::IsSet,
S::Level: log_entry_state::IsSet,
S::Message: log_entry_state::IsSet,
S::LogType: log_entry_state::IsSet,
{
pub fn build(self) -> LogEntry<'a> {
LogEntry {
created_at: self.__unsafe_private_named.0.unwrap(),
id: self.__unsafe_private_named.1.unwrap(),
job_id: self.__unsafe_private_named.2,
level: self.__unsafe_private_named.3.unwrap(),
log_type: self.__unsafe_private_named.4.unwrap(),
message: self.__unsafe_private_named.5.unwrap(),
metadata: self.__unsafe_private_named.6,
slice_uri: self.__unsafe_private_named.7,
user_did: self.__unsafe_private_named.8,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> LogEntry<'a> {
LogEntry {
created_at: self.__unsafe_private_named.0.unwrap(),
id: self.__unsafe_private_named.1.unwrap(),
job_id: self.__unsafe_private_named.2,
level: self.__unsafe_private_named.3.unwrap(),
log_type: self.__unsafe_private_named.4.unwrap(),
message: self.__unsafe_private_named.5.unwrap(),
metadata: self.__unsafe_private_named.6,
slice_uri: self.__unsafe_private_named.7,
user_did: self.__unsafe_private_named.8,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_network_slices_slice_getJobLogs() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("network.slices.slice.getJobLogs"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("logEntry"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("id"),
::jacquard_common::deps::smol_str::SmolStr::new_static("createdAt"),
::jacquard_common::deps::smol_str::SmolStr::new_static("logType"),
::jacquard_common::deps::smol_str::SmolStr::new_static("level"),
::jacquard_common::deps::smol_str::SmolStr::new_static("message")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"When the log entry was created",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("id"),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"jobId",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"UUID of related job if applicable",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"level",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Log level"),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"logType",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Type of log entry"),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"message",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("Log message"),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"metadata",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"sliceUri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of related slice if applicable",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"userDid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"DID of related user if applicable",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Did,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery {
description: None,
parameters: Some(
::jacquard_lexicon::lexicon::LexXrpcQueryParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("jobId")
],
),
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"jobId",
),
::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"UUID of the sync job",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"limit",
),
::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
),
output: None,
errors: None,
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LogEntry<'a> {
fn nsid() -> &'static str {
"network.slices.slice.getJobLogs"
}
fn def_name() -> &'static str {
"logEntry"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_network_slices_slice_getJobLogs()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
fn _default_limit() -> std::option::Option<i64> {
Some(100i64)
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GetJobLogs<'a> {
#[serde(borrow)]
pub job_id: jacquard_common::CowStr<'a>,
#[serde(default = "_default_limit")]
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub limit: std::option::Option<i64>,
}
pub mod get_job_logs_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type JobId;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type JobId = Unset;
}
pub struct SetJobId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetJobId<S> {}
impl<S: State> State for SetJobId<S> {
type JobId = Set<members::job_id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct job_id(());
}
}
pub struct GetJobLogsBuilder<'a, S: get_job_logs_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<i64>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> GetJobLogs<'a> {
pub fn new() -> GetJobLogsBuilder<'a, get_job_logs_state::Empty> {
GetJobLogsBuilder::new()
}
}
impl<'a> GetJobLogsBuilder<'a, get_job_logs_state::Empty> {
pub fn new() -> Self {
GetJobLogsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> GetJobLogsBuilder<'a, S>
where
S: get_job_logs_state::State,
S::JobId: get_job_logs_state::IsUnset,
{
pub fn job_id(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> GetJobLogsBuilder<'a, get_job_logs_state::SetJobId<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
GetJobLogsBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: get_job_logs_state::State> GetJobLogsBuilder<'a, S> {
pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> GetJobLogsBuilder<'a, S>
where
S: get_job_logs_state::State,
S::JobId: get_job_logs_state::IsSet,
{
pub fn build(self) -> GetJobLogs<'a> {
GetJobLogs {
job_id: self.__unsafe_private_named.0.unwrap(),
limit: self.__unsafe_private_named.1,
}
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GetJobLogsOutput<'a> {
#[serde(borrow)]
pub logs: Vec<crate::network_slices::slice::get_job_logs::LogEntry<'a>>,
}
pub struct GetJobLogsResponse;
impl jacquard_common::xrpc::XrpcResp for GetJobLogsResponse {
const NSID: &'static str = "network.slices.slice.getJobLogs";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetJobLogsOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetJobLogs<'a> {
const NSID: &'static str = "network.slices.slice.getJobLogs";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetJobLogsResponse;
}
pub struct GetJobLogsRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetJobLogsRequest {
const PATH: &'static str = "/xrpc/network.slices.slice.getJobLogs";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetJobLogs<'de>;
type Response = GetJobLogsResponse;
}