Skip to main content

hanzo_client/models/
endpoint.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 Endpoint {
16    /// CreatedAt is when the endpoint was registered, RFC3339 in UTC — stored in that spelling because it sorts as a string.
17    #[serde(rename = "created", skip_serializing_if = "Option::is_none")]
18    pub created: Option<String>,
19    /// Deliveries7d is how many deliveries SETTLED in the trailing 7 days — the attempts that ended ok or failed, so a delivery still retrying is in neither counter yet. It is counted from the log at read time rather than stored, and it is filled only on a list or a get; a create answers 0 because there is no history, which is why it is never omitted.
20    #[serde(rename = "deliveries7d", skip_serializing_if = "Option::is_none")]
21    pub deliveries7d: Option<i32>,
22    /// Description is the operator's own label for the endpoint. Never sent anywhere.
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// Events are the subject patterns this endpoint subscribes to (\"commerce.order.>\"). An EMPTY list means every event, not none.
26    #[serde(rename = "events", skip_serializing_if = "Option::is_none")]
27    pub events: Option<Vec<String>>,
28    /// Failures7d is how many of those settled as failed — the subscriber never accepted it and no further attempt will be made. It is the numerator to Deliveries7d, over the same window.
29    #[serde(rename = "failures7d", skip_serializing_if = "Option::is_none")]
30    pub failures7d: Option<i32>,
31    /// ID is the endpoint's handle, server-minted and stable for its life. It is what every other route here addresses.
32    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
33    pub id: Option<String>,
34    /// Org is the tenant that owns the endpoint, taken from the validated principal rather than from any request field.
35    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
36    pub org: Option<String>,
37    /// Secret is the HMAC-SHA256 signing key a subscriber recomputes the signature with. It is returned exactly ONCE, on create: a later read of the endpoint omits it, so a lost secret is replaced rather than recovered.
38    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
39    pub secret: Option<String>,
40    /// Status is \"active\" or \"disabled\" — nothing else is accepted. A disabled endpoint keeps its subscription and receives no deliveries, except a manual test send, which goes out anyway.
41    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
42    pub status: Option<String>,
43    /// UpdatedAt is when its url, events, status or description last changed.
44    #[serde(rename = "updated", skip_serializing_if = "Option::is_none")]
45    pub updated: Option<String>,
46    /// URL is where the POST goes. Changing it is the one edit that redirects an org's events, which is why it is never bindable from a query string.
47    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
48    pub url: Option<String>,
49}
50
51impl Endpoint {
52    pub fn new() -> Endpoint {
53        Endpoint {
54            created: None,
55            deliveries7d: None,
56            description: None,
57            events: None,
58            failures7d: None,
59            id: None,
60            org: None,
61            secret: None,
62            status: None,
63            updated: None,
64            url: None,
65        }
66    }
67}
68