Skip to main content

hanzo_client/models/
agent_binding.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 AgentBinding {
16    /// AgentName is the cloud Agent (/v1/agents) this machine runs — the agent a message to the bot is actually run against. It is the one field that decides what the bot DOES.
17    #[serde(rename = "agentName", skip_serializing_if = "Option::is_none")]
18    pub agent_name: Option<String>,
19    /// BotVersion pins the @hanzo/bot runtime version the machine runs. Empty means the machine took the default in force when it was bound.
20    #[serde(rename = "botVersion", skip_serializing_if = "Option::is_none")]
21    pub bot_version: Option<String>,
22    /// CreatedTime is when the binding was first made.
23    #[serde(rename = "createdTime", skip_serializing_if = "Option::is_none")]
24    pub created_time: Option<String>,
25    /// MachineId is the bound machine as vm addresses it, owner-qualified (\"<org>/<machine>\"). The unqualified half is what this surface's :id routes take.
26    #[serde(rename = "machineId", skip_serializing_if = "Option::is_none")]
27    pub machine_id: Option<String>,
28    /// Message is vm's human-readable detail on Status (\"machine provisioning; @hanzo/bot runtime not yet confirmed\") — the reason behind the state, not a second state.
29    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
30    pub message: Option<String>,
31    /// Name is the binding's own key, which is the machine's id: a machine hosts at most one agent, so the binding is named for it. This is the key a bots list joins bindings onto machines by.
32    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
33    pub name: Option<String>,
34    /// Org is the Hanzo tenant the binding belongs to.
35    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
36    pub org: Option<String>,
37    /// Owner is the tenant vm filed the binding under, resolved from the ?owner it was called with — which is the caller's validated org and never a body field.
38    #[serde(rename = "owner", skip_serializing_if = "Option::is_none")]
39    pub owner: Option<String>,
40    /// Provider is the cloud the bound machine runs on, carried here so a bindings list says where each bot lives without a second read per machine.
41    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
42    pub provider: Option<String>,
43    /// PublicIp is the bound machine's public address as vm recorded it on the binding. Empty while the machine has none yet.
44    #[serde(rename = "publicIp", skip_serializing_if = "Option::is_none")]
45    pub public_ip: Option<String>,
46    /// Status is the binding's lifecycle in VM's OWN words — \"Pending\" while the machine provisions and the runtime is unconfirmed, \"running\" once vm has confirmed it. The vocabulary is vm's and passes through unmapped, which is why its capitalization does not match the machine states beside it, and it is vm's reconciled reading rather than anything asserted here.
47    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
48    pub status: Option<String>,
49    /// UpdatedTime is when vm last reconciled it — the age of Status.
50    #[serde(rename = "updatedTime", skip_serializing_if = "Option::is_none")]
51    pub updated_time: Option<String>,
52}
53
54impl AgentBinding {
55    pub fn new() -> AgentBinding {
56        AgentBinding {
57            agent_name: None,
58            bot_version: None,
59            created_time: None,
60            machine_id: None,
61            message: None,
62            name: None,
63            org: None,
64            owner: None,
65            provider: None,
66            public_ip: None,
67            status: None,
68            updated_time: None,
69        }
70    }
71}
72