pipedrive_rs/models/add_or_update_role_setting_request.rs
1/*
2 * Pipedrive API v1
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AddOrUpdateRoleSettingRequest {
16 #[serde(rename = "setting_key")]
17 pub setting_key: SettingKey,
18 /// Possible values for the `default_visibility` setting depending on the subscription plan:<br> <table class='role-setting'> <caption><b>Essential / Advanced plan</b></caption> <tr><th><b>Value</b></th><th><b>Description</b></th></tr> <tr><td>`1`</td><td>Owner & Followers</td></tr> <tr><td>`3`</td><td>Entire company</td></tr> </table> <br> <table class='role-setting'> <caption><b>Professional / Enterprise plan</b></caption> <tr><th><b>Value</b></th><th><b>Description</b></th></tr> <tr><td>`1`</td><td>Owner only</td></tr> <tr><td>`3`</td><td>Owner's visibility group</td></tr> <tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr> <tr><td>`7`</td><td>Entire company</td></tr> </table> <br> Read more about visibility groups <a href='https://support.pipedrive.com/en/article/visibility-groups'>here</a>.
19 #[serde(rename = "value")]
20 pub value: Value,
21}
22
23impl AddOrUpdateRoleSettingRequest {
24 pub fn new(setting_key: SettingKey, value: Value) -> AddOrUpdateRoleSettingRequest {
25 AddOrUpdateRoleSettingRequest {
26 setting_key,
27 value,
28 }
29 }
30}
31
32///
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum SettingKey {
35 #[serde(rename = "deal_default_visibility")]
36 DealDefaultVisibility,
37 #[serde(rename = "lead_default_visibility")]
38 LeadDefaultVisibility,
39 #[serde(rename = "org_default_visibility")]
40 OrgDefaultVisibility,
41 #[serde(rename = "person_default_visibility")]
42 PersonDefaultVisibility,
43 #[serde(rename = "product_default_visibility")]
44 ProductDefaultVisibility,
45}
46
47impl Default for SettingKey {
48 fn default() -> SettingKey {
49 Self::DealDefaultVisibility
50 }
51}
52/// Possible values for the `default_visibility` setting depending on the subscription plan:<br> <table class='role-setting'> <caption><b>Essential / Advanced plan</b></caption> <tr><th><b>Value</b></th><th><b>Description</b></th></tr> <tr><td>`1`</td><td>Owner & Followers</td></tr> <tr><td>`3`</td><td>Entire company</td></tr> </table> <br> <table class='role-setting'> <caption><b>Professional / Enterprise plan</b></caption> <tr><th><b>Value</b></th><th><b>Description</b></th></tr> <tr><td>`1`</td><td>Owner only</td></tr> <tr><td>`3`</td><td>Owner's visibility group</td></tr> <tr><td>`5`</td><td>Owner's visibility group and sub-groups</td></tr> <tr><td>`7`</td><td>Entire company</td></tr> </table> <br> Read more about visibility groups <a href='https://support.pipedrive.com/en/article/visibility-groups'>here</a>.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum Value {
55 #[serde(rename = "1")]
56 Variant1,
57 #[serde(rename = "3")]
58 Variant3,
59 #[serde(rename = "5")]
60 Variant5,
61 #[serde(rename = "7")]
62 Variant7,
63}
64
65impl Default for Value {
66 fn default() -> Value {
67 Self::Variant1
68 }
69}
70