Skip to main content

hanzo_client/models/
edge_state.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EdgeState {
16    /// Configured is whether the edge holds credentials to act at all. False means every purge is a no-op.
17    #[serde(rename = "configured", skip_serializing_if = "Option::is_none")]
18    pub configured: Option<bool>,
19    /// Error is the blocker, so an operator reads it instead of guessing at it.
20    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
21    pub error: Option<String>,
22    /// Freshness says, in one phrase, how long after a publish a reader sees it. It is the sentence an operator actually wants; the booleans above are how a machine reads the same fact.
23    #[serde(rename = "freshness", skip_serializing_if = "Option::is_none")]
24    pub freshness: Option<String>,
25    /// Policy is the Cache-Control this edge serves each class of object with. It is DERIVED from the one canonical function, never a second copy: half the confusion when a publish looks stale is not knowing what the TTLs are, and reading them out of the source is not something an operator should have to do to answer \"how long until this is live\".
26    #[serde(rename = "policy", skip_serializing_if = "Option::is_none")]
27    pub policy: Option<std::collections::HashMap<String, String>>,
28    /// Provider is the CDN behind this edge, or \"none\". It is the first thing an operator wants and the only vendor name this API returns.
29    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
30    pub provider: Option<String>,
31    /// Reach is the apexes a publish is invalidated on. A site is served on more than one — the site plane's own and the first-party apex — and a purge that covers one of them looks identical from here to a purge that covers both.
32    #[serde(rename = "reach", skip_serializing_if = "Option::is_none")]
33    pub reach: Option<Vec<String>>,
34    /// Status is \"ok\" when a publish reaches readers immediately, else \"degraded\".
35    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
36    pub status: Option<String>,
37}
38
39impl EdgeState {
40    pub fn new() -> EdgeState {
41        EdgeState {
42            configured: None,
43            error: None,
44            freshness: None,
45            policy: None,
46            provider: None,
47            reach: None,
48            status: None,
49        }
50    }
51}
52