Skip to content

Commit

Permalink
Updated to latest Digikey API definition
Browse files Browse the repository at this point in the history
Adding BackOrderDetails and DefaultShipping to ordersupport queries
  • Loading branch information
peeter123 committed Nov 19, 2021
1 parent 0d4b3c1 commit 0b2b2b4
Show file tree
Hide file tree
Showing 12 changed files with 605 additions and 31 deletions.
2 changes: 2 additions & 0 deletions digikey/v3/ordersupport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
from digikey.v3.ordersupport.models.address import Address
from digikey.v3.ordersupport.models.api_error_response import ApiErrorResponse
from digikey.v3.ordersupport.models.api_validation_error import ApiValidationError
from digikey.v3.ordersupport.models.back_order_details import BackOrderDetails
from digikey.v3.ordersupport.models.default_shipping import DefaultShipping
from digikey.v3.ordersupport.models.line_item import LineItem
from digikey.v3.ordersupport.models.order_status_response import OrderStatusResponse
from digikey.v3.ordersupport.models.sales_order_history_item import SalesOrderHistoryItem
Expand Down
4 changes: 2 additions & 2 deletions digikey/v3/ordersupport/api/order_details_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def order_history_with_http_info(self, authorization, x_digikey_client_id, **kwa
['application/json']) # noqa: E501

# Authentication setting
auth_settings = [] # noqa: E501
auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501

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

# Authentication setting
auth_settings = [] # noqa: E501
auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501

