smartsheet-python-sdk 3.0.5__py2.py3-none-any.whl → 3.2.0__py2.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/folders.py +62 -0
- smartsheet/home.py +6 -0
- smartsheet/models/__init__.py +3 -0
- smartsheet/models/datetime_object_value.py +2 -2
- smartsheet/models/enums/__init__.py +1 -0
- smartsheet/models/enums/seat_type.py +17 -0
- smartsheet/models/folder.py +29 -1
- smartsheet/models/index_result.py +10 -1
- smartsheet/models/paginated_children_result.py +80 -0
- smartsheet/models/source.py +1 -1
- smartsheet/models/token_paginated_result.py +79 -0
- smartsheet/models/user_model.py +28 -0
- smartsheet/models/user_plan.py +68 -0
- smartsheet/models/workspace.py +29 -1
- smartsheet/users.py +94 -1
- smartsheet/version.py +2 -2
- smartsheet/workspaces.py +125 -11
- {smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/METADATA +1 -1
- {smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/RECORD +23 -19
- {smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/LICENSE.md +0 -0
- {smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/NOTICE +0 -0
- {smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/WHEEL +0 -0
- {smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/top_level.txt +0 -0
smartsheet/folders.py
CHANGED
|
@@ -22,6 +22,7 @@ import os.path
|
|
|
22
22
|
|
|
23
23
|
from . import fresh_operation
|
|
24
24
|
from .models.folder import Folder
|
|
25
|
+
from .util import deprecated
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
class Folders:
|
|
@@ -173,9 +174,13 @@ class Folders:
|
|
|
173
174
|
|
|
174
175
|
return response
|
|
175
176
|
|
|
177
|
+
@deprecated
|
|
176
178
|
def get_folder(self, folder_id, include=None):
|
|
177
179
|
"""Get the specified Folder (and list its contents).
|
|
178
180
|
|
|
181
|
+
Deprecated: 3.1.0
|
|
182
|
+
Use `get_folder_metadata` and `get_folder_children` instead.
|
|
183
|
+
|
|
179
184
|
Args:
|
|
180
185
|
folder_id (int): Folder ID
|
|
181
186
|
include (list[str]): A comma-separated list of
|
|
@@ -196,9 +201,13 @@ class Folders:
|
|
|
196
201
|
|
|
197
202
|
return response
|
|
198
203
|
|
|
204
|
+
@deprecated
|
|
199
205
|
def list_folders(self, folder_id, page_size=None, page=None, include_all=None):
|
|
200
206
|
"""Get a list of top-level child Folders within the specified Folder.
|
|
201
207
|
|
|
208
|
+
Deprecated: 3.1.0
|
|
209
|
+
Use `get_folder_children` with children_resource_types=['folders'] instead.
|
|
210
|
+
|
|
202
211
|
Args:
|
|
203
212
|
folder_id (int): Folder ID
|
|
204
213
|
page_size (int): The maximum number of items to
|
|
@@ -272,6 +281,59 @@ class Folders:
|
|
|
272
281
|
|
|
273
282
|
return response
|
|
274
283
|
|
|
284
|
+
def get_folder_metadata(self, folder_id, include=None):
|
|
285
|
+
"""Get the metadata of a folder.
|
|
286
|
+
|
|
287
|
+
Args:
|
|
288
|
+
folder_id (int): Folder ID
|
|
289
|
+
include (list[str]): A list of optional elements to include
|
|
290
|
+
in the response. Valid list values: source.
|
|
291
|
+
|
|
292
|
+
Returns:
|
|
293
|
+
Folder
|
|
294
|
+
"""
|
|
295
|
+
_op = fresh_operation("get_folder_metadata")
|
|
296
|
+
_op["method"] = "GET"
|
|
297
|
+
_op["path"] = "/folders/" + str(folder_id) + "/metadata"
|
|
298
|
+
_op["query_params"]["include"] = include
|
|
299
|
+
|
|
300
|
+
expected = "Folder"
|
|
301
|
+
prepped_request = self._base.prepare_request(_op)
|
|
302
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
303
|
+
|
|
304
|
+
return response
|
|
305
|
+
|
|
306
|
+
def get_folder_children(self, folder_id, children_resource_types=None, include=None, last_key=None, max_items=None):
|
|
307
|
+
"""Get the children of a folder.
|
|
308
|
+
|
|
309
|
+
Args:
|
|
310
|
+
folder_id (int): Folder ID
|
|
311
|
+
children_resource_types (list[str]): The types of the children resources.
|
|
312
|
+
If not provided, returns children of all types.
|
|
313
|
+
Valid list values: sheets, reports, sights, folders.
|
|
314
|
+
include (list[str]): A list of optional elements to include in the
|
|
315
|
+
response. Valid list values: source, ownerInfo.
|
|
316
|
+
last_key (str): The token from a previous request that will allow this one
|
|
317
|
+
to fetch the next page of results.
|
|
318
|
+
max_items (int): The maximum number of items to return in the response.
|
|
319
|
+
|
|
320
|
+
Returns:
|
|
321
|
+
PaginatedChildrenResult
|
|
322
|
+
"""
|
|
323
|
+
_op = fresh_operation("get_folder_children")
|
|
324
|
+
_op["method"] = "GET"
|
|
325
|
+
_op["path"] = "/folders/" + str(folder_id) + "/children"
|
|
326
|
+
_op["query_params"]["childrenResourceTypes"] = children_resource_types
|
|
327
|
+
_op["query_params"]["include"] = include
|
|
328
|
+
_op["query_params"]["lastKey"] = last_key
|
|
329
|
+
_op["query_params"]["maxItems"] = max_items
|
|
330
|
+
|
|
331
|
+
expected = "PaginatedChildrenResult"
|
|
332
|
+
prepped_request = self._base.prepare_request(_op)
|
|
333
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
334
|
+
|
|
335
|
+
return response
|
|
336
|
+
|
|
275
337
|
def import_csv_sheet(
|
|
276
338
|
self,
|
|
277
339
|
folder_id,
|
smartsheet/home.py
CHANGED
|
@@ -22,6 +22,7 @@ import logging
|
|
|
22
22
|
from . import fresh_operation
|
|
23
23
|
from .models.folder import Folder
|
|
24
24
|
from .models.sheet import Sheet
|
|
25
|
+
from .util import deprecated
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
class Home:
|
|
@@ -33,6 +34,7 @@ class Home:
|
|
|
33
34
|
self._base = smartsheet_obj
|
|
34
35
|
self._log = logging.getLogger(__name__)
|
|
35
36
|
|
|
37
|
+
@deprecated
|
|
36
38
|
def create_folder(self, folder_obj):
|
|
37
39
|
"""Creates a Folder in the user's Sheets folder (Home).
|
|
38
40
|
|
|
@@ -57,6 +59,7 @@ class Home:
|
|
|
57
59
|
|
|
58
60
|
return response
|
|
59
61
|
|
|
62
|
+
@deprecated
|
|
60
63
|
def create_sheet(self, sheet_obj):
|
|
61
64
|
"""Create a Sheet from scratch in the user's Sheets folder within
|
|
62
65
|
Home.
|
|
@@ -82,6 +85,7 @@ class Home:
|
|
|
82
85
|
|
|
83
86
|
return response
|
|
84
87
|
|
|
88
|
+
@deprecated
|
|
85
89
|
def create_sheet_from_template(self, sheet_obj, include=None):
|
|
86
90
|
"""Create a Sheet in the Sheets folder from the specified Template.
|
|
87
91
|
|
|
@@ -118,6 +122,7 @@ class Home:
|
|
|
118
122
|
|
|
119
123
|
return response
|
|
120
124
|
|
|
125
|
+
@deprecated
|
|
121
126
|
def list_all_contents(self, include=None, exclude=None):
|
|
122
127
|
"""Get a nested list of all Home objects, including Sheets,
|
|
123
128
|
Workspaces, Folders, Reports and Templates.
|
|
@@ -145,6 +150,7 @@ class Home:
|
|
|
145
150
|
|
|
146
151
|
return response
|
|
147
152
|
|
|
153
|
+
@deprecated
|
|
148
154
|
def list_folders(self, page_size=None, page=None, include_all=None):
|
|
149
155
|
"""Gets a list of top-level child Folders within the user's Sheets
|
|
150
156
|
folder.
|
smartsheet/models/__init__.py
CHANGED
|
@@ -73,6 +73,8 @@ from .multi_row_email import MultiRowEmail
|
|
|
73
73
|
from .number_object_value import NumberObjectValue
|
|
74
74
|
from .o_auth_error import OAuthError
|
|
75
75
|
from .object_value import ObjectValue
|
|
76
|
+
from .paginated_children_result import PaginatedChildrenResult
|
|
77
|
+
from .token_paginated_result import TokenPaginatedResult
|
|
76
78
|
from .predecessor import Predecessor
|
|
77
79
|
from .predecessor_list import PredecessorList
|
|
78
80
|
from .project_settings import ProjectSettings
|
|
@@ -119,3 +121,4 @@ from .webhook_subscope import WebhookSubscope
|
|
|
119
121
|
from .widget import Widget
|
|
120
122
|
from .widget_content import WidgetContent
|
|
121
123
|
from .workspace import Workspace
|
|
124
|
+
from .user_plan import UserPlan
|
|
@@ -26,10 +26,10 @@ from .object_value import ObjectValue, six
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class DatetimeObjectValue(ObjectValue):
|
|
29
|
-
"""Smartsheet
|
|
29
|
+
"""Smartsheet DatetimeObjectValue data model."""
|
|
30
30
|
|
|
31
31
|
def __init__(self, props=None, object_type=None, base_obj=None):
|
|
32
|
-
"""Initialize the
|
|
32
|
+
"""Initialize the DatetimeObjectValue model."""
|
|
33
33
|
super().__init__(object_type, base_obj)
|
|
34
34
|
self._base = None
|
|
35
35
|
if base_obj is not None:
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
class SeatType(str, Enum):
|
|
4
|
+
VIEWER = 'VIEWER'
|
|
5
|
+
GUEST = 'GUEST'
|
|
6
|
+
MEMBER = 'MEMBER'
|
|
7
|
+
PROVISIONAL_MEMBER = 'PROVISIONAL_MEMBER'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DowngradeSeatType(str, Enum):
|
|
11
|
+
VIEWER = 'VIEWER'
|
|
12
|
+
GUEST = 'GUEST'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class UpgradeSeatType(str, Enum):
|
|
16
|
+
GUEST = 'GUEST'
|
|
17
|
+
MEMBER = 'MEMBER'
|
smartsheet/models/folder.py
CHANGED
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import absolute_import
|
|
19
19
|
|
|
20
|
-
from ..types import Boolean, Number, String, TypedList, json
|
|
20
|
+
from ..types import Boolean, Number, String, Timestamp, TypedList, TypedObject, json
|
|
21
21
|
from ..util import deserialize, serialize
|
|
22
22
|
from .report import Report
|
|
23
23
|
from .sheet import Sheet
|
|
24
24
|
from .sight import Sight
|
|
25
|
+
from .source import Source
|
|
25
26
|
from .template import Template
|
|
26
27
|
|
|
27
28
|
|
|
@@ -35,14 +36,17 @@ class Folder:
|
|
|
35
36
|
if base_obj is not None:
|
|
36
37
|
self._base = base_obj
|
|
37
38
|
|
|
39
|
+
self._created_at = Timestamp()
|
|
38
40
|
self._favorite = Boolean()
|
|
39
41
|
self._folders = TypedList(Folder)
|
|
40
42
|
self._id_ = Number()
|
|
43
|
+
self._modified_at = Timestamp()
|
|
41
44
|
self._name = String()
|
|
42
45
|
self._permalink = String()
|
|
43
46
|
self._reports = TypedList(Report)
|
|
44
47
|
self._sheets = TypedList(Sheet)
|
|
45
48
|
self._sights = TypedList(Sight)
|
|
49
|
+
self._source = TypedObject(Source)
|
|
46
50
|
self._templates = TypedList(Template)
|
|
47
51
|
|
|
48
52
|
if props:
|
|
@@ -64,6 +68,14 @@ class Folder:
|
|
|
64
68
|
else:
|
|
65
69
|
super().__setattr__(key, value)
|
|
66
70
|
|
|
71
|
+
@property
|
|
72
|
+
def created_at(self):
|
|
73
|
+
return self._created_at.value
|
|
74
|
+
|
|
75
|
+
@created_at.setter
|
|
76
|
+
def created_at(self, value):
|
|
77
|
+
self._created_at.value = value
|
|
78
|
+
|
|
67
79
|
@property
|
|
68
80
|
def favorite(self):
|
|
69
81
|
return self._favorite.value
|
|
@@ -88,6 +100,14 @@ class Folder:
|
|
|
88
100
|
def id_(self, value):
|
|
89
101
|
self._id_.value = value
|
|
90
102
|
|
|
103
|
+
@property
|
|
104
|
+
def modified_at(self):
|
|
105
|
+
return self._modified_at.value
|
|
106
|
+
|
|
107
|
+
@modified_at.setter
|
|
108
|
+
def modified_at(self, value):
|
|
109
|
+
self._modified_at.value = value
|
|
110
|
+
|
|
91
111
|
@property
|
|
92
112
|
def name(self):
|
|
93
113
|
return self._name.value
|
|
@@ -128,6 +148,14 @@ class Folder:
|
|
|
128
148
|
def sights(self, value):
|
|
129
149
|
self._sights.load(value)
|
|
130
150
|
|
|
151
|
+
@property
|
|
152
|
+
def source(self):
|
|
153
|
+
return self._source.value
|
|
154
|
+
|
|
155
|
+
@source.setter
|
|
156
|
+
def source(self, value):
|
|
157
|
+
self._source.value = value
|
|
158
|
+
|
|
131
159
|
@property
|
|
132
160
|
def templates(self):
|
|
133
161
|
return self._templates
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import absolute_import
|
|
19
19
|
|
|
20
|
-
from ..types import Number, TypedList, importlib, json
|
|
20
|
+
from ..types import Number, TypedList, importlib, json, String
|
|
21
21
|
from ..util import deserialize, serialize
|
|
22
22
|
|
|
23
23
|
|
|
@@ -40,6 +40,7 @@ class IndexResult:
|
|
|
40
40
|
self._page_size = Number()
|
|
41
41
|
self._total_count = Number()
|
|
42
42
|
self._total_pages = Number()
|
|
43
|
+
self._last_key = String()
|
|
43
44
|
|
|
44
45
|
if props:
|
|
45
46
|
deserialize(self, props)
|
|
@@ -94,6 +95,14 @@ class IndexResult:
|
|
|
94
95
|
def total_pages(self, value):
|
|
95
96
|
self._total_pages.value = value
|
|
96
97
|
|
|
98
|
+
@property
|
|
99
|
+
def last_key(self):
|
|
100
|
+
return self._last_key.value
|
|
101
|
+
|
|
102
|
+
@last_key.setter
|
|
103
|
+
def last_key(self, value):
|
|
104
|
+
self._last_key.value = value
|
|
105
|
+
|
|
97
106
|
@property
|
|
98
107
|
def result(self):
|
|
99
108
|
"""Simplify difference between Result and IndexResult"""
|
|
@@ -0,0 +1,80 @@
|
|
|
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 Union
|
|
21
|
+
from ..util import deserialize
|
|
22
|
+
from .token_paginated_result import TokenPaginatedResult
|
|
23
|
+
from .folder import Folder
|
|
24
|
+
from .sheet import Sheet
|
|
25
|
+
from .sight import Sight
|
|
26
|
+
from .report import Report
|
|
27
|
+
|
|
28
|
+
# Type alias for children that can be any of these types
|
|
29
|
+
ChildType = Union[Folder, Sheet, Sight, Report]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class PaginatedChildrenResult(TokenPaginatedResult[ChildType]):
|
|
33
|
+
"""Smartsheet PaginatedChildrenResult that deserializes mixed children based on resourceType."""
|
|
34
|
+
|
|
35
|
+
def __init__(self, props=None, base_obj=None):
|
|
36
|
+
"""Initialize the PaginatedChildrenResult model."""
|
|
37
|
+
super().__init__(props=None, base_obj=base_obj)
|
|
38
|
+
|
|
39
|
+
if props:
|
|
40
|
+
self._deserialize_data(props)
|
|
41
|
+
deserialize(self, props)
|
|
42
|
+
|
|
43
|
+
def _deserialize_data(self, props):
|
|
44
|
+
"""Custom deserialization for data array based on resourceType."""
|
|
45
|
+
if 'data' in props:
|
|
46
|
+
self._data = []
|
|
47
|
+
for item in props['data']:
|
|
48
|
+
self.append_data(item)
|
|
49
|
+
|
|
50
|
+
def append_data(self, item):
|
|
51
|
+
"""Append data item, converting to appropriate model based on resourceType."""
|
|
52
|
+
# Get resource type from either dict or object
|
|
53
|
+
if isinstance(item, dict):
|
|
54
|
+
resource_type = item.get('resourceType', '').lower()
|
|
55
|
+
else:
|
|
56
|
+
resource_type = getattr(item, 'resourceType', '').lower()
|
|
57
|
+
|
|
58
|
+
# Convert to appropriate model object based on resource type
|
|
59
|
+
if resource_type == 'folder':
|
|
60
|
+
self._data.append(Folder(item, self._base))
|
|
61
|
+
elif resource_type == 'sheet':
|
|
62
|
+
self._data.append(Sheet(item, self._base))
|
|
63
|
+
elif resource_type == 'sight':
|
|
64
|
+
self._data.append(Sight(item, self._base))
|
|
65
|
+
elif resource_type == 'report':
|
|
66
|
+
self._data.append(Report(item, self._base))
|
|
67
|
+
else:
|
|
68
|
+
# If no resource type or unknown type, append as-is
|
|
69
|
+
self._data.append(item)
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def data(self):
|
|
73
|
+
return self._data
|
|
74
|
+
|
|
75
|
+
@data.setter
|
|
76
|
+
def data(self, value):
|
|
77
|
+
"""Custom setter that handles deserialization of mixed resource types."""
|
|
78
|
+
self._data = []
|
|
79
|
+
for item in value:
|
|
80
|
+
self.append_data(item)
|
smartsheet/models/source.py
CHANGED
|
@@ -31,7 +31,7 @@ class Source:
|
|
|
31
31
|
if base_obj is not None:
|
|
32
32
|
self._base = base_obj
|
|
33
33
|
|
|
34
|
-
self.allowed_values = {"_type": ["report", "sheet", "sight", "template"]}
|
|
34
|
+
self.allowed_values = {"_type": ["folder", "report", "sheet", "sight", "template", "workspace"]}
|
|
35
35
|
|
|
36
36
|
self._id_ = Number()
|
|
37
37
|
self._type_ = String(accept=self.allowed_values["_type"])
|
|
@@ -0,0 +1,79 @@
|
|
|
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 TypeVar, Generic, List
|
|
21
|
+
from ..types import String, json, TypedList, importlib
|
|
22
|
+
from ..util import deserialize, serialize
|
|
23
|
+
|
|
24
|
+
T = TypeVar('T')
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class TokenPaginatedResult(Generic[T]):
|
|
28
|
+
"""Smartsheet TokenPaginatedResult data model with generic type support."""
|
|
29
|
+
|
|
30
|
+
def __init__(self, props=None, dynamic_data_type=None, base_obj=None):
|
|
31
|
+
"""Initialize the TokenPaginatedResult model."""
|
|
32
|
+
self._base = None
|
|
33
|
+
if base_obj is not None:
|
|
34
|
+
self._base = base_obj
|
|
35
|
+
|
|
36
|
+
self._dynamic_data_type = None
|
|
37
|
+
if dynamic_data_type is not None:
|
|
38
|
+
self._dynamic_data_type = dynamic_data_type
|
|
39
|
+
|
|
40
|
+
self._data = TypedList(object)
|
|
41
|
+
self._last_key = String()
|
|
42
|
+
|
|
43
|
+
if props:
|
|
44
|
+
deserialize(self, props)
|
|
45
|
+
|
|
46
|
+
self.request_response = None
|
|
47
|
+
self.__initialized = True
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def data(self) -> List[T]:
|
|
51
|
+
return self._data
|
|
52
|
+
|
|
53
|
+
@data.setter
|
|
54
|
+
def data(self, value):
|
|
55
|
+
class_ = getattr(
|
|
56
|
+
importlib.import_module("smartsheet.models"), self._dynamic_data_type
|
|
57
|
+
)
|
|
58
|
+
if isinstance(value, list):
|
|
59
|
+
self._data = [class_(x, self._base) for x in value]
|
|
60
|
+
else:
|
|
61
|
+
self._data = class_(value, self._base)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def last_key(self):
|
|
66
|
+
return self._last_key.value
|
|
67
|
+
|
|
68
|
+
@last_key.setter
|
|
69
|
+
def last_key(self, value):
|
|
70
|
+
self._last_key.value = value
|
|
71
|
+
|
|
72
|
+
def to_dict(self):
|
|
73
|
+
return serialize(self)
|
|
74
|
+
|
|
75
|
+
def to_json(self):
|
|
76
|
+
return json.dumps(self.to_dict())
|
|
77
|
+
|
|
78
|
+
def __str__(self):
|
|
79
|
+
return self.to_json()
|
smartsheet/models/user_model.py
CHANGED
|
@@ -19,6 +19,7 @@ from __future__ import absolute_import
|
|
|
19
19
|
|
|
20
20
|
from ..types import (Boolean, EnumeratedValue, Number, String, Timestamp,
|
|
21
21
|
TypedList, TypedObject, json)
|
|
22
|
+
from ..models.enums import SeatType
|
|
22
23
|
from ..util import deserialize, serialize
|
|
23
24
|
from .alternate_email import AlternateEmail
|
|
24
25
|
from .enums import UserStatus
|
|
@@ -44,6 +45,7 @@ class UserModel:
|
|
|
44
45
|
self._first_name = String()
|
|
45
46
|
self._group_admin = Boolean()
|
|
46
47
|
self._id_ = Number()
|
|
48
|
+
self._is_internal = Boolean()
|
|
47
49
|
self._last_login = Timestamp()
|
|
48
50
|
self._last_name = String()
|
|
49
51
|
self._licensed_sheet_creator = Boolean()
|
|
@@ -51,6 +53,8 @@ class UserModel:
|
|
|
51
53
|
self._profile_image = TypedObject(ProfileImage)
|
|
52
54
|
self._resource_viewer = Boolean()
|
|
53
55
|
self._role = String()
|
|
56
|
+
self._seat_type = EnumeratedValue(SeatType)
|
|
57
|
+
self._seat_type_last_changed_at = Timestamp()
|
|
54
58
|
self._sheet_count = Number()
|
|
55
59
|
self._status = EnumeratedValue(UserStatus)
|
|
56
60
|
self._title = String()
|
|
@@ -145,6 +149,14 @@ class UserModel:
|
|
|
145
149
|
def id_(self, value):
|
|
146
150
|
self._id_.value = value
|
|
147
151
|
|
|
152
|
+
@property
|
|
153
|
+
def is_internal(self):
|
|
154
|
+
return self._is_internal.value
|
|
155
|
+
|
|
156
|
+
@is_internal.setter
|
|
157
|
+
def is_internal(self, value):
|
|
158
|
+
self._is_internal.value = value
|
|
159
|
+
|
|
148
160
|
@property
|
|
149
161
|
def last_login(self):
|
|
150
162
|
return self._last_login.value
|
|
@@ -201,6 +213,22 @@ class UserModel:
|
|
|
201
213
|
def role(self, value):
|
|
202
214
|
self._role.value = value
|
|
203
215
|
|
|
216
|
+
@property
|
|
217
|
+
def seat_type(self):
|
|
218
|
+
return self._seat_type
|
|
219
|
+
|
|
220
|
+
@seat_type.setter
|
|
221
|
+
def seat_type(self, value):
|
|
222
|
+
self._seat_type.set(value)
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def seat_type_last_changed_at(self):
|
|
226
|
+
return self._seat_type_last_changed_at.value
|
|
227
|
+
|
|
228
|
+
@seat_type_last_changed_at.setter
|
|
229
|
+
def seat_type_last_changed_at(self, value):
|
|
230
|
+
self._seat_type_last_changed_at.value = value
|
|
231
|
+
|
|
204
232
|
@property
|
|
205
233
|
def sheet_count(self):
|
|
206
234
|
return self._sheet_count.value
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from __future__ import absolute_import
|
|
2
|
+
|
|
3
|
+
from ..types import (Boolean, EnumeratedValue, Number, String, Timestamp,
|
|
4
|
+
TypedList, TypedObject, json)
|
|
5
|
+
from ..models.enums import SeatType
|
|
6
|
+
from ..util import deserialize, serialize
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class UserPlan:
|
|
10
|
+
|
|
11
|
+
"""Smartsheet Plan for a User data model."""
|
|
12
|
+
|
|
13
|
+
def __init__(self, props=None, base_obj=None):
|
|
14
|
+
"""Initialize the UserPlan model."""
|
|
15
|
+
self._base = None
|
|
16
|
+
if base_obj is not None:
|
|
17
|
+
self._base = base_obj
|
|
18
|
+
|
|
19
|
+
self._plan_id = Number()
|
|
20
|
+
self._seat_type = EnumeratedValue(SeatType)
|
|
21
|
+
self._seat_type_last_changed_at = Timestamp()
|
|
22
|
+
self._is_internal = Boolean()
|
|
23
|
+
|
|
24
|
+
if props:
|
|
25
|
+
deserialize(self, props)
|
|
26
|
+
|
|
27
|
+
self.__initialized = True
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def plan_id(self):
|
|
31
|
+
return self._plan_id.value
|
|
32
|
+
|
|
33
|
+
@plan_id.setter
|
|
34
|
+
def plan_id(self, value):
|
|
35
|
+
self._plan_id.value = value
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def seat_type(self):
|
|
39
|
+
return self._seat_type
|
|
40
|
+
|
|
41
|
+
@seat_type.setter
|
|
42
|
+
def seat_type(self, value):
|
|
43
|
+
self._seat_type.set(value)
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def seat_type_last_changed_at(self):
|
|
47
|
+
return self._seat_type_last_changed_at.value
|
|
48
|
+
|
|
49
|
+
@seat_type_last_changed_at.setter
|
|
50
|
+
def seat_type_last_changed_at(self, value):
|
|
51
|
+
self._seat_type_last_changed_at.value = value
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def is_internal(self):
|
|
55
|
+
return self._is_internal.value
|
|
56
|
+
|
|
57
|
+
@is_internal.setter
|
|
58
|
+
def is_internal(self, value):
|
|
59
|
+
self._is_internal.value = value
|
|
60
|
+
|
|
61
|
+
def to_dict(self):
|
|
62
|
+
return serialize(self)
|
|
63
|
+
|
|
64
|
+
def to_json(self):
|
|
65
|
+
return json.dumps(self.to_dict())
|
|
66
|
+
|
|
67
|
+
def __str__(self):
|
|
68
|
+
return self.to_json()
|
smartsheet/models/workspace.py
CHANGED
|
@@ -17,13 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
from __future__ import absolute_import
|
|
19
19
|
|
|
20
|
-
from ..types import Boolean, EnumeratedValue, Number, String, TypedList, json
|
|
20
|
+
from ..types import Boolean, EnumeratedValue, Number, String, Timestamp, TypedList, TypedObject, json
|
|
21
21
|
from ..util import deserialize, serialize
|
|
22
22
|
from .enums import AccessLevel
|
|
23
23
|
from .folder import Folder
|
|
24
24
|
from .report import Report
|
|
25
25
|
from .sheet import Sheet
|
|
26
26
|
from .sight import Sight
|
|
27
|
+
from .source import Source
|
|
27
28
|
from .template import Template
|
|
28
29
|
|
|
29
30
|
|
|
@@ -38,14 +39,17 @@ class Workspace:
|
|
|
38
39
|
self._base = base_obj
|
|
39
40
|
|
|
40
41
|
self._access_level = EnumeratedValue(AccessLevel)
|
|
42
|
+
self._created_at = Timestamp()
|
|
41
43
|
self._favorite = Boolean()
|
|
42
44
|
self._folders = TypedList(Folder)
|
|
43
45
|
self._id_ = Number()
|
|
46
|
+
self._modified_at = Timestamp()
|
|
44
47
|
self._name = String()
|
|
45
48
|
self._permalink = String()
|
|
46
49
|
self._reports = TypedList(Report)
|
|
47
50
|
self._sheets = TypedList(Sheet)
|
|
48
51
|
self._sights = TypedList(Sight)
|
|
52
|
+
self._source = TypedObject(Source)
|
|
49
53
|
self._templates = TypedList(Template)
|
|
50
54
|
|
|
51
55
|
if props:
|
|
@@ -75,6 +79,14 @@ class Workspace:
|
|
|
75
79
|
def access_level(self, value):
|
|
76
80
|
self._access_level.set(value)
|
|
77
81
|
|
|
82
|
+
@property
|
|
83
|
+
def created_at(self):
|
|
84
|
+
return self._created_at.value
|
|
85
|
+
|
|
86
|
+
@created_at.setter
|
|
87
|
+
def created_at(self, value):
|
|
88
|
+
self._created_at.value = value
|
|
89
|
+
|
|
78
90
|
@property
|
|
79
91
|
def favorite(self):
|
|
80
92
|
return self._favorite.value
|
|
@@ -99,6 +111,14 @@ class Workspace:
|
|
|
99
111
|
def id_(self, value):
|
|
100
112
|
self._id_.value = value
|
|
101
113
|
|
|
114
|
+
@property
|
|
115
|
+
def modified_at(self):
|
|
116
|
+
return self._modified_at.value
|
|
117
|
+
|
|
118
|
+
@modified_at.setter
|
|
119
|
+
def modified_at(self, value):
|
|
120
|
+
self._modified_at.value = value
|
|
121
|
+
|
|
102
122
|
@property
|
|
103
123
|
def name(self):
|
|
104
124
|
return self._name.value
|
|
@@ -139,6 +159,14 @@ class Workspace:
|
|
|
139
159
|
def sights(self, value):
|
|
140
160
|
self._sights.load(value)
|
|
141
161
|
|
|
162
|
+
@property
|
|
163
|
+
def source(self):
|
|
164
|
+
return self._source.value
|
|
165
|
+
|
|
166
|
+
@source.setter
|
|
167
|
+
def source(self, value):
|
|
168
|
+
self._source.value = value
|
|
169
|
+
|
|
142
170
|
@property
|
|
143
171
|
def templates(self):
|
|
144
172
|
return self._templates
|
smartsheet/users.py
CHANGED
|
@@ -21,6 +21,7 @@ import logging
|
|
|
21
21
|
from datetime import datetime
|
|
22
22
|
|
|
23
23
|
from . import fresh_operation
|
|
24
|
+
from .models.enums.seat_type import SeatType
|
|
24
25
|
|
|
25
26
|
|
|
26
27
|
class Users:
|
|
@@ -254,7 +255,8 @@ class Users:
|
|
|
254
255
|
return response
|
|
255
256
|
|
|
256
257
|
def list_users(
|
|
257
|
-
self, email=None, page_size=None, page=None, include_all=None, include=None
|
|
258
|
+
self, email=None, page_size=None, page=None, include_all=None, include=None,
|
|
259
|
+
plan_id=None, seat_type=None
|
|
258
260
|
):
|
|
259
261
|
"""Get the list of Users in the organization.
|
|
260
262
|
|
|
@@ -268,6 +270,10 @@ class Users:
|
|
|
268
270
|
(i.e. do not paginate).
|
|
269
271
|
include(list[str]): optional include parameter, only current
|
|
270
272
|
accepted value is 'lastLogin'
|
|
273
|
+
plan_id(int): optional plan_id parameter, returns users
|
|
274
|
+
in the selected plan.
|
|
275
|
+
seat_type(SeatType): optional seat_type parameter, filters users
|
|
276
|
+
by their seat type.
|
|
271
277
|
|
|
272
278
|
Returns:
|
|
273
279
|
IndexResult
|
|
@@ -280,6 +286,8 @@ class Users:
|
|
|
280
286
|
_op["query_params"]["pageSize"] = page_size
|
|
281
287
|
_op["query_params"]["page"] = page
|
|
282
288
|
_op["query_params"]["includeAll"] = include_all
|
|
289
|
+
_op["query_params"]["planId"] = plan_id
|
|
290
|
+
_op["query_params"]["seatType"] = seat_type
|
|
283
291
|
|
|
284
292
|
expected = ["IndexResult", "User"]
|
|
285
293
|
|
|
@@ -358,6 +366,91 @@ class Users:
|
|
|
358
366
|
|
|
359
367
|
return response
|
|
360
368
|
|
|
369
|
+
def upgrade_user(self, user_id, plan_id, seat_type):
|
|
370
|
+
"""Upgrades a user for a plan.
|
|
371
|
+
|
|
372
|
+
Args:
|
|
373
|
+
user_id (int): User ID
|
|
374
|
+
plan_id (int): Plan ID
|
|
375
|
+
seat_type (UpgradeSeatType): Seat type to upgrade to
|
|
376
|
+
|
|
377
|
+
Returns:
|
|
378
|
+
dict: Result
|
|
379
|
+
"""
|
|
380
|
+
_op = fresh_operation("upgrade_user")
|
|
381
|
+
_op["method"] = "POST"
|
|
382
|
+
_op["path"] = f"/users/{user_id}/plans/{plan_id}/upgrade"
|
|
383
|
+
_op["json"] = {"seatType": seat_type}
|
|
384
|
+
|
|
385
|
+
expected = ["Result", None]
|
|
386
|
+
|
|
387
|
+
prepped_request = self._base.prepare_request(_op)
|
|
388
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
389
|
+
|
|
390
|
+
return response
|
|
391
|
+
|
|
392
|
+
def downgrade_user(self, user_id, plan_id, seat_type):
|
|
393
|
+
"""Downgrades a user for a plan.
|
|
394
|
+
|
|
395
|
+
Args:
|
|
396
|
+
user_id (int): User ID
|
|
397
|
+
plan_id (int): Plan ID
|
|
398
|
+
seat_type (DowngradeSeatType): Seat type to downgrade to
|
|
399
|
+
|
|
400
|
+
Returns:
|
|
401
|
+
dict: Result
|
|
402
|
+
"""
|
|
403
|
+
_op = fresh_operation("downgrade_user")
|
|
404
|
+
_op["method"] = "POST"
|
|
405
|
+
_op["path"] = f"/users/{user_id}/plans/{plan_id}/downgrade"
|
|
406
|
+
_op["json"] = {"seatType": seat_type}
|
|
407
|
+
|
|
408
|
+
expected = ["Result", None]
|
|
409
|
+
|
|
410
|
+
prepped_request = self._base.prepare_request(_op)
|
|
411
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
412
|
+
|
|
413
|
+
return response
|
|
414
|
+
|
|
415
|
+
def list_user_plans(self, user_id, last_key=None, max_items=None):
|
|
416
|
+
"""List user's plans.
|
|
417
|
+
Args:
|
|
418
|
+
user_id (int): User ID
|
|
419
|
+
Returns:
|
|
420
|
+
TokenPaginatedResult
|
|
421
|
+
"""
|
|
422
|
+
_op = fresh_operation("list_user_plans")
|
|
423
|
+
_op["method"] = "GET"
|
|
424
|
+
_op["path"] = f"/users/{user_id}/plans"
|
|
425
|
+
_op["query_params"]["lastKey"] = last_key
|
|
426
|
+
_op["query_params"]["maxItems"] = max_items
|
|
427
|
+
|
|
428
|
+
expected = ["TokenPaginatedResult", "UserPlan"]
|
|
429
|
+
|
|
430
|
+
prepped_request = self._base.prepare_request(_op)
|
|
431
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
432
|
+
|
|
433
|
+
return response
|
|
434
|
+
|
|
435
|
+
def remove_user_from_plan(self, user_id, plan_id):
|
|
436
|
+
"""Remove user from plan.
|
|
437
|
+
Args:
|
|
438
|
+
user_id (int): User ID
|
|
439
|
+
plan_id (int): Plan ID
|
|
440
|
+
Returns:
|
|
441
|
+
Result
|
|
442
|
+
"""
|
|
443
|
+
_op = fresh_operation("remove_user_from_plan")
|
|
444
|
+
_op["method"] = "DELETE"
|
|
445
|
+
_op["path"] = f"/users/{user_id}/plans/{plan_id}"
|
|
446
|
+
|
|
447
|
+
expected = ["Result", None]
|
|
448
|
+
|
|
449
|
+
prepped_request = self._base.prepare_request(_op)
|
|
450
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
451
|
+
|
|
452
|
+
return response
|
|
453
|
+
|
|
361
454
|
def add_profile_image(self, user_id, file, file_type):
|
|
362
455
|
"""Uploads a profile image for the specified user.
|
|
363
456
|
|
smartsheet/version.py
CHANGED
smartsheet/workspaces.py
CHANGED
|
@@ -19,9 +19,12 @@ from __future__ import absolute_import
|
|
|
19
19
|
|
|
20
20
|
import logging
|
|
21
21
|
import os.path
|
|
22
|
+
import warnings
|
|
23
|
+
from typing import Optional, Union
|
|
22
24
|
|
|
23
25
|
from . import fresh_operation
|
|
24
26
|
from .models.folder import Folder
|
|
27
|
+
from .util import deprecated
|
|
25
28
|
|
|
26
29
|
|
|
27
30
|
class Workspaces:
|
|
@@ -235,9 +238,13 @@ class Workspaces:
|
|
|
235
238
|
|
|
236
239
|
return response
|
|
237
240
|
|
|
241
|
+
@deprecated
|
|
238
242
|
def get_workspace(self, workspace_id, load_all=False, include=None):
|
|
239
243
|
"""Get the specified Workspace and list its contents.
|
|
240
244
|
|
|
245
|
+
Deprecated: 3.1.0
|
|
246
|
+
Use `get_workspace_metadata` and `get_workspace_children` instead.
|
|
247
|
+
|
|
241
248
|
Get the specified Workspace and list its contents. By
|
|
242
249
|
default, this operation only returns top-level items in the
|
|
243
250
|
Workspace. To load all of the contents, including nested Folders,
|
|
@@ -266,10 +273,14 @@ class Workspaces:
|
|
|
266
273
|
|
|
267
274
|
return response
|
|
268
275
|
|
|
276
|
+
@deprecated
|
|
269
277
|
def list_folders(self, workspace_id, page_size=None, page=None, include_all=None):
|
|
270
278
|
"""Get a list of top-level child Folders within the specified
|
|
271
279
|
Workspace.
|
|
272
280
|
|
|
281
|
+
Deprecated: 3.1.0
|
|
282
|
+
Use `get_workspace_children` with children_resource_types=['folders'] instead.
|
|
283
|
+
|
|
273
284
|
Args:
|
|
274
285
|
workspace_id (int): Workspace ID
|
|
275
286
|
page_size (int): The maximum number of items to
|
|
@@ -323,25 +334,75 @@ class Workspaces:
|
|
|
323
334
|
|
|
324
335
|
return response
|
|
325
336
|
|
|
326
|
-
def list_workspaces(
|
|
337
|
+
def list_workspaces(
|
|
338
|
+
self,
|
|
339
|
+
page_size: Optional[int] = None,
|
|
340
|
+
page: Optional[int] = None,
|
|
341
|
+
include_all: Optional[bool] = None,
|
|
342
|
+
last_key: Optional[str] = None,
|
|
343
|
+
max_items: Optional[int] = None,
|
|
344
|
+
pagination_type: Optional[str] = None
|
|
345
|
+
):
|
|
327
346
|
"""Get the list of Workspaces the authenticated User may access.
|
|
328
|
-
|
|
329
347
|
Args:
|
|
330
|
-
page_size (int): The maximum number of items to
|
|
331
|
-
return per page.
|
|
332
|
-
page (int): Which page to return.
|
|
333
|
-
|
|
334
|
-
|
|
348
|
+
page_size (int, optional): [DEPRECATED] The maximum number of items to
|
|
349
|
+
return per page. Use pagination_type='token' with max_items instead.
|
|
350
|
+
page (int, optional): [DEPRECATED] Which page to return.
|
|
351
|
+
Use pagination_type='token' with last_key instead.
|
|
352
|
+
include_all (bool, optional): [DEPRECATED] If true, include all results
|
|
353
|
+
(i.e. do not paginate). Use pagination_type='token' instead.
|
|
354
|
+
last_key (str, optional): Pagination cursor for next page (token pagination only).
|
|
355
|
+
max_items (int, optional): Maximum items per page (token pagination only).
|
|
356
|
+
Must be a positive integer.
|
|
357
|
+
pagination_type (str, optional): Use 'token' for efficient cursor-based pagination.
|
|
358
|
+
Defaults to legacy offset-based pagination if not specified.
|
|
335
359
|
|
|
336
360
|
Returns:
|
|
337
|
-
IndexResult
|
|
361
|
+
IndexResult: When pagination_type='token', contains 'data' and 'last_key' attributes.
|
|
362
|
+
When using legacy pagination, contains paginated results with
|
|
363
|
+
total_count, total_pages, etc.
|
|
364
|
+
|
|
365
|
+
Raises:
|
|
366
|
+
ValueError: If pagination_type is not 'token' or None, or if max_items <= 0
|
|
367
|
+
when using token pagination.
|
|
338
368
|
"""
|
|
369
|
+
# Parameter validation
|
|
370
|
+
if pagination_type is not None and pagination_type not in ['token']:
|
|
371
|
+
raise ValueError("pagination_type must be 'token' or None")
|
|
372
|
+
if pagination_type == 'token' and max_items is not None and max_items <= 0:
|
|
373
|
+
raise ValueError("max_items must be a positive integer")
|
|
339
374
|
_op = fresh_operation("list_workspaces")
|
|
340
375
|
_op["method"] = "GET"
|
|
341
376
|
_op["path"] = "/workspaces"
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
377
|
+
|
|
378
|
+
# Issue deprecation warnings for old parameters when used
|
|
379
|
+
if page_size is not None:
|
|
380
|
+
warnings.warn(
|
|
381
|
+
"page_size parameter is deprecated. Use pagination_type='token' with max_items instead.",
|
|
382
|
+
DeprecationWarning,
|
|
383
|
+
stacklevel=2
|
|
384
|
+
)
|
|
385
|
+
if page is not None:
|
|
386
|
+
warnings.warn(
|
|
387
|
+
"page parameter is deprecated. Use pagination_type='token' with last_key instead.",
|
|
388
|
+
DeprecationWarning,
|
|
389
|
+
stacklevel=2
|
|
390
|
+
)
|
|
391
|
+
if include_all is not None:
|
|
392
|
+
warnings.warn(
|
|
393
|
+
"include_all parameter is deprecated. Use pagination_type='token' instead.",
|
|
394
|
+
DeprecationWarning,
|
|
395
|
+
stacklevel=2
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
if pagination_type == "token":
|
|
399
|
+
_op["query_params"]["lastKey"] = last_key
|
|
400
|
+
_op["query_params"]["maxItems"] = max_items
|
|
401
|
+
_op["query_params"]["paginationType"] = pagination_type
|
|
402
|
+
else:
|
|
403
|
+
_op["query_params"]["pageSize"] = page_size
|
|
404
|
+
_op["query_params"]["page"] = page
|
|
405
|
+
_op["query_params"]["includeAll"] = include_all
|
|
345
406
|
|
|
346
407
|
expected = ["IndexResult", "Workspace"]
|
|
347
408
|
|
|
@@ -429,6 +490,59 @@ class Workspaces:
|
|
|
429
490
|
|
|
430
491
|
return response
|
|
431
492
|
|
|
493
|
+
def get_workspace_metadata(self, workspace_id, include=None):
|
|
494
|
+
"""Get metadata of a workspace.
|
|
495
|
+
|
|
496
|
+
Args:
|
|
497
|
+
workspace_id (int): Workspace ID
|
|
498
|
+
include (list[str]): A list of optional elements to include
|
|
499
|
+
in the response. Valid list values: source
|
|
500
|
+
|
|
501
|
+
Returns:
|
|
502
|
+
Workspace
|
|
503
|
+
"""
|
|
504
|
+
_op = fresh_operation("get_workspace_metadata")
|
|
505
|
+
_op["method"] = "GET"
|
|
506
|
+
_op["path"] = "/workspaces/" + str(workspace_id) + "/metadata"
|
|
507
|
+
_op["query_params"]["include"] = include
|
|
508
|
+
|
|
509
|
+
expected = "Workspace"
|
|
510
|
+
prepped_request = self._base.prepare_request(_op)
|
|
511
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
512
|
+
|
|
513
|
+
return response
|
|
514
|
+
|
|
515
|
+
def get_workspace_children(self, workspace_id, children_resource_types=None, include=None, last_key=None, max_items=None):
|
|
516
|
+
"""Get children of a workspace.
|
|
517
|
+
|
|
518
|
+
Args:
|
|
519
|
+
workspace_id (int): Workspace ID
|
|
520
|
+
children_resource_types (list[str]): The types of the children resources.
|
|
521
|
+
If not provided, returns children of all types.
|
|
522
|
+
Valid list values: sheets, reports, sights, folders.
|
|
523
|
+
include (list[str]): A list of optional elements to include in the response.
|
|
524
|
+
Valid list values: source, ownerInfo.
|
|
525
|
+
last_key (str): The token from a previous request that will allow this one
|
|
526
|
+
to fetch the next page of results.
|
|
527
|
+
max_items (int): The maximum number of items to return in the response.
|
|
528
|
+
|
|
529
|
+
Returns:
|
|
530
|
+
PaginatedChildrenResult
|
|
531
|
+
"""
|
|
532
|
+
_op = fresh_operation("get_workspace_children")
|
|
533
|
+
_op["method"] = "GET"
|
|
534
|
+
_op["path"] = "/workspaces/" + str(workspace_id) + "/children"
|
|
535
|
+
_op["query_params"]["childrenResourceTypes"] = children_resource_types
|
|
536
|
+
_op["query_params"]["include"] = include
|
|
537
|
+
_op["query_params"]["lastKey"] = last_key
|
|
538
|
+
_op["query_params"]["maxItems"] = max_items
|
|
539
|
+
|
|
540
|
+
expected = "PaginatedChildrenResult"
|
|
541
|
+
prepped_request = self._base.prepare_request(_op)
|
|
542
|
+
response = self._base.request(prepped_request, expected, _op)
|
|
543
|
+
|
|
544
|
+
return response
|
|
545
|
+
|
|
432
546
|
def import_csv_sheet(
|
|
433
547
|
self,
|
|
434
548
|
workspace_id,
|
|
@@ -6,9 +6,9 @@ smartsheet/discussions.py,sha256=n0mbARczzdBkw83ZPKcNABp5j6AQLZPUHkKAZOK5q1Y,131
|
|
|
6
6
|
smartsheet/events.py,sha256=MKASwB9BF5AeEMC7Qx-YPKpd9yjs6UCWwilBC8RZDgA,3417
|
|
7
7
|
smartsheet/exceptions.py,sha256=ISCV4fIAkYgcYMsZL62zDr48qIPPok6N4myifej2M4c,3894
|
|
8
8
|
smartsheet/favorites.py,sha256=8D1o1YCmzie43cNvSVwuDKdUnRaEV8-1PiIimNcQkp0,3921
|
|
9
|
-
smartsheet/folders.py,sha256=
|
|
9
|
+
smartsheet/folders.py,sha256=GemtQiqLnuc2beU-VKqbGRAz5Ec8brUWfhyFeAFoIPY,14441
|
|
10
10
|
smartsheet/groups.py,sha256=Sk9mhsR9KtIKTTX8SzqIyagz93rSr5z_5G19fn1eAoI,5325
|
|
11
|
-
smartsheet/home.py,sha256=
|
|
11
|
+
smartsheet/home.py,sha256=u0Ioz59TiNQRf-u5N6s3ZQTuaW3Ck4FJIT04nbSoJt8,5650
|
|
12
12
|
smartsheet/images.py,sha256=Pts20YXCsZ06JGC6av3mk2je_kbcM11b9lO7L11mJoc,1872
|
|
13
13
|
smartsheet/object_value.py,sha256=dcPFZEPpqAiZsBRUawozLSSlVjxGBWTT3VXvsRYso8Q,3129
|
|
14
14
|
smartsheet/passthrough.py,sha256=k4p_3Kk7ISApNNFLDicVN5KYL0ll2AA4eAgX2cjnlzg,3950
|
|
@@ -22,12 +22,12 @@ smartsheet/smartsheet.py,sha256=wOBejFgIh_xQu1KuIlh9ZAsq2OxG8EIWUqtBQpmz1y4,2340
|
|
|
22
22
|
smartsheet/templates.py,sha256=z_Tj-4jZsu3RkLNbCAZWM2W05Zbio9T_uyU33rUPxzE,2898
|
|
23
23
|
smartsheet/token.py,sha256=5uz-IG5adx_zr2-uepH-W8ATv0dq9aZNjYLeZNwldqI,4703
|
|
24
24
|
smartsheet/types.py,sha256=aIdRJ89jwclmiZ4RH3hnZHJTFWFxgNKW3d8fghm21eM,9126
|
|
25
|
-
smartsheet/users.py,sha256=
|
|
25
|
+
smartsheet/users.py,sha256=1KnqKJIzJEPMNy26BQY1b9jb3dItbzglrljV1MGD5ic,15887
|
|
26
26
|
smartsheet/util.py,sha256=12Y6eluecB8k4Ns-at81AEM18ND2TCKa9bF4BlNRrKM,5633
|
|
27
|
-
smartsheet/version.py,sha256=
|
|
27
|
+
smartsheet/version.py,sha256=jXprrDLc5_o9OzizdGMr92Lmhow65AreA5_ht6m6bmA,160
|
|
28
28
|
smartsheet/webhooks.py,sha256=7F7g4Ks0GyS3QxsNWm1SFtrOr00jBisCjj7-hcToHM8,4637
|
|
29
|
-
smartsheet/workspaces.py,sha256=
|
|
30
|
-
smartsheet/models/__init__.py,sha256=
|
|
29
|
+
smartsheet/workspaces.py,sha256=r81xh3HfYsX--ll5pQ-h7kSSJELokYV-bSjuD0WloeU,22651
|
|
30
|
+
smartsheet/models/__init__.py,sha256=4P6wKY8TpbV_rI5Z5c1ifxiwJEWL5bsvecVcjtUSJ9U,4754
|
|
31
31
|
smartsheet/models/access_token.py,sha256=sKHL5cFRWPTjymX06ZIXaCDp8ZJQEVpXN8mns1DAvGM,2564
|
|
32
32
|
smartsheet/models/account.py,sha256=nLg_5O4Vnc7aNf9p1kIcsgdAm23IC2H7cKkxjLxwS9U,1941
|
|
33
33
|
smartsheet/models/alternate_email.py,sha256=n8zqWkY-uzSw_CVKBvYUc6pGSR0v4yTx8S5PaIiX_AU,2263
|
|
@@ -56,7 +56,7 @@ smartsheet/models/criteria.py,sha256=zk6Zxq1JkO3TVRGhenKPdupxlFJYLXRLe_eM0yns4IY
|
|
|
56
56
|
smartsheet/models/cross_sheet_reference.py,sha256=rh5vhbkPGf20wOqQoGamERju0TkzMUXzcqYjw6ydOU8,3476
|
|
57
57
|
smartsheet/models/currency.py,sha256=XHaEaLAvM5J8WRphwMc1ldY94Qfk_cFmmghx2uooeOA,1692
|
|
58
58
|
smartsheet/models/date_object_value.py,sha256=YEKtiaY9yb-PzK1RlFA3yqYd932XAlVYuoXBVPcUsd0,1616
|
|
59
|
-
smartsheet/models/datetime_object_value.py,sha256=
|
|
59
|
+
smartsheet/models/datetime_object_value.py,sha256=uWH-YSOjy5P-BiavVMJFMkbcb5MEFTmyeqTAH5X25_k,1652
|
|
60
60
|
smartsheet/models/discussion.py,sha256=ndazqRPjrmE1FV42czM9NDI1VFE78y8v8KhOlylJpd8,4790
|
|
61
61
|
smartsheet/models/downloaded_file.py,sha256=8o6namCzPceSV_FbTzgywFu2JdOWiwll94pRFXftnGM,2869
|
|
62
62
|
smartsheet/models/duration.py,sha256=jaHSGFUiAxbvQ1-McK3U1kKicgIHam4dV6DSAymL9r8,2767
|
|
@@ -67,7 +67,7 @@ smartsheet/models/event.py,sha256=GFs2nK2wPfPOCiRlu6qhn0Teu_b2-JcIdA7nlo_TDf0,40
|
|
|
67
67
|
smartsheet/models/event_result.py,sha256=XN1TYx6RUPlXq6qHYvbRI2Pfm2-HcBs8WNmB5gzoGVQ,2560
|
|
68
68
|
smartsheet/models/explicit_null.py,sha256=ajwJRTseizgnf2ZY0qf5k97zvNTm033bKduA1OGCm0M,774
|
|
69
69
|
smartsheet/models/favorite.py,sha256=BTQumH0o-MQ93AS02qymyIxEVCR_CrwMWfuT0H051dc,2157
|
|
70
|
-
smartsheet/models/folder.py,sha256=
|
|
70
|
+
smartsheet/models/folder.py,sha256=WOLaECb18w07tn5PuRpF0aNiovZ9I3B9oH5-1QMgoi8,4325
|
|
71
71
|
smartsheet/models/font_family.py,sha256=32tBgd0w58dWco3goN4NZ9eMafaU3szzXYdQudGmeUM,1646
|
|
72
72
|
smartsheet/models/format_details.py,sha256=DwVi1XpXq__lFa1WQHzciE9s8nJltUmfq9l7xTM4uec,1542
|
|
73
73
|
smartsheet/models/format_tables.py,sha256=FwoZBr030PDZ1s2Z2Prfob1csHao5TyNKB2vlOttGPU,4765
|
|
@@ -79,7 +79,7 @@ smartsheet/models/image.py,sha256=EkoTNgg8dTo2cHBd1TmBI0l735nrxGiTMEM1cVRNFcQ,24
|
|
|
79
79
|
smartsheet/models/image_url.py,sha256=NmUotfupHxj6F3UvqykhgjzhcSrtPYUXRfxxOovDqGQ,2261
|
|
80
80
|
smartsheet/models/image_url_map.py,sha256=k3U1mykrlMsSPQxGa9AAC-erFfEMpvaL5nGp7stBZz0,1927
|
|
81
81
|
smartsheet/models/image_widget_content.py,sha256=lWmhK9rIoG62rIGXDMnSswn09qPBICeCEk5lYxRCqdw,3098
|
|
82
|
-
smartsheet/models/index_result.py,sha256=
|
|
82
|
+
smartsheet/models/index_result.py,sha256=OzLE8Hd57CJSbTCJSpHS5equd0N1HW9_NrrEaQivS_4,3235
|
|
83
83
|
smartsheet/models/json_object.py,sha256=HDJeFcPhlLrhUyb2nMO2ARE9AaCmWXHJ_O3YUQ1vl3s,1572
|
|
84
84
|
smartsheet/models/multi_contact_object_value.py,sha256=m59rDL0a3QXPYJ4Lz27ECeVji7IP5ptrCwhZBHFoBzc,1538
|
|
85
85
|
smartsheet/models/multi_picklist_object_value.py,sha256=jDwPLZZYaFTob74r2SeJSp_4bFL7BAr_zjfPkZhyz7E,1475
|
|
@@ -87,6 +87,7 @@ smartsheet/models/multi_row_email.py,sha256=LXvLY7b9KIqubaFX9uLjh4JsUHIQgPg0O_oC
|
|
|
87
87
|
smartsheet/models/number_object_value.py,sha256=m4s9dsDxIl-t6jPB0_sZtCL82EHBcc8yatXjyCCDGZY,1241
|
|
88
88
|
smartsheet/models/o_auth_error.py,sha256=svDzW9mqdUnRD4g0lhrr0QQVvBHPqY6C1nZj7oPw8p4,2340
|
|
89
89
|
smartsheet/models/object_value.py,sha256=YeKhWcL_y_lsSRdXEFdc14K9HG3FHFPJvAKGypWDAtE,3444
|
|
90
|
+
smartsheet/models/paginated_children_result.py,sha256=zcFUp7k8AQDbDLw-UWTZYkf6Gp8Z-v7LQWy9FPJ5ry4,2913
|
|
90
91
|
smartsheet/models/predecessor.py,sha256=UjmBW_bTD7cAySPL-p5BrkcjNEQxkDizdgcr-KCuvM8,2629
|
|
91
92
|
smartsheet/models/predecessor_list.py,sha256=OYfrr_P4YkdDRNU6IUGL1ZN75yWyejCNx_q7rGdzIx0,1523
|
|
92
93
|
smartsheet/models/primitive_object_value.py,sha256=LaO7zBnVPZIXXEqS_oGSLi6XaulTiw9dK6-bM8pEYXc,1563
|
|
@@ -125,14 +126,16 @@ smartsheet/models/sight.py,sha256=braCa6b4GX-3XS7PpNJxnLUcoFxRy1XsauGjs_lVKTE,43
|
|
|
125
126
|
smartsheet/models/sight_publish.py,sha256=kzYJ2v4Klw28bOZmnlDG0c5HkUXZ5R7F_mc7DXB6oX0,2342
|
|
126
127
|
smartsheet/models/sort_criterion.py,sha256=VwQwDZrqeEqoahpAqf7PJWEUogqcEhH-owV89EAbqsQ,1757
|
|
127
128
|
smartsheet/models/sort_specifier.py,sha256=1wR3RX7xSQni2jzSkid1OS7swSUyDJay46nWOeN_zTQ,1566
|
|
128
|
-
smartsheet/models/source.py,sha256=
|
|
129
|
+
smartsheet/models/source.py,sha256=9Yko05-2BaTZBG8JgQWqZyvTOFMmWI9yndBak12_D1Q,2202
|
|
129
130
|
smartsheet/models/string_object_value.py,sha256=GPMIAA1utIefw4VVsHWcT5y5GBK9Z9FC4dc3qua4Px0,1241
|
|
130
131
|
smartsheet/models/summary_field.py,sha256=QdVYD2XleUKkprVAxOJ6dfTbZo8w7sSTj2p_wj2Ue2E,6341
|
|
131
132
|
smartsheet/models/template.py,sha256=Up5yM3Q02-8QM8j74_WWWN-AwCValM3xnAiOzmmQiDE,4207
|
|
132
133
|
smartsheet/models/title_rich_text_widget_content.py,sha256=zdHd_RdPPO7flnOmKqIkkqo_CSDtOg0Z4hj0vAK7-ZU,2018
|
|
134
|
+
smartsheet/models/token_paginated_result.py,sha256=gfdLwahCrG7kTRMVvoXe78jqYdw6TeZEVbnKqUPwCqc,2297
|
|
133
135
|
smartsheet/models/update_request.py,sha256=5CkaSfhPLUPqtU6O9EuwFsyccpeBB3rnLLtvyxPmrpM,2881
|
|
134
136
|
smartsheet/models/user.py,sha256=CKMjNusL7_TU0V07vqoxruL6gQbXHctBNItJJIsSQHI,1553
|
|
135
|
-
smartsheet/models/user_model.py,sha256=
|
|
137
|
+
smartsheet/models/user_model.py,sha256=dVJp2mvtiUH-qi5rQX42S_7kPywyMaMnRkpNTv7-lTw,6910
|
|
138
|
+
smartsheet/models/user_plan.py,sha256=WbZUzvl8GDIaUskqJU6g-ROMgIuFSQN4PjZAqxeOiUg,1696
|
|
136
139
|
smartsheet/models/user_profile.py,sha256=vKVL2XkFdO9l2RGZRRcpiASjek1q-Ffee7x4z53SLtE,2341
|
|
137
140
|
smartsheet/models/version.py,sha256=gC8YvEjB-RO9avvz3sG2lDHrDkMi0i-o9SP8h5vLrbY,1540
|
|
138
141
|
smartsheet/models/web_content_widget_content.py,sha256=N_2HEOsWLI6D3s6vGZV_qCsVEEe3xkxeK9xUAP4SqCI,1719
|
|
@@ -143,8 +146,8 @@ smartsheet/models/webhook_subscope.py,sha256=h65vj3vww4GsnBreDRKJcgg76XbC0-2K0PB
|
|
|
143
146
|
smartsheet/models/widget.py,sha256=G5UKR1latGSuXqm-MCRQxn9W7IJgo2FsUWJ9heEW0RA,6099
|
|
144
147
|
smartsheet/models/widget_content.py,sha256=hxv3DJWO8YPe4ND-HUZ59eOVU9LAy02owU-KQVWUsDU,1525
|
|
145
148
|
smartsheet/models/widget_hyperlink.py,sha256=JPjaSftHFHiFj48tfOckGWzrew_CLKmE2k9lUA_RQSk,2059
|
|
146
|
-
smartsheet/models/workspace.py,sha256=
|
|
147
|
-
smartsheet/models/enums/__init__.py,sha256=
|
|
149
|
+
smartsheet/models/workspace.py,sha256=_YT4i4DEK32kEyqlWixZUQSQyBiZkNtwtSmuhc98H2s,4522
|
|
150
|
+
smartsheet/models/enums/__init__.py,sha256=i-B6OYkAIRRQZwG8JgX19ZBHwVrBXWHfrLEWMUPXpj4,2322
|
|
148
151
|
smartsheet/models/enums/access_level.py,sha256=LvKh3Z2LrFeLm-R-dT0qOVinBsA4jEOxM02flg0LFaY,816
|
|
149
152
|
smartsheet/models/enums/attachment_parent_type.py,sha256=EFcrHg8xpx_ZxrrGb3vkk9Ji8PD74Q8GeWhXZMquVEw,770
|
|
150
153
|
smartsheet/models/enums/attachment_sub_type.py,sha256=wZEo80LynIFDFZkTHCpQx5T-G5deT9HSRBMRdvHyh7Q,826
|
|
@@ -168,6 +171,7 @@ smartsheet/models/enums/paper_type.py,sha256=vh0VrF6G9xB5Kdt979I51wulnTqYl8hMrXo
|
|
|
168
171
|
smartsheet/models/enums/predecessor_type.py,sha256=CB2oX7xbjAV8RjzkTCSHTKVWvzvCkwZLa21jBQLjotA,767
|
|
169
172
|
smartsheet/models/enums/publish_accessible_by.py,sha256=x5z2CCHttwprcyV7XL0AN39E1h7OIUMpe_Fei5HpBGo,751
|
|
170
173
|
smartsheet/models/enums/schedule_type.py,sha256=KtTpdD3oKlntmk1Nl2i3ymIfGW6CP3I_7mi7vrVTCZc,793
|
|
174
|
+
smartsheet/models/enums/seat_type.py,sha256=5kaFtJPpescgCtnbXg4JM6H35UQKh-eeSWBFlaBkbE4,318
|
|
171
175
|
smartsheet/models/enums/share_scope.py,sha256=LEZnBQjBGnFIHVHrX_FsG-sndGK-XsfqDhPeY7oZPWs,749
|
|
172
176
|
smartsheet/models/enums/share_type.py,sha256=89e8ki-mlH3i8qEjFKnqBEK-GUEipFItOE5rhED39bg,744
|
|
173
177
|
smartsheet/models/enums/sheet_email_format.py,sha256=St0FcwbnnkPQa0ZqlwnkQ44XxineojE-XtZmZd7_B9U,768
|
|
@@ -179,9 +183,9 @@ smartsheet/models/enums/system_column_type.py,sha256=UfhNUBGD_0K1Pas7fujGEuax55O
|
|
|
179
183
|
smartsheet/models/enums/update_request_status.py,sha256=xYF84x1dTFhJMYVi1q3G1T9u1IGN3szlR1jj5HHC0hE,777
|
|
180
184
|
smartsheet/models/enums/user_status.py,sha256=SB7qRcA0dhdRimsOKHCGF3CB6fL0XuifxQEWZGNNS8Q,766
|
|
181
185
|
smartsheet/models/enums/widget_type.py,sha256=VfVq59fLZsT4ks_ZBrtv52u2Cl60iAdlA6mGD_elz-k,1072
|
|
182
|
-
smartsheet_python_sdk-3.0.
|
|
183
|
-
smartsheet_python_sdk-3.0.
|
|
184
|
-
smartsheet_python_sdk-3.0.
|
|
185
|
-
smartsheet_python_sdk-3.0.
|
|
186
|
-
smartsheet_python_sdk-3.0.
|
|
187
|
-
smartsheet_python_sdk-3.0.
|
|
186
|
+
smartsheet_python_sdk-3.2.0.dist-info/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
187
|
+
smartsheet_python_sdk-3.2.0.dist-info/METADATA,sha256=MM8LT9xqe55C482AZXjBraonFBh1ofXzLcO2QEspIuI,4693
|
|
188
|
+
smartsheet_python_sdk-3.2.0.dist-info/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
|
|
189
|
+
smartsheet_python_sdk-3.2.0.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
|
|
190
|
+
smartsheet_python_sdk-3.2.0.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
|
|
191
|
+
smartsheet_python_sdk-3.2.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{smartsheet_python_sdk-3.0.5.dist-info → smartsheet_python_sdk-3.2.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|