Skip to main content

jacquard_api/network_slices/slice/
sync_user_collections.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.slice.syncUserCollections
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_derive::{IntoStatic, lexicon};
15use serde::{Serialize, Deserialize};
16
17#[lexicon]
18#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
19#[serde(rename_all = "camelCase")]
20pub struct SyncUserCollections<'a> {
21    ///AT-URI of the slice to sync user data into
22    #[serde(borrow)]
23    pub slice: CowStr<'a>,
24    ///Timeout in seconds for the sync operation  Defaults to `30`.
25    #[serde(skip_serializing_if = "Option::is_none")]
26    #[serde(default = "_default_sync_user_collections_timeout_seconds")]
27    pub timeout_seconds: Option<i64>,
28}
29
30
31#[lexicon]
32#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
33#[serde(rename_all = "camelCase")]
34pub struct SyncUserCollectionsOutput<'a> {
35    ///Number of records successfully synced
36    pub records_synced: i64,
37    ///Number of repositories processed during sync
38    pub repos_processed: i64,
39    ///Whether the sync operation exceeded the timeout
40    pub timed_out: bool,
41}
42
43/// Response type for network.slices.slice.syncUserCollections
44pub struct SyncUserCollectionsResponse;
45impl jacquard_common::xrpc::XrpcResp for SyncUserCollectionsResponse {
46    const NSID: &'static str = "network.slices.slice.syncUserCollections";
47    const ENCODING: &'static str = "application/json";
48    type Output<'de> = SyncUserCollectionsOutput<'de>;
49    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
50}
51
52impl<'a> jacquard_common::xrpc::XrpcRequest for SyncUserCollections<'a> {
53    const NSID: &'static str = "network.slices.slice.syncUserCollections";
54    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
55        "application/json",
56    );
57    type Response = SyncUserCollectionsResponse;
58}
59
60/// Endpoint type for network.slices.slice.syncUserCollections
61pub struct SyncUserCollectionsRequest;
62impl jacquard_common::xrpc::XrpcEndpoint for SyncUserCollectionsRequest {
63    const PATH: &'static str = "/xrpc/network.slices.slice.syncUserCollections";
64    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
65        "application/json",
66    );
67    type Request<'de> = SyncUserCollections<'de>;
68    type Response = SyncUserCollectionsResponse;
69}
70
71fn _default_sync_user_collections_timeout_seconds() -> Option<i64> {
72    Some(30i64)
73}