Skip to content

Commit c8fda2a

Browse files
authored
Add created_at on orders (#38)
* Add created_at on order response * Update changelog
1 parent 2d989c5 commit c8fda2a

8 files changed

+45
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.12.0] - 2021-09-08
9+
10+
### Added
11+
12+
- Adds a `created_at` attribute in all order responses
13+
814
## [1.11.0] - 2021-09-07
915

1016
### Added

patch_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from __future__ import absolute_import
1717

18-
__version__ = "1.11.0"
18+
__version__ = "1.12.0"
1919

2020
# import ApiClient
2121
from patch_api.api_client import ApiClient

patch_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __init__(
9191
self.default_headers[header_name] = header_value
9292
self.cookie = cookie
9393
# Set default User-Agent.
94-
self.user_agent = "patch-python/1.11.0"
94+
self.user_agent = "patch-python/1.12.0"
9595

9696
def __del__(self):
9797
if self._pool:

patch_api/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def to_debug_report(self):
341341
"OS: {env}\n"
342342
"Python Version: {pyversion}\n"
343343
"Version of the API: v1\n"
344-
"SDK Package Version: 1.11.0".format(
344+
"SDK Package Version: 1.12.0".format(
345345
env=sys.platform, pyversion=sys.version
346346
)
347347
)

patch_api/models/create_bitcoin_estimate_request.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CreateBitcoinEstimateRequest(object):
3434
and the value is json key in definition.
3535
"""
3636
openapi_types = {
37-
"timestamp": "str",
37+
"timestamp": "datetime",
3838
"transaction_value_btc_sats": "int",
3939
"project_id": "str",
4040
"create_order": "bool",
@@ -77,7 +77,7 @@ def timestamp(self):
7777
7878
7979
:return: The timestamp of this CreateBitcoinEstimateRequest. # noqa: E501
80-
:rtype: str
80+
:rtype: datetime
8181
"""
8282
return self._timestamp
8383

@@ -87,7 +87,7 @@ def timestamp(self, timestamp):
8787
8888
8989
:param timestamp: The timestamp of this CreateBitcoinEstimateRequest. # noqa: E501
90-
:type: str
90+
:type: datetime
9191
"""
9292

9393
self._timestamp = timestamp

patch_api/models/order.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class Order(object):
3535
"""
3636
openapi_types = {
3737
"id": "str",
38+
"created_at": "datetime",
3839
"mass_g": "int",
3940
"production": "bool",
4041
"state": "str",
@@ -48,6 +49,7 @@ class Order(object):
4849

4950
attribute_map = {
5051
"id": "id",
52+
"created_at": "created_at",
5153
"mass_g": "mass_g",
5254
"production": "production",
5355
"state": "state",
@@ -62,6 +64,7 @@ class Order(object):
6264
def __init__(
6365
self,
6466
id=None,
67+
created_at=None,
6568
mass_g=None,
6669
production=None,
6770
state=None,
@@ -79,6 +82,7 @@ def __init__(
7982
self.local_vars_configuration = local_vars_configuration
8083

8184
self._id = None
85+
self._created_at = None
8286
self._mass_g = None
8387
self._production = None
8488
self._state = None
@@ -91,6 +95,8 @@ def __init__(
9195
self.discriminator = None
9296

9397
self.id = id
98+
if created_at is not None:
99+
self.created_at = created_at
94100
self.mass_g = mass_g
95101
self.production = production
96102
self.state = state
@@ -129,6 +135,29 @@ def id(self, id):
129135

130136
self._id = id
131137

138+
@property
139+
def created_at(self):
140+
"""Gets the created_at of this Order. # noqa: E501
141+
142+
The timestamp at which the order was created # noqa: E501
143+
144+
:return: The created_at of this Order. # noqa: E501
145+
:rtype: datetime
146+
"""
147+
return self._created_at
148+
149+
@created_at.setter
150+
def created_at(self, created_at):
151+
"""Sets the created_at of this Order.
152+
153+
The timestamp at which the order was created # noqa: E501
154+
155+
:param created_at: The created_at of this Order. # noqa: E501
156+
:type: datetime
157+
"""
158+
159+
self._created_at = created_at
160+
132161
@property
133162
def mass_g(self):
134163
"""Gets the mass_g of this Order. # noqa: E501

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from setuptools import setup, find_packages # noqa: H301
1313

1414
NAME = "patch-api"
15-
VERSION = "1.11.0"
15+
VERSION = "1.12.0"
1616
# To install the library, run the following
1717
#
1818
# python setup.py install

test/test_orders_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import unittest
1717
import os
18+
import datetime
1819

1920
from patch_api.api_client import ApiClient
2021

@@ -38,6 +39,8 @@ def test_interactions_with_an_order(self):
3839

3940
self.assertTrue(order)
4041

42+
self.assertIsInstance(order.data.created_at, datetime.datetime)
43+
4144
self.assertEqual(order.data.mass_g, 100)
4245

4346
"""Create an order on price

0 commit comments

Comments
 (0)