hanzo_client/models/score_config_req.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 ScoreConfigReq {
16 /// Categories is the closed set of labels a CATEGORICAL score may carry. A CATEGORICAL rubric with none is refused.
17 #[serde(rename = "categories", skip_serializing_if = "Option::is_none")]
18 pub categories: Option<Vec<String>>,
19 /// DataType is NUMERIC (the default), CATEGORICAL or BOOLEAN.
20 #[serde(rename = "dataType", skip_serializing_if = "Option::is_none")]
21 pub data_type: Option<String>,
22 /// MaxValue is the inclusive ceiling a NUMERIC score must stay under, finite.
23 #[serde(rename = "maxValue", skip_serializing_if = "Option::is_none")]
24 pub max_value: Option<f64>,
25 /// MinValue is the inclusive floor a NUMERIC score must clear. It must be finite and must not exceed MaxValue.
26 #[serde(rename = "minValue", skip_serializing_if = "Option::is_none")]
27 pub min_value: Option<f64>,
28 /// Name is the score name this rubric governs, matching ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$. The name is the key, so re-posting one replaces its rules.
29 #[serde(rename = "name")]
30 pub name: String,
31}
32
33impl ScoreConfigReq {
34 pub fn new(name: String) -> ScoreConfigReq {
35 ScoreConfigReq {
36 categories: None,
37 data_type: None,
38 max_value: None,
39 min_value: None,
40 name,
41 }
42 }
43}
44