smartsheet-python-sdk 3.7.2__py3-none-any.whl → 3.9.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. smartsheet/favorites.py +32 -8
  2. smartsheet/models/__init__.py +11 -0
  3. smartsheet/models/create_report_request.py +107 -0
  4. smartsheet/models/create_report_result.py +105 -0
  5. smartsheet/models/enums/__init__.py +6 -0
  6. smartsheet/models/enums/favorite_type.py +26 -0
  7. smartsheet/models/enums/report_aggregation_type.py +27 -0
  8. smartsheet/models/enums/report_asset_type.py +22 -0
  9. smartsheet/models/enums/report_boolean_operator.py +22 -0
  10. smartsheet/models/enums/report_destination_type.py +22 -0
  11. smartsheet/models/enums/report_filter_operator.py +56 -0
  12. smartsheet/models/enums/seat_type.py +2 -0
  13. smartsheet/models/favorite.py +18 -0
  14. smartsheet/models/report_column_identifier.py +117 -0
  15. smartsheet/models/report_definition.py +98 -0
  16. smartsheet/models/report_destination.py +64 -0
  17. smartsheet/models/report_filter_criterion.py +100 -0
  18. smartsheet/models/report_filter_expression.py +126 -0
  19. smartsheet/models/report_grouping_criterion.py +83 -0
  20. smartsheet/models/report_scope_inclusion.py +68 -0
  21. smartsheet/models/report_sorting_criterion.py +73 -0
  22. smartsheet/models/report_summarizing_criterion.py +73 -0
  23. smartsheet/reports.py +166 -1
  24. smartsheet/smartsheet.py +5 -3
  25. smartsheet/types.py +15 -4
  26. smartsheet/users.py +14 -2
  27. smartsheet/util.py +0 -1
  28. smartsheet/version.py +8 -18
  29. {smartsheet_python_sdk-3.7.2.dist-info → smartsheet_python_sdk-3.9.0.dist-info}/METADATA +1 -1
  30. {smartsheet_python_sdk-3.7.2.dist-info → smartsheet_python_sdk-3.9.0.dist-info}/RECORD +34 -17
  31. {smartsheet_python_sdk-3.7.2.dist-info → smartsheet_python_sdk-3.9.0.dist-info}/WHEEL +1 -1
  32. {smartsheet_python_sdk-3.7.2.dist-info → smartsheet_python_sdk-3.9.0.dist-info}/licenses/LICENSE.md +0 -0
  33. {smartsheet_python_sdk-3.7.2.dist-info → smartsheet_python_sdk-3.9.0.dist-info}/licenses/NOTICE +0 -0
  34. {smartsheet_python_sdk-3.7.2.dist-info → smartsheet_python_sdk-3.9.0.dist-info}/top_level.txt +0 -0
smartsheet/favorites.py CHANGED
@@ -23,6 +23,7 @@ import logging
23
23
 
24
24
  from .util import fresh_operation
25
25
  from .models import Error, Favorite, IndexResult, Result
26
+ from .models.enums import FavoriteType
26
27
 
27
28
 
28
29
  class Favorites:
@@ -92,25 +93,21 @@ class Favorites:
92
93
 
93
94
  return response
94
95
 
95
- def remove_favorites(self, favorite_type, object_ids) -> Union[Result[None], Error]:
96
+ def remove_favorites(self, favorite_type: FavoriteType, object_ids: list[int]) -> Union[Result[None], Error]:
96
97
  """Delete one or more of Favorite objects of the specified type.
97
98
 
98
- Specify a favorite type of: folder, report, sheet,
99
- template, workspace. The object IDs passed in will be deleted in a
100
- batch operation.
101
-
102
99
  Args:
103
- favorite_type (str): Name of favorite type to
104
- manipulate.
100
+ favorite_type FavoriteType: The favorite type enum value.
105
101
  object_ids (list[int]): a comma-separated list
106
102
  of object IDs representing the items to work on.
107
103
 
108
104
  Returns:
109
105
  Union[Result[None], Error]: The result of the operation, or an Error object if the request fails.
110
106
  """
