smartsheet-python-sdk 3.7.0__py3-none-any.whl → 3.7.2__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
@@ -17,7 +17,7 @@
17
17
 
18
18
  from __future__ import absolute_import
19
19
 
20
- from typing import Union
20
+ from typing import Union, List
21
21
 
22
22
  import logging
23
23
 
@@ -34,7 +34,7 @@ class Favorites:
34
34
  self._base = smartsheet_obj
35
35
  self._log = logging.getLogger(__name__)
36
36
 
37
- def add_favorites(self, favorite_obj) -> Union[Result[Favorite], Error]:
37
+ def add_favorites(self, favorite_obj) -> Union[Result[Union[Favorite, List[Favorite]]], Error]:
38
38
  """Add one or more items to the user's list of Favorite items.
39
39
 
40
40
  Adds one or more items to the user's list of Favorite
@@ -50,7 +50,8 @@ class Favorites:
50
50
  more Favorite objects
51
51
 
52
52
  Returns:
53
- Union[Result[Favorite], Error]: The result of the operation, or an Error object if the request fails.
53
+ Union[Result[Union[Favorite, List[Favorite]]], Error]: The result of the operation - either a list or a
54
+ single object, or an Error object if the request fails.
54
55
  """
55
56
  _op = fresh_operation("add_favorites")
56
57
  _op["method"] = "POST"
smartsheet/groups.py CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  from __future__ import absolute_import
19
19
 
20
- from typing import Union
20
+ from typing import Union, List
21
21
 
22
22
  import logging
23
23
 
@@ -34,7 +34,7 @@ class Groups:
34
34
  self._base = smartsheet_obj
35
35
  self._log = logging.getLogger(__name__)
36
36
 
37
- def add_members(self, group_id, group_member_obj) -> Union[Result[GroupMember], Error]:
37
+ def add_members(self, group_id, group_member_obj) -> Union[Result[Union[GroupMember, List[GroupMember]]], Error]:
38
38
  """Add one or more members to a Group.
39
39
 
40
40
  Args:
@@ -43,7 +43,8 @@ class Groups:
43
43
  object(s).
44
44
 
45
45
  Returns:
46
- Union[Result[GroupMember], Error]: The result of the operation, or an Error object if the request fails.
46
+ Union[Result[Union[GroupMember, List[GroupMember]]], Error]: The result of the operation - either a list or
47
+ a single object, or an Error object if the request fails.
47
48
  """
48
49
  _op = fresh_operation("add_members")
49
50
  _op["method"] = "POST"
smartsheet/sheets.py CHANGED
@@ -20,7 +20,7 @@ from __future__ import absolute_import
20
20
  import logging
21
21
  import os.path
22
22
  from datetime import datetime
23
- from typing import Union
23
+ from typing import Union, List
24
24
 
25
25
  import six
26
26
 
@@ -40,7 +40,7 @@ class Sheets:
40
40
  self._base = smartsheet_obj
41
41
  self._log = logging.getLogger(__name__)
42
42
 
43
- def add_columns(self, sheet_id, list_of_columns) -> Union[Result[Column], Error]:
43
+ def add_columns(self, sheet_id, list_of_columns) -> Union[Result[Union[Column, List[Column]]], Error]:
44
44
  """Insert one or more Columns into the specified Sheet
45
45
 
46
46
  Args:
@@ -49,7 +49,7 @@ class Sheets:
49
49
  Column objects
50
50
 
51
51
  Returns:
52
- Union[Result[Column], Error]: The result of the operation, or an Error object if the request fails.
52
+ Union[Result[Union[Column, List[Column]]], Error]: The result of the operation - either a list or a single object, or an Error object if the request fails.
53
53
  """
54
54
 
55
55
  if isinstance(list_of_columns, (dict, Column)):
@@ -69,7 +69,7 @@ class Sheets:
69
69
 
70
70
  return response
71
71
 
72
- def add_rows(self, sheet_id, list_of_rows) -> Union[Result[Row], Error]:
72
+ def add_rows(self, sheet_id, list_of_rows) -> Union[Result[Union[Row, List[Row]]], Error]:
73
73
  """Insert one or more Rows into the specified Sheet.
74
74
 
75
75
  If multiple rows are specified in the request, all rows
@@ -109,7 +109,7 @@ class Sheets:
109
109
  hyperlink (optional)
110
110
 
111
111
  Returns:
112
- Union[Result[Row], Error]: The result of the operation, or an Error object if the request fails.
112
+ Union[Result[Union[Row, List[Row]]], Error]: The result of the operation - either a list or a single object, or an Error object if the request fails.
113
113
  """
