sendinblue_v3/models/
create_attribute.rs

1/*
2 * SendinBlue API
3 *
4 * SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to :   - Manage your campaigns and get the statistics   - Manage your contacts   - Send transactional Emails and SMS   - and much more...  You can download our wrappers at https://github.com/orgs/sendinblue  **Possible responses**   | Code | Message |   | :-------------: | ------------- |   | 200  | OK. Successful Request  |   | 201  | OK. Successful Creation |   | 202  | OK. Request accepted |   | 204  | OK. Successful Update/Deletion  |   | 400  | Error. Bad Request  |   | 401  | Error. Authentication Needed  |   | 402  | Error. Not enough credit, plan upgrade needed  |   | 403  | Error. Permission denied  |   | 404  | Error. Object does not exist |   | 405  | Error. Method not allowed  |   | 406  | Error. Not Acceptable  | 
5 *
6 * The version of the OpenAPI document: 3.0.0
7 * Contact: contact@sendinblue.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct CreateAttribute {
16    /// Value of the attribute. Use only if the attribute's category is 'calculated' or 'global'
17    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
18    pub value: Option<String>,
19    /// List of values and labels that the attribute can take. Use only if the attribute's category is \"category\". For example, [{\"value\":1, \"label\":\"male\"}, {\"value\":2, \"label\":\"female\"}]
20    #[serde(rename = "enumeration", skip_serializing_if = "Option::is_none")]
21    pub enumeration: Option<Vec<crate::models::CreateAttributeEnumerationInner>>,
22    /// Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
23    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
24    pub r#type: Option<RHashType>,
25}
26
27impl CreateAttribute {
28    pub fn new() -> CreateAttribute {
29        CreateAttribute {
30            value: None,
31            enumeration: None,
32            r#type: None,
33        }
34    }
35}
36
37/// Type of the attribute. Use only if the attribute's category is 'normal', 'category' or 'transactional' ( type 'boolean' is only available if the category is 'normal' attribute, type 'id' is only available if the category is 'transactional' attribute & type 'category' is only available if the category is 'category' attribute )
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum RHashType {
40    #[serde(rename = "text")]
41    Text,
42    #[serde(rename = "date")]
43    Date,
44    #[serde(rename = "float")]
45    Float,
46    #[serde(rename = "boolean")]
47    Boolean,
48    #[serde(rename = "id")]
49    Id,
50    #[serde(rename = "category")]
51    Category,
52}
53
54impl Default for RHashType {
55    fn default() -> RHashType {
56        Self::Text
57    }
58}
59