107
+
111
108
  _op = fresh_operation("remove_favorites")
112
109
  _op["method"] = "DELETE"
113
- _op["path"] = "/favorites/" + str(favorite_type)
110
+ _op["path"] = "/favorites/" + favorite_type
114
111
  _op["query_params"]["objectIds"] = object_ids
115
112
 
116
113
  expected = ["Result", None]
@@ -118,3 +115,30 @@ class Favorites:
118
115
  response = self._base.request(prepped_request, expected, _op)
119
116
 
120
117
  return response
118
+
119
+ def is_favorite(self, favorite_type: FavoriteType, favorite_id: int, include=None) -> Union[Favorite, Error]:
120
+ """Check whether an item has been tagged as a favorite for the current user.
121
+
122
+ Args:
123
+ favorite_type FavoriteType: The favorite type enum value.
124
+ favorite_id (int): ID of the favorite being accessed.
125
+ include (str): A comma-separated list of optional elements to
126
+ include in the response. Valid values: "directId", "name".
127
+
128
+ Returns:
129
+ Union[Favorite, Error]: The Favorite object if the item is favorited,
130
+ or an Error object if the request fails or the item is not favorited.
131
+ """
132
+
133
+ _op = fresh_operation("is_favorite")
134
+ _op["method"] = "GET"
135
+ _op["path"] = "/favorites/" + favorite_type + "/" + str(favorite_id)
136
+ if include is not None:
137
+ _op["query_params"]["include"] = include
138
+
139
+ expected = "Favorite"
140
+
141
+ prepped_request = self._base.prepare_request(_op)
142
+ response = self._base.request(prepped_request, expected, _op)
143
+
144
+ return response
@@ -79,11 +79,22 @@ from .predecessor import Predecessor
79
79
  from .predecessor_list import PredecessorList
80
80
  from .project_settings import ProjectSettings
81
81
  from .recipient import Recipient
82
+ from .create_report_request import CreateReportRequest
83
+ from .create_report_result import CreateReportResult
82
84
  from .report import Report
85
+ from .report_summarizing_criterion import ReportSummarizingCriterion
83
86
  from .report_cell import ReportCell
84
87
  from .report_column import ReportColumn
88
+ from .report_column_identifier import ReportColumnIdentifier
89
+ from .report_definition import ReportDefinition
90
+ from .report_destination import ReportDestination
91
+ from .report_filter_criterion import ReportFilterCriterion
92
+ from .report_filter_expression import ReportFilterExpression
93
+ from .report_grouping_criterion import ReportGroupingCriterion
85
94
  from .report_publish import ReportPublish
86
95
  from .report_row import ReportRow
96
+ from .report_sorting_criterion import ReportSortingCriterion
97
+ from .report_scope_inclusion import ReportScopeInclusion
87
98
  from .result import Result
88
99
  from .row import Row
89
100
  from .row_email import RowEmail
