1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use crate::models::EnumStr;

use std::fmt;

#[derive(Debug)]
/// Row Include Flags are documented here:
///   https://smartsheet-platform.github.io/api-docs/#row-cells
pub enum RowIncludeFlags {
    Attachments,
    Columns,
    ColumnType,
    Discussions,
    Filters,
    Format,
    ObjectValue,
    RowPermalink,
    RowWriterInfo,
    WriterInfo,
}

impl EnumStr for RowIncludeFlags {
    fn as_str<'a>(&self) -> &'a str {
        match self {
            Self::Attachments => "attachments",
            Self::Columns => "columns",
            Self::ColumnType => "columnType",
            Self::Discussions => "discussions",
            Self::Filters => "filters",
            Self::Format => "format",
            Self::ObjectValue => "objectValue",
            Self::RowPermalink => "rowPermalink",
            Self::RowWriterInfo => "rowWriterInfo",
            Self::WriterInfo => "writerInfo",
        }
    }
}

impl fmt::Display for RowIncludeFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(self.as_str())
    }
}

#[derive(Debug)]
/// Ref: https://smartsheet-platform.github.io/api-docs/#row-cells
pub enum RowExcludeFlags {
    /// excludes the following attributes from the cell.linkInFromCell object:
    ///   - columnId
    ///   - rowId
    ///   - status
    LinkInFromCellDetails,
    /// excludes the following attributes from the cell.linksOutToCells object:
    ///   - columnId
    ///   - rowId
    ///   - status
    LinkOutToCellDetails,
    /// excludes cells that have never contained any data
    NonExistentCells,
}

impl EnumStr for RowExcludeFlags {
    fn as_str<'a>(&self) -> &'a str {
        match self {
            Self::LinkInFromCellDetails => "linkInFromCellDetails",
            Self::LinkOutToCellDetails => "linksOutToCellsDetails",
            Self::NonExistentCells => "nonexistentCells",
        }
    }
}

impl fmt::Display for RowExcludeFlags {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        f.write_str(self.as_str())
    }
}