smartsheet-python-sdk 3.7.2__py3-none-any.whl → 3.8.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.
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
@@ -36,6 +36,7 @@ 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
@@ -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"
@@ -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
 
smartsheet/version.py CHANGED
@@ -1,5 +1,6 @@
1
- # file generated by setuptools-scm
1
+ # file generated by vcs-versioning
2
2
  # don't change, don't track in version control
3
+ from __future__ import annotations
3
4
 
4
5
  __all__ = [
5
6
  "__version__",
@@ -10,25 +11,14 @@ __all__ = [
10
11
  "commit_id",
11
12
  ]
12
13
 
13
- TYPE_CHECKING = False
14
- if TYPE_CHECKING:
15
- from typing import Tuple
16
- from typing import Union
17
-
18
- VERSION_TUPLE = Tuple[Union[int, str], ...]
19
- COMMIT_ID = Union[str, None]
20
- else:
21
- VERSION_TUPLE = object
22
- COMMIT_ID = object
23
-
24
14
  version: str
25
15
  __version__: str
26
- __version_tuple__: VERSION_TUPLE
27
- version_tuple: VERSION_TUPLE
28
- commit_id: COMMIT_ID
29
- __commit_id__: COMMIT_ID
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
30
20
 
31
- __version__ = version = '3.7.2'
32
- __version_tuple__ = version_tuple = (3, 7, 2)
21
+ __version__ = version = '3.8.0'
22
+ __version_tuple__ = version_tuple = (3, 8, 0)
33
23
 
34
24
  __commit_id__ = commit_id = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smartsheet-python-sdk
3
- Version: 3.7.2
3
+ Version: 3.8.0
4
4
  Summary: Library that uses Python to connect to Smartsheet services (using API 2.0).
5
5
  License-Expression: Apache-2.0
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -5,7 +5,7 @@ smartsheet/contacts.py,sha256=NXOUWLZYytkPSyoo5XaUvp4agL_JDSOn9KqWtEkVvig,2703
5
5
  smartsheet/discussions.py,sha256=xfWiDKOuXdJI0KynVU1cdYryPnsY3oXXau_RLzr63rI,14862
6
6
  smartsheet/events.py,sha256=e8JaaAoDf2LwcKz8nzSOGPtbxT615lz6TB11LTTBRcc,3588
7
7
  smartsheet/exceptions.py,sha256=ISCV4fIAkYgcYMsZL62zDr48qIPPok6N4myifej2M4c,3894
8
- smartsheet/favorites.py,sha256=zLiZavNW-8VuSG8HJtVRNM9wpo7pMQMjwuKhk4GVMEw,4491
8
+ smartsheet/favorites.py,sha256=Gv4w8Icf2KvEnAcZZnH_nYFIkvcyp_FxHNoPPOtt0eA,5492
9
9
  smartsheet/folders.py,sha256=wzpQi1WnIgWTEeP4ukLUcpjxWoqwZUJlVRaCu2XaQCg,16220
10
10
  smartsheet/groups.py,sha256=uPxr6krN08pxwk4XRv65H6989S6SjdF-sT12X7JVhyE,6386
11
11
  smartsheet/home.py,sha256=3klXCDfejwXRsL_n3w_pECm3ugDgSvsWsWmdM-EcTXw,6223
@@ -25,7 +25,7 @@ smartsheet/token.py,sha256=NDej84rGP55yOgkrtgAggL1F0HN3zFH9Xw0r2z-To7s,5128
25
25
  smartsheet/types.py,sha256=aIdRJ89jwclmiZ4RH3hnZHJTFWFxgNKW3d8fghm21eM,9126
26
26
  smartsheet/users.py,sha256=R5ssS7n-rJihyRexqCTZxiY3au8VmWlYwFf_eQMi1d0,21611
27
27
  smartsheet/util.py,sha256=-eNjczPYtmtlnSF28z1lUdb6X_DLsHFPSqG1AJpvj8c,6157
28
- smartsheet/version.py,sha256=U56HPfvEIuf7OLsDIujfkDm-48o-vtgN9ELCjYsmg1s,704
28
+ smartsheet/version.py,sha256=LquZ2PiLwBUfZDl-AcmTob2jcVqOFv3hELKt5TZ7DKU,520
29
29
  smartsheet/webhooks.py,sha256=pihpwFJ-IY8RRwWPlNZN71hdM6IsvzAoOzjSTqMGSi0,5492
30
30
  smartsheet/workspaces.py,sha256=4l2VH4ojvE8Mr5Mnm5xVmSWgk4owJ37eQqA5oE0IocE,25100
31
31
  smartsheet/models/__init__.py,sha256=wJter68K1D2T3Noq4r7SooPhahtdkJBKIrrUwJxymNQ,4860
@@ -69,7 +69,7 @@ smartsheet/models/error_result.py,sha256=kwMIb5YkEcPhpbkqKh63FAVLmvBL_SYt-bjDuGq
69
69
  smartsheet/models/event.py,sha256=GFs2nK2wPfPOCiRlu6qhn0Teu_b2-JcIdA7nlo_TDf0,4050
70
70
  smartsheet/models/event_result.py,sha256=o80wEQHfhqUehKIMPnXOXQGehm2thUpanEbuOotzWxw,2648
71
71
  smartsheet/models/explicit_null.py,sha256=ajwJRTseizgnf2ZY0qf5k97zvNTm033bKduA1OGCm0M,774
72
- smartsheet/models/favorite.py,sha256=BTQumH0o-MQ93AS02qymyIxEVCR_CrwMWfuT0H051dc,2157
72
+ smartsheet/models/favorite.py,sha256=52p3KlDUuNsMRN-3rZNQGJL9jxcjZtnGsimTA-WSK8w,2537
73
73
  smartsheet/models/folder.py,sha256=WOLaECb18w07tn5PuRpF0aNiovZ9I3B9oH5-1QMgoi8,4325
74
74
  smartsheet/models/font_family.py,sha256=32tBgd0w58dWco3goN4NZ9eMafaU3szzXYdQudGmeUM,1646
75
75
  smartsheet/models/format_details.py,sha256=DwVi1XpXq__lFa1WQHzciE9s8nJltUmfq9l7xTM4uec,1542
@@ -150,7 +150,7 @@ smartsheet/models/widget.py,sha256=G5UKR1latGSuXqm-MCRQxn9W7IJgo2FsUWJ9heEW0RA,6
150
150
  smartsheet/models/widget_content.py,sha256=hxv3DJWO8YPe4ND-HUZ59eOVU9LAy02owU-KQVWUsDU,1525
151
151
  smartsheet/models/widget_hyperlink.py,sha256=JPjaSftHFHiFj48tfOckGWzrew_CLKmE2k9lUA_RQSk,2059
152
152
  smartsheet/models/workspace.py,sha256=_YT4i4DEK32kEyqlWixZUQSQyBiZkNtwtSmuhc98H2s,4522
153
- smartsheet/models/enums/__init__.py,sha256=3WfK4QQnd0zHCchGFalzKqkuYIwSTOxBAhdS3IOhldA,2356
153
+ smartsheet/models/enums/__init__.py,sha256=0BtIiNRFPMpoFsnVEFa3ZBpYbVVF9p4ZTuTpHQk2whw,2396
154
154
  smartsheet/models/enums/access_level.py,sha256=LvKh3Z2LrFeLm-R-dT0qOVinBsA4jEOxM02flg0LFaY,816
155
155
  smartsheet/models/enums/asset_type.py,sha256=hrNXZDk_mme57f-0wO86mk_RwzNP8zkb9h7GAEZbhjQ,253
156
156
  smartsheet/models/enums/attachment_parent_type.py,sha256=EFcrHg8xpx_ZxrrGb3vkk9Ji8PD74Q8GeWhXZMquVEw,770
@@ -169,6 +169,7 @@ smartsheet/models/enums/day_ordinal.py,sha256=Wg2H2oOefSEH5hMJyo5vZ8Ge4_D6lXbq6p
169
169
  smartsheet/models/enums/event_action.py,sha256=zO8QQN1doN5FaxuWtLMRQWRwDZ-iQ_aaq-jl9SlIUto,2005
170
170
  smartsheet/models/enums/event_object_type.py,sha256=hB_J5FfiNJuaodxgjjcNehL1e8Pooq1yVtgP_ITS7lI,946
171
171
  smartsheet/models/enums/event_source.py,sha256=tB9IEhZY4JvOUxX0qjckturiWMLF8S05gFh557DvjNk,847
172
+ smartsheet/models/enums/favorite_type.py,sha256=YgQMRzVtk_UzMhmAXIhvF42HQW7i9DTltjD2sqKznMA,863
172
173
  smartsheet/models/enums/global_template.py,sha256=NQjHD1h9rn7B4CvOAeJzRVisCoGmlcdn_t-ZGaE7rTQ,782
173
174
  smartsheet/models/enums/operator.py,sha256=fREabjb27V-vt2KDHZpDFwLf75TrAQwTte6S0OrEU0U,1606
174
175
  smartsheet/models/enums/paper_type.py,sha256=vh0VrF6G9xB5Kdt979I51wulnTqYl8hMrXoUaR0MXUo,828
@@ -187,9 +188,9 @@ smartsheet/models/enums/system_column_type.py,sha256=UfhNUBGD_0K1Pas7fujGEuax55O
187
188
  smartsheet/models/enums/update_request_status.py,sha256=xYF84x1dTFhJMYVi1q3G1T9u1IGN3szlR1jj5HHC0hE,777
188
189
  smartsheet/models/enums/user_status.py,sha256=SB7qRcA0dhdRimsOKHCGF3CB6fL0XuifxQEWZGNNS8Q,766
189
190
  smartsheet/models/enums/widget_type.py,sha256=VfVq59fLZsT4ks_ZBrtv52u2Cl60iAdlA6mGD_elz-k,1072
190
- smartsheet_python_sdk-3.7.2.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
191
- smartsheet_python_sdk-3.7.2.dist-info/licenses/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
192
- smartsheet_python_sdk-3.7.2.dist-info/METADATA,sha256=QUH-3fsmyGvlmBTQ5uyTGarnTEZCsjHr6Qw5bhz_x24,5618
193
- smartsheet_python_sdk-3.7.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
194
- smartsheet_python_sdk-3.7.2.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
195
- smartsheet_python_sdk-3.7.2.dist-info/RECORD,,
191
+ smartsheet_python_sdk-3.8.0.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
192
+ smartsheet_python_sdk-3.8.0.dist-info/licenses/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
193
+ smartsheet_python_sdk-3.8.0.dist-info/METADATA,sha256=OMF57tGu0DFiu5ildgVDHV0XclhO5wQCrL1rkm6GnJw,5618
194
+ smartsheet_python_sdk-3.8.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
195
+ smartsheet_python_sdk-3.8.0.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
196
+ smartsheet_python_sdk-3.8.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.2)
2
+ Generator: setuptools (82.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5