@@ -0,0 +1,107 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from __future__ import absolute_import
19
+
20
+ from typing import Optional
21
+
22
+ from ..types import Boolean, String, TypedList, TypedObject, json
23
+ from ..util import deserialize, serialize
24
+
25
+ from .report_column import ReportColumn
26
+ from .report_scope_inclusion import ReportScopeInclusion
27
+ from .report_destination import ReportDestination
28
+ from .report_definition import ReportDefinition
29
+
30
+
31
+ class CreateReportRequest:
32
+ """Smartsheet CreateReportRequest data model."""
33
+
34
+ def __init__(self, props=None, base_obj=None):
35
+ """Initialize the CreateReportRequest model."""
36
+ self._base = None
37
+ if base_obj is not None:
38
+ self._base = base_obj
39
+
40
+ self._name = String()
41
+ self._columns = TypedList(ReportColumn)
42
+ self._scope = TypedList(ReportScopeInclusion)
43
+ self._report_definition = TypedObject(ReportDefinition)
44
+ self._is_summary_report = Boolean()
45
+ self._destination = TypedObject(ReportDestination)
46
+
47
+ if props:
48
+ deserialize(self, props)
49
+
50
+ self.__initialized = True
51
+
52
+ @property
53
+ def name(self) -> Optional[str]:
54
+ return self._name.value
55
+
56
+ @name.setter
57
+ def name(self, value: str) -> None:
58
+ self._name.value = value
59
+
60
+ @property
61
+ def columns(self) -> TypedList:
62
+ return self._columns
63
+
64
+ @columns.setter
65
+ def columns(self, value) -> None:
66
+ self._columns.load(value)
67
+
68
+ @property
69
+ def scope(self) -> TypedList:
70
+ return self._scope
71
+
72
+ @scope.setter
73
+ def scope(self, value) -> None:
74
+ self._scope.load(value)
75
+
76
+ @property
77
+ def report_definition(self):
78
+ return self._report_definition.value
79
+
80
+ @report_definition.setter
81
+ def report_definition(self, value) -> None:
82
+ self._report_definition.value = value
83
+
84
+ @property
85
+ def is_summary_report(self) -> Optional[bool]:
86
+ return self._is_summary_report.value
87
+
88
+ @is_summary_report.setter
89
+ def is_summary_report(self, value: bool) -> None:
90
+ self._is_summary_report.value = value
91
+
92
+ @property
93
+ def destination(self):
94
+ return self._destination.value
95
+
96
+ @destination.setter
97
+ def destination(self, value) -> None:
98
+ self._destination.value = value
99
+
100
+ def to_dict(self):
101
+ return serialize(self)
102
+
103
+ def to_json(self):
104
+ return json.dumps(self.to_dict())
105
+
106
+ def __str__(self):
107
+ return self.to_json()
@@ -0,0 +1,105 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from __future__ import absolute_import
19
+
20
+ from typing import Optional
21
+
22
+ from smartsheet.models.enums.access_level import AccessLevel
23
+ from .report_column import ReportColumn
24
+
25
+ from ..types import Boolean, EnumeratedValue, Number, String, TypedList, json
26
+ from ..util import deserialize, serialize
27
+
28
+
29
+ class CreateReportResult:
30
+ """Smartsheet CreateReportResult data model."""
31
+
32
+ def __init__(self, props=None, base_obj=None):
33
+ """Initialize the CreateReportResult model."""
34
+ self._base = None
35
+ if base_obj is not None:
36
+ self._base = base_obj
37
+
38
+ self._id = Number()
39
+ self._name = String()
40
+ self._access_level = EnumeratedValue(AccessLevel)
41
+ self._permalink = String()
42
+ self._is_summary_report = Boolean()
43
+ self._columns = TypedList(ReportColumn)
44
+
45
+ if props:
46
+ deserialize(self, props)
47
+
48
+ self.__initialized = True
49
+
50
+ @property
51
+ def id(self) -> Optional[int]:
52
+ return self._id.value
53
+
54
+ @id.setter
55
+ def id(self, value: int) -> None:
56
+ self._id.value = value
57
+
58
+ @property
59
+ def name(self) -> Optional[str]:
60
+ return self._name.value
61
+
62
+ @name.setter
63
+ def name(self, value: str) -> None:
64
+ self._name.value = value
65
+
66
+ @property
67
+ def access_level(self):
68
+ return self._access_level.value
69
+
70
+ @access_level.setter
71
+ def access_level(self, value) -> None:
72
+ self._access_level.set(value)
73
+
74
+ @property
75
+ def permalink(self) -> Optional[str]:
76
+ return self._permalink.value
77
+
78
+ @permalink.setter
79
+ def permalink(self, value: str) -> None:
80
+ self._permalink.value = value
81
+
82
+ @property
83
+ def is_summary_report(self) -> Optional[bool]:
84
+ return self._is_summary_report.value
85
+
86
+ @is_summary_report.setter
87
+ def is_summary_report(self, value: bool) -> None:
88
+ self._is_summary_report.value = value
89
+
90
+ @property
91
+ def columns(self) -> TypedList:
92
+ return self._columns
93
+
94
+ @columns.setter
95
+ def columns(self, value) -> None:
96
+ self._columns.load(value)
97
+
98
+ def to_dict(self):
99
+ return serialize(self)
100
+
101
+ def to_json(self):
102
+ return json.dumps(self.to_dict())
103
+
104
+ def __str__(self):
105
+ return self.to_json()
@@ -36,11 +36,17 @@ from .day_ordinal import DayOrdinal
36
36
  from .event_action import EventAction
