Skip to main content

nym_api_requests/models/
utility.rs

1// Copyright 2025 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: Apache-2.0
3
4use serde::{Deserialize, Serialize};
5use time::OffsetDateTime;
6use utoipa::ToSchema;
7
8#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
9pub struct RefreshMixnetContractCacheRequestBody {
10    // for now no additional data is needed, but keep the struct for easier changes down the line
11}
12
13#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
14pub struct RefreshMixnetContractCacheResponse {
15    pub success: bool,
16}
17
18#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
19pub struct MixnetContractCacheTimestampResponse {
20    #[serde(with = "time::serde::rfc3339")]
21    #[schema(value_type = String)]
22    pub timestamp: OffsetDateTime,
23}
24
25#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
26pub struct RefreshNodeStatusCacheRequestBody {
27    // for now no additional data is needed, but keep the struct for easier changes down the line
28}
29
30#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
31pub struct RefreshNodeStatusCacheResponse {
32    pub success: bool,
33}
34
35#[derive(Clone, Debug, Serialize, Deserialize, ToSchema)]
36pub struct NodeStatusCacheTimestampResponse {
37    #[serde(with = "time::serde::rfc3339")]
38    #[schema(value_type = String)]
39    pub timestamp: OffsetDateTime,
40}