1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Hanzo Cloud API
*
* 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/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Endpoint {
/// CreatedAt is when the endpoint was registered, RFC3339 in UTC — stored in that spelling because it sorts as a string.
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
/// 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.
#[serde(rename = "deliveries7d", skip_serializing_if = "Option::is_none")]
pub deliveries7d: Option<i32>,
/// Description is the operator's own label for the endpoint. Never sent anywhere.
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// Events are the subject patterns this endpoint subscribes to (\"commerce.order.>\"). An EMPTY list means every event, not none.
#[serde(rename = "events", skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<String>>,
/// 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.
#[serde(rename = "failures7d", skip_serializing_if = "Option::is_none")]
pub failures7d: Option<i32>,
/// ID is the endpoint's handle, server-minted and stable for its life. It is what every other route here addresses.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// Org is the tenant that owns the endpoint, taken from the validated principal rather than from any request field.
#[serde(rename = "org", skip_serializing_if = "Option::is_none")]
pub org: Option<String>,
/// 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.
#[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
pub secret: Option<String>,
/// 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.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// UpdatedAt is when its url, events, status or description last changed.
#[serde(rename = "updated", skip_serializing_if = "Option::is_none")]
pub updated: Option<String>,
/// 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.
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl Endpoint {
pub fn new() -> Endpoint {
Endpoint {
created: None,
deliveries7d: None,
description: None,
events: None,
failures7d: None,
id: None,
org: None,
secret: None,
status: None,
updated: None,
url: None,
}
}
}