Skip to main content

hanzo_client/models/
function_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 FunctionView {
16    /// mean wall-clock of those runs
17    #[serde(rename = "avgDurationMs", skip_serializing_if = "Option::is_none")]
18    pub avg_duration_ms: Option<f64>,
19    /// when it was first published
20    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
21    pub created_at: Option<String>,
22    /// the path that invokes it
23    #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none")]
24    pub endpoint: Option<String>,
25    /// how many secret NAMES it mounts; values are never carried
26    #[serde(rename = "envCount", skip_serializing_if = "Option::is_none")]
27    pub env_count: Option<i32>,
28    /// the language it runs under
29    #[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
30    pub environment: Option<String>,
31    /// how many of those runs failed
32    #[serde(rename = "errors7d", skip_serializing_if = "Option::is_none")]
33    pub errors7d: Option<i32>,
34    /// the prebuilt image it runs, when it runs one instead of source
35    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
36    pub image: Option<String>,
37    /// runs in the last 7 days; ABSENT, never 0, when it has not run
38    #[serde(rename = "invocations7d", skip_serializing_if = "Option::is_none")]
39    pub invocations7d: Option<i32>,
40    /// when its code last changed
41    #[serde(rename = "lastDeployedAt", skip_serializing_if = "Option::is_none")]
42    pub last_deployed_at: Option<String>,
43    /// the memory it runs with, and the multiplier on its compute charge
44    #[serde(rename = "memoryLimit", skip_serializing_if = "Option::is_none")]
45    pub memory_limit: Option<String>,
46    /// the function's org-unique handle
47    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
48    pub name: Option<String>,
49    /// the display group it belongs to; the org is the isolation key
50    #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
51    pub namespace: Option<String>,
52    /// whether it is ready to serve
53    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
54    pub status: Option<String>,
55    /// share of those runs that succeeded, 0..1
56    #[serde(rename = "successRate", skip_serializing_if = "Option::is_none")]
57    pub success_rate: Option<f64>,
58    /// where it runs: empty for the sandbox, \"fleet\" for the org's GPU fleet
59    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
60    pub target: Option<String>,
61    /// its per-invocation deadline
62    #[serde(rename = "timeoutSec", skip_serializing_if = "Option::is_none")]
63    pub timeout_sec: Option<i32>,
64}
65
66impl FunctionView {
67    pub fn new() -> FunctionView {
68        FunctionView {
69            avg_duration_ms: None,
70            created_at: None,
71            endpoint: None,
72            env_count: None,
73            environment: None,
74            errors7d: None,
75            image: None,
76            invocations7d: None,
77            last_deployed_at: None,
78            memory_limit: None,
79            name: None,
80            namespace: None,
81            status: None,
82            success_rate: None,
83            target: None,
84            timeout_sec: None,
85        }
86    }
87}
88