smartsheet-python-sdk 3.0.2__py2.py3-none-any.whl → 3.0.4__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/__init__.py CHANGED
@@ -33,3 +33,5 @@ except ImportError:
33
33
 
34
34
  from .smartsheet import (AbstractUserCalcBackoff, Smartsheet, # NOQA
35
35
  fresh_operation)
36
+
37
+ from . import models
smartsheet/events.py CHANGED
@@ -30,13 +30,19 @@ class Events:
30
30
  self._log = logging.getLogger(__name__)
31
31
 
32
32
  def list_events(
33
- self, since=None, stream_position=None, max_count=None, numeric_dates=None
33
+ self, since=None, to=None, stream_position=None, max_count=None, numeric_dates=None # pylint: disable=invalid-name
34
34
  ):
35
35
  """Get the list of all Events.
36
36
 
37
37
  Args:
38
38
  since (str or long): Starting time for events to return.
39
39
  You must pass in a value for either since or streamPosition and never both.
40
+ to (str or long): Ending time for events to return.
41
+ This parameter specifies the endpoint in time for the events to be fetched.
42
+ Similar to the `since` parameter, `to` can be passed in either as a datetime string in
43
+ ISO 8601 format or as a UNIX epoch time in milliseconds. This allows for defining a
44
+ precise time range for the events query. Note that `to` is optional and can be used in
45
+ conjunction with `since` to specify both the start and end times for the event retrieval window.
40
46
  stream_position (str): Indicates next set of events to return.
41
47
  Use value of nextStreamPosition returned from the previous call.
42
48
  You must pass in a value for either since or streamPosition and never both.
@@ -53,9 +59,14 @@ class Events:
53
59
  _op["method"] = "GET"
54
60
  _op["path"] = "/events"
55
61
  if isinstance(since, datetime):
56
- _op["query_params"]["since"] = since # .isoformat()
62
+ _op["query_params"]["since"] = since.isoformat()
57
63
  else:
58
64
  _op["query_params"]["since"] = since
65
+
66
+ if isinstance(to, datetime):
67
+ _op["query_params"]["to"] = to.isoformat()
68
+ else:
69
+ _op["query_params"]["to"] = to
59
70
  _op["query_params"]["streamPosition"] = stream_position
60
71
  _op["query_params"]["maxCount"] = max_count
61
72
  _op["query_params"]["numericDates"] = numeric_dates
smartsheet/smartsheet.py CHANGED
@@ -279,16 +279,16 @@ class Smartsheet:
279
279
  response.request.url,
280
280
  )
281
281
  if response.request.body is not None:
282
- body_dumps = f'"<< {response.request.headers["Content-Type"]} content type suppressed >>"'
282
+ body_dumps = f'"<< {response.request.headers.get("Content-Type")} content type suppressed >>"'
283
283
  if is_multipart(response.request):
284
284
  body_dumps = '"<< multipart body suppressed >>"'
285
- elif "application/json" in response.request.headers["Content-Type"]:
285
+ elif response.request.headers.get("Content-Type") is not None and "application/json" in response.request.headers.get("Content-Type"):
286
286
  body = response.request.body.decode("utf8")
287
287
  body_dumps = json.dumps(json.loads(body), sort_keys=True)
288
288
  self._log.debug('{"requestBody": %s}', body_dumps)
289
289
  # response
290
- content_dumps = f'"<< {response.headers["Content-Type"]} content type suppressed >>"'
291
- if "application/json" in response.headers["Content-Type"]:
290
+ content_dumps = f'"<< {response.headers.get("Content-Type")} content type suppressed >>"'
291
+ if response.request.headers.get("Content-Type") is not None and "application/json" in response.headers.get("Content-Type"):
292
292
  content = response.content.decode("utf8")
293
293
  content_dumps = json.dumps(json.loads(content), sort_keys=True)
294
294
  if 200 <= response.status_code <= 299:
smartsheet/util.py CHANGED
@@ -112,6 +112,14 @@ def serialize(obj):
112
112
  serialized = serialize(item)
113
113
  if not hasattr(serialized, "is_explicit_null"):
114
114
  retval.append(serialized)
115
+
116
+ elif isinstance(obj, dict):
117
+ retval = {}
118
+ for key, value in obj.items():
119
+ serialized_value = serialize(value)
120
+ if not hasattr(serialized_value, "is_explicit_null"):
121
+ retval[key] = serialized_value
122
+
115
123
  else:
116
124
  retval = {}
117
125
  prop_list = get_child_properties(obj)
smartsheet/version.py CHANGED
@@ -1,4 +1,16 @@
1
1
  # file generated by setuptools_scm
2
2
  # don't change, don't track in version control
3
- __version__ = version = '3.0.2'
4
- __version_tuple__ = version_tuple = (3, 0, 2)
3
+ TYPE_CHECKING = False
4
+ if TYPE_CHECKING:
5
+ from typing import Tuple, Union
6
+ VERSION_TUPLE = Tuple[Union[int, str], ...]
7
+ else:
8
+ VERSION_TUPLE = object
9
+
10
+ version: str
11
+ __version__: str
12
+ __version_tuple__: VERSION_TUPLE
13
+ version_tuple: VERSION_TUPLE
14
+
15
+ __version__ = version = '3.0.4'
16
+ __version_tuple__ = version_tuple = (3, 0, 4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: smartsheet-python-sdk
3
- Version: 3.0.2
3
+ Version: 3.0.4
4
4
  Summary: Library that uses Python to connect to Smartsheet services (using API 2.0).
5
5
  Home-page: http://smartsheet-platform.github.io/api-docs/
6
6
  Author: Smartsheet
@@ -24,7 +24,7 @@ License-File: LICENSE.md
24
24
  License-File: NOTICE
25
25
  Requires-Dist: requests
26
26
  Requires-Dist: requests-toolbelt
27
- Requires-Dist: six (>=1.9)
27
+ Requires-Dist: six >=1.9
28
28
  Requires-Dist: certifi
29
29
  Requires-Dist: python-dateutil
30
30
  Provides-Extra: develop
@@ -1,9 +1,9 @@
1
- smartsheet/__init__.py,sha256=dptnqBf0CnloqwcXiXPWMbdsR563wkgC3gKp9EBQGBo,1130
1
+ smartsheet/__init__.py,sha256=h2TD_nYTxqa7lcKb_mOIa-DMQN-pYaGk1Du0U3IVMyA,1152
2
2
  smartsheet/attachments.py,sha256=eZ1y5jS_TJSyZzzapc68ol1qhrLxCXc2sY8l8oY1Gvo,17865
3
3
  smartsheet/cells.py,sha256=juLA85Zdyt5KfvDLdFkvEJ6S635JMTJs8Xhb2CchCPw,4800
4
4
  smartsheet/contacts.py,sha256=IBV3ncoP7R7GmzQI0H1CIwq4scGk9iBC1ayyQ927YrQ,2383
5
5
  smartsheet/discussions.py,sha256=n0mbARczzdBkw83ZPKcNABp5j6AQLZPUHkKAZOK5q1Y,13110
6
- smartsheet/events.py,sha256=XVYcH568gQDMLmcHnQKTsiMVL2EnuRZmayNrhaWNoYs,2656
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
9
  smartsheet/folders.py,sha256=GLFtMe7IXQmaf7jhrWWwnSrDn60sueG-oISspsY5e_A,12011
@@ -18,13 +18,13 @@ smartsheet/server.py,sha256=9wySsa_y_G-VO88tEHGHp919zRVFS0kCFIhiM6crWEU,1429
18
18
  smartsheet/session.py,sha256=TQ3IgVZ64r7Dszwo8rMISFezWxuwFYshhW9QhzoA428,2125
19
19
  smartsheet/sheets.py,sha256=Tk1-llyfoTaVZybpBCOskR75cTF_tFhE3EIducCumsA,70060
20
20
  smartsheet/sights.py,sha256=IZgy8CJZBJ-pQo6vNwkDSBuoLCv5RAW39kNUMMNJ-oc,11569
21
- smartsheet/smartsheet.py,sha256=VSZDOvNDK2WMBbQ46ZgaVMGoHD-CpxrdqxO6rWdB8BY,22520
21
+ smartsheet/smartsheet.py,sha256=01NgYLZkn83BrOhuoPYkNEnjRacJniLrMJ-jIxgVs4E,22658
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
25
  smartsheet/users.py,sha256=3LyC7BsPLa3dAg5EXaGswgXq0O8s77nsE0sSkjLfRe8,12775
26
- smartsheet/util.py,sha256=mpGYgQ6cQMzXFTEwILf5tG18VrhGY1annrs_wUuw1Fo,5379
27
- smartsheet/version.py,sha256=kRTVoJDIeBlQnnXKcdQp_FRvpXSxKyQtsod3gd_y8tg,160
26
+ smartsheet/util.py,sha256=12Y6eluecB8k4Ns-at81AEM18ND2TCKa9bF4BlNRrKM,5633
27
+ smartsheet/version.py,sha256=yyqcyuVbO5Bq7rMS_oAT4a92vlOM2Jk4fCNagNkWYJk,411
28
28
  smartsheet/webhooks.py,sha256=7F7g4Ks0GyS3QxsNWm1SFtrOr00jBisCjj7-hcToHM8,4637
29
29
  smartsheet/workspaces.py,sha256=u67WtvWFEgXRBNVFPXeNHnim2BymFaBz3v6q6wDHYOg,17550
30
30
  smartsheet/models/__init__.py,sha256=gdk_4O22uy8m4yStECUiGzNnxqMqFonPskJGbB5AIwo,4602
@@ -179,9 +179,9 @@ smartsheet/models/enums/system_column_type.py,sha256=UfhNUBGD_0K1Pas7fujGEuax55O
179
179
  smartsheet/models/enums/update_request_status.py,sha256=xYF84x1dTFhJMYVi1q3G1T9u1IGN3szlR1jj5HHC0hE,777
180
180
  smartsheet/models/enums/user_status.py,sha256=SB7qRcA0dhdRimsOKHCGF3CB6fL0XuifxQEWZGNNS8Q,766
181
181
  smartsheet/models/enums/widget_type.py,sha256=VfVq59fLZsT4ks_ZBrtv52u2Cl60iAdlA6mGD_elz-k,1072
182
- smartsheet_python_sdk-3.0.2.dist-info/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
183
- smartsheet_python_sdk-3.0.2.dist-info/METADATA,sha256=OJuxbX626xdAQK6Hxqr9Zo1VX2HyU3XCiZE7X07Eenw,4703
184
- smartsheet_python_sdk-3.0.2.dist-info/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
185
- smartsheet_python_sdk-3.0.2.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
186
- smartsheet_python_sdk-3.0.2.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
187
- smartsheet_python_sdk-3.0.2.dist-info/RECORD,,
182
+ smartsheet_python_sdk-3.0.4.dist-info/LICENSE.md,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
183
+ smartsheet_python_sdk-3.0.4.dist-info/METADATA,sha256=EtQ9wKIN5l365kGm1R0Nc5upU_n7cdrUsj3X12ELJzg,4701
184
+ smartsheet_python_sdk-3.0.4.dist-info/NOTICE,sha256=mXr2ryVjnCjykeW0J79kFfVXQG_Z9SV4BV_QPNENW1U,420
185
+ smartsheet_python_sdk-3.0.4.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
186
+ smartsheet_python_sdk-3.0.4.dist-info/top_level.txt,sha256=kozWEYiKjyJmSXzd6p5ugkQ5bhoHS9V3NnvLagUfcNw,11
187
+ smartsheet_python_sdk-3.0.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.40.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py2-none-any
5
5
  Tag: py3-none-any