return self.api_client.call_api(
'/Status/{salesOrderId}', 'GET',
Expand Down
2 changes: 2 additions & 0 deletions digikey/v3/ordersupport/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from digikey.v3.ordersupport.models.address import Address
from digikey.v3.ordersupport.models.api_error_response import ApiErrorResponse
from digikey.v3.ordersupport.models.api_validation_error import ApiValidationError
from digikey.v3.ordersupport.models.back_order_details import BackOrderDetails
from digikey.v3.ordersupport.models.default_shipping import DefaultShipping
from digikey.v3.ordersupport.models.line_item import LineItem
from digikey.v3.ordersupport.models.order_status_response import OrderStatusResponse
from digikey.v3.ordersupport.models.sales_order_history_item import SalesOrderHistoryItem
Expand Down
12 changes: 0 additions & 12 deletions digikey/v3/ordersupport/models/api_error_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def __init__(self, error_response_version=None, status_code=None, error_message=
def error_response_version(self):
"""Gets the error_response_version of this ApiErrorResponse. # noqa: E501
The version of the error handler. # noqa: E501
:return: The error_response_version of this ApiErrorResponse. # noqa: E501
:rtype: str
Expand All @@ -87,7 +86,6 @@ def error_response_version(self):
def error_response_version(self, error_response_version):
"""Sets the error_response_version of this ApiErrorResponse.
The version of the error handler. # noqa: E501
:param error_response_version: The error_response_version of this ApiErrorResponse. # noqa: E501
:type: str
Expand All @@ -99,7 +97,6 @@ def error_response_version(self, error_response_version):
def status_code(self):
"""Gets the status_code of this ApiErrorResponse. # noqa: E501
The HttpStatusCode of the error. # noqa: E501
:return: The status_code of this ApiErrorResponse. # noqa: E501
:rtype: int
Expand All @@ -110,7 +107,6 @@ def status_code(self):
def status_code(self, status_code):
"""Sets the status_code of this ApiErrorResponse.
The HttpStatusCode of the error. # noqa: E501
:param status_code: The status_code of this ApiErrorResponse. # noqa: E501
:type: int
Expand All @@ -122,7 +118,6 @@ def status_code(self, status_code):
def error_message(self):
"""Gets the error_message of this ApiErrorResponse. # noqa: E501
The message provided by the error handler. # noqa: E501
:return: The error_message of this ApiErrorResponse. # noqa: E501
:rtype: str
Expand All @@ -133,7 +128,6 @@ def error_message(self):
def error_message(self, error_message):
"""Sets the error_message of this ApiErrorResponse.
The message provided by the error handler. # noqa: E501
:param error_message: The error_message of this ApiErrorResponse. # noqa: E501
:type: str
Expand All @@ -145,7 +139,6 @@ def error_message(self, error_message):
def error_details(self):
"""Gets the error_details of this ApiErrorResponse. # noqa: E501
The details of the error. # noqa: E501
:return: The error_details of this ApiErrorResponse. # noqa: E501
:rtype: str
Expand All @@ -156,7 +149,6 @@ def error_details(self):
def error_details(self, error_details):
"""Sets the error_details of this ApiErrorResponse.
The details of the error. # noqa: E501
:param error_details: The error_details of this ApiErrorResponse. # noqa: E501
:type: str
Expand All @@ -168,7 +160,6 @@ def error_details(self, error_details):
def request_id(self):
"""Gets the request_id of this ApiErrorResponse. # noqa: E501
The Id of the request that triggered the error. If contacting API Support, please include the RequestId. # noqa: E501
:return: The request_id of this ApiErrorResponse. # noqa: E501
:rtype: str
Expand All @@ -179,7 +170,6 @@ def request_id(self):
def request_id(self, request_id):
"""Sets the request_id of this ApiErrorResponse.
The Id of the request that triggered the error. If contacting API Support, please include the RequestId. # noqa: E501
:param request_id: The request_id of this ApiErrorResponse. # noqa: E501
:type: str
Expand All @@ -191,7 +181,6 @@ def request_id(self, request_id):
def validation_errors(self):
"""Gets the validation_errors of this ApiErrorResponse. # noqa: E501
The list of validation errors (if applicable). # noqa: E501
:return: The validation_errors of this ApiErrorResponse. # noqa: E501
:rtype: list[ApiValidationError]
Expand All @@ -202,7 +191,6 @@ def validation_errors(self):
def validation_errors(self, validation_errors):
"""Sets the validation_errors of this ApiErrorResponse.
The list of validation errors (if applicable). # noqa: E501
:param validation_errors: The validation_errors of this ApiErrorResponse. # noqa: E501
:type: list[ApiValidationError]
Expand Down
4 changes: 0 additions & 4 deletions digikey/v3/ordersupport/models/api_validation_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def __init__(self, field=None, message=None): # noqa: E501
def field(self):
"""Gets the field of this ApiValidationError. # noqa: E501
The field that generated the error. # noqa: E501
:return: The field of this ApiValidationError. # noqa: E501
:rtype: str
Expand All @@ -67,7 +66,6 @@ def field(self):
def field(self, field):
"""Sets the field of this ApiValidationError.
The field that generated the error. # noqa: E501
:param field: The field of this ApiValidationError. # noqa: E501
:type: str
Expand All @@ -79,7 +77,6 @@ def field(self, field):
def message(self):
"""Gets the message of this ApiValidationError. # noqa: E501
The error message that was generated. This often explains how to fix your API input to be valid. # noqa: E501
:return: The message of this ApiValidationError. # noqa: E501
:rtype: str
Expand All @@ -90,7 +87,6 @@ def message(self):
def message(self, message):
"""Sets the message of this ApiValidationError.
The error message that was generated. This often explains how to fix your API input to be valid. # noqa: E501
:param message: The message of this ApiValidationError. # noqa: E501
:type: str
Expand Down
145 changes: 145 additions & 0 deletions digikey/v3/ordersupport/models/back_order_details.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# coding: utf-8

"""
Order Details
Retrieve information about current and past orders. # noqa: E501
OpenAPI spec version: v3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


import pprint
import re # noqa: F401

import six


class BackOrderDetails(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""

"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'quantity': 'int',
'back_order_estimates': 'list[Schedule]'
}

attribute_map = {
'quantity': 'Quantity',
'back_order_estimates': 'BackOrderEstimates'
}

def __init__(self, quantity=None, back_order_estimates=None): # noqa: E501
"""BackOrderDetails - a model defined in Swagger""" # noqa: E501

self._quantity = None
self._back_order_estimates = None
self.discriminator = None

if quantity is not None:
self.quantity = quantity
if back_order_estimates is not None:
self.back_order_estimates = back_order_estimates

@property
def quantity(self):
"""Gets the quantity of this BackOrderDetails. # noqa: E501
The total quantity that is backorder. This quantity is the same as LinteItem.QuantityBackorder # noqa: E501
:return: The quantity of this BackOrderDetails. # noqa: E501
:rtype: int
"""
return self._quantity

@quantity.setter
def quantity(self, quantity):
"""Sets the quantity of this BackOrderDetails.
The total quantity that is backorder. This quantity is the same as LinteItem.QuantityBackorder # noqa: E501
:param quantity: The quantity of this BackOrderDetails. # noqa: E501
:type: int
"""

self._quantity = quantity

@property
def back_order_estimates(self):
"""Gets the back_order_estimates of this BackOrderDetails. # noqa: E501
The Manufacturer's estimated date and quantity that Digi-Key will receive the product. # noqa: E501
:return: The back_order_estimates of this BackOrderDetails. # noqa: E501
:rtype: list[Schedule]
"""
return self._back_order_estimates

@back_order_estimates.setter
def back_order_estimates(self, back_order_estimates):
"""Sets the back_order_estimates of this BackOrderDetails.
The Manufacturer's estimated date and quantity that Digi-Key will receive the product. # noqa: E501
:param back_order_estimates: The back_order_estimates of this BackOrderDetails. # noqa: E501
:type: list[Schedule]
"""

self._back_order_estimates = back_order_estimates

def to_dict(self):
"""Returns the model properties as a dict"""
result = {}

for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(BackOrderDetails, dict):
for key, value in self.items():
result[key] = value

return result

def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())

def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()

def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, BackOrderDetails):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
Loading

0 comments on commit 0b2b2b4

Please sign in to comment.