114
114
  if isinstance(list_of_rows, (dict, Row)):
115
115
  arg_value = list_of_rows
@@ -281,7 +281,7 @@ class Sheets:
281
281
 
282
282
  return response
283
283
 
284
- def delete_rows(self, sheet_id, ids, ignore_rows_not_found=False) -> Union[Result[NumberObjectValue], Error]:
284
+ def delete_rows(self, sheet_id, ids, ignore_rows_not_found=False) -> Union[Result[List[NumberObjectValue]], Error]:
285
285
  """Deletes one or more Row(s) from the specified Sheeet.
286
286
 
287
287
  Args:
@@ -296,7 +296,7 @@ class Sheets:
296
296
  will be altered).
297
297
 
298
298
  Returns:
299
- Union[Result[NumberObjectValue], Error]: The result of the operation, or an Error object if the request fails.
299
+ Union[Result[List[NumberObjectValue]], Error]: The result of the operation - a list of deleted object IDs, or an Error object if the request fails.
300
300
  """
301
301
  _op = fresh_operation("delete_rows")
302
302
  _op["method"] = "DELETE"
smartsheet/sights.py CHANGED
@@ -16,8 +16,9 @@
16
16
  # under the License.
17
17
 
18
18
  import logging
19
+ import warnings
19
20
  from datetime import datetime
20
- from typing import Union
21
+ from typing import Optional, Union
21
22
 
22
23
  from .util import fresh_operation
23
24
  from .models import Error, IndexResult, Result, Share, Sight, SightPublish
@@ -33,28 +34,80 @@ class Sights:
33
34
  self._log = logging.getLogger(__name__)
34
35
 
35
36
  def list_sights(
36
- self, page_size=None, page=None, include_all=None, modified_since=None
37
+ self,
38
+ page_size: Optional[int] = None,
39
+ page: Optional[int] = None,
40
+ include_all: Optional[bool] = None,
41
+ last_key: Optional[str] = None,
42
+ max_items: Optional[int] = None,
43
+ pagination_type: Optional[str] = None,
44
+ modified_since: Optional[datetime] = None
37
45
  ) -> Union[IndexResult[Sight], Error]:
38
46
  """Get the list of all Sights the User has access to, in alphabetical
39
47
  order, by name.
40
48
 
41
49
  Args:
42
- page_size (int): The maximum number of items to
43
- return per page.
44
- page (int): Which page to return.
45
- include_all (bool): If true, include all results
46
- (i.e. do not paginate).
47
- modified_since(datetime): return sights modified since datetime
50
+ page_size (int, optional): [DEPRECATED] The maximum number of items to
51
+ return per page. Use pagination_type='token' with max_items instead.
52
+ page (int, optional): [DEPRECATED] Which page to return.
53
+ Use pagination_type='token' with last_key instead.
54
+ include_all (bool, optional): [DEPRECATED] If true, include all results
55
+ (i.e. do not paginate). Use pagination_type='token' instead.
56
+ last_key (str, optional): Pagination cursor for next page (token pagination only).
57
+ max_items (int, optional): Maximum items per page (token pagination only).
58
+ Must be a positive integer.
59
+ pagination_type (str, optional): Use 'token' for efficient cursor-based pagination.
60
+ Defaults to legacy offset-based pagination if not specified.
61
+ modified_since (datetime, optional): Return sights modified since datetime.
48
62
 
49
63
  Returns:
50
64
  Union[IndexResult[Sight], Error]: The result of the operation, or an Error object if the request fails.
65
+ When using legacy pagination, contains paginated results with
66
+ total_count, total_pages, etc.
67
+
68
+ Raises:
69
+ ValueError: If pagination_type is not 'token' or None, or if max_items <= 0
70
+ when using token pagination.
51
71
  """
72
+ # Parameter validation
73
+ if pagination_type is not None and pagination_type not in ['token']:
74
+ raise ValueError("pagination_type must be 'token' or None")
75
+ if pagination_type == 'token' and max_items is not None and max_items <= 0:
76
+ raise ValueError("max_items must be a positive integer")
77
+
52
78
  _op = fresh_operation("list_sights")
53
79
  _op["method"] = "GET"
54
80
  _op["path"] = "/sights"
