#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Nsid, Datetime};
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::network_slices::slice::get_job_status;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct JobStatus<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub completed_at: Option<Datetime>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub error: Option<CowStr<'a>>,
#[serde(borrow)]
pub job_id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub result: Option<get_job_status::SyncJobResult<'a>>,
pub retry_count: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub started_at: Option<Datetime>,
#[serde(borrow)]
pub status: CowStr<'a>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetJobStatus<'a> {
#[serde(borrow)]
pub job_id: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetJobStatusOutput<'a> {
#[serde(flatten)]
#[serde(borrow)]
pub value: jacquard_common::types::value::Data<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SyncJobResult<'a> {
#[serde(borrow)]
pub collections_synced: Vec<Nsid<'a>>,
#[serde(borrow)]
pub message: CowStr<'a>,
pub repos_processed: i64,
pub success: bool,
pub total_records: i64,
}
impl<'a> LexiconSchema for JobStatus<'a> {
fn nsid() -> &'static str {
"network.slices.slice.getJobStatus"
}
fn def_name() -> &'static str {
"jobStatus"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_network_slices_slice_getJobStatus()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub struct GetJobStatusResponse;
impl jacquard_common::xrpc::XrpcResp for GetJobStatusResponse {
const NSID: &'static str = "network.slices.slice.getJobStatus";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetJobStatusOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetJobStatus<'a> {
const NSID: &'static str = "network.slices.slice.getJobStatus";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetJobStatusResponse;
}
pub struct GetJobStatusRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetJobStatusRequest {
const PATH: &'static str = "/xrpc/network.slices.slice.getJobStatus";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetJobStatus<'de>;
type Response = GetJobStatusResponse;
}
impl<'a> LexiconSchema for SyncJobResult<'a> {
fn nsid() -> &'static str {
"network.slices.slice.getJobStatus"
}
fn def_name() -> &'static str {
"syncJobResult"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_network_slices_slice_getJobStatus()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod job_status_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 Status;
type CreatedAt;
type JobId;
type RetryCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Status = Unset;
type CreatedAt = Unset;
type JobId = Unset;
type RetryCount = Unset;
}
pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStatus<S> {}
impl<S: State> State for SetStatus<S> {
type Status = Set<members::status>;
type CreatedAt = S::CreatedAt;
type JobId = S::JobId;
type RetryCount = S::RetryCount;
}
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 Status = S::Status;
type CreatedAt = Set<members::created_at>;
type JobId = S::JobId;
type RetryCount = S::RetryCount;
}
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 Status = S::Status;
type CreatedAt = S::CreatedAt;
type JobId = Set<members::job_id>;
type RetryCount = S::RetryCount;
}
pub struct SetRetryCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRetryCount<S> {}
impl<S: State> State for SetRetryCount<S> {
type Status = S::Status;
type CreatedAt = S::CreatedAt;
type JobId = S::JobId;
type RetryCount = Set<members::retry_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct status(());
pub struct created_at(());
pub struct job_id(());
pub struct retry_count(());
}
}
pub struct JobStatusBuilder<'a, S: job_status_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Datetime>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<get_job_status::SyncJobResult<'a>>,
Option<i64>,
Option<Datetime>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> JobStatus<'a> {
pub fn new() -> JobStatusBuilder<'a, job_status_state::Empty> {
JobStatusBuilder::new()
}
}
impl<'a> JobStatusBuilder<'a, job_status_state::Empty> {
pub fn new() -> Self {
JobStatusBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> {
pub fn completed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_completed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> JobStatusBuilder<'a, S>
where
S: job_status_state::State,
S::CreatedAt: job_status_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> JobStatusBuilder<'a, job_status_state::SetCreatedAt<S>> {
self._fields.1 = Option::Some(value.into());
JobStatusBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> {
pub fn error(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_error(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> JobStatusBuilder<'a, S>
where
S: job_status_state::State,
S::JobId: job_status_state::IsUnset,
{
pub fn job_id(
mut self,
value: impl Into<CowStr<'a>>,
) -> JobStatusBuilder<'a, job_status_state::SetJobId<S>> {
self._fields.3 = Option::Some(value.into());
JobStatusBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> {
pub fn result(
mut self,
value: impl Into<Option<get_job_status::SyncJobResult<'a>>>,
) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_result(
mut self,
value: Option<get_job_status::SyncJobResult<'a>>,
) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> JobStatusBuilder<'a, S>
where
S: job_status_state::State,
S::RetryCount: job_status_state::IsUnset,
{
pub fn retry_count(
mut self,
value: impl Into<i64>,
) -> JobStatusBuilder<'a, job_status_state::SetRetryCount<S>> {
self._fields.5 = Option::Some(value.into());
JobStatusBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: job_status_state::State> JobStatusBuilder<'a, S> {
pub fn started_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_started_at(mut self, value: Option<Datetime>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> JobStatusBuilder<'a, S>
where
S: job_status_state::State,
S::Status: job_status_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<CowStr<'a>>,
) -> JobStatusBuilder<'a, job_status_state::SetStatus<S>> {
self._fields.7 = Option::Some(value.into());
JobStatusBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> JobStatusBuilder<'a, S>
where
S: job_status_state::State,
S::Status: job_status_state::IsSet,
S::CreatedAt: job_status_state::IsSet,
S::JobId: job_status_state::IsSet,
S::RetryCount: job_status_state::IsSet,
{
pub fn build(self) -> JobStatus<'a> {
JobStatus {
completed_at: self._fields.0,
created_at: self._fields.1.unwrap(),
error: self._fields.2,
job_id: self._fields.3.unwrap(),
result: self._fields.4,
retry_count: self._fields.5.unwrap(),
started_at: self._fields.6,
status: self._fields.7.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> JobStatus<'a> {
JobStatus {
completed_at: self._fields.0,
created_at: self._fields.1.unwrap(),
error: self._fields.2,
job_id: self._fields.3.unwrap(),
result: self._fields.4,
retry_count: self._fields.5.unwrap(),
started_at: self._fields.6,
status: self._fields.7.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_network_slices_slice_getJobStatus() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("network.slices.slice.getJobStatus"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("jobStatus"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("jobId"), SmolStr::new_static("status"),
SmolStr::new_static("createdAt"),
SmolStr::new_static("retryCount")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("completedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the job completed"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the job was created"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("error"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Error message if job failed"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("jobId"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("UUID of the job")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("result"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#syncJobResult"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("retryCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("startedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the job started executing"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Current status of the job"),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::XrpcQuery(LexXrpcQuery {
parameters: Some(
LexXrpcQueryParameter::Params(LexXrpcParameters {
required: Some(vec![SmolStr::new_static("jobId")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("jobId"),
LexXrpcParametersProperty::String(LexString {
description: Some(
CowStr::new_static("UUID of the sync job"),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("syncJobResult"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("success"),
SmolStr::new_static("totalRecords"),
SmolStr::new_static("collectionsSynced"),
SmolStr::new_static("reposProcessed"),
SmolStr::new_static("message")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("collectionsSynced"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"List of collection NSIDs that were synced",
),
),
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Nsid),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("message"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Human-readable message about the job completion",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("reposProcessed"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("success"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalRecords"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod get_job_status_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 GetJobStatusBuilder<'a, S: get_job_status_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<CowStr<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> GetJobStatus<'a> {
pub fn new() -> GetJobStatusBuilder<'a, get_job_status_state::Empty> {
GetJobStatusBuilder::new()
}
}
impl<'a> GetJobStatusBuilder<'a, get_job_status_state::Empty> {
pub fn new() -> Self {
GetJobStatusBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetJobStatusBuilder<'a, S>
where
S: get_job_status_state::State,
S::JobId: get_job_status_state::IsUnset,
{
pub fn job_id(
mut self,
value: impl Into<CowStr<'a>>,
) -> GetJobStatusBuilder<'a, get_job_status_state::SetJobId<S>> {
self._fields.0 = Option::Some(value.into());
GetJobStatusBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetJobStatusBuilder<'a, S>
where
S: get_job_status_state::State,
S::JobId: get_job_status_state::IsSet,
{
pub fn build(self) -> GetJobStatus<'a> {
GetJobStatus {
job_id: self._fields.0.unwrap(),
}
}
}
pub mod sync_job_result_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 Success;
type CollectionsSynced;
type TotalRecords;
type ReposProcessed;
type Message;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Success = Unset;
type CollectionsSynced = Unset;
type TotalRecords = Unset;
type ReposProcessed = Unset;
type Message = Unset;
}
pub struct SetSuccess<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSuccess<S> {}
impl<S: State> State for SetSuccess<S> {
type Success = Set<members::success>;
type CollectionsSynced = S::CollectionsSynced;
type TotalRecords = S::TotalRecords;
type ReposProcessed = S::ReposProcessed;
type Message = S::Message;
}
pub struct SetCollectionsSynced<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCollectionsSynced<S> {}
impl<S: State> State for SetCollectionsSynced<S> {
type Success = S::Success;
type CollectionsSynced = Set<members::collections_synced>;
type TotalRecords = S::TotalRecords;
type ReposProcessed = S::ReposProcessed;
type Message = S::Message;
}
pub struct SetTotalRecords<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTotalRecords<S> {}
impl<S: State> State for SetTotalRecords<S> {
type Success = S::Success;
type CollectionsSynced = S::CollectionsSynced;
type TotalRecords = Set<members::total_records>;
type ReposProcessed = S::ReposProcessed;
type Message = S::Message;
}
pub struct SetReposProcessed<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetReposProcessed<S> {}
impl<S: State> State for SetReposProcessed<S> {
type Success = S::Success;
type CollectionsSynced = S::CollectionsSynced;
type TotalRecords = S::TotalRecords;
type ReposProcessed = Set<members::repos_processed>;
type Message = S::Message;
}
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 Success = S::Success;
type CollectionsSynced = S::CollectionsSynced;
type TotalRecords = S::TotalRecords;
type ReposProcessed = S::ReposProcessed;
type Message = Set<members::message>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct success(());
pub struct collections_synced(());
pub struct total_records(());
pub struct repos_processed(());
pub struct message(());
}
}
pub struct SyncJobResultBuilder<'a, S: sync_job_result_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Vec<Nsid<'a>>>,
Option<CowStr<'a>>,
Option<i64>,
Option<bool>,
Option<i64>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SyncJobResult<'a> {
pub fn new() -> SyncJobResultBuilder<'a, sync_job_result_state::Empty> {
SyncJobResultBuilder::new()
}
}
impl<'a> SyncJobResultBuilder<'a, sync_job_result_state::Empty> {
pub fn new() -> Self {
SyncJobResultBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SyncJobResultBuilder<'a, S>
where
S: sync_job_result_state::State,
S::CollectionsSynced: sync_job_result_state::IsUnset,
{
pub fn collections_synced(
mut self,
value: impl Into<Vec<Nsid<'a>>>,
) -> SyncJobResultBuilder<'a, sync_job_result_state::SetCollectionsSynced<S>> {
self._fields.0 = Option::Some(value.into());
SyncJobResultBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SyncJobResultBuilder<'a, S>
where
S: sync_job_result_state::State,
S::Message: sync_job_result_state::IsUnset,
{
pub fn message(
mut self,
value: impl Into<CowStr<'a>>,
) -> SyncJobResultBuilder<'a, sync_job_result_state::SetMessage<S>> {
self._fields.1 = Option::Some(value.into());
SyncJobResultBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SyncJobResultBuilder<'a, S>
where
S: sync_job_result_state::State,
S::ReposProcessed: sync_job_result_state::IsUnset,
{
pub fn repos_processed(
mut self,
value: impl Into<i64>,
) -> SyncJobResultBuilder<'a, sync_job_result_state::SetReposProcessed<S>> {
self._fields.2 = Option::Some(value.into());
SyncJobResultBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SyncJobResultBuilder<'a, S>
where
S: sync_job_result_state::State,
S::Success: sync_job_result_state::IsUnset,
{
pub fn success(
mut self,
value: impl Into<bool>,
) -> SyncJobResultBuilder<'a, sync_job_result_state::SetSuccess<S>> {
self._fields.3 = Option::Some(value.into());
SyncJobResultBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SyncJobResultBuilder<'a, S>
where
S: sync_job_result_state::State,
S::TotalRecords: sync_job_result_state::IsUnset,
{
pub fn total_records(
mut self,
value: impl Into<i64>,
) -> SyncJobResultBuilder<'a, sync_job_result_state::SetTotalRecords<S>> {
self._fields.4 = Option::Some(value.into());
SyncJobResultBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SyncJobResultBuilder<'a, S>
where
S: sync_job_result_state::State,
S::Success: sync_job_result_state::IsSet,
S::CollectionsSynced: sync_job_result_state::IsSet,
S::TotalRecords: sync_job_result_state::IsSet,
S::ReposProcessed: sync_job_result_state::IsSet,
S::Message: sync_job_result_state::IsSet,
{
pub fn build(self) -> SyncJobResult<'a> {
SyncJobResult {
collections_synced: self._fields.0.unwrap(),
message: self._fields.1.unwrap(),
repos_processed: self._fields.2.unwrap(),
success: self._fields.3.unwrap(),
total_records: self._fields.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SyncJobResult<'a> {
SyncJobResult {
collections_synced: self._fields.0.unwrap(),
message: self._fields.1.unwrap(),
repos_processed: self._fields.2.unwrap(),
success: self._fields.3.unwrap(),
total_records: self._fields.4.unwrap(),
extra_data: Some(extra_data),
}
}
}