Skip to content

Commit 9f6d40b

Browse files
authored
Update SDK to make the order allocations array optional (#49)
1 parent 2961b98 commit 9f6d40b

File tree

7 files changed

+17
-16
lines changed

7 files changed

+17
-16
lines changed

CHANGELOG.md

+6
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.17.0] - 2022-01-11
9+
10+
### Changed
11+
12+
- Set the order allocatations array as optional.
13+
814
## [1.16.0] - 2021-12-07
915

1016
### Removed

patch_api/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from __future__ import absolute_import
1717

18-
__version__ = "1.16.0"
18+
__version__ = "1.17.0"
1919

2020
# import ApiClient
2121
from patch_api.api_client import ApiClient

patch_api/api_client.py

+1-1
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.16.0"
94+
self.user_agent = "patch-python/1.17.0"
9595

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

patch_api/configuration.py

+1-1
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.16.0".format(
344+
"SDK Package Version: 1.17.0".format(
345345
env=sys.platform, pyversion=sys.version
346346
)
347347
)

patch_api/models/order.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ def __init__(
103103
self.allocation_state = allocation_state
104104
self.price_cents_usd = price_cents_usd
105105
self.patch_fee_cents_usd = patch_fee_cents_usd
106-
self.allocations = allocations
106+
if allocations is not None:
107+
self.allocations = allocations
107108
if registry_url is not None:
108109
self.registry_url = registry_url
109110
self.metadata = metadata
@@ -304,7 +305,7 @@ def allocation_state(self, allocation_state):
304305
raise ValueError(
305306
"Invalid value for `allocation_state`, must not be `None`"
306307
) # noqa: E501
307-
allowed_values = ["pending", "partially_allocated", "allocated"] # noqa: E501
308+
allowed_values = ["pending", "allocated"] # noqa: E501
308309
if (
309310
self.local_vars_configuration.client_side_validation
310311
and allocation_state not in allowed_values
@@ -367,7 +368,7 @@ def patch_fee_cents_usd(self, patch_fee_cents_usd):
367368
def allocations(self):
368369
"""Gets the allocations of this Order. # noqa: E501
369370
370-
An array containing the inventory allocations for this order. # noqa: E501
371+
DEPRECATED. An array containing the inventory allocations for this order. # noqa: E501
371372
372373
:return: The allocations of this Order. # noqa: E501
373374
:rtype: list[Allocation]
@@ -378,17 +379,11 @@ def allocations(self):
378379
def allocations(self, allocations):
379380
"""Sets the allocations of this Order.
380381
381-
An array containing the inventory allocations for this order. # noqa: E501
382+
DEPRECATED. An array containing the inventory allocations for this order. # noqa: E501
382383
383384
:param allocations: The allocations of this Order. # noqa: E501
384385
:type: list[Allocation]
385386
"""
386-
if (
387-
self.local_vars_configuration.client_side_validation and allocations is None
388-
): # noqa: E501
389-
raise ValueError(
390-
"Invalid value for `allocations`, must not be `None`"
391-
) # noqa: E501
392387

393388
self._allocations = allocations
394389

patch_api/models/project.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def description(self, description):
273273
def type(self):
274274
"""Gets the type of this Project. # noqa: E501
275275
276-
Deprecated. Favor the technology_type field instead. # noqa: E501
276+
DEPRECATED. Favor the technology_type field instead. # noqa: E501
277277
278278
:return: The type of this Project. # noqa: E501
279279
:rtype: str
@@ -284,7 +284,7 @@ def type(self):
284284
def type(self, type):
285285
"""Sets the type of this Project.
286286
287-
Deprecated. Favor the technology_type field instead. # noqa: E501
287+
DEPRECATED. Favor the technology_type field instead. # noqa: E501
288288
289289
:param type: The type of this Project. # noqa: E501
290290
:type: str

setup.py

+1-1
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.16.0"
15+
VERSION = "1.17.0"
1616
# To install the library, run the following
1717
#
1818
# python setup.py install

0 commit comments

Comments
 (0)