hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * 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 FunctionView {
    /// mean wall-clock of those runs
    #[serde(rename = "avgDurationMs", skip_serializing_if = "Option::is_none")]
    pub avg_duration_ms: Option<f64>,
    /// when it was first published
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// the path that invokes it
    #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none")]
    pub endpoint: Option<String>,
    /// how many secret NAMES it mounts; values are never carried
    #[serde(rename = "envCount", skip_serializing_if = "Option::is_none")]
    pub env_count: Option<i32>,
    /// the language it runs under
    #[serde(rename = "environment", skip_serializing_if = "Option::is_none")]
    pub environment: Option<String>,
    /// how many of those runs failed
    #[serde(rename = "errors7d", skip_serializing_if = "Option::is_none")]
    pub errors7d: Option<i32>,
    /// the prebuilt image it runs, when it runs one instead of source
    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    /// runs in the last 7 days; ABSENT, never 0, when it has not run
    #[serde(rename = "invocations7d", skip_serializing_if = "Option::is_none")]
    pub invocations7d: Option<i32>,
    /// when its code last changed
    #[serde(rename = "lastDeployedAt", skip_serializing_if = "Option::is_none")]
    pub last_deployed_at: Option<String>,
    /// the memory it runs with, and the multiplier on its compute charge
    #[serde(rename = "memoryLimit", skip_serializing_if = "Option::is_none")]
    pub memory_limit: Option<String>,
    /// the function's org-unique handle
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// the display group it belongs to; the org is the isolation key
    #[serde(rename = "namespace", skip_serializing_if = "Option::is_none")]
    pub namespace: Option<String>,
    /// whether it is ready to serve
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// share of those runs that succeeded, 0..1
    #[serde(rename = "successRate", skip_serializing_if = "Option::is_none")]
    pub success_rate: Option<f64>,
    /// where it runs: empty for the sandbox, \"fleet\" for the org's GPU fleet
    #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
    pub target: Option<String>,
    /// its per-invocation deadline
    #[serde(rename = "timeoutSec", skip_serializing_if = "Option::is_none")]
    pub timeout_sec: Option<i32>,
}

impl FunctionView {
    pub fn new() -> FunctionView {
        FunctionView {
            avg_duration_ms: None,
            created_at: None,
            endpoint: None,
            env_count: None,
            environment: None,
            errors7d: None,
            image: None,
            invocations7d: None,
            last_deployed_at: None,
            memory_limit: None,
            name: None,
            namespace: None,
            status: None,
            success_rate: None,
            target: None,
            timeout_sec: None,
        }
    }
}