1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.getJobStatus
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10 serde::Serialize,
11 serde::Deserialize,
12 Debug,
13 Clone,
14 PartialEq,
15 Eq,
16 jacquard_derive::IntoStatic,
17 bon::Builder
18)]
19#[serde(rename_all = "camelCase")]
20pub struct JobStatus<'a> {
21 /// When the job completed
22 #[serde(skip_serializing_if = "std::option::Option::is_none")]
23 #[builder(into)]
24 pub completed_at: Option<jacquard_common::types::string::Datetime>,
25 /// When the job was created
26 pub created_at: jacquard_common::types::string::Datetime,
27 /// Error message if job failed
28 #[serde(skip_serializing_if = "std::option::Option::is_none")]
29 #[builder(into)]
30 #[serde(borrow)]
31 pub error: Option<jacquard_common::CowStr<'a>>,
32 /// UUID of the job
33 #[serde(borrow)]
34 #[builder(into)]
35 pub job_id: jacquard_common::CowStr<'a>,
36 /// Job result if completed successfully
37 #[serde(skip_serializing_if = "std::option::Option::is_none")]
38 #[builder(into)]
39 #[serde(borrow)]
40 pub result: Option<crate::network_slices::slice::get_job_status::SyncJobResult<'a>>,
41 /// Number of times the job has been retried
42 pub retry_count: i64,
43 /// When the job started executing
44 #[serde(skip_serializing_if = "std::option::Option::is_none")]
45 #[builder(into)]
46 pub started_at: Option<jacquard_common::types::string::Datetime>,
47 /// Current status of the job
48 #[serde(borrow)]
49 #[builder(into)]
50 pub status: jacquard_common::CowStr<'a>,
51}
52
53#[derive(
54 serde::Serialize,
55 serde::Deserialize,
56 Debug,
57 Clone,
58 PartialEq,
59 Eq,
60 bon::Builder,
61 jacquard_derive::IntoStatic
62)]
63#[builder(start_fn = new)]
64#[serde(rename_all = "camelCase")]
65pub struct GetJobStatus<'a> {
66 #[serde(borrow)]
67 #[builder(into)]
68 pub job_id: jacquard_common::CowStr<'a>,
69}
70
71#[jacquard_derive::lexicon]
72#[derive(
73 serde::Serialize,
74 serde::Deserialize,
75 Debug,
76 Clone,
77 PartialEq,
78 Eq,
79 jacquard_derive::IntoStatic
80)]
81#[serde(rename_all = "camelCase")]
82pub struct GetJobStatusOutput<'a> {
83 #[serde(flatten)]
84 #[serde(borrow)]
85 pub value: jacquard_common::types::value::Data<'a>,
86}
87
88///Response type for
89///network.slices.slice.getJobStatus
90pub struct GetJobStatusResponse;
91impl jacquard_common::xrpc::XrpcResp for GetJobStatusResponse {
92 const NSID: &'static str = "network.slices.slice.getJobStatus";
93 const ENCODING: &'static str = "application/json";
94 type Output<'de> = GetJobStatusOutput<'de>;
95 type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
96}
97
98impl<'a> jacquard_common::xrpc::XrpcRequest for GetJobStatus<'a> {
99 const NSID: &'static str = "network.slices.slice.getJobStatus";
100 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
101 type Response = GetJobStatusResponse;
102}
103
104///Endpoint type for
105///network.slices.slice.getJobStatus
106pub struct GetJobStatusRequest;
107impl jacquard_common::xrpc::XrpcEndpoint for GetJobStatusRequest {
108 const PATH: &'static str = "/xrpc/network.slices.slice.getJobStatus";
109 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
110 type Request<'de> = GetJobStatus<'de>;
111 type Response = GetJobStatusResponse;
112}
113
114#[jacquard_derive::lexicon]
115#[derive(
116 serde::Serialize,
117 serde::Deserialize,
118 Debug,
119 Clone,
120 PartialEq,
121 Eq,
122 jacquard_derive::IntoStatic,
123 bon::Builder
124)]
125#[serde(rename_all = "camelCase")]
126pub struct SyncJobResult<'a> {
127 /// List of collection NSIDs that were synced
128 #[serde(borrow)]
129 pub collections_synced: Vec<jacquard_common::types::string::Nsid<'a>>,
130 /// Human-readable message about the job completion
131 #[serde(borrow)]
132 #[builder(into)]
133 pub message: jacquard_common::CowStr<'a>,
134 /// Number of repositories processed
135 pub repos_processed: i64,
136 /// Whether the sync job completed successfully
137 pub success: bool,
138 /// Total number of records synced
139 pub total_records: i64,
140}