37
37
  from .event_object_type import EventObjectType
38
38
  from .event_source import EventSource
39
+ from .favorite_type import FavoriteType
39
40
  from .global_template import GlobalTemplate
40
41
  from .operator import Operator
41
42
  from .paper_type import PaperType
42
43
  from .predecessor_type import PredecessorType
43
44
  from .publish_accessible_by import PublishAccessibleBy
45
+ from .report_aggregation_type import ReportAggregationType
46
+ from .report_asset_type import ReportAssetType
47
+ from .report_boolean_operator import ReportBooleanOperator
48
+ from .report_destination_type import ReportDestinationType
49
+ from .report_filter_operator import ReportFilterOperator
44
50
  from .schedule_type import ScheduleType
45
51
  from .share_scope import ShareScope
46
52
  from .share_type import ShareType
@@ -0,0 +1,26 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ from enum import Enum
18
+
19
+
20
+ class FavoriteType(str, Enum):
21
+ FOLDER = "folder"
22
+ REPORT = "report"
23
+ SHEET = "sheet"
24
+ SIGHT = "sight"
25
+ TEMPLATE = "template"
26
+ WORKSPACE = "workspace"
@@ -0,0 +1,27 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ from enum import Enum
18
+
19
+
20
+ class ReportAggregationType(str, Enum):
21
+ SUM = 'SUM'
22
+ AVG = 'AVG'
23
+ MIN = 'MIN'
24
+ MAX = 'MAX'
25
+ COUNT = 'COUNT'
26
+ FIRST = 'FIRST'
27
+ LAST = 'LAST'
@@ -0,0 +1,22 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ from enum import Enum
18
+
19
+
20
+ class ReportAssetType(str, Enum):
21
+ SHEET = 'sheet'
22
+ WORKSPACE = 'workspace'
@@ -0,0 +1,22 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ from enum import Enum
18
+
19
+
20
+ class ReportBooleanOperator(str, Enum):
21
+ AND = 'AND'
22
+ OR = 'OR'
@@ -0,0 +1,22 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ from enum import Enum
18
+
19
+
20
+ class ReportDestinationType(str, Enum):
21
+ WORKSPACE = 'workspace'
22
+ FOLDER = 'folder'
@@ -0,0 +1,56 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2018 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+ from enum import Enum
18
+
19
+
20
+ class ReportFilterOperator(str, Enum):
21
+ EQUAL = 'EQUAL'
22
+ NOT_EQUAL = 'NOT_EQUAL'
23
+ GREATER_THAN = 'GREATER_THAN'
24
+ LESS_THAN = 'LESS_THAN'
25
+ CONTAINS = 'CONTAINS'
26
+ BETWEEN = 'BETWEEN'
27
+ TODAY = 'TODAY'
28
+ PAST = 'PAST'
29
+ FUTURE = 'FUTURE'
30
+ LAST_N_DAYS = 'LAST_N_DAYS'
31
+ NEXT_N_DAYS = 'NEXT_N_DAYS'
32
+ IS_BLANK = 'IS_BLANK'
33
+ IS_NOT_BLANK = 'IS_NOT_BLANK'
34
+ IS_NUMBER = 'IS_NUMBER'
35
+ IS_NOT_NUMBER = 'IS_NOT_NUMBER'
36
+ IS_DATE = 'IS_DATE'
37
+ IS_NOT_DATE = 'IS_NOT_DATE'
38
+ IS_CHECKED = 'IS_CHECKED'
39
+ IS_UNCHECKED = 'IS_UNCHECKED'
40
+ IS_ONE_OF = 'IS_ONE_OF'
41
+ IS_NOT_ONE_OF = 'IS_NOT_ONE_OF'
42
+ LESS_THAN_OR_EQUAL = 'LESS_THAN_OR_EQUAL'
43
+ GREATER_THAN_OR_EQUAL = 'GREATER_THAN_OR_EQUAL'
44
+ DOES_NOT_CONTAIN = 'DOES_NOT_CONTAIN'
45
+ NOT_BETWEEN = 'NOT_BETWEEN'
46
+ NOT_TODAY = 'NOT_TODAY'
47
+ NOT_PAST = 'NOT_PAST'
48
+ NOT_FUTURE = 'NOT_FUTURE'
49
+ NOT_LAST_N_DAYS = 'NOT_LAST_N_DAYS'
50
+ NOT_NEXT_N_DAYS = 'NOT_NEXT_N_DAYS'
51
+ HAS_ANY_OF = 'HAS_ANY_OF'
52
+ HAS_NONE_OF = 'HAS_NONE_OF'
53
+ HAS_ALL_OF = 'HAS_ALL_OF'
54
+ NOT_ALL_OF = 'NOT_ALL_OF'
55
+ MULTI_IS_EQUAL = 'MULTI_IS_EQUAL'
56
+ MULTI_IS_NOT_EQUAL = 'MULTI_IS_NOT_EQUAL'
@@ -5,11 +5,13 @@ class SeatType(str, Enum):
5
5
  GUEST = 'GUEST'
