Skip to main content

nym_node_requests/api/v2/node/
models.rs

1// Copyright 2026 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: GPL-3.0-only
3
4use crate::api::v1::node::models::AnnouncePorts;
5use celes::Country;
6use schemars::JsonSchema;
7use serde::{Deserialize, Serialize};
8
9/// Auxiliary details of the associated Nym Node.
10#[derive(Clone, Debug, Default, Serialize, Deserialize, JsonSchema)]
11#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
12pub struct AuxiliaryDetailsV2 {
13    /// Optional ISO 3166 alpha-2 two-letter country code of the node's **physical** location
14    #[cfg_attr(feature = "openapi", schema(example = "PL", value_type = Option<String>))]
15    #[schemars(with = "Option<String>")]
16    #[schemars(length(equal = 2))]
17    pub location: Option<Country>,
18
19    /// On-chain address of this node
20    pub address: String,
21
22    #[serde(default)]
23    pub announce_ports: AnnouncePorts,
24
25    /// Specifies whether this node operator has agreed to the terms and conditions
26    /// as defined at <https://nymtech.net/terms-and-conditions/operators/v1.0.0>
27    // make sure to include the default deserialisation as this field hasn't existed when the struct was first created
28    #[serde(default)]
29    pub accepted_operator_terms_and_conditions: bool,
30}