Skip to main content

jacquard_api/network_slices/slice/
start_sync.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.startSync
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_common::types::string::{Did, Nsid};
15use jacquard_derive::{IntoStatic, lexicon};
16use serde::{Serialize, Deserialize};
17
18#[lexicon]
19#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
20#[serde(rename_all = "camelCase")]
21pub struct StartSync<'a> {
22    ///List of collection NSIDs to sync (primary collections matching slice domain)
23    #[serde(skip_serializing_if = "Option::is_none")]
24    #[serde(borrow)]
25    pub collections: Option<Vec<Nsid<'a>>>,
26    ///List of external collection NSIDs to sync (collections outside slice domain)
27    #[serde(skip_serializing_if = "Option::is_none")]
28    #[serde(borrow)]
29    pub external_collections: Option<Vec<Nsid<'a>>>,
30    ///Maximum number of records to sync per repository
31    #[serde(skip_serializing_if = "Option::is_none")]
32    pub limit_per_repo: Option<i64>,
33    ///List of specific repository DIDs to sync from
34    #[serde(skip_serializing_if = "Option::is_none")]
35    #[serde(borrow)]
36    pub repos: Option<Vec<Did<'a>>>,
37    ///Skip lexicon validation during sync  Defaults to `false`.
38    #[serde(skip_serializing_if = "Option::is_none")]
39    #[serde(default = "_default_start_sync_skip_validation")]
40    pub skip_validation: Option<bool>,
41    ///AT-URI of the slice to sync data into
42    #[serde(borrow)]
43    pub slice: CowStr<'a>,
44}
45
46
47#[lexicon]
48#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
49#[serde(rename_all = "camelCase")]
50pub struct StartSyncOutput<'a> {
51    ///UUID of the enqueued sync job
52    #[serde(borrow)]
53    pub job_id: CowStr<'a>,
54    ///Success message confirming job enqueue
55    #[serde(borrow)]
56    pub message: CowStr<'a>,
57}
58
59/// Response type for network.slices.slice.startSync
60pub struct StartSyncResponse;
61impl jacquard_common::xrpc::XrpcResp for StartSyncResponse {
62    const NSID: &'static str = "network.slices.slice.startSync";
63    const ENCODING: &'static str = "application/json";
64    type Output<'de> = StartSyncOutput<'de>;
65    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
66}
67
68impl<'a> jacquard_common::xrpc::XrpcRequest for StartSync<'a> {
69    const NSID: &'static str = "network.slices.slice.startSync";
70    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
71        "application/json",
72    );
73    type Response = StartSyncResponse;
74}
75
76/// Endpoint type for network.slices.slice.startSync
77pub struct StartSyncRequest;
78impl jacquard_common::xrpc::XrpcEndpoint for StartSyncRequest {
79    const PATH: &'static str = "/xrpc/network.slices.slice.startSync";
80    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
81        "application/json",
82    );
83    type Request<'de> = StartSync<'de>;
84    type Response = StartSyncResponse;
85}
86
87fn _default_start_sync_skip_validation() -> Option<bool> {
88    Some(false)
89}