Skip to main content

dinio_sdk/models/
free_domain.rs

1use serde::{Deserialize, Serialize};
2
3/// The platform's free domains (`GET /free-domains`): below each, any user can lease one
4/// subdomain as their own zone, with
5/// [`Zones::create`](crate::api::Zones::create).
6#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
7pub struct FreeDomainList {
8    /// The free domains, e.g. `dinio.eu`.
9    pub domains: Vec<String>,
10    /// Leases per user across all free domains (an Admin has no limit).
11    pub limit: u32,
12}
13
14/// Whether `<label>.<domain>` can be leased now (`GET /free-domains/:domain/available`).
15#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
16pub struct FreeLabelAvailability {
17    /// The full name, e.g. `myhome.dinio.eu`.
18    pub name: String,
19    /// Whether it can be leased.
20    pub available: bool,
21    /// Why not, in words, when `available` is `false` (taken, reserved, too short, …).
22    #[serde(default, skip_serializing_if = "Option::is_none")]
23    pub reason: Option<String>,
24}