Skip to main content

hanzo_client/models/
assignment.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 Assignment {
16    /// Trial is the experiment that was evaluated.
17    #[serde(rename = "experiment", skip_serializing_if = "Option::is_none")]
18    pub experiment: Option<String>,
19    /// On is false when the flag returned nothing for this subject, which means the subject is not enrolled — not an error.
20    #[serde(rename = "on", skip_serializing_if = "Option::is_none")]
21    pub on: Option<bool>,
22    #[serde(rename = "payload", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub payload: Option<Option<serde_json::Value>>,
24    /// Subject is the unit that was bucketed.
25    #[serde(rename = "subject", skip_serializing_if = "Option::is_none")]
26    pub subject: Option<String>,
27    /// Arm is the arm the subject falls in, empty when the flag enrolled it in none.
28    #[serde(rename = "variant", skip_serializing_if = "Option::is_none")]
29    pub variant: Option<String>,
30}
31
32impl Assignment {
33    pub fn new() -> Assignment {
34        Assignment {
35            experiment: None,
36            on: None,
37            payload: None,
38            subject: None,
39            variant: None,
40        }
41    }
42}
43