6
6
  MEMBER = 'MEMBER'
7
7
  PROVISIONAL_MEMBER = 'PROVISIONAL_MEMBER'
8
+ CONTRIBUTOR = 'CONTRIBUTOR'
8
9
 
9
10
 
10
11
  class DowngradeSeatType(str, Enum):
11
12
  VIEWER = 'VIEWER'
12
13
  GUEST = 'GUEST'
14
+ CONTRIBUTOR = 'CONTRIBUTOR'
13
15
 
14
16
 
15
17
  class UpgradeSeatType(str, Enum):
@@ -37,6 +37,8 @@ class Favorite:
37
37
 
38
38
  self._object_id = Number()
39
39
  self._type_ = String(accept=self.allowed_values["_type"])
40
+ self._direct_id = String()
41
+ self._name = String()
40
42
 
41
43
  if props:
42
44
  deserialize(self, props)
@@ -71,6 +73,22 @@ class Favorite:
71
73
  def type_(self, value):
72
74
  self._type_.value = value
73
75
 
76
+ @property
77
+ def direct_id(self):
78
+ return self._direct_id.value
79
+
80
+ @direct_id.setter
81
+ def direct_id(self, value):
82
+ self._direct_id.value = value
83
+
84
+ @property
85
+ def name(self):
86
+ return self._name.value
87
+
88
+ @name.setter
89
+ def name(self, value):
90
+ self._name.value = value
91
+
74
92
  def to_dict(self):
75
93
  return serialize(self)
76
94
 