55
- _op["query_params"]["pageSize"] = page_size
56
- _op["query_params"]["page"] = page
57
- _op["query_params"]["includeAll"] = include_all
81
+
82
+ # Issue deprecation warnings for old parameters when used
83
+ if page_size is not None:
84
+ warnings.warn(
85
+ "page_size parameter is deprecated. Use pagination_type='token' with max_items instead.",
86
+ DeprecationWarning,
87
+ stacklevel=2
88
+ )
89
+ if page is not None:
90
+ warnings.warn(
91
+ "page parameter is deprecated. Use pagination_type='token' with last_key instead.",
92
+ DeprecationWarning,
93
+ stacklevel=2
94
+ )
95
+ if include_all is not None:
96
+ warnings.warn(
97
+ "include_all parameter is deprecated. Use pagination_type='token' instead.",
98
+ DeprecationWarning,
99
+ stacklevel=2
100
+ )
101
+
102
+ if pagination_type == "token":
103
+ _op["query_params"]["lastKey"] = last_key
104
+ _op["query_params"]["maxItems"] = max_items
105
+ _op["query_params"]["paginationType"] = pagination_type
106
+ else:
107
+ _op["query_params"]["pageSize"] = page_size
108
+ _op["query_params"]["page"] = page
109
+ _op["query_params"]["includeAll"] = include_all
110
+
58
111
  if isinstance(modified_since, datetime):
59
112
  _op["query_params"]["modifiedSince"] = modified_since.isoformat()
60
113
 
smartsheet/smartsheet.py CHANGED
@@ -38,6 +38,7 @@ from .session import pinned_session
38
38
  from .util import is_multipart, serialize
39
39
 
40
40
  from .attachments import Attachments
41
+ from .cells import Cells
41
42
  from .contacts import Contacts
42
43
  from .discussions import Discussions
43
44
  from .events import Events
@@ -119,6 +120,7 @@ class Smartsheet:
119
120
  """Use this to make requests to the Smartsheet API."""
120
121
 
121
122
  Attachments: Attachments
123
+ Cells: Cells
122
124
  Contacts: Contacts
123
125
  Discussions: Discussions
124
126
  Events: Events
smartsheet/users.py CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  from __future__ import absolute_import
19
19
 
20
- from typing import Union
20
+ from typing import Union, List
21
21
 
22
22
  import logging
23
23
  from datetime import datetime
@@ -36,7 +36,7 @@ class Users:
36
36
  self._base = smartsheet_obj
37
37
  self._log = logging.getLogger(__name__)
38
38
 
39
- def add_alternate_email(self, user_id, list_of_alternate_emails) -> Union[Result[AlternateEmail], Error]:
39
+ def add_alternate_email(self, user_id, list_of_alternate_emails) -> Union[Result[Union[AlternateEmail, List[AlternateEmail]]], Error]:
40
40
  """Add one or more alternate email addresses for the specified User
41
41
 
42
42
  Args:
@@ -45,7 +45,7 @@ class Users:
45
45
  An array of one or more AlternateEmail objects.
46
46
 
47
47
  Returns:
48
- Union[Result[AlternateEmail], Error]: The result of the operation, or an Error object if the request fails.
48
+ Union[Result[List[AlternateEmail]], Error]: The result of the operation - either a list or a single object, or an Error object if the request fails.
49
49
  """
50
50
  _op = fresh_operation("add_alternate_email")
51
51
  _op["method"] = "POST"
smartsheet/version.py CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '3.7.0'
32
- __version_tuple__ = version_tuple = (3, 7, 0)
31
+ __version__ = version = '3.7.2'
32
+ __version_tuple__ = version_tuple = (3, 7, 2)
33
33
 
34
34
  __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.0
3
+ Version: 3.7.2
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,9 +5,9 @@ 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=yTMOPNbGF0yVUl0Mu1YmCt1xbljQ3rAYomYdG_RO2sc,4392
8
+ smartsheet/favorites.py,sha256=zLiZavNW-8VuSG8HJtVRNM9wpo7pMQMjwuKhk4GVMEw,4491
9
9
  smartsheet/folders.py,sha256=wzpQi1WnIgWTEeP4ukLUcpjxWoqwZUJlVRaCu2XaQCg,16220
10
- smartsheet/groups.py,sha256=b2n-YTRkrITlGk-e5u7GLy20pgKtWoUsXnTFqJ4ckZM,6281
10
+ smartsheet/groups.py,sha256=uPxr6krN08pxwk4XRv65H6989S6SjdF-sT12X7JVhyE,6386
11
11
  smartsheet/home.py,sha256=3klXCDfejwXRsL_n3w_pECm3ugDgSvsWsWmdM-EcTXw,6223
