hanzo_client/models/sync_view.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 SyncView {
16 /// Actor is the identity a reconcile writes AS. It is the loop guard: a change this identity made is one we already have, so it is not synced back.
17 #[serde(rename = "actor", skip_serializing_if = "Option::is_none")]
18 pub actor: Option<String>,
19 /// CreatedAt is when the link was first declared, RFC3339 in UTC.
20 #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
21 pub created_at: Option<String>,
22 /// Direction is which way work flows: \"both\", \"pull\" (target ← source), \"push\" (source → target), or \"off\" — which keeps the link declared and moves nothing.
23 #[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
24 pub direction: Option<String>,
25 /// ID is the link's handle, derived from its source and target — which is what makes re-declaring the same pair an update rather than a duplicate.
26 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
27 pub id: Option<String>,
28 /// Kind is what is being synced. \"git\" today; the field exists so a storage or database link is a value here rather than a second route family.
29 #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
30 pub kind: Option<String>,
31 /// Source is the side read FROM on a pull.
32 #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
33 pub source: Option<Box<models::EndpointView>>,
34 /// Target is the side written TO on a push.
35 #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
36 pub target: Option<Box<models::EndpointView>>,
37 /// Trigger is what starts a reconcile: \"webhook\" (the provider tells us), \"poll\" (we ask on a schedule), or \"manual\" (only an explicit call).
38 #[serde(rename = "trigger", skip_serializing_if = "Option::is_none")]
39 pub trigger: Option<String>,
40 /// UpdatedAt is bumped by every reconcile, so it reads as the LAST-SYNCED time rather than the last edit. Absent until the first one runs.
41 #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
42 pub updated_at: Option<String>,
43}
44
45impl SyncView {
46 pub fn new() -> SyncView {
47 SyncView {
48 actor: None,
49 created_at: None,
50 direction: None,
51 id: None,
52 kind: None,
53 source: None,
54 target: None,
55 trigger: None,
56 updated_at: None,
57 }
58 }
59}
60