@@ -0,0 +1,117 @@
1
+ # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
2
+ # Smartsheet Python SDK.
3
+ #
4
+ # Copyright 2016 Smartsheet.com, Inc.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"): you may
7
+ # not use this file except in compliance with the License. You may obtain
8
+ # a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations
16
+ # under the License.
17
+
18
+ from __future__ import absolute_import
19
+
20
+ from typing import Optional, Union
21
+
22
+ from ..types import EnumeratedValue, String, Boolean, json
23
+ from ..util import deserialize, serialize
24
+ from .enums import ColumnType, SystemColumnType
25
+
26
+
27
+ class ReportColumnIdentifier:
28
+ """Smartsheet ReportColumnIdentifier data model.
29
+
30
+ Object used to match a sheet column for a report. Either 'type' or 'primary' must be
31
+ specified.
32
+
33
+ **Column Matching Options:**
34
+ - **Regular columns**: Specify 'type' to match columns by type (optionally with 'title'
35
+ for additional matching).
36
+ - **System columns**: Specify both 'type' and 'systemColumnType' to match system columns
37
+ (e.g., Created By, Modified Date).
38
+ - **Sheet name column**: Specify 'type=TEXT_NUMBER' and 'sheetNameColumn=True' to match
39
+ the special "Sheet Name" column.
40
+ - **Primary column**: Specify 'primary=True' to match the primary column. When matching
41
+ primary columns, 'title' can be used to customize the primary column name in the
42
+ rendered report.
43
+
44
+ **Note:** Columns in the report are matched by the combination of 'title' and 'type'
45
+ (and 'systemColumnType' or 'sheetNameColumn' if specified).
46
+
47
+ **Note:** 'symbol' is not used for matching and as a result 'CHECKBOX' or 'PICKLIST'
48
+ columns with different symbols (from different sheets) can be combined into the same
49
+ column in the report. You cannot combine 'CHECKBOX' with 'PICKLIST' into the same column
50
+ in the report because they are different types.
51
+ """
52
+
53
+ def __init__(self, props=None, base_obj=None):
54
+ """Initialize the ReportColumnIdentifier model."""
55
+ self._base = None
56
+ if base_obj is not None:
57
+ self._base = base_obj
58
+
59
+ self._title = String()
60
+ self._type = EnumeratedValue(ColumnType)
61
+ self._system_column_type = EnumeratedValue(SystemColumnType)
62
+ self._primary = Boolean()
63
+ self._sheet_name_column = Boolean()
64
+
65
+ if props:
66
+ deserialize(self, props)
67
+
68
+ self.__initialized = True
69
+
70
+ @property
71
+ def title(self) -> Optional[str]:
72
+ return self._title.value
73
+
74
+ @title.setter
75
+ def title(self, value: str) -> None:
76
+ self._title.value = value
77
+
78
+ @property
79
+ def type(self) -> EnumeratedValue:
80
+ return self._type
81
+
82
+ @type.setter
83
+ def type(self, value: Union[ColumnType, str]) -> None:
84
+ self._type.set(value)
85
+
86
+ @property
87
+ def system_column_type(self) -> EnumeratedValue:
88
+ return self._system_column_type
89
+
90
+ @system_column_type.setter
91
+ def system_column_type(self, value: Union[SystemColumnType, str]) -> None:
92
+ self._system_column_type.set(value)
93
+
94
+ @property
95
+ def primary(self) -> Optional[bool]:
96
+ return self._primary.value
97
+
98
+ @primary.setter
99
+ def primary(self, value: bool) -> None:
100
+ self._primary.value = value
101
+
102
+ @property
103
+ def sheet_name_column(self) -> Optional[bool]:
104
+ return self._sheet_name_column.value
105
+
106
+ @sheet_name_column.setter
107
+ def sheet_name_column(self, value: bool) -> None:
108
+ self._sheet_name_column.value = value
109
+
110
+ def to_dict(self):
111
+ return serialize(self)
112
+
113
+ def to_json(self):
114
+ return json.dumps(self.to_dict())
115
+
116
+ def __str__(self):
117
+ return self.to_json()