smartsheet-python-sdk 3.7.1__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/sights.py +64 -11
- smartsheet/smartsheet.py +2 -0
- smartsheet/version.py +2 -2
- {smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/METADATA +1 -1
- {smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/RECORD +9 -9
- {smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/WHEEL +1 -1
- {smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/licenses/LICENSE.md +0 -0
- {smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/licenses/NOTICE +0 -0
- {smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/top_level.txt +0 -0
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,
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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/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.
|
|
32
|
-
__version_tuple__ = version_tuple = (3, 7,
|
|
31
|
+
__version__ = version = '3.7.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (3, 7, 2)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -18,14 +18,14 @@ 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
20
|
smartsheet/sheets.py,sha256=V_rgks6duwUu0mggn-uCse0AyADkHSiS4LXJMKlEW1s,79143
|
|
21
|
-
smartsheet/sights.py,sha256=
|
|
22
|
-
smartsheet/smartsheet.py,sha256=
|
|
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
26
|
smartsheet/users.py,sha256=R5ssS7n-rJihyRexqCTZxiY3au8VmWlYwFf_eQMi1d0,21611
|
|
27
27
|
smartsheet/util.py,sha256=-eNjczPYtmtlnSF28z1lUdb6X_DLsHFPSqG1AJpvj8c,6157
|
|
28
|
-
smartsheet/version.py,sha256=
|
|
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.
|
|
191
|
-
smartsheet_python_sdk-3.7.
|
|
192
|
-
smartsheet_python_sdk-3.7.
|
|
193
|
-
smartsheet_python_sdk-3.7.
|
|
194
|
-
smartsheet_python_sdk-3.7.
|
|
195
|
-
smartsheet_python_sdk-3.7.
|
|
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,,
|
{smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/licenses/LICENSE.md
RENAMED
|
File without changes
|
{smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/licenses/NOTICE
RENAMED
|
File without changes
|
{smartsheet_python_sdk-3.7.1.dist-info → smartsheet_python_sdk-3.7.2.dist-info}/top_level.txt
RENAMED
|
File without changes
|