12
12
  smartsheet/images.py,sha256=nUjJxSP-O559i3TruB5DTpVl2lOVLC4fWvsYaHEebUI,2026
13
13
  smartsheet/object_value.py,sha256=dcPFZEPpqAiZsBRUawozLSSlVjxGBWTT3VXvsRYso8Q,3129
@@ -17,15 +17,15 @@ smartsheet/search.py,sha256=ziSXW9EPf2SvrveHdq1nux74Vkvzk57L-v0gyMz03AY,3694
17
17
  smartsheet/server.py,sha256=_HGk5e6N4y8OceFVFXGaKoilrbSXk0OmnKnFFXfyR7A,1610
18
18
  smartsheet/session.py,sha256=TQ3IgVZ64r7Dszwo8rMISFezWxuwFYshhW9QhzoA428,2125
19
19
  smartsheet/sharing.py,sha256=N0FxpfFINjQ-cb6-zGnAy-a1ViM1YDIMzF1LWJ1hyNY,6623
20
- smartsheet/sheets.py,sha256=zupO4RHwnwJb9NAmxY2TDf6RWytDeGZXuWQc4T5RF8k,78946
21
- smartsheet/sights.py,sha256=F5lQ1lowQFq1yIr3aD6GUH_BJ2b-krbOU2CjU1xH-cg,13254
22
- smartsheet/smartsheet.py,sha256=qvDHQmUUjiJzDxb5Tot9SUS3toCcHpdvcXd1xWzkSgk,25405
20
+ smartsheet/sheets.py,sha256=V_rgks6duwUu0mggn-uCse0AyADkHSiS4LXJMKlEW1s,79143
21
+ smartsheet/sights.py,sha256=08HNkZzbNw2MvrEqTnFvqnHglv61bZDjYwXs43O_Ekw,15787
22
+ smartsheet/smartsheet.py,sha256=8ESvLqmgfGozE1aQRnmC26oqPuNVL4AYISV7z7IA8gU,25447
23
23
  smartsheet/templates.py,sha256=LgFisxV1yU6OuUcxg8dKo-otG2eATMTwxE4tTfLDJDU,3245
24
24
  smartsheet/token.py,sha256=NDej84rGP55yOgkrtgAggL1F0HN3zFH9Xw0r2z-To7s,5128
25
25
  smartsheet/types.py,sha256=aIdRJ89jwclmiZ4RH3hnZHJTFWFxgNKW3d8fghm21eM,9126
26
- smartsheet/users.py,sha256=eQFUy3S1LEgqjEJ8Jm4E5sEqt65mrdbLZgeDzsy_dV4,21535
26
+ smartsheet/users.py,sha256=R5ssS7n-rJihyRexqCTZxiY3au8VmWlYwFf_eQMi1d0,21611
27
27
  smartsheet/util.py,sha256=-eNjczPYtmtlnSF28z1lUdb6X_DLsHFPSqG1AJpvj8c,6157
28
- smartsheet/version.py,sha256=frF0s_klEYGUc3TneTySz4_c3QJVUDixsbSrgy4TDFU,704
28
+ smartsheet/version.py,sha256=U56HPfvEIuf7OLsDIujfkDm-48o-vtgN9ELCjYsmg1s,704
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
@@ -187,9 +187,9 @@ smartsheet/models/enums/system_column_type.py,sha256=UfhNUBGD_0K1Pas7fujGEuax55O
187
187
  smartsheet/models/enums/update_request_status.py,sha256=xYF84x1dTFhJMYVi1q3G1T9u1IGN3szlR1jj5HHC0hE,777
188
188
  smartsheet/models/enums/user_status.py,sha256=SB7qRcA0dhdRimsOKHCGF3CB6fL0XuifxQEWZGNNS8Q,766
189
189
  smartsheet/models/enums/widget_type.py,sha256=VfVq59fLZsT4ks_ZBrtv52u2Cl60iAdlA6mGD_elz-k,1072
190
- smartsheet_python_sdk-3.7.0.dist-info/licenses/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
191
- smartsheet_python_sdk-3.7.0.dist-info/licenses/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
192
- smartsheet_python_sdk-3.7.0.dist-info/METADATA,sha256=7jR8S8qdqPskCkZBk4K20ydFjBHP867Nc0VH2XdIpu4,5618
193
- smartsheet_python_sdk-3.7.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
194
- smartsheet_python_sdk-3.7.0.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
195
- smartsheet_python_sdk-3.7.0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5