Skip to content

Add created_at on orders #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.12.0] - 2021-09-08

### Added

- Adds a `created_at` attribute in all order responses

## [1.11.0] - 2021-09-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion patch_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from __future__ import absolute_import

__version__ = "1.11.0"
__version__ = "1.12.0"

# import ApiClient
from patch_api.api_client import ApiClient
Expand Down
2 changes: 1 addition & 1 deletion patch_api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "patch-python/1.11.0"
self.user_agent = "patch-python/1.12.0"

def __del__(self):
if self._pool:
Expand Down
2 changes: 1 addition & 1 deletion patch_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def to_debug_report(self):
"OS: {env}\n"
"Python Version: {pyversion}\n"
"Version of the API: v1\n"
"SDK Package Version: 1.11.0".format(
"SDK Package Version: 1.12.0".format(
env=sys.platform, pyversion=sys.version
)
)
Expand Down
6 changes: 3 additions & 3 deletions patch_api/models/create_bitcoin_estimate_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CreateBitcoinEstimateRequest(object):
and the value is json key in definition.
"""
openapi_types = {
"timestamp": "str",
"timestamp": "datetime",
"transaction_value_btc_sats": "int",
"project_id": "str",
"create_order": "bool",
Expand Down Expand Up @@ -77,7 +77,7 @@ def timestamp(self):


:return: The timestamp of this CreateBitcoinEstimateRequest. # noqa: E501
:rtype: str
:rtype: datetime
"""
return self._timestamp

Expand All @@ -87,7 +87,7 @@ def timestamp(self, timestamp):


:param timestamp: The timestamp of this CreateBitcoinEstimateRequest. # noqa: E501
:type: str
:type: datetime
"""

self._timestamp = timestamp
Expand Down
29 changes: 29 additions & 0 deletions patch_api/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class Order(object):
"""
openapi_types = {
"id": "str",
"created_at": "datetime",
"mass_g": "int",
"production": "bool",
"state": "str",
Expand All @@ -48,6 +49,7 @@ class Order(object):

attribute_map = {
"id": "id",
"created_at": "created_at",
"mass_g": "mass_g",
"production": "production",
"state": "state",
Expand All @@ -62,6 +64,7 @@ class Order(object):
def __init__(
self,
id=None,
created_at=None,
mass_g=None,
production=None,
state=None,
Expand All @@ -79,6 +82,7 @@ def __init__(
self.local_vars_configuration = local_vars_configuration

self._id = None
self._created_at = None
self._mass_g = None
self._production = None
self._state = None
Expand All @@ -91,6 +95,8 @@ def __init__(
self.discriminator = None

self.id = id
if created_at is not None:
self.created_at = created_at
self.mass_g = mass_g
self.production = production
self.state = state
Expand Down Expand Up @@ -129,6 +135,29 @@ def id(self, id):

self._id = id

@property
def created_at(self):
"""Gets the created_at of this Order. # noqa: E501

The timestamp at which the order was created # noqa: E501

:return: The created_at of this Order. # noqa: E501
:rtype: datetime
"""
return self._created_at

@created_at.setter
def created_at(self, created_at):
"""Sets the created_at of this Order.

The timestamp at which the order was created # noqa: E501

:param created_at: The created_at of this Order. # noqa: E501
:type: datetime
"""

self._created_at = created_at

@property
def mass_g(self):
"""Gets the mass_g of this Order. # noqa: E501
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from setuptools import setup, find_packages # noqa: H301

NAME = "patch-api"
VERSION = "1.11.0"
VERSION = "1.12.0"
# To install the library, run the following
#
# python setup.py install
Expand Down
3 changes: 3 additions & 0 deletions test/test_orders_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import unittest
import os
import datetime

from patch_api.api_client import ApiClient

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

self.assertTrue(order)

self.assertIsInstance(order.data.created_at, datetime.datetime)

self.assertEqual(order.data.mass_g, 100)

"""Create an order on price
Expand Down