Skip to content

Commit 0b2b2b4

Browse files
committed
Updated to latest Digikey API definition
Adding BackOrderDetails and DefaultShipping to ordersupport queries
1 parent 0d4b3c1 commit 0b2b2b4

12 files changed

+605
-31
lines changed

digikey/v3/ordersupport/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
from digikey.v3.ordersupport.models.address import Address
2626
from digikey.v3.ordersupport.models.api_error_response import ApiErrorResponse
2727
from digikey.v3.ordersupport.models.api_validation_error import ApiValidationError
28+
from digikey.v3.ordersupport.models.back_order_details import BackOrderDetails
29+
from digikey.v3.ordersupport.models.default_shipping import DefaultShipping
2830
from digikey.v3.ordersupport.models.line_item import LineItem
2931
from digikey.v3.ordersupport.models.order_status_response import OrderStatusResponse
3032
from digikey.v3.ordersupport.models.sales_order_history_item import SalesOrderHistoryItem

digikey/v3/ordersupport/api/order_details_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def order_history_with_http_info(self, authorization, x_digikey_client_id, **kwa
140140
['application/json']) # noqa: E501
141141

142142
# Authentication setting
143-
auth_settings = [] # noqa: E501
143+
auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501
144144

145145
return self.api_client.call_api(
146146
'/History', 'GET',
@@ -253,7 +253,7 @@ def order_status_with_http_info(self, sales_order_id, authorization, x_digikey_c
253253
['application/json']) # noqa: E501
254254

255255
# Authentication setting
256-
auth_settings = [] # noqa: E501
256+
auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501
257257

258258
return self.api_client.call_api(
259259
'/Status/{salesOrderId}', 'GET',

digikey/v3/ordersupport/models/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from digikey.v3.ordersupport.models.address import Address
1919
from digikey.v3.ordersupport.models.api_error_response import ApiErrorResponse
2020
from digikey.v3.ordersupport.models.api_validation_error import ApiValidationError
21+
from digikey.v3.ordersupport.models.back_order_details import BackOrderDetails
22+
from digikey.v3.ordersupport.models.default_shipping import DefaultShipping
2123
from digikey.v3.ordersupport.models.line_item import LineItem
2224
from digikey.v3.ordersupport.models.order_status_response import OrderStatusResponse
2325
from digikey.v3.ordersupport.models.sales_order_history_item import SalesOrderHistoryItem

digikey/v3/ordersupport/models/api_error_response.py

-12
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def __init__(self, error_response_version=None, status_code=None, error_message=
7676
def error_response_version(self):
7777
"""Gets the error_response_version of this ApiErrorResponse. # noqa: E501
7878
79-
The version of the error handler. # noqa: E501
8079
8180
:return: The error_response_version of this ApiErrorResponse. # noqa: E501
8281
:rtype: str
@@ -87,7 +86,6 @@ def error_response_version(self):
8786
def error_response_version(self, error_response_version):
8887
"""Sets the error_response_version of this ApiErrorResponse.
8988
90-
The version of the error handler. # noqa: E501
9189
9290
:param error_response_version: The error_response_version of this ApiErrorResponse. # noqa: E501
9391
:type: str
@@ -99,7 +97,6 @@ def error_response_version(self, error_response_version):
9997
def status_code(self):
10098
"""Gets the status_code of this ApiErrorResponse. # noqa: E501
10199
102-
The HttpStatusCode of the error. # noqa: E501
103100
104101
:return: The status_code of this ApiErrorResponse. # noqa: E501
105102
:rtype: int
@@ -110,7 +107,6 @@ def status_code(self):
110107
def status_code(self, status_code):
111108
"""Sets the status_code of this ApiErrorResponse.
112109
113-
The HttpStatusCode of the error. # noqa: E501
114110
115111
:param status_code: The status_code of this ApiErrorResponse. # noqa: E501
116112
:type: int
@@ -122,7 +118,6 @@ def status_code(self, status_code):
122118
def error_message(self):
123119
"""Gets the error_message of this ApiErrorResponse. # noqa: E501
124120
125-
The message provided by the error handler. # noqa: E501
126121
127122
:return: The error_message of this ApiErrorResponse. # noqa: E501
128123
:rtype: str
@@ -133,7 +128,6 @@ def error_message(self):
133128
def error_message(self, error_message):
134129
"""Sets the error_message of this ApiErrorResponse.
135130
136-
The message provided by the error handler. # noqa: E501
137131
138132
:param error_message: The error_message of this ApiErrorResponse. # noqa: E501
139133
:type: str
@@ -145,7 +139,6 @@ def error_message(self, error_message):
145139
def error_details(self):
146140
"""Gets the error_details of this ApiErrorResponse. # noqa: E501
147141
148-
The details of the error. # noqa: E501
149142
150143
:return: The error_details of this ApiErrorResponse. # noqa: E501
151144
:rtype: str
@@ -156,7 +149,6 @@ def error_details(self):
156149
def error_details(self, error_details):
157150
"""Sets the error_details of this ApiErrorResponse.
158151
159-
The details of the error. # noqa: E501
160152
161153
:param error_details: The error_details of this ApiErrorResponse. # noqa: E501
162154
:type: str
@@ -168,7 +160,6 @@ def error_details(self, error_details):
168160
def request_id(self):
169161
"""Gets the request_id of this ApiErrorResponse. # noqa: E501
170162
171-
The Id of the request that triggered the error. If contacting API Support, please include the RequestId. # noqa: E501
172163
173164
:return: The request_id of this ApiErrorResponse. # noqa: E501
174165
:rtype: str
@@ -179,7 +170,6 @@ def request_id(self):
179170
def request_id(self, request_id):
180171
"""Sets the request_id of this ApiErrorResponse.
181172
182-
The Id of the request that triggered the error. If contacting API Support, please include the RequestId. # noqa: E501
183173
184174
:param request_id: The request_id of this ApiErrorResponse. # noqa: E501
185175
:type: str
@@ -191,7 +181,6 @@ def request_id(self, request_id):
191181
def validation_errors(self):
192182
"""Gets the validation_errors of this ApiErrorResponse. # noqa: E501
193183
194-
The list of validation errors (if applicable). # noqa: E501
195184
196185
:return: The validation_errors of this ApiErrorResponse. # noqa: E501
197186
:rtype: list[ApiValidationError]
@@ -202,7 +191,6 @@ def validation_errors(self):
202191
def validation_errors(self, validation_errors):
203192
"""Sets the validation_errors of this ApiErrorResponse.
204193
205-
The list of validation errors (if applicable). # noqa: E501
206194
207195
:param validation_errors: The validation_errors of this ApiErrorResponse. # noqa: E501
208196
:type: list[ApiValidationError]

digikey/v3/ordersupport/models/api_validation_error.py

-4
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def __init__(self, field=None, message=None): # noqa: E501
5656
def field(self):
5757
"""Gets the field of this ApiValidationError. # noqa: E501
5858
59-
The field that generated the error. # noqa: E501
6059
6160
:return: The field of this ApiValidationError. # noqa: E501
6261
:rtype: str
@@ -67,7 +66,6 @@ def field(self):
6766
def field(self, field):
6867
"""Sets the field of this ApiValidationError.
6968
70-
The field that generated the error. # noqa: E501
7169
7270
:param field: The field of this ApiValidationError. # noqa: E501
7371
:type: str
@@ -79,7 +77,6 @@ def field(self, field):
7977
def message(self):
8078
"""Gets the message of this ApiValidationError. # noqa: E501
8179
82-
The error message that was generated. This often explains how to fix your API input to be valid. # noqa: E501
8380
8481
:return: The message of this ApiValidationError. # noqa: E501
8582
:rtype: str
@@ -90,7 +87,6 @@ def message(self):
9087
def message(self, message):
9188
"""Sets the message of this ApiValidationError.
9289
93-
The error message that was generated. This often explains how to fix your API input to be valid. # noqa: E501
9490
9591
:param message: The message of this ApiValidationError. # noqa: E501
9692
:type: str
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# coding: utf-8
2+
3+
"""
4+
Order Details
5+
6+
Retrieve information about current and past orders. # noqa: E501
7+
8+
OpenAPI spec version: v3
9+
10+
Generated by: https://github.com/swagger-api/swagger-codegen.git
11+
"""
12+
13+
14+
import pprint
15+
import re # noqa: F401
16+
17+
import six
18+
19+
20+
class BackOrderDetails(object):
21+
"""NOTE: This class is auto generated by the swagger code generator program.
22+
23+
Do not edit the class manually.
24+
"""
25+
26+
"""
27+
Attributes:
28+
swagger_types (dict): The key is attribute name
29+
and the value is attribute type.
30+
attribute_map (dict): The key is attribute name
31+
and the value is json key in definition.
32+
"""
33+
swagger_types = {
34+
'quantity': 'int',
35+
'back_order_estimates': 'list[Schedule]'
36+
}
37+
38+
attribute_map = {
39+
'quantity': 'Quantity',
40+
'back_order_estimates': 'BackOrderEstimates'
41+
}
42+
43+
def __init__(self, quantity=None, back_order_estimates=None): # noqa: E501
44+
"""BackOrderDetails - a model defined in Swagger""" # noqa: E501
45+
46+
self._quantity = None
47+
self._back_order_estimates = None
48+
self.discriminator = None
49+
50+
if quantity is not None:
51+
self.quantity = quantity
52+
if back_order_estimates is not None:
53+
self.back_order_estimates = back_order_estimates
54+
55+
@property
56+
def quantity(self):
57+
"""Gets the quantity of this BackOrderDetails. # noqa: E501
58+
59+
The total quantity that is backorder. This quantity is the same as LinteItem.QuantityBackorder # noqa: E501
60+
61+
:return: The quantity of this BackOrderDetails. # noqa: E501
62+
:rtype: int
63+
"""
64+
return self._quantity
65+
66+
@quantity.setter
67+
def quantity(self, quantity):
68+
"""Sets the quantity of this BackOrderDetails.
69+
70+
The total quantity that is backorder. This quantity is the same as LinteItem.QuantityBackorder # noqa: E501
71+
72+
:param quantity: The quantity of this BackOrderDetails. # noqa: E501
73+
:type: int
74+
"""
75+
76+
self._quantity = quantity
77+
78+
@property
79+
def back_order_estimates(self):
80+
"""Gets the back_order_estimates of this BackOrderDetails. # noqa: E501
81+
82+
The Manufacturer's estimated date and quantity that Digi-Key will receive the product. # noqa: E501
83+
84+
:return: The back_order_estimates of this BackOrderDetails. # noqa: E501
85+
:rtype: list[Schedule]
86+
"""
87+
return self._back_order_estimates
88+
89+
@back_order_estimates.setter
90+
def back_order_estimates(self, back_order_estimates):
91+
"""Sets the back_order_estimates of this BackOrderDetails.
92+
93+
The Manufacturer's estimated date and quantity that Digi-Key will receive the product. # noqa: E501
94+
95+
:param back_order_estimates: The back_order_estimates of this BackOrderDetails. # noqa: E501
96+
:type: list[Schedule]
97+
"""
98+
99+
self._back_order_estimates = back_order_estimates
100+
101+
def to_dict(self):
102+
"""Returns the model properties as a dict"""
103+
result = {}
104+
105+
for attr, _ in six.iteritems(self.swagger_types):
106+
value = getattr(self, attr)
107+
if isinstance(value, list):
108+
result[attr] = list(map(
109+
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
110+
value
111+
))
112+
elif hasattr(value, "to_dict"):
113+
result[attr] = value.to_dict()
114+
elif isinstance(value, dict):
115+
result[attr] = dict(map(
116+
lambda item: (item[0], item[1].to_dict())
117+
if hasattr(item[1], "to_dict") else item,
118+
value.items()
119+
))
120+
else:
121+
result[attr] = value
122+
if issubclass(BackOrderDetails, dict):
123+
for key, value in self.items():
124+
result[key] = value
125+
126+
return result
127+
128+
def to_str(self):
129+
"""Returns the string representation of the model"""
130+
return pprint.pformat(self.to_dict())
131+
132+
def __repr__(self):
133+
"""For `print` and `pprint`"""
134+
return self.to_str()
135+
136+
def __eq__(self, other):
137+
"""Returns true if both objects are equal"""
138+
if not isinstance(other, BackOrderDetails):
139+
return False
140+
141+
return self.__dict__ == other.__dict__
142+
143+
def __ne__(self, other):
144+
"""Returns true if both objects are not equal"""
145+
return not self == other

0 commit comments

Comments
 (0)