diff --git a/README.md b/README.md index fb424da..da3093a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ manufacturers overlap other manufacturer part numbers. [![Donate](https://img.shields.io/badge/Donate-PayPal-gold.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=53HWHHVCJ3D4J¤cy_code=EUR&source=url) # What does it do -`digikey-api` is an [Digkey Part Search API](https://api-portal.digikey.com/node/8517) client for Python 3.6+. API response data is returned as Python objects that attempt to make it easy to get the data you want. Not all endpoints have been implemented. +`digikey-api` is an [Digkey Part Search API](https://api-portal.digikey.com/node/8517) client for Python 3.12+. API response data is returned as Python objects that attempt to make it easy to get the data you want. Not all endpoints have been implemented. # Quickstart @@ -25,15 +25,15 @@ export DIGIKEY_STORAGE_PATH="path/to/cache/dir" The cache dir is used to store the OAUTH access and refresh token, if you delete it you will need to login again. -# API V3 +# API V4 ## Register -Register an app on the Digikey API portal: [Digi-Key API V3](https://developer.digikey.com/get_started). You will need +Register an app on the Digikey API portal: [Digi-Key API V4](https://developer.digikey.com/get_started). You will need the client ID and the client secret to use the API. You will also need a Digi-Key account to authenticate, using the Oauth2 process. When registering an app the OAuth Callback needs to be set to `https://localhost:8139/digikey_callback`. -## Use [API V3] +## Use [API V4] Python will automatically spawn a browser to allow you to authenticate using the Oauth2 process. After obtaining a token the library will cache the access token and use the refresh token to automatically refresh your credentials. @@ -48,8 +48,8 @@ import os from pathlib import Path import digikey -from digikey.v3.productinformation import KeywordSearchRequest -from digikey.v3.batchproductdetails import BatchProductDetailsRequest +from digikey.v4.productinformation import KeywordRequest +from digikey.v4.batchproductdetails import BatchProductDetailsRequest CACHE_DIR = Path('path/to/cache/dir') @@ -63,7 +63,7 @@ dkpn = '296-6501-1-ND' part = digikey.product_details(dkpn) # Search for parts -search_request = KeywordSearchRequest(keywords='CRCW080510K0FKEA', record_count=10) +search_request = KeywordSearchRequest(keywords='CRCW080510K0FKEA', limit=10, offset = 0) result = digikey.keyword_search(body=search_request) # Only if BatchProductDetails endpoint is explicitly enabled @@ -73,7 +73,7 @@ batch_request = BatchProductDetailsRequest(products=mpn_list) part_results = digikey.batch_product_details(body=batch_request) ``` -## Logging [API V3] +## Logging [API V4] Logging is not forced upon the user but can be enabled according to convention: ```python import logging @@ -118,7 +118,7 @@ The API has a limited amount of requests you can make per time interval [Digikey It is possible to retrieve the number of max requests and current requests by passing an optional api_limits kwarg to an API function: ```python api_limit = {} -search_request = KeywordSearchRequest(keywords='CRCW080510K0FKEA', record_count=10) +search_request = KeywordSearchRequest(keywords='CRCW080510K0FKEA', limit=10) result = digikey.keyword_search(body=search_request, api_limits=api_limit) ``` @@ -129,4 +129,29 @@ The dict will be filled with the information returned from the API: 'api_requests_remaining': 139 } ``` -Sometimes the API does not return any rate limit data, the values will then be set to None. +Sometimes the API does not return any rate limit data, the values will then be set to `None`. + + +## Offsets +The api has a maximum of 50 parts in a request. +In order to gather more than the limit input into the `KeywordRequest` an offset must be input: +```python +# request items 51-100 +search_request = KeywordRequest(keywords='RaspberryPi pico',limit = 50,offset=50) +``` + +This can also be used to gather all items to a request very simply: +```python +offset = 0 +products = [] + +while(offset == 0 or (len(result.products) >= 49)): + + search_request = KeywordRequest(keywords='RaspberryPi pico',limit = 50,offset=offset) + result = digikey.keyword_search(body=search_request) + + for product in result.products: + products.append(product) + + offset +=50 +``` diff --git a/digikey/__init__.py b/digikey/__init__.py index 566f840..10efe88 100644 --- a/digikey/__init__.py +++ b/digikey/__init__.py @@ -1,6 +1,6 @@ -from digikey.v3.api import (keyword_search, product_details, digi_reel_pricing, suggested_parts, - manufacturer_product_details) -from digikey.v3.api import (status_salesorder_id, salesorder_history) -from digikey.v3.api import (batch_product_details) +from digikey.v4.api import (keyword_search, product_details, digi_reel_pricing, suggested_parts, + ) +from digikey.v4.api import (status_salesorder_id, salesorder_history) +from digikey.v4.api import (batch_product_details) name = 'digikey' diff --git a/digikey/oauth/oauth2.py b/digikey/oauth/oauth2.py index 1568e18..0f227ea 100644 --- a/digikey/oauth/oauth2.py +++ b/digikey/oauth/oauth2.py @@ -105,7 +105,7 @@ def __init__(self, version: int = 2, sandbox: bool = False): - if version == 3: + if version == 3 or version == 4: if sandbox: self.auth_url = AUTH_URL_V3_SB self.token_url = TOKEN_URL_V3_SB @@ -252,7 +252,9 @@ def get_access_token(self) -> Oauth2Token: ('localhost', PORT), lambda request, address, server: HTTPServerHandler( request, address, server, self._id, self._secret)) - httpd.socket = ssl.wrap_socket(httpd.socket, certfile=str(Path(filename)), server_side=True) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.load_cert_chain(str(Path(filename))) + httpd.socket=context.wrap_socket(httpd.socket,server_side=True,) httpd.stop = 0 # This function will block until it receives a request diff --git a/digikey/v4/__init__.py b/digikey/v4/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/digikey/v4/api.py b/digikey/v4/api.py new file mode 100644 index 0000000..2d046b7 --- /dev/null +++ b/digikey/v4/api.py @@ -0,0 +1,171 @@ +import os +import logging +from distutils.util import strtobool +import digikey.oauth.oauth2 +from digikey.exceptions import DigikeyError +from digikey.v4.productinformation import (KeywordRequest, KeywordResponse, ProductDetails, DigiReelPricing, + ) +from digikey.v4.productinformation.rest import ApiException +from digikey.v4.ordersupport import (OrderStatusResponse, SalesOrderHistoryItem) +from digikey.v4.batchproductdetails import (BatchProductDetailsRequest, BatchProductDetailsResponse) + +logger = logging.getLogger(__name__) + + +class DigikeyApiWrapper(object): + def __init__(self, wrapped_function, module): + self.sandbox = False + + apinames = { + digikey.v4.productinformation: 'products', + digikey.v4.ordersupport: 'OrderDetails', + digikey.v4.batchproductdetails: 'BatchSearch' + } + + apiclasses = { + digikey.v4.productinformation: digikey.v4.productinformation.ProductSearchApi, + digikey.v4.ordersupport: digikey.v4.ordersupport.OrderDetailsApi, + digikey.v4.batchproductdetails: digikey.v4.batchproductdetails.BatchSearchApi + } + + apiname = apinames[module] + apiclass = apiclasses[module] + + # Configure API key authorization: apiKeySecurity + configuration = module.Configuration() + configuration.api_key['X-DIGIKEY-Client-Id'] = os.getenv('DIGIKEY_CLIENT_ID') + + # Return quietly if no clientid has been set to prevent errors when importing the module + if os.getenv('DIGIKEY_CLIENT_ID') is None or os.getenv('DIGIKEY_CLIENT_SECRET') is None: + raise DigikeyError('Please provide a valid DIGIKEY_CLIENT_ID and DIGIKEY_CLIENT_SECRET in your env setup') + + # Use normal API by default, if DIGIKEY_CLIENT_SANDBOX is True use sandbox API + configuration.host = 'https://api.digikey.com/' + apiname + '/v4' + try: + if bool(strtobool(os.getenv('DIGIKEY_CLIENT_SANDBOX'))): + configuration.host = 'https://sandbox-api.digikey.com/' + apiname + '/v4' + self.sandbox = True + except (ValueError, AttributeError): + pass + + # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed + # configuration.api_key_prefix['X-DIGIKEY-Client-Id'] = 'Bearer' + + # Configure OAuth2 access token for authorization: oauth2AccessCodeSecurity + self._digikeyApiToken = digikey.oauth.oauth2.TokenHandler(version=3, sandbox=self.sandbox).get_access_token() + configuration.access_token = self._digikeyApiToken.access_token + + # create an instance of the API class + self._api_instance = apiclass(module.ApiClient(configuration)) + + # Populate reused ids + self.authorization = self._digikeyApiToken.get_authorization() + self.x_digikey_client_id = os.getenv('DIGIKEY_CLIENT_ID') + + self.wrapped_function = wrapped_function + + @staticmethod + def _remaining_requests(header, api_limits): + try: + rate_limit = header['X-RateLimit-Limit'] + rate_limit_rem = header['X-RateLimit-Remaining'] + + if api_limits is not None and type(api_limits) == dict: + api_limits['api_requests_limit'] = int(rate_limit) + api_limits['api_requests_remaining'] = int(rate_limit_rem) + + logger.debug('Requests remaining: [{}/{}]'.format(rate_limit_rem, rate_limit)) + except (KeyError, ValueError) as e: + logger.debug(f'No api limits returned -> {e.__class__.__name__}: {e}') + if api_limits is not None and type(api_limits) == dict: + api_limits['api_requests_limit'] = None + api_limits['api_requests_remaining'] = None + + @staticmethod + def _store_api_statuscode(statuscode, status): + if status is not None and type(status) == dict: + status['code'] = int(statuscode) + + logger.debug('API returned code: {}'.format(statuscode)) + + def call_api_function(self, *args, **kwargs): + try: + # If optional api_limits, status mutable object is passed use it to store API limits and status code + api_limits = kwargs.pop('api_limits', None) + status = kwargs.pop('status', None) + + func = getattr(self._api_instance, self.wrapped_function) + logger.debug(f'CALL wrapped -> {func.__qualname__}') + api_response = func(*args, self.x_digikey_client_id, authorization = self.authorization, **kwargs) + self._remaining_requests(api_response[2], api_limits) + self._store_api_statuscode(api_response[1], status) + + return api_response[0] + except ApiException as e: + logger.error(f'Exception when calling {self.wrapped_function}: {e}') + self._store_api_statuscode(e.status, status) + + +def keyword_search(*args, **kwargs) -> KeywordResponse: + client = DigikeyApiWrapper('keyword_search_with_http_info', digikey.v4.productinformation) + + if 'body' in kwargs and type(kwargs['body']) == KeywordRequest: + logger.info(f'Search for: {kwargs["body"].keywords}') + logger.debug('CALL -> keyword_search') + return client.call_api_function(*args, **kwargs) + else: + raise DigikeyError('Please provide a valid KeywordSearchRequest argument') + + +def product_details(*args, **kwargs) -> ProductDetails: + client = DigikeyApiWrapper('product_details_with_http_info', digikey.v4.productinformation) + + if len(args): + logger.info(f'Get product details for: {args[0]}') + return client.call_api_function(*args, **kwargs) + + +def digi_reel_pricing(*args, **kwargs) -> DigiReelPricing: + client = DigikeyApiWrapper('digi_reel_pricing_with_http_info', digikey.v4.productinformation) + + if len(args): + logger.info(f'Calculate the DigiReel pricing for {args[0]} with quantity {args[1]}') + return client.call_api_function(*args, **kwargs) + + +def suggested_parts(*args, **kwargs) -> ProductDetails: + client = DigikeyApiWrapper('suggested_parts_with_http_info', digikey.v4.productinformation) + + if len(args): + logger.info(f'Retrieve detailed product information and two suggested products for: {args[0]}') + return client.call_api_function(*args, **kwargs) + + +def status_salesorder_id(*args, **kwargs) -> OrderStatusResponse: + client = DigikeyApiWrapper('order_status_with_http_info', digikey.v4.ordersupport) + + if len(args): + logger.info(f'Get order details for: {args[0]}') + return client.call_api_function(*args, **kwargs) + + +def salesorder_history(*args, **kwargs) -> [SalesOrderHistoryItem]: + client = DigikeyApiWrapper('order_history_with_http_info', digikey.v4.ordersupport) + + if 'start_date' in kwargs and type(kwargs['start_date']) == str \ + and 'end_date' in kwargs and type(kwargs['end_date']) == str: + logger.info(f'Searching for orders in date range ' + kwargs['start_date'] + ' to ' + kwargs['end_date']) + return client.call_api_function(*args, **kwargs) + else: + raise DigikeyError('Please provide valid start_date and end_date strings') + + +def batch_product_details(*args, **kwargs) -> BatchProductDetailsResponse: + client = DigikeyApiWrapper('batch_product_details_with_http_info', digikey.v4.batchproductdetails) + + if 'body' in kwargs and type(kwargs['body']) == BatchProductDetailsRequest: + logger.info(f'Batch product search: {kwargs["body"].products}') + logger.debug('CALL -> batch_product_details') + return client.call_api_function(*args, **kwargs) + else: + raise DigikeyError('Please provide a valid BatchProductDetailsRequest argument') diff --git a/digikey/v4/batchproductdetails/__init__.py b/digikey/v4/batchproductdetails/__init__.py new file mode 100644 index 0000000..b9a07f0 --- /dev/null +++ b/digikey/v4/batchproductdetails/__init__.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # noqa: E501 + + OpenAPI spec version: v3 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import apis into sdk package +from digikey.v3.batchproductdetails.api.batch_search_api import BatchSearchApi + +# import ApiClient +from digikey.v3.batchproductdetails.api_client import ApiClient +from digikey.v3.batchproductdetails.configuration import Configuration +# import models into sdk package +from digikey.v3.batchproductdetails.models.api_error_response import ApiErrorResponse +from digikey.v3.batchproductdetails.models.api_validation_error import ApiValidationError +from digikey.v3.batchproductdetails.models.associated_product import AssociatedProduct +from digikey.v3.batchproductdetails.models.basic_product import BasicProduct +from digikey.v3.batchproductdetails.models.batch_product_details_request import BatchProductDetailsRequest +from digikey.v3.batchproductdetails.models.batch_product_details_response import BatchProductDetailsResponse +from digikey.v3.batchproductdetails.models.iso_search_locale import IsoSearchLocale +from digikey.v3.batchproductdetails.models.kit_part import KitPart +from digikey.v3.batchproductdetails.models.limited_taxonomy import LimitedTaxonomy +from digikey.v3.batchproductdetails.models.media_links import MediaLinks +from digikey.v3.batchproductdetails.models.pid_vid import PidVid +from digikey.v3.batchproductdetails.models.price_break import PriceBreak +from digikey.v3.batchproductdetails.models.product_details import ProductDetails diff --git a/digikey/v4/batchproductdetails/api/__init__.py b/digikey/v4/batchproductdetails/api/__init__.py new file mode 100644 index 0000000..e67de79 --- /dev/null +++ b/digikey/v4/batchproductdetails/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from digikey.v3.batchproductdetails.api.batch_search_api import BatchSearchApi diff --git a/digikey/v4/batchproductdetails/api/batch_search_api.py b/digikey/v4/batchproductdetails/api/batch_search_api.py new file mode 100644 index 0000000..f3bc32a --- /dev/null +++ b/digikey/v4/batchproductdetails/api/batch_search_api.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # noqa: E501 + + OpenAPI spec version: v3 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from digikey.v3.batchproductdetails.api_client import ApiClient + + +class BatchSearchApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def batch_product_details(self, authorization, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve detailed product information including real time pricing and availability. # noqa: E501 + + Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.batch_product_details(authorization, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param bool exclude_market_place_products: Used to exclude MarkPlace products from search results. Default is false + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_locale_ship_to_country: ISO code for country to ship to. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param BatchProductDetailsRequest body: List of Digi-Key products + :return: BatchProductDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.batch_product_details_with_http_info(authorization, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.batch_product_details_with_http_info(authorization, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def batch_product_details_with_http_info(self, authorization, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve detailed product information including real time pricing and availability. # noqa: E501 + + Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.batch_product_details_with_http_info(authorization, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param bool exclude_market_place_products: Used to exclude MarkPlace products from search results. Default is false + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_locale_ship_to_country: ISO code for country to ship to. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param BatchProductDetailsRequest body: List of Digi-Key products + :return: BatchProductDetailsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['authorization', 'x_digikey_client_id', 'exclude_market_place_products', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_locale_ship_to_country', 'x_digikey_customer_id', 'body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method batch_product_details" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `batch_product_details`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `batch_product_details`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'exclude_market_place_products' in params: + query_params.append(('excludeMarketPlaceProducts', params['exclude_market_place_products'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_locale_ship_to_country' in params: + header_params['X-DIGIKEY-Locale-ShipToCountry'] = params['x_digikey_locale_ship_to_country'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json-patch+json', 'application/json', 'text/json', 'application/*+json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/ProductDetails', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='BatchProductDetailsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/digikey/v4/batchproductdetails/api_client.py b/digikey/v4/batchproductdetails/api_client.py new file mode 100644 index 0000000..4075732 --- /dev/null +++ b/digikey/v4/batchproductdetails/api_client.py @@ -0,0 +1,638 @@ +# coding: utf-8 +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # noqa: E501 + + OpenAPI spec version: v3 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from digikey.v3.batchproductdetails.configuration import Configuration +import digikey.v3.batchproductdetails.models +from digikey.v3.batchproductdetails import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + # Use the pool property to lazily initialize the ThreadPool. + self._pool = None + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/0.1.0/python' + + def __del__(self): + if self._pool is not None: + self._pool.close() + self._pool.join() + + @property + def pool(self): + if self._pool is None: + self._pool = ThreadPool() + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(digikey.v3.batchproductdetails.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if (not klass.swagger_types and + not self.__hasattr(klass, 'get_real_child_model')): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/digikey/v4/batchproductdetails/configuration.py b/digikey/v4/batchproductdetails/configuration.py new file mode 100644 index 0000000..faf88e5 --- /dev/null +++ b/digikey/v4/batchproductdetails/configuration.py @@ -0,0 +1,255 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # noqa: E501 + + OpenAPI spec version: v3 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + _default = None + + def __init__(self): + """Constructor""" + if self._default: + for key in self._default.__dict__.keys(): + self.__dict__[key] = copy.copy(self._default.__dict__[key]) + return + + # Default Base url + self.host = "https://api.digikey.com/BatchSearch/v3" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + + # access token for OAuth + self.access_token = "" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("digikey.v3.batchproductdetails") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @classmethod + def set_default(cls, default): + cls._default = default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'apiKeySecurity': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-DIGIKEY-Client-Id', + 'value': self.get_api_key_with_prefix('X-DIGIKEY-Client-Id') + }, + + 'oauth2AccessCodeSecurity': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: v3\n"\ + "SDK Package Version: 0.1.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/digikey/v4/batchproductdetails/models/__init__.py b/digikey/v4/batchproductdetails/models/__init__.py new file mode 100644 index 0000000..6583bd0 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/__init__.py @@ -0,0 +1,30 @@ +# coding: utf-8 + +# flake8: noqa +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # noqa: E501 + + OpenAPI spec version: v3 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +# import models into model package +from digikey.v3.batchproductdetails.models.api_error_response import ApiErrorResponse +from digikey.v3.batchproductdetails.models.api_validation_error import ApiValidationError +from digikey.v3.batchproductdetails.models.associated_product import AssociatedProduct +from digikey.v3.batchproductdetails.models.basic_product import BasicProduct +from digikey.v3.batchproductdetails.models.batch_product_details_request import BatchProductDetailsRequest +from digikey.v3.batchproductdetails.models.batch_product_details_response import BatchProductDetailsResponse +from digikey.v3.batchproductdetails.models.iso_search_locale import IsoSearchLocale +from digikey.v3.batchproductdetails.models.kit_part import KitPart +from digikey.v3.batchproductdetails.models.limited_taxonomy import LimitedTaxonomy +from digikey.v3.batchproductdetails.models.media_links import MediaLinks +from digikey.v3.batchproductdetails.models.pid_vid import PidVid +from digikey.v3.batchproductdetails.models.price_break import PriceBreak +from digikey.v3.batchproductdetails.models.product_details import ProductDetails diff --git a/digikey/v4/batchproductdetails/models/api_error_response.py b/digikey/v4/batchproductdetails/models/api_error_response.py new file mode 100644 index 0000000..bf72a9c --- /dev/null +++ b/digikey/v4/batchproductdetails/models/api_error_response.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 ApiErrorResponse(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 = { + 'error_response_version': 'str', + 'status_code': 'int', + 'error_message': 'str', + 'error_details': 'str', + 'request_id': 'str', + 'validation_errors': 'list[ApiValidationError]' + } + + attribute_map = { + 'error_response_version': 'ErrorResponseVersion', + 'status_code': 'StatusCode', + 'error_message': 'ErrorMessage', + 'error_details': 'ErrorDetails', + 'request_id': 'RequestId', + 'validation_errors': 'ValidationErrors' + } + + def __init__(self, error_response_version=None, status_code=None, error_message=None, error_details=None, request_id=None, validation_errors=None): # noqa: E501 + """ApiErrorResponse - a model defined in Swagger""" # noqa: E501 + + self._error_response_version = None + self._status_code = None + self._error_message = None + self._error_details = None + self._request_id = None + self._validation_errors = None + self.discriminator = None + + if error_response_version is not None: + self.error_response_version = error_response_version + if status_code is not None: + self.status_code = status_code + if error_message is not None: + self.error_message = error_message + if error_details is not None: + self.error_details = error_details + if request_id is not None: + self.request_id = request_id + if validation_errors is not None: + self.validation_errors = validation_errors + + @property + def error_response_version(self): + """Gets the error_response_version of this ApiErrorResponse. # noqa: E501 + + + :return: The error_response_version of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_response_version + + @error_response_version.setter + def error_response_version(self, error_response_version): + """Sets the error_response_version of this ApiErrorResponse. + + + :param error_response_version: The error_response_version of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_response_version = error_response_version + + @property + def status_code(self): + """Gets the status_code of this ApiErrorResponse. # noqa: E501 + + + :return: The status_code of this ApiErrorResponse. # noqa: E501 + :rtype: int + """ + return self._status_code + + @status_code.setter + def status_code(self, status_code): + """Sets the status_code of this ApiErrorResponse. + + + :param status_code: The status_code of this ApiErrorResponse. # noqa: E501 + :type: int + """ + + self._status_code = status_code + + @property + def error_message(self): + """Gets the error_message of this ApiErrorResponse. # noqa: E501 + + + :return: The error_message of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_message + + @error_message.setter + def error_message(self, error_message): + """Sets the error_message of this ApiErrorResponse. + + + :param error_message: The error_message of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_message = error_message + + @property + def error_details(self): + """Gets the error_details of this ApiErrorResponse. # noqa: E501 + + + :return: The error_details of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_details + + @error_details.setter + def error_details(self, error_details): + """Sets the error_details of this ApiErrorResponse. + + + :param error_details: The error_details of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_details = error_details + + @property + def request_id(self): + """Gets the request_id of this ApiErrorResponse. # noqa: E501 + + + :return: The request_id of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._request_id + + @request_id.setter + def request_id(self, request_id): + """Sets the request_id of this ApiErrorResponse. + + + :param request_id: The request_id of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._request_id = request_id + + @property + def validation_errors(self): + """Gets the validation_errors of this ApiErrorResponse. # noqa: E501 + + + :return: The validation_errors of this ApiErrorResponse. # noqa: E501 + :rtype: list[ApiValidationError] + """ + return self._validation_errors + + @validation_errors.setter + def validation_errors(self, validation_errors): + """Sets the validation_errors of this ApiErrorResponse. + + + :param validation_errors: The validation_errors of this ApiErrorResponse. # noqa: E501 + :type: list[ApiValidationError] + """ + + self._validation_errors = validation_errors + + 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(ApiErrorResponse, 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, ApiErrorResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/api_validation_error.py b/digikey/v4/batchproductdetails/models/api_validation_error.py new file mode 100644 index 0000000..73902de --- /dev/null +++ b/digikey/v4/batchproductdetails/models/api_validation_error.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 ApiValidationError(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 = { + 'field': 'str', + 'message': 'str' + } + + attribute_map = { + 'field': 'Field', + 'message': 'Message' + } + + def __init__(self, field=None, message=None): # noqa: E501 + """ApiValidationError - a model defined in Swagger""" # noqa: E501 + + self._field = None + self._message = None + self.discriminator = None + + if field is not None: + self.field = field + if message is not None: + self.message = message + + @property + def field(self): + """Gets the field of this ApiValidationError. # noqa: E501 + + + :return: The field of this ApiValidationError. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this ApiValidationError. + + + :param field: The field of this ApiValidationError. # noqa: E501 + :type: str + """ + + self._field = field + + @property + def message(self): + """Gets the message of this ApiValidationError. # noqa: E501 + + + :return: The message of this ApiValidationError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiValidationError. + + + :param message: The message of this ApiValidationError. # noqa: E501 + :type: str + """ + + self._message = message + + 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(ApiValidationError, 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, ApiValidationError): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/associated_product.py b/digikey/v4/batchproductdetails/models/associated_product.py new file mode 100644 index 0000000..23f5ff8 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/associated_product.py @@ -0,0 +1,477 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 AssociatedProduct(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 = { + 'product_url': 'str', + 'manufacturer_part_number': 'str', + 'minimum_order_quantity': 'int', + 'non_stock': 'bool', + 'packaging': 'PidVid', + 'quantity_available': 'int', + 'digi_key_part_number': 'str', + 'product_description': 'str', + 'unit_price': 'float', + 'manufacturer': 'PidVid', + 'manufacturer_public_quantity': 'int', + 'quantity_on_order': 'int', + 'dk_plus_restriction': 'bool', + 'supplier_direct_ship': 'bool' + } + + attribute_map = { + 'product_url': 'ProductUrl', + 'manufacturer_part_number': 'ManufacturerPartNumber', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'non_stock': 'NonStock', + 'packaging': 'Packaging', + 'quantity_available': 'QuantityAvailable', + 'digi_key_part_number': 'DigiKeyPartNumber', + 'product_description': 'ProductDescription', + 'unit_price': 'UnitPrice', + 'manufacturer': 'Manufacturer', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'quantity_on_order': 'QuantityOnOrder', + 'dk_plus_restriction': 'DKPlusRestriction', + 'supplier_direct_ship': 'SupplierDirectShip' + } + + def __init__(self, product_url=None, manufacturer_part_number=None, minimum_order_quantity=None, non_stock=None, packaging=None, quantity_available=None, digi_key_part_number=None, product_description=None, unit_price=None, manufacturer=None, manufacturer_public_quantity=None, quantity_on_order=None, dk_plus_restriction=None, supplier_direct_ship=None): # noqa: E501 + """AssociatedProduct - a model defined in Swagger""" # noqa: E501 + + self._product_url = None + self._manufacturer_part_number = None + self._minimum_order_quantity = None + self._non_stock = None + self._packaging = None + self._quantity_available = None + self._digi_key_part_number = None + self._product_description = None + self._unit_price = None + self._manufacturer = None + self._manufacturer_public_quantity = None + self._quantity_on_order = None + self._dk_plus_restriction = None + self._supplier_direct_ship = None + self.discriminator = None + + if product_url is not None: + self.product_url = product_url + if manufacturer_part_number is not None: + self.manufacturer_part_number = manufacturer_part_number + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if non_stock is not None: + self.non_stock = non_stock + if packaging is not None: + self.packaging = packaging + if quantity_available is not None: + self.quantity_available = quantity_available + if digi_key_part_number is not None: + self.digi_key_part_number = digi_key_part_number + if product_description is not None: + self.product_description = product_description + if unit_price is not None: + self.unit_price = unit_price + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if quantity_on_order is not None: + self.quantity_on_order = quantity_on_order + if dk_plus_restriction is not None: + self.dk_plus_restriction = dk_plus_restriction + if supplier_direct_ship is not None: + self.supplier_direct_ship = supplier_direct_ship + + @property + def product_url(self): + """Gets the product_url of this AssociatedProduct. # noqa: E501 + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :return: The product_url of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this AssociatedProduct. + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :param product_url: The product_url of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def manufacturer_part_number(self): + """Gets the manufacturer_part_number of this AssociatedProduct. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_part_number of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_part_number + + @manufacturer_part_number.setter + def manufacturer_part_number(self, manufacturer_part_number): + """Sets the manufacturer_part_number of this AssociatedProduct. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_part_number: The manufacturer_part_number of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_part_number = manufacturer_part_number + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this AssociatedProduct. # noqa: E501 + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :return: The minimum_order_quantity of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this AssociatedProduct. + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def non_stock(self): + """Gets the non_stock of this AssociatedProduct. # noqa: E501 + + Indicates this product is a non stock product. # noqa: E501 + + :return: The non_stock of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._non_stock + + @non_stock.setter + def non_stock(self, non_stock): + """Sets the non_stock of this AssociatedProduct. + + Indicates this product is a non stock product. # noqa: E501 + + :param non_stock: The non_stock of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._non_stock = non_stock + + @property + def packaging(self): + """Gets the packaging of this AssociatedProduct. # noqa: E501 + + + :return: The packaging of this AssociatedProduct. # noqa: E501 + :rtype: PidVid + """ + return self._packaging + + @packaging.setter + def packaging(self, packaging): + """Sets the packaging of this AssociatedProduct. + + + :param packaging: The packaging of this AssociatedProduct. # noqa: E501 + :type: PidVid + """ + + self._packaging = packaging + + @property + def quantity_available(self): + """Gets the quantity_available of this AssociatedProduct. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this AssociatedProduct. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def digi_key_part_number(self): + """Gets the digi_key_part_number of this AssociatedProduct. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_part_number of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._digi_key_part_number + + @digi_key_part_number.setter + def digi_key_part_number(self, digi_key_part_number): + """Sets the digi_key_part_number of this AssociatedProduct. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_part_number: The digi_key_part_number of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._digi_key_part_number = digi_key_part_number + + @property + def product_description(self): + """Gets the product_description of this AssociatedProduct. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this AssociatedProduct. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def unit_price(self): + """Gets the unit_price of this AssociatedProduct. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this AssociatedProduct. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this AssociatedProduct. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this AssociatedProduct. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def manufacturer(self): + """Gets the manufacturer of this AssociatedProduct. # noqa: E501 + + + :return: The manufacturer of this AssociatedProduct. # noqa: E501 + :rtype: PidVid + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this AssociatedProduct. + + + :param manufacturer: The manufacturer of this AssociatedProduct. # noqa: E501 + :type: PidVid + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this AssociatedProduct. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this AssociatedProduct. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def quantity_on_order(self): + """Gets the quantity_on_order of this AssociatedProduct. # noqa: E501 + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :return: The quantity_on_order of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_on_order + + @quantity_on_order.setter + def quantity_on_order(self, quantity_on_order): + """Sets the quantity_on_order of this AssociatedProduct. + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :param quantity_on_order: The quantity_on_order of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._quantity_on_order = quantity_on_order + + @property + def dk_plus_restriction(self): + """Gets the dk_plus_restriction of this AssociatedProduct. # noqa: E501 + + If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site # noqa: E501 + + :return: The dk_plus_restriction of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._dk_plus_restriction + + @dk_plus_restriction.setter + def dk_plus_restriction(self, dk_plus_restriction): + """Sets the dk_plus_restriction of this AssociatedProduct. + + If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site # noqa: E501 + + :param dk_plus_restriction: The dk_plus_restriction of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._dk_plus_restriction = dk_plus_restriction + + @property + def supplier_direct_ship(self): + """Gets the supplier_direct_ship of this AssociatedProduct. # noqa: E501 + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :return: The supplier_direct_ship of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._supplier_direct_ship + + @supplier_direct_ship.setter + def supplier_direct_ship(self, supplier_direct_ship): + """Sets the supplier_direct_ship of this AssociatedProduct. + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :param supplier_direct_ship: The supplier_direct_ship of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._supplier_direct_ship = supplier_direct_ship + + 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(AssociatedProduct, 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, AssociatedProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/basic_product.py b/digikey/v4/batchproductdetails/models/basic_product.py new file mode 100644 index 0000000..08004d2 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/basic_product.py @@ -0,0 +1,449 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 BasicProduct(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 = { + 'manufacturer_part_number': 'str', + 'minimum_order_quantity': 'int', + 'non_stock': 'bool', + 'packaging': 'PidVid', + 'quantity_available': 'int', + 'digi_key_part_number': 'str', + 'product_description': 'str', + 'unit_price': 'float', + 'manufacturer': 'PidVid', + 'manufacturer_public_quantity': 'int', + 'quantity_on_order': 'int', + 'dk_plus_restriction': 'bool', + 'supplier_direct_ship': 'bool' + } + + attribute_map = { + 'manufacturer_part_number': 'ManufacturerPartNumber', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'non_stock': 'NonStock', + 'packaging': 'Packaging', + 'quantity_available': 'QuantityAvailable', + 'digi_key_part_number': 'DigiKeyPartNumber', + 'product_description': 'ProductDescription', + 'unit_price': 'UnitPrice', + 'manufacturer': 'Manufacturer', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'quantity_on_order': 'QuantityOnOrder', + 'dk_plus_restriction': 'DKPlusRestriction', + 'supplier_direct_ship': 'SupplierDirectShip' + } + + def __init__(self, manufacturer_part_number=None, minimum_order_quantity=None, non_stock=None, packaging=None, quantity_available=None, digi_key_part_number=None, product_description=None, unit_price=None, manufacturer=None, manufacturer_public_quantity=None, quantity_on_order=None, dk_plus_restriction=None, supplier_direct_ship=None): # noqa: E501 + """BasicProduct - a model defined in Swagger""" # noqa: E501 + + self._manufacturer_part_number = None + self._minimum_order_quantity = None + self._non_stock = None + self._packaging = None + self._quantity_available = None + self._digi_key_part_number = None + self._product_description = None + self._unit_price = None + self._manufacturer = None + self._manufacturer_public_quantity = None + self._quantity_on_order = None + self._dk_plus_restriction = None + self._supplier_direct_ship = None + self.discriminator = None + + if manufacturer_part_number is not None: + self.manufacturer_part_number = manufacturer_part_number + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if non_stock is not None: + self.non_stock = non_stock + if packaging is not None: + self.packaging = packaging + if quantity_available is not None: + self.quantity_available = quantity_available + if digi_key_part_number is not None: + self.digi_key_part_number = digi_key_part_number + if product_description is not None: + self.product_description = product_description + if unit_price is not None: + self.unit_price = unit_price + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if quantity_on_order is not None: + self.quantity_on_order = quantity_on_order + if dk_plus_restriction is not None: + self.dk_plus_restriction = dk_plus_restriction + if supplier_direct_ship is not None: + self.supplier_direct_ship = supplier_direct_ship + + @property + def manufacturer_part_number(self): + """Gets the manufacturer_part_number of this BasicProduct. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_part_number of this BasicProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_part_number + + @manufacturer_part_number.setter + def manufacturer_part_number(self, manufacturer_part_number): + """Sets the manufacturer_part_number of this BasicProduct. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_part_number: The manufacturer_part_number of this BasicProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_part_number = manufacturer_part_number + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this BasicProduct. # noqa: E501 + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :return: The minimum_order_quantity of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this BasicProduct. + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this BasicProduct. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def non_stock(self): + """Gets the non_stock of this BasicProduct. # noqa: E501 + + Indicates this product is a non stock product. # noqa: E501 + + :return: The non_stock of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._non_stock + + @non_stock.setter + def non_stock(self, non_stock): + """Sets the non_stock of this BasicProduct. + + Indicates this product is a non stock product. # noqa: E501 + + :param non_stock: The non_stock of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._non_stock = non_stock + + @property + def packaging(self): + """Gets the packaging of this BasicProduct. # noqa: E501 + + + :return: The packaging of this BasicProduct. # noqa: E501 + :rtype: PidVid + """ + return self._packaging + + @packaging.setter + def packaging(self, packaging): + """Sets the packaging of this BasicProduct. + + + :param packaging: The packaging of this BasicProduct. # noqa: E501 + :type: PidVid + """ + + self._packaging = packaging + + @property + def quantity_available(self): + """Gets the quantity_available of this BasicProduct. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this BasicProduct. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this BasicProduct. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def digi_key_part_number(self): + """Gets the digi_key_part_number of this BasicProduct. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_part_number of this BasicProduct. # noqa: E501 + :rtype: str + """ + return self._digi_key_part_number + + @digi_key_part_number.setter + def digi_key_part_number(self, digi_key_part_number): + """Sets the digi_key_part_number of this BasicProduct. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_part_number: The digi_key_part_number of this BasicProduct. # noqa: E501 + :type: str + """ + + self._digi_key_part_number = digi_key_part_number + + @property + def product_description(self): + """Gets the product_description of this BasicProduct. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this BasicProduct. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this BasicProduct. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this BasicProduct. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def unit_price(self): + """Gets the unit_price of this BasicProduct. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this BasicProduct. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this BasicProduct. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this BasicProduct. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def manufacturer(self): + """Gets the manufacturer of this BasicProduct. # noqa: E501 + + + :return: The manufacturer of this BasicProduct. # noqa: E501 + :rtype: PidVid + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this BasicProduct. + + + :param manufacturer: The manufacturer of this BasicProduct. # noqa: E501 + :type: PidVid + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this BasicProduct. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this BasicProduct. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this BasicProduct. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def quantity_on_order(self): + """Gets the quantity_on_order of this BasicProduct. # noqa: E501 + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :return: The quantity_on_order of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_on_order + + @quantity_on_order.setter + def quantity_on_order(self, quantity_on_order): + """Sets the quantity_on_order of this BasicProduct. + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :param quantity_on_order: The quantity_on_order of this BasicProduct. # noqa: E501 + :type: int + """ + + self._quantity_on_order = quantity_on_order + + @property + def dk_plus_restriction(self): + """Gets the dk_plus_restriction of this BasicProduct. # noqa: E501 + + If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site # noqa: E501 + + :return: The dk_plus_restriction of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._dk_plus_restriction + + @dk_plus_restriction.setter + def dk_plus_restriction(self, dk_plus_restriction): + """Sets the dk_plus_restriction of this BasicProduct. + + If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site # noqa: E501 + + :param dk_plus_restriction: The dk_plus_restriction of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._dk_plus_restriction = dk_plus_restriction + + @property + def supplier_direct_ship(self): + """Gets the supplier_direct_ship of this BasicProduct. # noqa: E501 + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :return: The supplier_direct_ship of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._supplier_direct_ship + + @supplier_direct_ship.setter + def supplier_direct_ship(self, supplier_direct_ship): + """Sets the supplier_direct_ship of this BasicProduct. + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :param supplier_direct_ship: The supplier_direct_ship of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._supplier_direct_ship = supplier_direct_ship + + 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(BasicProduct, 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, BasicProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/batch_product_details_request.py b/digikey/v4/batchproductdetails/models/batch_product_details_request.py new file mode 100644 index 0000000..9a92953 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/batch_product_details_request.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 BatchProductDetailsRequest(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 = { + 'products': 'list[str]' + } + + attribute_map = { + 'products': 'Products' + } + + def __init__(self, products=None): # noqa: E501 + """BatchProductDetailsRequest - a model defined in Swagger""" # noqa: E501 + + self._products = None + self.discriminator = None + + self.products = products + + @property + def products(self): + """Gets the products of this BatchProductDetailsRequest. # noqa: E501 + + # noqa: E501 + + :return: The products of this BatchProductDetailsRequest. # noqa: E501 + :rtype: list[str] + """ + return self._products + + @products.setter + def products(self, products): + """Sets the products of this BatchProductDetailsRequest. + + # noqa: E501 + + :param products: The products of this BatchProductDetailsRequest. # noqa: E501 + :type: list[str] + """ + if products is None: + raise ValueError("Invalid value for `products`, must not be `None`") # noqa: E501 + + self._products = products + + 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(BatchProductDetailsRequest, 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, BatchProductDetailsRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/batch_product_details_response.py b/digikey/v4/batchproductdetails/models/batch_product_details_response.py new file mode 100644 index 0000000..2291e42 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/batch_product_details_response.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 BatchProductDetailsResponse(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 = { + 'product_details': 'list[ProductDetails]', + 'errors': 'list[str]' + } + + attribute_map = { + 'product_details': 'ProductDetails', + 'errors': 'Errors' + } + + def __init__(self, product_details=None, errors=None): # noqa: E501 + """BatchProductDetailsResponse - a model defined in Swagger""" # noqa: E501 + + self._product_details = None + self._errors = None + self.discriminator = None + + if product_details is not None: + self.product_details = product_details + if errors is not None: + self.errors = errors + + @property + def product_details(self): + """Gets the product_details of this BatchProductDetailsResponse. # noqa: E501 + + List of ProductDetails # noqa: E501 + + :return: The product_details of this BatchProductDetailsResponse. # noqa: E501 + :rtype: list[ProductDetails] + """ + return self._product_details + + @product_details.setter + def product_details(self, product_details): + """Sets the product_details of this BatchProductDetailsResponse. + + List of ProductDetails # noqa: E501 + + :param product_details: The product_details of this BatchProductDetailsResponse. # noqa: E501 + :type: list[ProductDetails] + """ + + self._product_details = product_details + + @property + def errors(self): + """Gets the errors of this BatchProductDetailsResponse. # noqa: E501 + + List of Errors # noqa: E501 + + :return: The errors of this BatchProductDetailsResponse. # noqa: E501 + :rtype: list[str] + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this BatchProductDetailsResponse. + + List of Errors # noqa: E501 + + :param errors: The errors of this BatchProductDetailsResponse. # noqa: E501 + :type: list[str] + """ + + self._errors = errors + + 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(BatchProductDetailsResponse, 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, BatchProductDetailsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/iso_search_locale.py b/digikey/v4/batchproductdetails/models/iso_search_locale.py new file mode 100644 index 0000000..69b9f62 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/iso_search_locale.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 IsoSearchLocale(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 = { + 'site': 'str', + 'language': 'str', + 'currency': 'str', + 'ship_to_country': 'str' + } + + attribute_map = { + 'site': 'Site', + 'language': 'Language', + 'currency': 'Currency', + 'ship_to_country': 'ShipToCountry' + } + + def __init__(self, site=None, language=None, currency=None, ship_to_country=None): # noqa: E501 + """IsoSearchLocale - a model defined in Swagger""" # noqa: E501 + + self._site = None + self._language = None + self._currency = None + self._ship_to_country = None + self.discriminator = None + + if site is not None: + self.site = site + if language is not None: + self.language = language + if currency is not None: + self.currency = currency + if ship_to_country is not None: + self.ship_to_country = ship_to_country + + @property + def site(self): + """Gets the site of this IsoSearchLocale. # noqa: E501 + + The site used for the API call. # noqa: E501 + + :return: The site of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._site + + @site.setter + def site(self, site): + """Sets the site of this IsoSearchLocale. + + The site used for the API call. # noqa: E501 + + :param site: The site of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._site = site + + @property + def language(self): + """Gets the language of this IsoSearchLocale. # noqa: E501 + + The language used for the API call. If the provided language is not valid for the site, it will be set to the site default. # noqa: E501 + + :return: The language of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this IsoSearchLocale. + + The language used for the API call. If the provided language is not valid for the site, it will be set to the site default. # noqa: E501 + + :param language: The language of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._language = language + + @property + def currency(self): + """Gets the currency of this IsoSearchLocale. # noqa: E501 + + The currency used for the API call. If the provided currency is not valid for the site, it will be set to the site default. # noqa: E501 + + :return: The currency of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this IsoSearchLocale. + + The currency used for the API call. If the provided currency is not valid for the site, it will be set to the site default. # noqa: E501 + + :param currency: The currency of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def ship_to_country(self): + """Gets the ship_to_country of this IsoSearchLocale. # noqa: E501 + + The destination for shipping the product. This is used for tariffs and regional pricing. # noqa: E501 + + :return: The ship_to_country of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._ship_to_country + + @ship_to_country.setter + def ship_to_country(self, ship_to_country): + """Sets the ship_to_country of this IsoSearchLocale. + + The destination for shipping the product. This is used for tariffs and regional pricing. # noqa: E501 + + :param ship_to_country: The ship_to_country of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._ship_to_country = ship_to_country + + 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(IsoSearchLocale, 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, IsoSearchLocale): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/kit_part.py b/digikey/v4/batchproductdetails/models/kit_part.py new file mode 100644 index 0000000..f891562 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/kit_part.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 KitPart(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 = { + 'associated_product': 'AssociatedProduct', + 'kit_part_quantity': 'int' + } + + attribute_map = { + 'associated_product': 'AssociatedProduct', + 'kit_part_quantity': 'KitPartQuantity' + } + + def __init__(self, associated_product=None, kit_part_quantity=None): # noqa: E501 + """KitPart - a model defined in Swagger""" # noqa: E501 + + self._associated_product = None + self._kit_part_quantity = None + self.discriminator = None + + if associated_product is not None: + self.associated_product = associated_product + if kit_part_quantity is not None: + self.kit_part_quantity = kit_part_quantity + + @property + def associated_product(self): + """Gets the associated_product of this KitPart. # noqa: E501 + + + :return: The associated_product of this KitPart. # noqa: E501 + :rtype: AssociatedProduct + """ + return self._associated_product + + @associated_product.setter + def associated_product(self, associated_product): + """Sets the associated_product of this KitPart. + + + :param associated_product: The associated_product of this KitPart. # noqa: E501 + :type: AssociatedProduct + """ + + self._associated_product = associated_product + + @property + def kit_part_quantity(self): + """Gets the kit_part_quantity of this KitPart. # noqa: E501 + + Number of the product in the Kit. # noqa: E501 + + :return: The kit_part_quantity of this KitPart. # noqa: E501 + :rtype: int + """ + return self._kit_part_quantity + + @kit_part_quantity.setter + def kit_part_quantity(self, kit_part_quantity): + """Sets the kit_part_quantity of this KitPart. + + Number of the product in the Kit. # noqa: E501 + + :param kit_part_quantity: The kit_part_quantity of this KitPart. # noqa: E501 + :type: int + """ + + self._kit_part_quantity = kit_part_quantity + + 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(KitPart, 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, KitPart): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/limited_taxonomy.py b/digikey/v4/batchproductdetails/models/limited_taxonomy.py new file mode 100644 index 0000000..ae5ccbc --- /dev/null +++ b/digikey/v4/batchproductdetails/models/limited_taxonomy.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 LimitedTaxonomy(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 = { + 'children': 'list[LimitedTaxonomy]', + 'product_count': 'int', + 'new_product_count': 'int', + 'parameter_id': 'int', + 'value_id': 'str', + 'parameter': 'str', + 'value': 'str' + } + + attribute_map = { + 'children': 'Children', + 'product_count': 'ProductCount', + 'new_product_count': 'NewProductCount', + 'parameter_id': 'ParameterId', + 'value_id': 'ValueId', + 'parameter': 'Parameter', + 'value': 'Value' + } + + def __init__(self, children=None, product_count=None, new_product_count=None, parameter_id=None, value_id=None, parameter=None, value=None): # noqa: E501 + """LimitedTaxonomy - a model defined in Swagger""" # noqa: E501 + + self._children = None + self._product_count = None + self._new_product_count = None + self._parameter_id = None + self._value_id = None + self._parameter = None + self._value = None + self.discriminator = None + + if children is not None: + self.children = children + if product_count is not None: + self.product_count = product_count + if new_product_count is not None: + self.new_product_count = new_product_count + if parameter_id is not None: + self.parameter_id = parameter_id + if value_id is not None: + self.value_id = value_id + if parameter is not None: + self.parameter = parameter + if value is not None: + self.value = value + + @property + def children(self): + """Gets the children of this LimitedTaxonomy. # noqa: E501 + + List of taxonomies contained within this taxonomy. # noqa: E501 + + :return: The children of this LimitedTaxonomy. # noqa: E501 + :rtype: list[LimitedTaxonomy] + """ + return self._children + + @children.setter + def children(self, children): + """Sets the children of this LimitedTaxonomy. + + List of taxonomies contained within this taxonomy. # noqa: E501 + + :param children: The children of this LimitedTaxonomy. # noqa: E501 + :type: list[LimitedTaxonomy] + """ + + self._children = children + + @property + def product_count(self): + """Gets the product_count of this LimitedTaxonomy. # noqa: E501 + + The number of products contained within this taxonomy. # noqa: E501 + + :return: The product_count of this LimitedTaxonomy. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this LimitedTaxonomy. + + The number of products contained within this taxonomy. # noqa: E501 + + :param product_count: The product_count of this LimitedTaxonomy. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + @property + def new_product_count(self): + """Gets the new_product_count of this LimitedTaxonomy. # noqa: E501 + + The number of new products contained within this taxonomy. # noqa: E501 + + :return: The new_product_count of this LimitedTaxonomy. # noqa: E501 + :rtype: int + """ + return self._new_product_count + + @new_product_count.setter + def new_product_count(self, new_product_count): + """Sets the new_product_count of this LimitedTaxonomy. + + The number of new products contained within this taxonomy. # noqa: E501 + + :param new_product_count: The new_product_count of this LimitedTaxonomy. # noqa: E501 + :type: int + """ + + self._new_product_count = new_product_count + + @property + def parameter_id(self): + """Gets the parameter_id of this LimitedTaxonomy. # noqa: E501 + + The Id of the parameter. # noqa: E501 + + :return: The parameter_id of this LimitedTaxonomy. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this LimitedTaxonomy. + + The Id of the parameter. # noqa: E501 + + :param parameter_id: The parameter_id of this LimitedTaxonomy. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def value_id(self): + """Gets the value_id of this LimitedTaxonomy. # noqa: E501 + + The Id of the value. # noqa: E501 + + :return: The value_id of this LimitedTaxonomy. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this LimitedTaxonomy. + + The Id of the value. # noqa: E501 + + :param value_id: The value_id of this LimitedTaxonomy. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def parameter(self): + """Gets the parameter of this LimitedTaxonomy. # noqa: E501 + + The name of the parameter. # noqa: E501 + + :return: The parameter of this LimitedTaxonomy. # noqa: E501 + :rtype: str + """ + return self._parameter + + @parameter.setter + def parameter(self, parameter): + """Sets the parameter of this LimitedTaxonomy. + + The name of the parameter. # noqa: E501 + + :param parameter: The parameter of this LimitedTaxonomy. # noqa: E501 + :type: str + """ + + self._parameter = parameter + + @property + def value(self): + """Gets the value of this LimitedTaxonomy. # noqa: E501 + + The name of the value. # noqa: E501 + + :return: The value of this LimitedTaxonomy. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this LimitedTaxonomy. + + The name of the value. # noqa: E501 + + :param value: The value of this LimitedTaxonomy. # noqa: E501 + :type: str + """ + + self._value = value + + 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(LimitedTaxonomy, 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, LimitedTaxonomy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/media_links.py b/digikey/v4/batchproductdetails/models/media_links.py new file mode 100644 index 0000000..67bf45f --- /dev/null +++ b/digikey/v4/batchproductdetails/models/media_links.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 MediaLinks(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 = { + 'media_type': 'str', + 'title': 'str', + 'small_photo': 'str', + 'thumbnail': 'str', + 'url': 'str' + } + + attribute_map = { + 'media_type': 'MediaType', + 'title': 'Title', + 'small_photo': 'SmallPhoto', + 'thumbnail': 'Thumbnail', + 'url': 'Url' + } + + def __init__(self, media_type=None, title=None, small_photo=None, thumbnail=None, url=None): # noqa: E501 + """MediaLinks - a model defined in Swagger""" # noqa: E501 + + self._media_type = None + self._title = None + self._small_photo = None + self._thumbnail = None + self._url = None + self.discriminator = None + + if media_type is not None: + self.media_type = media_type + if title is not None: + self.title = title + if small_photo is not None: + self.small_photo = small_photo + if thumbnail is not None: + self.thumbnail = thumbnail + if url is not None: + self.url = url + + @property + def media_type(self): + """Gets the media_type of this MediaLinks. # noqa: E501 + + The type of media. # noqa: E501 + + :return: The media_type of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._media_type + + @media_type.setter + def media_type(self, media_type): + """Sets the media_type of this MediaLinks. + + The type of media. # noqa: E501 + + :param media_type: The media_type of this MediaLinks. # noqa: E501 + :type: str + """ + + self._media_type = media_type + + @property + def title(self): + """Gets the title of this MediaLinks. # noqa: E501 + + The title of the media. # noqa: E501 + + :return: The title of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this MediaLinks. + + The title of the media. # noqa: E501 + + :param title: The title of this MediaLinks. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def small_photo(self): + """Gets the small_photo of this MediaLinks. # noqa: E501 + + URL to a small photo. # noqa: E501 + + :return: The small_photo of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._small_photo + + @small_photo.setter + def small_photo(self, small_photo): + """Sets the small_photo of this MediaLinks. + + URL to a small photo. # noqa: E501 + + :param small_photo: The small_photo of this MediaLinks. # noqa: E501 + :type: str + """ + + self._small_photo = small_photo + + @property + def thumbnail(self): + """Gets the thumbnail of this MediaLinks. # noqa: E501 + + URL to the thumbnail image of the media. # noqa: E501 + + :return: The thumbnail of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._thumbnail + + @thumbnail.setter + def thumbnail(self, thumbnail): + """Sets the thumbnail of this MediaLinks. + + URL to the thumbnail image of the media. # noqa: E501 + + :param thumbnail: The thumbnail of this MediaLinks. # noqa: E501 + :type: str + """ + + self._thumbnail = thumbnail + + @property + def url(self): + """Gets the url of this MediaLinks. # noqa: E501 + + URL of the media. # noqa: E501 + + :return: The url of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this MediaLinks. + + URL of the media. # noqa: E501 + + :param url: The url of this MediaLinks. # noqa: E501 + :type: str + """ + + self._url = url + + 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(MediaLinks, 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, MediaLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/pid_vid.py b/digikey/v4/batchproductdetails/models/pid_vid.py new file mode 100644 index 0000000..5561213 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/pid_vid.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 PidVid(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 = { + 'parameter_id': 'int', + 'value_id': 'str', + 'parameter': 'str', + 'value': 'str' + } + + attribute_map = { + 'parameter_id': 'ParameterId', + 'value_id': 'ValueId', + 'parameter': 'Parameter', + 'value': 'Value' + } + + def __init__(self, parameter_id=None, value_id=None, parameter=None, value=None): # noqa: E501 + """PidVid - a model defined in Swagger""" # noqa: E501 + + self._parameter_id = None + self._value_id = None + self._parameter = None + self._value = None + self.discriminator = None + + if parameter_id is not None: + self.parameter_id = parameter_id + if value_id is not None: + self.value_id = value_id + if parameter is not None: + self.parameter = parameter + if value is not None: + self.value = value + + @property + def parameter_id(self): + """Gets the parameter_id of this PidVid. # noqa: E501 + + The Id of the parameter. # noqa: E501 + + :return: The parameter_id of this PidVid. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this PidVid. + + The Id of the parameter. # noqa: E501 + + :param parameter_id: The parameter_id of this PidVid. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def value_id(self): + """Gets the value_id of this PidVid. # noqa: E501 + + The Id of the value. # noqa: E501 + + :return: The value_id of this PidVid. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this PidVid. + + The Id of the value. # noqa: E501 + + :param value_id: The value_id of this PidVid. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def parameter(self): + """Gets the parameter of this PidVid. # noqa: E501 + + The name of the parameter. # noqa: E501 + + :return: The parameter of this PidVid. # noqa: E501 + :rtype: str + """ + return self._parameter + + @parameter.setter + def parameter(self, parameter): + """Sets the parameter of this PidVid. + + The name of the parameter. # noqa: E501 + + :param parameter: The parameter of this PidVid. # noqa: E501 + :type: str + """ + + self._parameter = parameter + + @property + def value(self): + """Gets the value of this PidVid. # noqa: E501 + + The name of the value. # noqa: E501 + + :return: The value of this PidVid. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this PidVid. + + The name of the value. # noqa: E501 + + :param value: The value of this PidVid. # noqa: E501 + :type: str + """ + + self._value = value + + 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(PidVid, 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, PidVid): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/price_break.py b/digikey/v4/batchproductdetails/models/price_break.py new file mode 100644 index 0000000..2e24cda --- /dev/null +++ b/digikey/v4/batchproductdetails/models/price_break.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 PriceBreak(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 = { + 'break_quantity': 'int', + 'unit_price': 'float', + 'total_price': 'float' + } + + attribute_map = { + 'break_quantity': 'BreakQuantity', + 'unit_price': 'UnitPrice', + 'total_price': 'TotalPrice' + } + + def __init__(self, break_quantity=None, unit_price=None, total_price=None): # noqa: E501 + """PriceBreak - a model defined in Swagger""" # noqa: E501 + + self._break_quantity = None + self._unit_price = None + self._total_price = None + self.discriminator = None + + if break_quantity is not None: + self.break_quantity = break_quantity + if unit_price is not None: + self.unit_price = unit_price + if total_price is not None: + self.total_price = total_price + + @property + def break_quantity(self): + """Gets the break_quantity of this PriceBreak. # noqa: E501 + + Price tiers based on the available quantities of the product. # noqa: E501 + + :return: The break_quantity of this PriceBreak. # noqa: E501 + :rtype: int + """ + return self._break_quantity + + @break_quantity.setter + def break_quantity(self, break_quantity): + """Sets the break_quantity of this PriceBreak. + + Price tiers based on the available quantities of the product. # noqa: E501 + + :param break_quantity: The break_quantity of this PriceBreak. # noqa: E501 + :type: int + """ + + self._break_quantity = break_quantity + + @property + def unit_price(self): + """Gets the unit_price of this PriceBreak. # noqa: E501 + + Price of a single unit of the product at this break. # noqa: E501 + + :return: The unit_price of this PriceBreak. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this PriceBreak. + + Price of a single unit of the product at this break. # noqa: E501 + + :param unit_price: The unit_price of this PriceBreak. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def total_price(self): + """Gets the total_price of this PriceBreak. # noqa: E501 + + Price of BreakQuantity units of the product. # noqa: E501 + + :return: The total_price of this PriceBreak. # noqa: E501 + :rtype: float + """ + return self._total_price + + @total_price.setter + def total_price(self, total_price): + """Sets the total_price of this PriceBreak. + + Price of BreakQuantity units of the product. # noqa: E501 + + :param total_price: The total_price of this PriceBreak. # noqa: E501 + :type: float + """ + + self._total_price = total_price + + 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(PriceBreak, 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, PriceBreak): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/models/product_details.py b/digikey/v4/batchproductdetails/models/product_details.py new file mode 100644 index 0000000..a0d0473 --- /dev/null +++ b/digikey/v4/batchproductdetails/models/product_details.py @@ -0,0 +1,1423 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # 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 ProductDetails(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 = { + 'my_pricing': 'list[PriceBreak]', + 'obsolete': 'bool', + 'media_links': 'list[MediaLinks]', + 'standard_package': 'int', + 'limited_taxonomy': 'LimitedTaxonomy', + 'kits': 'list[AssociatedProduct]', + 'kit_contents': 'list[KitPart]', + 'mating_products': 'list[AssociatedProduct]', + 'search_locale_used': 'IsoSearchLocale', + 'associated_products': 'list[AssociatedProduct]', + 'for_use_with_products': 'list[AssociatedProduct]', + 'rohs_subs': 'list[AssociatedProduct]', + 'suggested_subs': 'list[AssociatedProduct]', + 'additional_value_fee': 'float', + 'reach_effective_date': 'str', + 'standard_pricing': 'list[PriceBreak]', + 'ro_hs_status': 'str', + 'lead_status': 'str', + 'parameters': 'list[PidVid]', + 'product_url': 'str', + 'primary_datasheet': 'str', + 'primary_photo': 'str', + 'primary_video': 'str', + 'series': 'PidVid', + 'manufacturer_lead_weeks': 'str', + 'manufacturer_page_url': 'str', + 'product_status': 'str', + 'date_last_buy_chance': 'datetime', + 'alternate_packaging': 'list[BasicProduct]', + 'detailed_description': 'str', + 'reach_status': 'str', + 'export_control_class_number': 'str', + 'htsus_code': 'str', + 'tariff_description': 'str', + 'moisture_sensitivity_level': 'str', + 'manufacturer_part_number': 'str', + 'minimum_order_quantity': 'int', + 'non_stock': 'bool', + 'packaging': 'PidVid', + 'quantity_available': 'int', + 'digi_key_part_number': 'str', + 'product_description': 'str', + 'unit_price': 'float', + 'manufacturer': 'PidVid', + 'manufacturer_public_quantity': 'int', + 'quantity_on_order': 'int', + 'dk_plus_restriction': 'bool', + 'supplier_direct_ship': 'bool' + } + + attribute_map = { + 'my_pricing': 'MyPricing', + 'obsolete': 'Obsolete', + 'media_links': 'MediaLinks', + 'standard_package': 'StandardPackage', + 'limited_taxonomy': 'LimitedTaxonomy', + 'kits': 'Kits', + 'kit_contents': 'KitContents', + 'mating_products': 'MatingProducts', + 'search_locale_used': 'SearchLocaleUsed', + 'associated_products': 'AssociatedProducts', + 'for_use_with_products': 'ForUseWithProducts', + 'rohs_subs': 'RohsSubs', + 'suggested_subs': 'SuggestedSubs', + 'additional_value_fee': 'AdditionalValueFee', + 'reach_effective_date': 'ReachEffectiveDate', + 'standard_pricing': 'StandardPricing', + 'ro_hs_status': 'RoHSStatus', + 'lead_status': 'LeadStatus', + 'parameters': 'Parameters', + 'product_url': 'ProductUrl', + 'primary_datasheet': 'PrimaryDatasheet', + 'primary_photo': 'PrimaryPhoto', + 'primary_video': 'PrimaryVideo', + 'series': 'Series', + 'manufacturer_lead_weeks': 'ManufacturerLeadWeeks', + 'manufacturer_page_url': 'ManufacturerPageUrl', + 'product_status': 'ProductStatus', + 'date_last_buy_chance': 'DateLastBuyChance', + 'alternate_packaging': 'AlternatePackaging', + 'detailed_description': 'DetailedDescription', + 'reach_status': 'ReachStatus', + 'export_control_class_number': 'ExportControlClassNumber', + 'htsus_code': 'HTSUSCode', + 'tariff_description': 'TariffDescription', + 'moisture_sensitivity_level': 'MoistureSensitivityLevel', + 'manufacturer_part_number': 'ManufacturerPartNumber', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'non_stock': 'NonStock', + 'packaging': 'Packaging', + 'quantity_available': 'QuantityAvailable', + 'digi_key_part_number': 'DigiKeyPartNumber', + 'product_description': 'ProductDescription', + 'unit_price': 'UnitPrice', + 'manufacturer': 'Manufacturer', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'quantity_on_order': 'QuantityOnOrder', + 'dk_plus_restriction': 'DKPlusRestriction', + 'supplier_direct_ship': 'SupplierDirectShip' + } + + def __init__(self, my_pricing=None, obsolete=None, media_links=None, standard_package=None, limited_taxonomy=None, kits=None, kit_contents=None, mating_products=None, search_locale_used=None, associated_products=None, for_use_with_products=None, rohs_subs=None, suggested_subs=None, additional_value_fee=None, reach_effective_date=None, standard_pricing=None, ro_hs_status=None, lead_status=None, parameters=None, product_url=None, primary_datasheet=None, primary_photo=None, primary_video=None, series=None, manufacturer_lead_weeks=None, manufacturer_page_url=None, product_status=None, date_last_buy_chance=None, alternate_packaging=None, detailed_description=None, reach_status=None, export_control_class_number=None, htsus_code=None, tariff_description=None, moisture_sensitivity_level=None, manufacturer_part_number=None, minimum_order_quantity=None, non_stock=None, packaging=None, quantity_available=None, digi_key_part_number=None, product_description=None, unit_price=None, manufacturer=None, manufacturer_public_quantity=None, quantity_on_order=None, dk_plus_restriction=None, supplier_direct_ship=None): # noqa: E501 + """ProductDetails - a model defined in Swagger""" # noqa: E501 + + self._my_pricing = None + self._obsolete = None + self._media_links = None + self._standard_package = None + self._limited_taxonomy = None + self._kits = None + self._kit_contents = None + self._mating_products = None + self._search_locale_used = None + self._associated_products = None + self._for_use_with_products = None + self._rohs_subs = None + self._suggested_subs = None + self._additional_value_fee = None + self._reach_effective_date = None + self._standard_pricing = None + self._ro_hs_status = None + self._lead_status = None + self._parameters = None + self._product_url = None + self._primary_datasheet = None + self._primary_photo = None + self._primary_video = None + self._series = None + self._manufacturer_lead_weeks = None + self._manufacturer_page_url = None + self._product_status = None + self._date_last_buy_chance = None + self._alternate_packaging = None + self._detailed_description = None + self._reach_status = None + self._export_control_class_number = None + self._htsus_code = None + self._tariff_description = None + self._moisture_sensitivity_level = None + self._manufacturer_part_number = None + self._minimum_order_quantity = None + self._non_stock = None + self._packaging = None + self._quantity_available = None + self._digi_key_part_number = None + self._product_description = None + self._unit_price = None + self._manufacturer = None + self._manufacturer_public_quantity = None + self._quantity_on_order = None + self._dk_plus_restriction = None + self._supplier_direct_ship = None + self.discriminator = None + + if my_pricing is not None: + self.my_pricing = my_pricing + if obsolete is not None: + self.obsolete = obsolete + if media_links is not None: + self.media_links = media_links + if standard_package is not None: + self.standard_package = standard_package + if limited_taxonomy is not None: + self.limited_taxonomy = limited_taxonomy + if kits is not None: + self.kits = kits + if kit_contents is not None: + self.kit_contents = kit_contents + if mating_products is not None: + self.mating_products = mating_products + if search_locale_used is not None: + self.search_locale_used = search_locale_used + if associated_products is not None: + self.associated_products = associated_products + if for_use_with_products is not None: + self.for_use_with_products = for_use_with_products + if rohs_subs is not None: + self.rohs_subs = rohs_subs + if suggested_subs is not None: + self.suggested_subs = suggested_subs + if additional_value_fee is not None: + self.additional_value_fee = additional_value_fee + if reach_effective_date is not None: + self.reach_effective_date = reach_effective_date + if standard_pricing is not None: + self.standard_pricing = standard_pricing + if ro_hs_status is not None: + self.ro_hs_status = ro_hs_status + if lead_status is not None: + self.lead_status = lead_status + if parameters is not None: + self.parameters = parameters + if product_url is not None: + self.product_url = product_url + if primary_datasheet is not None: + self.primary_datasheet = primary_datasheet + if primary_photo is not None: + self.primary_photo = primary_photo + if primary_video is not None: + self.primary_video = primary_video + if series is not None: + self.series = series + if manufacturer_lead_weeks is not None: + self.manufacturer_lead_weeks = manufacturer_lead_weeks + if manufacturer_page_url is not None: + self.manufacturer_page_url = manufacturer_page_url + if product_status is not None: + self.product_status = product_status + if date_last_buy_chance is not None: + self.date_last_buy_chance = date_last_buy_chance + if alternate_packaging is not None: + self.alternate_packaging = alternate_packaging + if detailed_description is not None: + self.detailed_description = detailed_description + if reach_status is not None: + self.reach_status = reach_status + if export_control_class_number is not None: + self.export_control_class_number = export_control_class_number + if htsus_code is not None: + self.htsus_code = htsus_code + if tariff_description is not None: + self.tariff_description = tariff_description + if moisture_sensitivity_level is not None: + self.moisture_sensitivity_level = moisture_sensitivity_level + if manufacturer_part_number is not None: + self.manufacturer_part_number = manufacturer_part_number + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if non_stock is not None: + self.non_stock = non_stock + if packaging is not None: + self.packaging = packaging + if quantity_available is not None: + self.quantity_available = quantity_available + if digi_key_part_number is not None: + self.digi_key_part_number = digi_key_part_number + if product_description is not None: + self.product_description = product_description + if unit_price is not None: + self.unit_price = unit_price + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if quantity_on_order is not None: + self.quantity_on_order = quantity_on_order + if dk_plus_restriction is not None: + self.dk_plus_restriction = dk_plus_restriction + if supplier_direct_ship is not None: + self.supplier_direct_ship = supplier_direct_ship + + @property + def my_pricing(self): + """Gets the my_pricing of this ProductDetails. # noqa: E501 + + Your pricing for the account with which you authenticated. Also dependent on locale information. # noqa: E501 + + :return: The my_pricing of this ProductDetails. # noqa: E501 + :rtype: list[PriceBreak] + """ + return self._my_pricing + + @my_pricing.setter + def my_pricing(self, my_pricing): + """Sets the my_pricing of this ProductDetails. + + Your pricing for the account with which you authenticated. Also dependent on locale information. # noqa: E501 + + :param my_pricing: The my_pricing of this ProductDetails. # noqa: E501 + :type: list[PriceBreak] + """ + + self._my_pricing = my_pricing + + @property + def obsolete(self): + """Gets the obsolete of this ProductDetails. # noqa: E501 + + Indicates whether this Part is obsolete. # noqa: E501 + + :return: The obsolete of this ProductDetails. # noqa: E501 + :rtype: bool + """ + return self._obsolete + + @obsolete.setter + def obsolete(self, obsolete): + """Sets the obsolete of this ProductDetails. + + Indicates whether this Part is obsolete. # noqa: E501 + + :param obsolete: The obsolete of this ProductDetails. # noqa: E501 + :type: bool + """ + + self._obsolete = obsolete + + @property + def media_links(self): + """Gets the media_links of this ProductDetails. # noqa: E501 + + Collection of MediaLinks objects. These can contain links to datasheets, photos or manuals. # noqa: E501 + + :return: The media_links of this ProductDetails. # noqa: E501 + :rtype: list[MediaLinks] + """ + return self._media_links + + @media_links.setter + def media_links(self, media_links): + """Sets the media_links of this ProductDetails. + + Collection of MediaLinks objects. These can contain links to datasheets, photos or manuals. # noqa: E501 + + :param media_links: The media_links of this ProductDetails. # noqa: E501 + :type: list[MediaLinks] + """ + + self._media_links = media_links + + @property + def standard_package(self): + """Gets the standard_package of this ProductDetails. # noqa: E501 + + The number of products in the manufacturer's standard package. # noqa: E501 + + :return: The standard_package of this ProductDetails. # noqa: E501 + :rtype: int + """ + return self._standard_package + + @standard_package.setter + def standard_package(self, standard_package): + """Sets the standard_package of this ProductDetails. + + The number of products in the manufacturer's standard package. # noqa: E501 + + :param standard_package: The standard_package of this ProductDetails. # noqa: E501 + :type: int + """ + + self._standard_package = standard_package + + @property + def limited_taxonomy(self): + """Gets the limited_taxonomy of this ProductDetails. # noqa: E501 + + + :return: The limited_taxonomy of this ProductDetails. # noqa: E501 + :rtype: LimitedTaxonomy + """ + return self._limited_taxonomy + + @limited_taxonomy.setter + def limited_taxonomy(self, limited_taxonomy): + """Sets the limited_taxonomy of this ProductDetails. + + + :param limited_taxonomy: The limited_taxonomy of this ProductDetails. # noqa: E501 + :type: LimitedTaxonomy + """ + + self._limited_taxonomy = limited_taxonomy + + @property + def kits(self): + """Gets the kits of this ProductDetails. # noqa: E501 + + Kits that this product is contained in. # noqa: E501 + + :return: The kits of this ProductDetails. # noqa: E501 + :rtype: list[AssociatedProduct] + """ + return self._kits + + @kits.setter + def kits(self, kits): + """Sets the kits of this ProductDetails. + + Kits that this product is contained in. # noqa: E501 + + :param kits: The kits of this ProductDetails. # noqa: E501 + :type: list[AssociatedProduct] + """ + + self._kits = kits + + @property + def kit_contents(self): + """Gets the kit_contents of this ProductDetails. # noqa: E501 + + Products contained within this product. Only applicable if this product is a kit. # noqa: E501 + + :return: The kit_contents of this ProductDetails. # noqa: E501 + :rtype: list[KitPart] + """ + return self._kit_contents + + @kit_contents.setter + def kit_contents(self, kit_contents): + """Sets the kit_contents of this ProductDetails. + + Products contained within this product. Only applicable if this product is a kit. # noqa: E501 + + :param kit_contents: The kit_contents of this ProductDetails. # noqa: E501 + :type: list[KitPart] + """ + + self._kit_contents = kit_contents + + @property + def mating_products(self): + """Gets the mating_products of this ProductDetails. # noqa: E501 + + An association of same manufacturer products that mate with each other. # noqa: E501 + + :return: The mating_products of this ProductDetails. # noqa: E501 + :rtype: list[AssociatedProduct] + """ + return self._mating_products + + @mating_products.setter + def mating_products(self, mating_products): + """Sets the mating_products of this ProductDetails. + + An association of same manufacturer products that mate with each other. # noqa: E501 + + :param mating_products: The mating_products of this ProductDetails. # noqa: E501 + :type: list[AssociatedProduct] + """ + + self._mating_products = mating_products + + @property + def search_locale_used(self): + """Gets the search_locale_used of this ProductDetails. # noqa: E501 + + + :return: The search_locale_used of this ProductDetails. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this ProductDetails. + + + :param search_locale_used: The search_locale_used of this ProductDetails. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + @property + def associated_products(self): + """Gets the associated_products of this ProductDetails. # noqa: E501 + + Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. # noqa: E501 + + :return: The associated_products of this ProductDetails. # noqa: E501 + :rtype: list[AssociatedProduct] + """ + return self._associated_products + + @associated_products.setter + def associated_products(self, associated_products): + """Sets the associated_products of this ProductDetails. + + Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. # noqa: E501 + + :param associated_products: The associated_products of this ProductDetails. # noqa: E501 + :type: list[AssociatedProduct] + """ + + self._associated_products = associated_products + + @property + def for_use_with_products(self): + """Gets the for_use_with_products of this ProductDetails. # noqa: E501 + + Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. # noqa: E501 + + :return: The for_use_with_products of this ProductDetails. # noqa: E501 + :rtype: list[AssociatedProduct] + """ + return self._for_use_with_products + + @for_use_with_products.setter + def for_use_with_products(self, for_use_with_products): + """Sets the for_use_with_products of this ProductDetails. + + Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. # noqa: E501 + + :param for_use_with_products: The for_use_with_products of this ProductDetails. # noqa: E501 + :type: list[AssociatedProduct] + """ + + self._for_use_with_products = for_use_with_products + + @property + def rohs_subs(self): + """Gets the rohs_subs of this ProductDetails. # noqa: E501 + + Rohs substitutions # noqa: E501 + + :return: The rohs_subs of this ProductDetails. # noqa: E501 + :rtype: list[AssociatedProduct] + """ + return self._rohs_subs + + @rohs_subs.setter + def rohs_subs(self, rohs_subs): + """Sets the rohs_subs of this ProductDetails. + + Rohs substitutions # noqa: E501 + + :param rohs_subs: The rohs_subs of this ProductDetails. # noqa: E501 + :type: list[AssociatedProduct] + """ + + self._rohs_subs = rohs_subs + + @property + def suggested_subs(self): + """Gets the suggested_subs of this ProductDetails. # noqa: E501 + + Suggested substitutions for when the product is obsolete. # noqa: E501 + + :return: The suggested_subs of this ProductDetails. # noqa: E501 + :rtype: list[AssociatedProduct] + """ + return self._suggested_subs + + @suggested_subs.setter + def suggested_subs(self, suggested_subs): + """Sets the suggested_subs of this ProductDetails. + + Suggested substitutions for when the product is obsolete. # noqa: E501 + + :param suggested_subs: The suggested_subs of this ProductDetails. # noqa: E501 + :type: list[AssociatedProduct] + """ + + self._suggested_subs = suggested_subs + + @property + def additional_value_fee(self): + """Gets the additional_value_fee of this ProductDetails. # noqa: E501 + + Any additional value fee. Most commonly the Digi-Reel fee. May be used for programmable parts as well. # noqa: E501 + + :return: The additional_value_fee of this ProductDetails. # noqa: E501 + :rtype: float + """ + return self._additional_value_fee + + @additional_value_fee.setter + def additional_value_fee(self, additional_value_fee): + """Sets the additional_value_fee of this ProductDetails. + + Any additional value fee. Most commonly the Digi-Reel fee. May be used for programmable parts as well. # noqa: E501 + + :param additional_value_fee: The additional_value_fee of this ProductDetails. # noqa: E501 + :type: float + """ + + self._additional_value_fee = additional_value_fee + + @property + def reach_effective_date(self): + """Gets the reach_effective_date of this ProductDetails. # noqa: E501 + + REACH effective date is string in format \"MMM-yyyy\" or blank \"\". REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. # noqa: E501 + + :return: The reach_effective_date of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._reach_effective_date + + @reach_effective_date.setter + def reach_effective_date(self, reach_effective_date): + """Sets the reach_effective_date of this ProductDetails. + + REACH effective date is string in format \"MMM-yyyy\" or blank \"\". REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. # noqa: E501 + + :param reach_effective_date: The reach_effective_date of this ProductDetails. # noqa: E501 + :type: str + """ + + self._reach_effective_date = reach_effective_date + + @property + def standard_pricing(self): + """Gets the standard_pricing of this ProductDetails. # noqa: E501 + + Standard pricing for the validated locale. # noqa: E501 + + :return: The standard_pricing of this ProductDetails. # noqa: E501 + :rtype: list[PriceBreak] + """ + return self._standard_pricing + + @standard_pricing.setter + def standard_pricing(self, standard_pricing): + """Sets the standard_pricing of this ProductDetails. + + Standard pricing for the validated locale. # noqa: E501 + + :param standard_pricing: The standard_pricing of this ProductDetails. # noqa: E501 + :type: list[PriceBreak] + """ + + self._standard_pricing = standard_pricing + + @property + def ro_hs_status(self): + """Gets the ro_hs_status of this ProductDetails. # noqa: E501 + + RoHS status. Can be: RoHS Compliant, RoHS non-compliant, RoHS Compliant By Exemption, Not Applicable, Vendor undefined, Request Inventory Verification, ROHS3 Compliant. # noqa: E501 + + :return: The ro_hs_status of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._ro_hs_status + + @ro_hs_status.setter + def ro_hs_status(self, ro_hs_status): + """Sets the ro_hs_status of this ProductDetails. + + RoHS status. Can be: RoHS Compliant, RoHS non-compliant, RoHS Compliant By Exemption, Not Applicable, Vendor undefined, Request Inventory Verification, ROHS3 Compliant. # noqa: E501 + + :param ro_hs_status: The ro_hs_status of this ProductDetails. # noqa: E501 + :type: str + """ + + self._ro_hs_status = ro_hs_status + + @property + def lead_status(self): + """Gets the lead_status of this ProductDetails. # noqa: E501 + + Lead status. Can be: Lead Free, Contains lead, Lead Free By Exemption, Not Applicable, Vendor undefined, unknown, or Request Inventory Verification. # noqa: E501 + + :return: The lead_status of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._lead_status + + @lead_status.setter + def lead_status(self, lead_status): + """Sets the lead_status of this ProductDetails. + + Lead status. Can be: Lead Free, Contains lead, Lead Free By Exemption, Not Applicable, Vendor undefined, unknown, or Request Inventory Verification. # noqa: E501 + + :param lead_status: The lead_status of this ProductDetails. # noqa: E501 + :type: str + """ + + self._lead_status = lead_status + + @property + def parameters(self): + """Gets the parameters of this ProductDetails. # noqa: E501 + + Parameters for the part. Can be used for filtering keyword searches. # noqa: E501 + + :return: The parameters of this ProductDetails. # noqa: E501 + :rtype: list[PidVid] + """ + return self._parameters + + @parameters.setter + def parameters(self, parameters): + """Sets the parameters of this ProductDetails. + + Parameters for the part. Can be used for filtering keyword searches. # noqa: E501 + + :param parameters: The parameters of this ProductDetails. # noqa: E501 + :type: list[PidVid] + """ + + self._parameters = parameters + + @property + def product_url(self): + """Gets the product_url of this ProductDetails. # noqa: E501 + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :return: The product_url of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this ProductDetails. + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :param product_url: The product_url of this ProductDetails. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def primary_datasheet(self): + """Gets the primary_datasheet of this ProductDetails. # noqa: E501 + + The URL to the product's datasheet. # noqa: E501 + + :return: The primary_datasheet of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._primary_datasheet + + @primary_datasheet.setter + def primary_datasheet(self, primary_datasheet): + """Sets the primary_datasheet of this ProductDetails. + + The URL to the product's datasheet. # noqa: E501 + + :param primary_datasheet: The primary_datasheet of this ProductDetails. # noqa: E501 + :type: str + """ + + self._primary_datasheet = primary_datasheet + + @property + def primary_photo(self): + """Gets the primary_photo of this ProductDetails. # noqa: E501 + + The URL to the product's image. # noqa: E501 + + :return: The primary_photo of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._primary_photo + + @primary_photo.setter + def primary_photo(self, primary_photo): + """Sets the primary_photo of this ProductDetails. + + The URL to the product's image. # noqa: E501 + + :param primary_photo: The primary_photo of this ProductDetails. # noqa: E501 + :type: str + """ + + self._primary_photo = primary_photo + + @property + def primary_video(self): + """Gets the primary_video of this ProductDetails. # noqa: E501 + + The URL to the product's video. # noqa: E501 + + :return: The primary_video of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._primary_video + + @primary_video.setter + def primary_video(self, primary_video): + """Sets the primary_video of this ProductDetails. + + The URL to the product's video. # noqa: E501 + + :param primary_video: The primary_video of this ProductDetails. # noqa: E501 + :type: str + """ + + self._primary_video = primary_video + + @property + def series(self): + """Gets the series of this ProductDetails. # noqa: E501 + + + :return: The series of this ProductDetails. # noqa: E501 + :rtype: PidVid + """ + return self._series + + @series.setter + def series(self, series): + """Sets the series of this ProductDetails. + + + :param series: The series of this ProductDetails. # noqa: E501 + :type: PidVid + """ + + self._series = series + + @property + def manufacturer_lead_weeks(self): + """Gets the manufacturer_lead_weeks of this ProductDetails. # noqa: E501 + + The number of weeks expected to receive stock from manufacturer. # noqa: E501 + + :return: The manufacturer_lead_weeks of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._manufacturer_lead_weeks + + @manufacturer_lead_weeks.setter + def manufacturer_lead_weeks(self, manufacturer_lead_weeks): + """Sets the manufacturer_lead_weeks of this ProductDetails. + + The number of weeks expected to receive stock from manufacturer. # noqa: E501 + + :param manufacturer_lead_weeks: The manufacturer_lead_weeks of this ProductDetails. # noqa: E501 + :type: str + """ + + self._manufacturer_lead_weeks = manufacturer_lead_weeks + + @property + def manufacturer_page_url(self): + """Gets the manufacturer_page_url of this ProductDetails. # noqa: E501 + + The URL to Digi-Key's page on the manufacturer. # noqa: E501 + + :return: The manufacturer_page_url of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._manufacturer_page_url + + @manufacturer_page_url.setter + def manufacturer_page_url(self, manufacturer_page_url): + """Sets the manufacturer_page_url of this ProductDetails. + + The URL to Digi-Key's page on the manufacturer. # noqa: E501 + + :param manufacturer_page_url: The manufacturer_page_url of this ProductDetails. # noqa: E501 + :type: str + """ + + self._manufacturer_page_url = manufacturer_page_url + + @property + def product_status(self): + """Gets the product_status of this ProductDetails. # noqa: E501 + + Status of the product. Options include: Active, Obsolete, Discontinued at Digi-Key, Last Time Buy, Not For New Designs, Preliminary. For obsolete parts the part will become a non-stocking item when stock is depleted; minimums will apply. Order the quantity available or the quantity available plus a multiple of the minimum order quantity. # noqa: E501 + + :return: The product_status of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._product_status + + @product_status.setter + def product_status(self, product_status): + """Sets the product_status of this ProductDetails. + + Status of the product. Options include: Active, Obsolete, Discontinued at Digi-Key, Last Time Buy, Not For New Designs, Preliminary. For obsolete parts the part will become a non-stocking item when stock is depleted; minimums will apply. Order the quantity available or the quantity available plus a multiple of the minimum order quantity. # noqa: E501 + + :param product_status: The product_status of this ProductDetails. # noqa: E501 + :type: str + """ + + self._product_status = product_status + + @property + def date_last_buy_chance(self): + """Gets the date_last_buy_chance of this ProductDetails. # noqa: E501 + + Last date that the product will be available for purchase. Date is in ISO 8601. # noqa: E501 + + :return: The date_last_buy_chance of this ProductDetails. # noqa: E501 + :rtype: datetime + """ + return self._date_last_buy_chance + + @date_last_buy_chance.setter + def date_last_buy_chance(self, date_last_buy_chance): + """Sets the date_last_buy_chance of this ProductDetails. + + Last date that the product will be available for purchase. Date is in ISO 8601. # noqa: E501 + + :param date_last_buy_chance: The date_last_buy_chance of this ProductDetails. # noqa: E501 + :type: datetime + """ + + self._date_last_buy_chance = date_last_buy_chance + + @property + def alternate_packaging(self): + """Gets the alternate_packaging of this ProductDetails. # noqa: E501 + + Other packaging types available for this product. # noqa: E501 + + :return: The alternate_packaging of this ProductDetails. # noqa: E501 + :rtype: list[BasicProduct] + """ + return self._alternate_packaging + + @alternate_packaging.setter + def alternate_packaging(self, alternate_packaging): + """Sets the alternate_packaging of this ProductDetails. + + Other packaging types available for this product. # noqa: E501 + + :param alternate_packaging: The alternate_packaging of this ProductDetails. # noqa: E501 + :type: list[BasicProduct] + """ + + self._alternate_packaging = alternate_packaging + + @property + def detailed_description(self): + """Gets the detailed_description of this ProductDetails. # noqa: E501 + + Extended catalog description of the product. # noqa: E501 + + :return: The detailed_description of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._detailed_description + + @detailed_description.setter + def detailed_description(self, detailed_description): + """Sets the detailed_description of this ProductDetails. + + Extended catalog description of the product. # noqa: E501 + + :param detailed_description: The detailed_description of this ProductDetails. # noqa: E501 + :type: str + """ + + self._detailed_description = detailed_description + + @property + def reach_status(self): + """Gets the reach_status of this ProductDetails. # noqa: E501 + + REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. # noqa: E501 + + :return: The reach_status of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._reach_status + + @reach_status.setter + def reach_status(self, reach_status): + """Sets the reach_status of this ProductDetails. + + REACH is a regulation of the European Union. See documentation from the European Chemicals Agency. # noqa: E501 + + :param reach_status: The reach_status of this ProductDetails. # noqa: E501 + :type: str + """ + + self._reach_status = reach_status + + @property + def export_control_class_number(self): + """Gets the export_control_class_number of this ProductDetails. # noqa: E501 + + Export control class number. See documentation from the U.S. Department of Commerce. # noqa: E501 + + :return: The export_control_class_number of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._export_control_class_number + + @export_control_class_number.setter + def export_control_class_number(self, export_control_class_number): + """Sets the export_control_class_number of this ProductDetails. + + Export control class number. See documentation from the U.S. Department of Commerce. # noqa: E501 + + :param export_control_class_number: The export_control_class_number of this ProductDetails. # noqa: E501 + :type: str + """ + + self._export_control_class_number = export_control_class_number + + @property + def htsus_code(self): + """Gets the htsus_code of this ProductDetails. # noqa: E501 + + Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. # noqa: E501 + + :return: The htsus_code of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._htsus_code + + @htsus_code.setter + def htsus_code(self, htsus_code): + """Sets the htsus_code of this ProductDetails. + + Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. # noqa: E501 + + :param htsus_code: The htsus_code of this ProductDetails. # noqa: E501 + :type: str + """ + + self._htsus_code = htsus_code + + @property + def tariff_description(self): + """Gets the tariff_description of this ProductDetails. # noqa: E501 + + Description of the tariff status. Only applies if purchasing in USD and shipping to the US. Valid options are No Tariff and Tariff Applied. # noqa: E501 + + :return: The tariff_description of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._tariff_description + + @tariff_description.setter + def tariff_description(self, tariff_description): + """Sets the tariff_description of this ProductDetails. + + Description of the tariff status. Only applies if purchasing in USD and shipping to the US. Valid options are No Tariff and Tariff Applied. # noqa: E501 + + :param tariff_description: The tariff_description of this ProductDetails. # noqa: E501 + :type: str + """ + + self._tariff_description = tariff_description + + @property + def moisture_sensitivity_level(self): + """Gets the moisture_sensitivity_level of this ProductDetails. # noqa: E501 + + Code for Moisture Sensitivity Level of the product # noqa: E501 + + :return: The moisture_sensitivity_level of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._moisture_sensitivity_level + + @moisture_sensitivity_level.setter + def moisture_sensitivity_level(self, moisture_sensitivity_level): + """Sets the moisture_sensitivity_level of this ProductDetails. + + Code for Moisture Sensitivity Level of the product # noqa: E501 + + :param moisture_sensitivity_level: The moisture_sensitivity_level of this ProductDetails. # noqa: E501 + :type: str + """ + + self._moisture_sensitivity_level = moisture_sensitivity_level + + @property + def manufacturer_part_number(self): + """Gets the manufacturer_part_number of this ProductDetails. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_part_number of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._manufacturer_part_number + + @manufacturer_part_number.setter + def manufacturer_part_number(self, manufacturer_part_number): + """Sets the manufacturer_part_number of this ProductDetails. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_part_number: The manufacturer_part_number of this ProductDetails. # noqa: E501 + :type: str + """ + + self._manufacturer_part_number = manufacturer_part_number + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this ProductDetails. # noqa: E501 + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :return: The minimum_order_quantity of this ProductDetails. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this ProductDetails. + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this ProductDetails. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def non_stock(self): + """Gets the non_stock of this ProductDetails. # noqa: E501 + + Indicates this product is a non stock product. # noqa: E501 + + :return: The non_stock of this ProductDetails. # noqa: E501 + :rtype: bool + """ + return self._non_stock + + @non_stock.setter + def non_stock(self, non_stock): + """Sets the non_stock of this ProductDetails. + + Indicates this product is a non stock product. # noqa: E501 + + :param non_stock: The non_stock of this ProductDetails. # noqa: E501 + :type: bool + """ + + self._non_stock = non_stock + + @property + def packaging(self): + """Gets the packaging of this ProductDetails. # noqa: E501 + + + :return: The packaging of this ProductDetails. # noqa: E501 + :rtype: PidVid + """ + return self._packaging + + @packaging.setter + def packaging(self, packaging): + """Sets the packaging of this ProductDetails. + + + :param packaging: The packaging of this ProductDetails. # noqa: E501 + :type: PidVid + """ + + self._packaging = packaging + + @property + def quantity_available(self): + """Gets the quantity_available of this ProductDetails. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this ProductDetails. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this ProductDetails. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this ProductDetails. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def digi_key_part_number(self): + """Gets the digi_key_part_number of this ProductDetails. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_part_number of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._digi_key_part_number + + @digi_key_part_number.setter + def digi_key_part_number(self, digi_key_part_number): + """Sets the digi_key_part_number of this ProductDetails. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_part_number: The digi_key_part_number of this ProductDetails. # noqa: E501 + :type: str + """ + + self._digi_key_part_number = digi_key_part_number + + @property + def product_description(self): + """Gets the product_description of this ProductDetails. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this ProductDetails. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this ProductDetails. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this ProductDetails. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def unit_price(self): + """Gets the unit_price of this ProductDetails. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this ProductDetails. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this ProductDetails. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this ProductDetails. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def manufacturer(self): + """Gets the manufacturer of this ProductDetails. # noqa: E501 + + + :return: The manufacturer of this ProductDetails. # noqa: E501 + :rtype: PidVid + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this ProductDetails. + + + :param manufacturer: The manufacturer of this ProductDetails. # noqa: E501 + :type: PidVid + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this ProductDetails. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this ProductDetails. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this ProductDetails. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this ProductDetails. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def quantity_on_order(self): + """Gets the quantity_on_order of this ProductDetails. # noqa: E501 + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :return: The quantity_on_order of this ProductDetails. # noqa: E501 + :rtype: int + """ + return self._quantity_on_order + + @quantity_on_order.setter + def quantity_on_order(self, quantity_on_order): + """Sets the quantity_on_order of this ProductDetails. + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :param quantity_on_order: The quantity_on_order of this ProductDetails. # noqa: E501 + :type: int + """ + + self._quantity_on_order = quantity_on_order + + @property + def dk_plus_restriction(self): + """Gets the dk_plus_restriction of this ProductDetails. # noqa: E501 + + If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site # noqa: E501 + + :return: The dk_plus_restriction of this ProductDetails. # noqa: E501 + :rtype: bool + """ + return self._dk_plus_restriction + + @dk_plus_restriction.setter + def dk_plus_restriction(self, dk_plus_restriction): + """Sets the dk_plus_restriction of this ProductDetails. + + If true- this product is not available for purchase through the Ordering API - it must be purchased through the Digi-Key web site # noqa: E501 + + :param dk_plus_restriction: The dk_plus_restriction of this ProductDetails. # noqa: E501 + :type: bool + """ + + self._dk_plus_restriction = dk_plus_restriction + + @property + def supplier_direct_ship(self): + """Gets the supplier_direct_ship of this ProductDetails. # noqa: E501 + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :return: The supplier_direct_ship of this ProductDetails. # noqa: E501 + :rtype: bool + """ + return self._supplier_direct_ship + + @supplier_direct_ship.setter + def supplier_direct_ship(self, supplier_direct_ship): + """Sets the supplier_direct_ship of this ProductDetails. + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :param supplier_direct_ship: The supplier_direct_ship of this ProductDetails. # noqa: E501 + :type: bool + """ + + self._supplier_direct_ship = supplier_direct_ship + + 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(ProductDetails, 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, ProductDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/batchproductdetails/rest.py b/digikey/v4/batchproductdetails/rest.py new file mode 100644 index 0000000..9476756 --- /dev/null +++ b/digikey/v4/batchproductdetails/rest.py @@ -0,0 +1,323 @@ +# coding: utf-8 + +""" + Batch Product Details Api + + Retrieve list of product details from list of part numbers # noqa: E501 + + OpenAPI spec version: v3 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/digikey/v4/ordersupport/__init__.py b/digikey/v4/ordersupport/__init__.py new file mode 100644 index 0000000..96808d3 --- /dev/null +++ b/digikey/v4/ordersupport/__init__.py @@ -0,0 +1,34 @@ +# coding: utf-8 + +# flake8: noqa + +""" + 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 +""" + + +from __future__ import absolute_import + +# import apis into sdk package +from digikey.v3.ordersupport.api.order_details_api import OrderDetailsApi + +# import ApiClient +from digikey.v3.ordersupport.api_client import ApiClient +from digikey.v3.ordersupport.configuration import Configuration +# import models into sdk package +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 +from digikey.v3.ordersupport.models.schedule import Schedule +from digikey.v3.ordersupport.models.shipping_detail import ShippingDetail diff --git a/digikey/v4/ordersupport/api/__init__.py b/digikey/v4/ordersupport/api/__init__.py new file mode 100644 index 0000000..639dfb2 --- /dev/null +++ b/digikey/v4/ordersupport/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from digikey.v3.ordersupport.api.order_details_api import OrderDetailsApi diff --git a/digikey/v4/ordersupport/api/order_details_api.py b/digikey/v4/ordersupport/api/order_details_api.py new file mode 100644 index 0000000..d8225b2 --- /dev/null +++ b/digikey/v4/ordersupport/api/order_details_api.py @@ -0,0 +1,272 @@ +# 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 +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from digikey.v3.ordersupport.api_client import ApiClient + + +class OrderDetailsApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def order_history(self, authorization, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieves a list of SalesOrderIds and dates for all SalesOrders within a date range belonging to a CustomerId. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.order_history(authorization, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param int customer_id: CustomerId that is on the Digi-Key account with which you authenticated. If not provided, will default to the first CustomerId on the Digi-Key account. + :param bool open_only: If true will only return open orders. If false, will return open and closed orders. + :param bool include_company_orders: Include all company orders for the location associated with the given CustomerId. + :param str start_date: Begining of date range in ISO 8601 format. For example: 2018-10-31 + :param str end_date: End of date range in ISO 8601 format. For example: 2018-10-31 + :param str includes: Comma separated list of fields to return. Used to customize response to reduce bandwidth with fields that you do not wish to receive. For example: \"SalesOrderId,PurchaseOrder\" + :return: list[SalesOrderHistoryItem] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.order_history_with_http_info(authorization, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.order_history_with_http_info(authorization, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def order_history_with_http_info(self, authorization, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieves a list of SalesOrderIds and dates for all SalesOrders within a date range belonging to a CustomerId. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.order_history_with_http_info(authorization, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param int customer_id: CustomerId that is on the Digi-Key account with which you authenticated. If not provided, will default to the first CustomerId on the Digi-Key account. + :param bool open_only: If true will only return open orders. If false, will return open and closed orders. + :param bool include_company_orders: Include all company orders for the location associated with the given CustomerId. + :param str start_date: Begining of date range in ISO 8601 format. For example: 2018-10-31 + :param str end_date: End of date range in ISO 8601 format. For example: 2018-10-31 + :param str includes: Comma separated list of fields to return. Used to customize response to reduce bandwidth with fields that you do not wish to receive. For example: \"SalesOrderId,PurchaseOrder\" + :return: list[SalesOrderHistoryItem] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['authorization', 'x_digikey_client_id', 'customer_id', 'open_only', 'include_company_orders', 'start_date', 'end_date', 'includes'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method order_history" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `order_history`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `order_history`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'customer_id' in params: + query_params.append(('CustomerId', params['customer_id'])) # noqa: E501 + if 'open_only' in params: + query_params.append(('OpenOnly', params['open_only'])) # noqa: E501 + if 'include_company_orders' in params: + query_params.append(('IncludeCompanyOrders', params['include_company_orders'])) # noqa: E501 + if 'start_date' in params: + query_params.append(('StartDate', params['start_date'])) # noqa: E501 + if 'end_date' in params: + query_params.append(('EndDate', params['end_date'])) # noqa: E501 + if 'includes' in params: + query_params.append(('Includes', params['includes'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/History', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[SalesOrderHistoryItem]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def order_status(self, sales_order_id, authorization, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve order status for given SalesOrderId # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.order_status(sales_order_id, authorization, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int sales_order_id: SalesOrderId belonging to you or your company that you wish to lookup (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str includes: Comma separated list of fields to return. Used to customize response to reduce bandwidth with fields that you do not wish to receive. For example: \"SalesOrderId,ShippingDetails\" + :return: OrderStatusResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.order_status_with_http_info(sales_order_id, authorization, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.order_status_with_http_info(sales_order_id, authorization, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def order_status_with_http_info(self, sales_order_id, authorization, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve order status for given SalesOrderId # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.order_status_with_http_info(sales_order_id, authorization, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int sales_order_id: SalesOrderId belonging to you or your company that you wish to lookup (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str includes: Comma separated list of fields to return. Used to customize response to reduce bandwidth with fields that you do not wish to receive. For example: \"SalesOrderId,ShippingDetails\" + :return: OrderStatusResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['sales_order_id', 'authorization', 'x_digikey_client_id', 'includes'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method order_status" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'sales_order_id' is set + if ('sales_order_id' not in params or + params['sales_order_id'] is None): + raise ValueError("Missing the required parameter `sales_order_id` when calling `order_status`") # noqa: E501 + # verify the required parameter 'authorization' is set + if ('authorization' not in params or + params['authorization'] is None): + raise ValueError("Missing the required parameter `authorization` when calling `order_status`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `order_status`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'sales_order_id' in params: + path_params['salesOrderId'] = params['sales_order_id'] # noqa: E501 + + query_params = [] + if 'includes' in params: + query_params.append(('Includes', params['includes'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2AccessCodeSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/Status/{salesOrderId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='OrderStatusResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/digikey/v4/ordersupport/api_client.py b/digikey/v4/ordersupport/api_client.py new file mode 100644 index 0000000..851fb97 --- /dev/null +++ b/digikey/v4/ordersupport/api_client.py @@ -0,0 +1,638 @@ +# 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 +""" + +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from digikey.v3.ordersupport.configuration import Configuration +import digikey.v3.ordersupport.models +from digikey.v3.ordersupport import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + # Use the pool property to lazily initialize the ThreadPool. + self._pool = None + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/0.1.0/python' + + def __del__(self): + if self._pool is not None: + self._pool.close() + self._pool.join() + + @property + def pool(self): + if self._pool is None: + self._pool = ThreadPool() + return self._pool + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(digikey.v3.ordersupport.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if (not klass.swagger_types and + not self.__hasattr(klass, 'get_real_child_model')): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/digikey/v4/ordersupport/configuration.py b/digikey/v4/ordersupport/configuration.py new file mode 100644 index 0000000..1b4b454 --- /dev/null +++ b/digikey/v4/ordersupport/configuration.py @@ -0,0 +1,255 @@ +# 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 +""" + + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class Configuration(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + _default = None + + def __init__(self): + """Constructor""" + if self._default: + for key in self._default.__dict__.keys(): + self.__dict__[key] = copy.copy(self._default.__dict__[key]) + return + + # Default Base url + self.host = "https://api.digikey.com/OrderDetails/v3" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + + # access token for OAuth + self.access_token = "" + + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("digikey.v3.ordersupport") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @classmethod + def set_default(cls, default): + cls._default = default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if (self.api_key.get(identifier) and + self.api_key_prefix.get(identifier)): + return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 + elif self.api_key.get(identifier): + return self.api_key[identifier] + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'apiKeySecurity': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-DIGIKEY-Client-Id', + 'value': self.get_api_key_with_prefix('X-DIGIKEY-Client-Id') + }, + + 'oauth2AccessCodeSecurity': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: v3\n"\ + "SDK Package Version: 0.1.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/digikey/v4/ordersupport/models/__init__.py b/digikey/v4/ordersupport/models/__init__.py new file mode 100644 index 0000000..6248b1e --- /dev/null +++ b/digikey/v4/ordersupport/models/__init__.py @@ -0,0 +1,27 @@ +# coding: utf-8 + +# flake8: noqa +""" + 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 +""" + + +from __future__ import absolute_import + +# import models into model package +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 +from digikey.v3.ordersupport.models.schedule import Schedule +from digikey.v3.ordersupport.models.shipping_detail import ShippingDetail diff --git a/digikey/v4/ordersupport/models/address.py b/digikey/v4/ordersupport/models/address.py new file mode 100644 index 0000000..319694e --- /dev/null +++ b/digikey/v4/ordersupport/models/address.py @@ -0,0 +1,369 @@ +# 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 Address(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 = { + 'company': 'str', + 'first_name': 'str', + 'last_name': 'str', + 'address_line_one': 'str', + 'address_line_two': 'str', + 'address_line_three': 'str', + 'city': 'str', + 'province': 'str', + 'postal_code': 'str', + 'country': 'str' + } + + attribute_map = { + 'company': 'Company', + 'first_name': 'FirstName', + 'last_name': 'LastName', + 'address_line_one': 'AddressLineOne', + 'address_line_two': 'AddressLineTwo', + 'address_line_three': 'AddressLineThree', + 'city': 'City', + 'province': 'Province', + 'postal_code': 'PostalCode', + 'country': 'Country' + } + + def __init__(self, company=None, first_name=None, last_name=None, address_line_one=None, address_line_two=None, address_line_three=None, city=None, province=None, postal_code=None, country=None): # noqa: E501 + """Address - a model defined in Swagger""" # noqa: E501 + + self._company = None + self._first_name = None + self._last_name = None + self._address_line_one = None + self._address_line_two = None + self._address_line_three = None + self._city = None + self._province = None + self._postal_code = None + self._country = None + self.discriminator = None + + if company is not None: + self.company = company + if first_name is not None: + self.first_name = first_name + if last_name is not None: + self.last_name = last_name + if address_line_one is not None: + self.address_line_one = address_line_one + if address_line_two is not None: + self.address_line_two = address_line_two + if address_line_three is not None: + self.address_line_three = address_line_three + if city is not None: + self.city = city + if province is not None: + self.province = province + if postal_code is not None: + self.postal_code = postal_code + if country is not None: + self.country = country + + @property + def company(self): + """Gets the company of this Address. # noqa: E501 + + Company or Organization name # noqa: E501 + + :return: The company of this Address. # noqa: E501 + :rtype: str + """ + return self._company + + @company.setter + def company(self, company): + """Sets the company of this Address. + + Company or Organization name # noqa: E501 + + :param company: The company of this Address. # noqa: E501 + :type: str + """ + + self._company = company + + @property + def first_name(self): + """Gets the first_name of this Address. # noqa: E501 + + First Name # noqa: E501 + + :return: The first_name of this Address. # noqa: E501 + :rtype: str + """ + return self._first_name + + @first_name.setter + def first_name(self, first_name): + """Sets the first_name of this Address. + + First Name # noqa: E501 + + :param first_name: The first_name of this Address. # noqa: E501 + :type: str + """ + + self._first_name = first_name + + @property + def last_name(self): + """Gets the last_name of this Address. # noqa: E501 + + Last Name # noqa: E501 + + :return: The last_name of this Address. # noqa: E501 + :rtype: str + """ + return self._last_name + + @last_name.setter + def last_name(self, last_name): + """Sets the last_name of this Address. + + Last Name # noqa: E501 + + :param last_name: The last_name of this Address. # noqa: E501 + :type: str + """ + + self._last_name = last_name + + @property + def address_line_one(self): + """Gets the address_line_one of this Address. # noqa: E501 + + First line of address # noqa: E501 + + :return: The address_line_one of this Address. # noqa: E501 + :rtype: str + """ + return self._address_line_one + + @address_line_one.setter + def address_line_one(self, address_line_one): + """Sets the address_line_one of this Address. + + First line of address # noqa: E501 + + :param address_line_one: The address_line_one of this Address. # noqa: E501 + :type: str + """ + + self._address_line_one = address_line_one + + @property + def address_line_two(self): + """Gets the address_line_two of this Address. # noqa: E501 + + Second line of address # noqa: E501 + + :return: The address_line_two of this Address. # noqa: E501 + :rtype: str + """ + return self._address_line_two + + @address_line_two.setter + def address_line_two(self, address_line_two): + """Sets the address_line_two of this Address. + + Second line of address # noqa: E501 + + :param address_line_two: The address_line_two of this Address. # noqa: E501 + :type: str + """ + + self._address_line_two = address_line_two + + @property + def address_line_three(self): + """Gets the address_line_three of this Address. # noqa: E501 + + Third line of address # noqa: E501 + + :return: The address_line_three of this Address. # noqa: E501 + :rtype: str + """ + return self._address_line_three + + @address_line_three.setter + def address_line_three(self, address_line_three): + """Sets the address_line_three of this Address. + + Third line of address # noqa: E501 + + :param address_line_three: The address_line_three of this Address. # noqa: E501 + :type: str + """ + + self._address_line_three = address_line_three + + @property + def city(self): + """Gets the city of this Address. # noqa: E501 + + City # noqa: E501 + + :return: The city of this Address. # noqa: E501 + :rtype: str + """ + return self._city + + @city.setter + def city(self, city): + """Sets the city of this Address. + + City # noqa: E501 + + :param city: The city of this Address. # noqa: E501 + :type: str + """ + + self._city = city + + @property + def province(self): + """Gets the province of this Address. # noqa: E501 + + Province or State # noqa: E501 + + :return: The province of this Address. # noqa: E501 + :rtype: str + """ + return self._province + + @province.setter + def province(self, province): + """Sets the province of this Address. + + Province or State # noqa: E501 + + :param province: The province of this Address. # noqa: E501 + :type: str + """ + + self._province = province + + @property + def postal_code(self): + """Gets the postal_code of this Address. # noqa: E501 + + Postal Code or Zip Code # noqa: E501 + + :return: The postal_code of this Address. # noqa: E501 + :rtype: str + """ + return self._postal_code + + @postal_code.setter + def postal_code(self, postal_code): + """Sets the postal_code of this Address. + + Postal Code or Zip Code # noqa: E501 + + :param postal_code: The postal_code of this Address. # noqa: E501 + :type: str + """ + + self._postal_code = postal_code + + @property + def country(self): + """Gets the country of this Address. # noqa: E501 + + Country 2 digit ISO code # noqa: E501 + + :return: The country of this Address. # noqa: E501 + :rtype: str + """ + return self._country + + @country.setter + def country(self, country): + """Sets the country of this Address. + + Country 2 digit ISO code # noqa: E501 + + :param country: The country of this Address. # noqa: E501 + :type: str + """ + + self._country = country + + 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(Address, 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, Address): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/api_error_response.py b/digikey/v4/ordersupport/models/api_error_response.py new file mode 100644 index 0000000..9cbcfab --- /dev/null +++ b/digikey/v4/ordersupport/models/api_error_response.py @@ -0,0 +1,245 @@ +# 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 ApiErrorResponse(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 = { + 'error_response_version': 'str', + 'status_code': 'int', + 'error_message': 'str', + 'error_details': 'str', + 'request_id': 'str', + 'validation_errors': 'list[ApiValidationError]' + } + + attribute_map = { + 'error_response_version': 'ErrorResponseVersion', + 'status_code': 'StatusCode', + 'error_message': 'ErrorMessage', + 'error_details': 'ErrorDetails', + 'request_id': 'RequestId', + 'validation_errors': 'ValidationErrors' + } + + def __init__(self, error_response_version=None, status_code=None, error_message=None, error_details=None, request_id=None, validation_errors=None): # noqa: E501 + """ApiErrorResponse - a model defined in Swagger""" # noqa: E501 + + self._error_response_version = None + self._status_code = None + self._error_message = None + self._error_details = None + self._request_id = None + self._validation_errors = None + self.discriminator = None + + if error_response_version is not None: + self.error_response_version = error_response_version + if status_code is not None: + self.status_code = status_code + if error_message is not None: + self.error_message = error_message + if error_details is not None: + self.error_details = error_details + if request_id is not None: + self.request_id = request_id + if validation_errors is not None: + self.validation_errors = validation_errors + + @property + def error_response_version(self): + """Gets the error_response_version of this ApiErrorResponse. # noqa: E501 + + + :return: The error_response_version of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_response_version + + @error_response_version.setter + def error_response_version(self, error_response_version): + """Sets the error_response_version of this ApiErrorResponse. + + + :param error_response_version: The error_response_version of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_response_version = error_response_version + + @property + def status_code(self): + """Gets the status_code of this ApiErrorResponse. # noqa: E501 + + + :return: The status_code of this ApiErrorResponse. # noqa: E501 + :rtype: int + """ + return self._status_code + + @status_code.setter + def status_code(self, status_code): + """Sets the status_code of this ApiErrorResponse. + + + :param status_code: The status_code of this ApiErrorResponse. # noqa: E501 + :type: int + """ + + self._status_code = status_code + + @property + def error_message(self): + """Gets the error_message of this ApiErrorResponse. # noqa: E501 + + + :return: The error_message of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_message + + @error_message.setter + def error_message(self, error_message): + """Sets the error_message of this ApiErrorResponse. + + + :param error_message: The error_message of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_message = error_message + + @property + def error_details(self): + """Gets the error_details of this ApiErrorResponse. # noqa: E501 + + + :return: The error_details of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_details + + @error_details.setter + def error_details(self, error_details): + """Sets the error_details of this ApiErrorResponse. + + + :param error_details: The error_details of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_details = error_details + + @property + def request_id(self): + """Gets the request_id of this ApiErrorResponse. # noqa: E501 + + + :return: The request_id of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._request_id + + @request_id.setter + def request_id(self, request_id): + """Sets the request_id of this ApiErrorResponse. + + + :param request_id: The request_id of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._request_id = request_id + + @property + def validation_errors(self): + """Gets the validation_errors of this ApiErrorResponse. # noqa: E501 + + + :return: The validation_errors of this ApiErrorResponse. # noqa: E501 + :rtype: list[ApiValidationError] + """ + return self._validation_errors + + @validation_errors.setter + def validation_errors(self, validation_errors): + """Sets the validation_errors of this ApiErrorResponse. + + + :param validation_errors: The validation_errors of this ApiErrorResponse. # noqa: E501 + :type: list[ApiValidationError] + """ + + self._validation_errors = validation_errors + + 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(ApiErrorResponse, 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, ApiErrorResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/api_validation_error.py b/digikey/v4/ordersupport/models/api_validation_error.py new file mode 100644 index 0000000..19f26df --- /dev/null +++ b/digikey/v4/ordersupport/models/api_validation_error.py @@ -0,0 +1,141 @@ +# 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 ApiValidationError(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 = { + 'field': 'str', + 'message': 'str' + } + + attribute_map = { + 'field': 'Field', + 'message': 'Message' + } + + def __init__(self, field=None, message=None): # noqa: E501 + """ApiValidationError - a model defined in Swagger""" # noqa: E501 + + self._field = None + self._message = None + self.discriminator = None + + if field is not None: + self.field = field + if message is not None: + self.message = message + + @property + def field(self): + """Gets the field of this ApiValidationError. # noqa: E501 + + + :return: The field of this ApiValidationError. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this ApiValidationError. + + + :param field: The field of this ApiValidationError. # noqa: E501 + :type: str + """ + + self._field = field + + @property + def message(self): + """Gets the message of this ApiValidationError. # noqa: E501 + + + :return: The message of this ApiValidationError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiValidationError. + + + :param message: The message of this ApiValidationError. # noqa: E501 + :type: str + """ + + self._message = message + + 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(ApiValidationError, 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, ApiValidationError): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/back_order_details.py b/digikey/v4/ordersupport/models/back_order_details.py new file mode 100644 index 0000000..daa24e5 --- /dev/null +++ b/digikey/v4/ordersupport/models/back_order_details.py @@ -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 diff --git a/digikey/v4/ordersupport/models/default_shipping.py b/digikey/v4/ordersupport/models/default_shipping.py new file mode 100644 index 0000000..8d71e85 --- /dev/null +++ b/digikey/v4/ordersupport/models/default_shipping.py @@ -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 DefaultShipping(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 = { + 'digi_key_release_date': 'str', + 'estimated_in_house_date': 'str' + } + + attribute_map = { + 'digi_key_release_date': 'DigiKeyReleaseDate', + 'estimated_in_house_date': 'EstimatedInHouseDate' + } + + def __init__(self, digi_key_release_date=None, estimated_in_house_date=None): # noqa: E501 + """DefaultShipping - a model defined in Swagger""" # noqa: E501 + + self._digi_key_release_date = None + self._estimated_in_house_date = None + self.discriminator = None + + if digi_key_release_date is not None: + self.digi_key_release_date = digi_key_release_date + if estimated_in_house_date is not None: + self.estimated_in_house_date = estimated_in_house_date + + @property + def digi_key_release_date(self): + """Gets the digi_key_release_date of this DefaultShipping. # noqa: E501 + + Default shipping date # noqa: E501 + + :return: The digi_key_release_date of this DefaultShipping. # noqa: E501 + :rtype: str + """ + return self._digi_key_release_date + + @digi_key_release_date.setter + def digi_key_release_date(self, digi_key_release_date): + """Sets the digi_key_release_date of this DefaultShipping. + + Default shipping date # noqa: E501 + + :param digi_key_release_date: The digi_key_release_date of this DefaultShipping. # noqa: E501 + :type: str + """ + + self._digi_key_release_date = digi_key_release_date + + @property + def estimated_in_house_date(self): + """Gets the estimated_in_house_date of this DefaultShipping. # noqa: E501 + + The estimated date the product will # noqa: E501 + + :return: The estimated_in_house_date of this DefaultShipping. # noqa: E501 + :rtype: str + """ + return self._estimated_in_house_date + + @estimated_in_house_date.setter + def estimated_in_house_date(self, estimated_in_house_date): + """Sets the estimated_in_house_date of this DefaultShipping. + + The estimated date the product will # noqa: E501 + + :param estimated_in_house_date: The estimated_in_house_date of this DefaultShipping. # noqa: E501 + :type: str + """ + + self._estimated_in_house_date = estimated_in_house_date + + 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(DefaultShipping, 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, DefaultShipping): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/line_item.py b/digikey/v4/ordersupport/models/line_item.py new file mode 100644 index 0000000..bd84931 --- /dev/null +++ b/digikey/v4/ordersupport/models/line_item.py @@ -0,0 +1,533 @@ +# 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 LineItem(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 = { + 'po_line_item_number': 'str', + 'digi_key_part_number': 'str', + 'manufacturer_part_number': 'str', + 'product_description': 'str', + 'manufacturer': 'str', + 'country_of_origin': 'str', + 'quantity': 'int', + 'customer_reference': 'str', + 'unit_price': 'float', + 'total_price': 'float', + 'quantity_backorder': 'int', + 'back_order_details': 'BackOrderDetails', + 'quantity_shipped': 'int', + 'invoice_id': 'int', + 'default_shipping': 'DefaultShipping', + 'schedule': 'list[Schedule]' + } + + attribute_map = { + 'po_line_item_number': 'PoLineItemNumber', + 'digi_key_part_number': 'DigiKeyPartNumber', + 'manufacturer_part_number': 'ManufacturerPartNumber', + 'product_description': 'ProductDescription', + 'manufacturer': 'Manufacturer', + 'country_of_origin': 'CountryOfOrigin', + 'quantity': 'Quantity', + 'customer_reference': 'CustomerReference', + 'unit_price': 'UnitPrice', + 'total_price': 'TotalPrice', + 'quantity_backorder': 'QuantityBackorder', + 'back_order_details': 'BackOrderDetails', + 'quantity_shipped': 'QuantityShipped', + 'invoice_id': 'InvoiceId', + 'default_shipping': 'DefaultShipping', + 'schedule': 'Schedule' + } + + def __init__(self, po_line_item_number=None, digi_key_part_number=None, manufacturer_part_number=None, product_description=None, manufacturer=None, country_of_origin=None, quantity=None, customer_reference=None, unit_price=None, total_price=None, quantity_backorder=None, back_order_details=None, quantity_shipped=None, invoice_id=None, default_shipping=None, schedule=None): # noqa: E501 + """LineItem - a model defined in Swagger""" # noqa: E501 + + self._po_line_item_number = None + self._digi_key_part_number = None + self._manufacturer_part_number = None + self._product_description = None + self._manufacturer = None + self._country_of_origin = None + self._quantity = None + self._customer_reference = None + self._unit_price = None + self._total_price = None + self._quantity_backorder = None + self._back_order_details = None + self._quantity_shipped = None + self._invoice_id = None + self._default_shipping = None + self._schedule = None + self.discriminator = None + + if po_line_item_number is not None: + self.po_line_item_number = po_line_item_number + if digi_key_part_number is not None: + self.digi_key_part_number = digi_key_part_number + if manufacturer_part_number is not None: + self.manufacturer_part_number = manufacturer_part_number + if product_description is not None: + self.product_description = product_description + if manufacturer is not None: + self.manufacturer = manufacturer + if country_of_origin is not None: + self.country_of_origin = country_of_origin + if quantity is not None: + self.quantity = quantity + if customer_reference is not None: + self.customer_reference = customer_reference + if unit_price is not None: + self.unit_price = unit_price + if total_price is not None: + self.total_price = total_price + if quantity_backorder is not None: + self.quantity_backorder = quantity_backorder + if back_order_details is not None: + self.back_order_details = back_order_details + if quantity_shipped is not None: + self.quantity_shipped = quantity_shipped + if invoice_id is not None: + self.invoice_id = invoice_id + if default_shipping is not None: + self.default_shipping = default_shipping + if schedule is not None: + self.schedule = schedule + + @property + def po_line_item_number(self): + """Gets the po_line_item_number of this LineItem. # noqa: E501 + + Line item number provided on purchase order # noqa: E501 + + :return: The po_line_item_number of this LineItem. # noqa: E501 + :rtype: str + """ + return self._po_line_item_number + + @po_line_item_number.setter + def po_line_item_number(self, po_line_item_number): + """Sets the po_line_item_number of this LineItem. + + Line item number provided on purchase order # noqa: E501 + + :param po_line_item_number: The po_line_item_number of this LineItem. # noqa: E501 + :type: str + """ + + self._po_line_item_number = po_line_item_number + + @property + def digi_key_part_number(self): + """Gets the digi_key_part_number of this LineItem. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_part_number of this LineItem. # noqa: E501 + :rtype: str + """ + return self._digi_key_part_number + + @digi_key_part_number.setter + def digi_key_part_number(self, digi_key_part_number): + """Sets the digi_key_part_number of this LineItem. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_part_number: The digi_key_part_number of this LineItem. # noqa: E501 + :type: str + """ + + self._digi_key_part_number = digi_key_part_number + + @property + def manufacturer_part_number(self): + """Gets the manufacturer_part_number of this LineItem. # noqa: E501 + + The Manufacturer Part Number. # noqa: E501 + + :return: The manufacturer_part_number of this LineItem. # noqa: E501 + :rtype: str + """ + return self._manufacturer_part_number + + @manufacturer_part_number.setter + def manufacturer_part_number(self, manufacturer_part_number): + """Sets the manufacturer_part_number of this LineItem. + + The Manufacturer Part Number. # noqa: E501 + + :param manufacturer_part_number: The manufacturer_part_number of this LineItem. # noqa: E501 + :type: str + """ + + self._manufacturer_part_number = manufacturer_part_number + + @property + def product_description(self): + """Gets the product_description of this LineItem. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this LineItem. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this LineItem. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this LineItem. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def manufacturer(self): + """Gets the manufacturer of this LineItem. # noqa: E501 + + The Manufacturer of the product. # noqa: E501 + + :return: The manufacturer of this LineItem. # noqa: E501 + :rtype: str + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this LineItem. + + The Manufacturer of the product. # noqa: E501 + + :param manufacturer: The manufacturer of this LineItem. # noqa: E501 + :type: str + """ + + self._manufacturer = manufacturer + + @property + def country_of_origin(self): + """Gets the country_of_origin of this LineItem. # noqa: E501 + + The Country Of Origin of the product # noqa: E501 + + :return: The country_of_origin of this LineItem. # noqa: E501 + :rtype: str + """ + return self._country_of_origin + + @country_of_origin.setter + def country_of_origin(self, country_of_origin): + """Sets the country_of_origin of this LineItem. + + The Country Of Origin of the product # noqa: E501 + + :param country_of_origin: The country_of_origin of this LineItem. # noqa: E501 + :type: str + """ + + self._country_of_origin = country_of_origin + + @property + def quantity(self): + """Gets the quantity of this LineItem. # noqa: E501 + + The total quantity for the order. # noqa: E501 + + :return: The quantity of this LineItem. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this LineItem. + + The total quantity for the order. # noqa: E501 + + :param quantity: The quantity of this LineItem. # noqa: E501 + :type: int + """ + + self._quantity = quantity + + @property + def customer_reference(self): + """Gets the customer_reference of this LineItem. # noqa: E501 + + Freeform customer reference # noqa: E501 + + :return: The customer_reference of this LineItem. # noqa: E501 + :rtype: str + """ + return self._customer_reference + + @customer_reference.setter + def customer_reference(self, customer_reference): + """Sets the customer_reference of this LineItem. + + Freeform customer reference # noqa: E501 + + :param customer_reference: The customer_reference of this LineItem. # noqa: E501 + :type: str + """ + + self._customer_reference = customer_reference + + @property + def unit_price(self): + """Gets the unit_price of this LineItem. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this LineItem. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this LineItem. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this LineItem. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def total_price(self): + """Gets the total_price of this LineItem. # noqa: E501 + + Price of ordered quantity of the product. # noqa: E501 + + :return: The total_price of this LineItem. # noqa: E501 + :rtype: float + """ + return self._total_price + + @total_price.setter + def total_price(self, total_price): + """Sets the total_price of this LineItem. + + Price of ordered quantity of the product. # noqa: E501 + + :param total_price: The total_price of this LineItem. # noqa: E501 + :type: float + """ + + self._total_price = total_price + + @property + def quantity_backorder(self): + """Gets the quantity_backorder of this LineItem. # noqa: E501 + + The quantity on backorder # noqa: E501 + + :return: The quantity_backorder of this LineItem. # noqa: E501 + :rtype: int + """ + return self._quantity_backorder + + @quantity_backorder.setter + def quantity_backorder(self, quantity_backorder): + """Sets the quantity_backorder of this LineItem. + + The quantity on backorder # noqa: E501 + + :param quantity_backorder: The quantity_backorder of this LineItem. # noqa: E501 + :type: int + """ + + self._quantity_backorder = quantity_backorder + + @property + def back_order_details(self): + """Gets the back_order_details of this LineItem. # noqa: E501 + + + :return: The back_order_details of this LineItem. # noqa: E501 + :rtype: BackOrderDetails + """ + return self._back_order_details + + @back_order_details.setter + def back_order_details(self, back_order_details): + """Sets the back_order_details of this LineItem. + + + :param back_order_details: The back_order_details of this LineItem. # noqa: E501 + :type: BackOrderDetails + """ + + self._back_order_details = back_order_details + + @property + def quantity_shipped(self): + """Gets the quantity_shipped of this LineItem. # noqa: E501 + + The quantity shipped # noqa: E501 + + :return: The quantity_shipped of this LineItem. # noqa: E501 + :rtype: int + """ + return self._quantity_shipped + + @quantity_shipped.setter + def quantity_shipped(self, quantity_shipped): + """Sets the quantity_shipped of this LineItem. + + The quantity shipped # noqa: E501 + + :param quantity_shipped: The quantity_shipped of this LineItem. # noqa: E501 + :type: int + """ + + self._quantity_shipped = quantity_shipped + + @property + def invoice_id(self): + """Gets the invoice_id of this LineItem. # noqa: E501 + + The Invoice Id for this shipment # noqa: E501 + + :return: The invoice_id of this LineItem. # noqa: E501 + :rtype: int + """ + return self._invoice_id + + @invoice_id.setter + def invoice_id(self, invoice_id): + """Sets the invoice_id of this LineItem. + + The Invoice Id for this shipment # noqa: E501 + + :param invoice_id: The invoice_id of this LineItem. # noqa: E501 + :type: int + """ + + self._invoice_id = invoice_id + + @property + def default_shipping(self): + """Gets the default_shipping of this LineItem. # noqa: E501 + + + :return: The default_shipping of this LineItem. # noqa: E501 + :rtype: DefaultShipping + """ + return self._default_shipping + + @default_shipping.setter + def default_shipping(self, default_shipping): + """Sets the default_shipping of this LineItem. + + + :param default_shipping: The default_shipping of this LineItem. # noqa: E501 + :type: DefaultShipping + """ + + self._default_shipping = default_shipping + + @property + def schedule(self): + """Gets the schedule of this LineItem. # noqa: E501 + + The Scheduled shipment # noqa: E501 + + :return: The schedule of this LineItem. # noqa: E501 + :rtype: list[Schedule] + """ + return self._schedule + + @schedule.setter + def schedule(self, schedule): + """Sets the schedule of this LineItem. + + The Scheduled shipment # noqa: E501 + + :param schedule: The schedule of this LineItem. # noqa: E501 + :type: list[Schedule] + """ + + self._schedule = schedule + + 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(LineItem, 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, LineItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/order_status_response.py b/digikey/v4/ordersupport/models/order_status_response.py new file mode 100644 index 0000000..2b825af --- /dev/null +++ b/digikey/v4/ordersupport/models/order_status_response.py @@ -0,0 +1,561 @@ +# 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 OrderStatusResponse(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 = { + 'salesorder_id': 'int', + 'customer_id': 'int', + 'billing_account': 'int', + 'email': 'str', + 'purchase_order': 'str', + 'payment_method': 'str', + 'supplier': 'str', + 'shipping_method': 'str', + 'backorder_shipping_method': 'str', + 'shipper_account_number': 'str', + 'backorder_shipper_account_number': 'str', + 'shipment_type': 'str', + 'currency': 'str', + 'shipping_address': 'Address', + 'billing_address': 'Address', + 'shipping_details': 'list[ShippingDetail]', + 'line_items': 'list[LineItem]' + } + + attribute_map = { + 'salesorder_id': 'SalesorderId', + 'customer_id': 'CustomerId', + 'billing_account': 'BillingAccount', + 'email': 'Email', + 'purchase_order': 'PurchaseOrder', + 'payment_method': 'PaymentMethod', + 'supplier': 'Supplier', + 'shipping_method': 'ShippingMethod', + 'backorder_shipping_method': 'BackorderShippingMethod', + 'shipper_account_number': 'ShipperAccountNumber', + 'backorder_shipper_account_number': 'BackorderShipperAccountNumber', + 'shipment_type': 'ShipmentType', + 'currency': 'Currency', + 'shipping_address': 'ShippingAddress', + 'billing_address': 'BillingAddress', + 'shipping_details': 'ShippingDetails', + 'line_items': 'LineItems' + } + + def __init__(self, salesorder_id=None, customer_id=None, billing_account=None, email=None, purchase_order=None, payment_method=None, supplier=None, shipping_method=None, backorder_shipping_method=None, shipper_account_number=None, backorder_shipper_account_number=None, shipment_type=None, currency=None, shipping_address=None, billing_address=None, shipping_details=None, line_items=None): # noqa: E501 + """OrderStatusResponse - a model defined in Swagger""" # noqa: E501 + + self._salesorder_id = None + self._customer_id = None + self._billing_account = None + self._email = None + self._purchase_order = None + self._payment_method = None + self._supplier = None + self._shipping_method = None + self._backorder_shipping_method = None + self._shipper_account_number = None + self._backorder_shipper_account_number = None + self._shipment_type = None + self._currency = None + self._shipping_address = None + self._billing_address = None + self._shipping_details = None + self._line_items = None + self.discriminator = None + + if salesorder_id is not None: + self.salesorder_id = salesorder_id + if customer_id is not None: + self.customer_id = customer_id + if billing_account is not None: + self.billing_account = billing_account + if email is not None: + self.email = email + if purchase_order is not None: + self.purchase_order = purchase_order + if payment_method is not None: + self.payment_method = payment_method + if supplier is not None: + self.supplier = supplier + if shipping_method is not None: + self.shipping_method = shipping_method + if backorder_shipping_method is not None: + self.backorder_shipping_method = backorder_shipping_method + if shipper_account_number is not None: + self.shipper_account_number = shipper_account_number + if backorder_shipper_account_number is not None: + self.backorder_shipper_account_number = backorder_shipper_account_number + if shipment_type is not None: + self.shipment_type = shipment_type + if currency is not None: + self.currency = currency + if shipping_address is not None: + self.shipping_address = shipping_address + if billing_address is not None: + self.billing_address = billing_address + if shipping_details is not None: + self.shipping_details = shipping_details + if line_items is not None: + self.line_items = line_items + + @property + def salesorder_id(self): + """Gets the salesorder_id of this OrderStatusResponse. # noqa: E501 + + Id for this order # noqa: E501 + + :return: The salesorder_id of this OrderStatusResponse. # noqa: E501 + :rtype: int + """ + return self._salesorder_id + + @salesorder_id.setter + def salesorder_id(self, salesorder_id): + """Sets the salesorder_id of this OrderStatusResponse. + + Id for this order # noqa: E501 + + :param salesorder_id: The salesorder_id of this OrderStatusResponse. # noqa: E501 + :type: int + """ + + self._salesorder_id = salesorder_id + + @property + def customer_id(self): + """Gets the customer_id of this OrderStatusResponse. # noqa: E501 + + Your Digi-Key customer Id # noqa: E501 + + :return: The customer_id of this OrderStatusResponse. # noqa: E501 + :rtype: int + """ + return self._customer_id + + @customer_id.setter + def customer_id(self, customer_id): + """Sets the customer_id of this OrderStatusResponse. + + Your Digi-Key customer Id # noqa: E501 + + :param customer_id: The customer_id of this OrderStatusResponse. # noqa: E501 + :type: int + """ + + self._customer_id = customer_id + + @property + def billing_account(self): + """Gets the billing_account of this OrderStatusResponse. # noqa: E501 + + Net Terms billing account number used for the order. # noqa: E501 + + :return: The billing_account of this OrderStatusResponse. # noqa: E501 + :rtype: int + """ + return self._billing_account + + @billing_account.setter + def billing_account(self, billing_account): + """Sets the billing_account of this OrderStatusResponse. + + Net Terms billing account number used for the order. # noqa: E501 + + :param billing_account: The billing_account of this OrderStatusResponse. # noqa: E501 + :type: int + """ + + self._billing_account = billing_account + + @property + def email(self): + """Gets the email of this OrderStatusResponse. # noqa: E501 + + Email Address # noqa: E501 + + :return: The email of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._email + + @email.setter + def email(self, email): + """Sets the email of this OrderStatusResponse. + + Email Address # noqa: E501 + + :param email: The email of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._email = email + + @property + def purchase_order(self): + """Gets the purchase_order of this OrderStatusResponse. # noqa: E501 + + Freeform purchase order # noqa: E501 + + :return: The purchase_order of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._purchase_order + + @purchase_order.setter + def purchase_order(self, purchase_order): + """Sets the purchase_order of this OrderStatusResponse. + + Freeform purchase order # noqa: E501 + + :param purchase_order: The purchase_order of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._purchase_order = purchase_order + + @property + def payment_method(self): + """Gets the payment_method of this OrderStatusResponse. # noqa: E501 + + Payment method for the order # noqa: E501 + + :return: The payment_method of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._payment_method + + @payment_method.setter + def payment_method(self, payment_method): + """Sets the payment_method of this OrderStatusResponse. + + Payment method for the order # noqa: E501 + + :param payment_method: The payment_method of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._payment_method = payment_method + + @property + def supplier(self): + """Gets the supplier of this OrderStatusResponse. # noqa: E501 + + Shipped by # noqa: E501 + + :return: The supplier of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._supplier + + @supplier.setter + def supplier(self, supplier): + """Sets the supplier of this OrderStatusResponse. + + Shipped by # noqa: E501 + + :param supplier: The supplier of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._supplier = supplier + + @property + def shipping_method(self): + """Gets the shipping_method of this OrderStatusResponse. # noqa: E501 + + Shipping method requested # noqa: E501 + + :return: The shipping_method of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._shipping_method + + @shipping_method.setter + def shipping_method(self, shipping_method): + """Sets the shipping_method of this OrderStatusResponse. + + Shipping method requested # noqa: E501 + + :param shipping_method: The shipping_method of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._shipping_method = shipping_method + + @property + def backorder_shipping_method(self): + """Gets the backorder_shipping_method of this OrderStatusResponse. # noqa: E501 + + Backorder shipping method requested # noqa: E501 + + :return: The backorder_shipping_method of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._backorder_shipping_method + + @backorder_shipping_method.setter + def backorder_shipping_method(self, backorder_shipping_method): + """Sets the backorder_shipping_method of this OrderStatusResponse. + + Backorder shipping method requested # noqa: E501 + + :param backorder_shipping_method: The backorder_shipping_method of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._backorder_shipping_method = backorder_shipping_method + + @property + def shipper_account_number(self): + """Gets the shipper_account_number of this OrderStatusResponse. # noqa: E501 + + Account number with the shipper # noqa: E501 + + :return: The shipper_account_number of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._shipper_account_number + + @shipper_account_number.setter + def shipper_account_number(self, shipper_account_number): + """Sets the shipper_account_number of this OrderStatusResponse. + + Account number with the shipper # noqa: E501 + + :param shipper_account_number: The shipper_account_number of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._shipper_account_number = shipper_account_number + + @property + def backorder_shipper_account_number(self): + """Gets the backorder_shipper_account_number of this OrderStatusResponse. # noqa: E501 + + Account number with the backorder shipper # noqa: E501 + + :return: The backorder_shipper_account_number of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._backorder_shipper_account_number + + @backorder_shipper_account_number.setter + def backorder_shipper_account_number(self, backorder_shipper_account_number): + """Sets the backorder_shipper_account_number of this OrderStatusResponse. + + Account number with the backorder shipper # noqa: E501 + + :param backorder_shipper_account_number: The backorder_shipper_account_number of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._backorder_shipper_account_number = backorder_shipper_account_number + + @property + def shipment_type(self): + """Gets the shipment_type of this OrderStatusResponse. # noqa: E501 + + Can be Immediate, Double or Single. If Immediate, all items will ship as available. If Double, all items immediately available will ship, and other items will be held untill all are available. If Single, entire order is held untill all items are available. # noqa: E501 + + :return: The shipment_type of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._shipment_type + + @shipment_type.setter + def shipment_type(self, shipment_type): + """Sets the shipment_type of this OrderStatusResponse. + + Can be Immediate, Double or Single. If Immediate, all items will ship as available. If Double, all items immediately available will ship, and other items will be held untill all are available. If Single, entire order is held untill all items are available. # noqa: E501 + + :param shipment_type: The shipment_type of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._shipment_type = shipment_type + + @property + def currency(self): + """Gets the currency of this OrderStatusResponse. # noqa: E501 + + ISO code for currency used in the order. # noqa: E501 + + :return: The currency of this OrderStatusResponse. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this OrderStatusResponse. + + ISO code for currency used in the order. # noqa: E501 + + :param currency: The currency of this OrderStatusResponse. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def shipping_address(self): + """Gets the shipping_address of this OrderStatusResponse. # noqa: E501 + + + :return: The shipping_address of this OrderStatusResponse. # noqa: E501 + :rtype: Address + """ + return self._shipping_address + + @shipping_address.setter + def shipping_address(self, shipping_address): + """Sets the shipping_address of this OrderStatusResponse. + + + :param shipping_address: The shipping_address of this OrderStatusResponse. # noqa: E501 + :type: Address + """ + + self._shipping_address = shipping_address + + @property + def billing_address(self): + """Gets the billing_address of this OrderStatusResponse. # noqa: E501 + + + :return: The billing_address of this OrderStatusResponse. # noqa: E501 + :rtype: Address + """ + return self._billing_address + + @billing_address.setter + def billing_address(self, billing_address): + """Sets the billing_address of this OrderStatusResponse. + + + :param billing_address: The billing_address of this OrderStatusResponse. # noqa: E501 + :type: Address + """ + + self._billing_address = billing_address + + @property + def shipping_details(self): + """Gets the shipping_details of this OrderStatusResponse. # noqa: E501 + + List of shipping details # noqa: E501 + + :return: The shipping_details of this OrderStatusResponse. # noqa: E501 + :rtype: list[ShippingDetail] + """ + return self._shipping_details + + @shipping_details.setter + def shipping_details(self, shipping_details): + """Sets the shipping_details of this OrderStatusResponse. + + List of shipping details # noqa: E501 + + :param shipping_details: The shipping_details of this OrderStatusResponse. # noqa: E501 + :type: list[ShippingDetail] + """ + + self._shipping_details = shipping_details + + @property + def line_items(self): + """Gets the line_items of this OrderStatusResponse. # noqa: E501 + + List of line items # noqa: E501 + + :return: The line_items of this OrderStatusResponse. # noqa: E501 + :rtype: list[LineItem] + """ + return self._line_items + + @line_items.setter + def line_items(self, line_items): + """Sets the line_items of this OrderStatusResponse. + + List of line items # noqa: E501 + + :param line_items: The line_items of this OrderStatusResponse. # noqa: E501 + :type: list[LineItem] + """ + + self._line_items = line_items + + 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(OrderStatusResponse, 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, OrderStatusResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/sales_order_history_item.py b/digikey/v4/ordersupport/models/sales_order_history_item.py new file mode 100644 index 0000000..2eee431 --- /dev/null +++ b/digikey/v4/ordersupport/models/sales_order_history_item.py @@ -0,0 +1,201 @@ +# 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 SalesOrderHistoryItem(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 = { + 'salesorder_id': 'int', + 'customer_id': 'int', + 'date_entered': 'str', + 'purchase_order': 'str' + } + + attribute_map = { + 'salesorder_id': 'SalesorderId', + 'customer_id': 'CustomerId', + 'date_entered': 'DateEntered', + 'purchase_order': 'PurchaseOrder' + } + + def __init__(self, salesorder_id=None, customer_id=None, date_entered=None, purchase_order=None): # noqa: E501 + """SalesOrderHistoryItem - a model defined in Swagger""" # noqa: E501 + + self._salesorder_id = None + self._customer_id = None + self._date_entered = None + self._purchase_order = None + self.discriminator = None + + if salesorder_id is not None: + self.salesorder_id = salesorder_id + if customer_id is not None: + self.customer_id = customer_id + if date_entered is not None: + self.date_entered = date_entered + if purchase_order is not None: + self.purchase_order = purchase_order + + @property + def salesorder_id(self): + """Gets the salesorder_id of this SalesOrderHistoryItem. # noqa: E501 + + The SalesOrder Id. You can use this Id to look up details on the order. # noqa: E501 + + :return: The salesorder_id of this SalesOrderHistoryItem. # noqa: E501 + :rtype: int + """ + return self._salesorder_id + + @salesorder_id.setter + def salesorder_id(self, salesorder_id): + """Sets the salesorder_id of this SalesOrderHistoryItem. + + The SalesOrder Id. You can use this Id to look up details on the order. # noqa: E501 + + :param salesorder_id: The salesorder_id of this SalesOrderHistoryItem. # noqa: E501 + :type: int + """ + + self._salesorder_id = salesorder_id + + @property + def customer_id(self): + """Gets the customer_id of this SalesOrderHistoryItem. # noqa: E501 + + The CustomerId associated with the SalesOrder # noqa: E501 + + :return: The customer_id of this SalesOrderHistoryItem. # noqa: E501 + :rtype: int + """ + return self._customer_id + + @customer_id.setter + def customer_id(self, customer_id): + """Sets the customer_id of this SalesOrderHistoryItem. + + The CustomerId associated with the SalesOrder # noqa: E501 + + :param customer_id: The customer_id of this SalesOrderHistoryItem. # noqa: E501 + :type: int + """ + + self._customer_id = customer_id + + @property + def date_entered(self): + """Gets the date_entered of this SalesOrderHistoryItem. # noqa: E501 + + Date in which the order was entered in ISO 8601 format. # noqa: E501 + + :return: The date_entered of this SalesOrderHistoryItem. # noqa: E501 + :rtype: str + """ + return self._date_entered + + @date_entered.setter + def date_entered(self, date_entered): + """Sets the date_entered of this SalesOrderHistoryItem. + + Date in which the order was entered in ISO 8601 format. # noqa: E501 + + :param date_entered: The date_entered of this SalesOrderHistoryItem. # noqa: E501 + :type: str + """ + + self._date_entered = date_entered + + @property + def purchase_order(self): + """Gets the purchase_order of this SalesOrderHistoryItem. # noqa: E501 + + Purchase order if available # noqa: E501 + + :return: The purchase_order of this SalesOrderHistoryItem. # noqa: E501 + :rtype: str + """ + return self._purchase_order + + @purchase_order.setter + def purchase_order(self, purchase_order): + """Sets the purchase_order of this SalesOrderHistoryItem. + + Purchase order if available # noqa: E501 + + :param purchase_order: The purchase_order of this SalesOrderHistoryItem. # noqa: E501 + :type: str + """ + + self._purchase_order = purchase_order + + 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(SalesOrderHistoryItem, 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, SalesOrderHistoryItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/salesorder_history_item.py b/digikey/v4/ordersupport/models/salesorder_history_item.py new file mode 100644 index 0000000..16825ed --- /dev/null +++ b/digikey/v4/ordersupport/models/salesorder_history_item.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + Order Details + + Retrieve information about current and past orders. # noqa: E501 + + OpenAPI spec version: v3 + Contact: api.contact@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class SalesorderHistoryItem(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 = { + 'salesorder_id': 'int', + 'customer_id': 'int', + 'date_entered': 'str', + 'purchase_order': 'str' + } + + attribute_map = { + 'salesorder_id': 'SalesorderId', + 'customer_id': 'CustomerId', + 'date_entered': 'DateEntered', + 'purchase_order': 'PurchaseOrder' + } + + def __init__(self, salesorder_id=None, customer_id=None, date_entered=None, purchase_order=None): # noqa: E501 + """SalesorderHistoryItem - a model defined in Swagger""" # noqa: E501 + + self._salesorder_id = None + self._customer_id = None + self._date_entered = None + self._purchase_order = None + self.discriminator = None + + if salesorder_id is not None: + self.salesorder_id = salesorder_id + if customer_id is not None: + self.customer_id = customer_id + if date_entered is not None: + self.date_entered = date_entered + if purchase_order is not None: + self.purchase_order = purchase_order + + @property + def salesorder_id(self): + """Gets the salesorder_id of this SalesorderHistoryItem. # noqa: E501 + + The Salesorder Id. You can use this Id to look up details on the order. # noqa: E501 + + :return: The salesorder_id of this SalesorderHistoryItem. # noqa: E501 + :rtype: int + """ + return self._salesorder_id + + @salesorder_id.setter + def salesorder_id(self, salesorder_id): + """Sets the salesorder_id of this SalesorderHistoryItem. + + The Salesorder Id. You can use this Id to look up details on the order. # noqa: E501 + + :param salesorder_id: The salesorder_id of this SalesorderHistoryItem. # noqa: E501 + :type: int + """ + + self._salesorder_id = salesorder_id + + @property + def customer_id(self): + """Gets the customer_id of this SalesorderHistoryItem. # noqa: E501 + + The CustomerId associated with the Salesorder # noqa: E501 + + :return: The customer_id of this SalesorderHistoryItem. # noqa: E501 + :rtype: int + """ + return self._customer_id + + @customer_id.setter + def customer_id(self, customer_id): + """Sets the customer_id of this SalesorderHistoryItem. + + The CustomerId associated with the Salesorder # noqa: E501 + + :param customer_id: The customer_id of this SalesorderHistoryItem. # noqa: E501 + :type: int + """ + + self._customer_id = customer_id + + @property + def date_entered(self): + """Gets the date_entered of this SalesorderHistoryItem. # noqa: E501 + + Date in which the order was entered in ISO 8601 format. # noqa: E501 + + :return: The date_entered of this SalesorderHistoryItem. # noqa: E501 + :rtype: str + """ + return self._date_entered + + @date_entered.setter + def date_entered(self, date_entered): + """Sets the date_entered of this SalesorderHistoryItem. + + Date in which the order was entered in ISO 8601 format. # noqa: E501 + + :param date_entered: The date_entered of this SalesorderHistoryItem. # noqa: E501 + :type: str + """ + + self._date_entered = date_entered + + @property + def purchase_order(self): + """Gets the purchase_order of this SalesorderHistoryItem. # noqa: E501 + + Purchase order if available # noqa: E501 + + :return: The purchase_order of this SalesorderHistoryItem. # noqa: E501 + :rtype: str + """ + return self._purchase_order + + @purchase_order.setter + def purchase_order(self, purchase_order): + """Sets the purchase_order of this SalesorderHistoryItem. + + Purchase order if available # noqa: E501 + + :param purchase_order: The purchase_order of this SalesorderHistoryItem. # noqa: E501 + :type: str + """ + + self._purchase_order = purchase_order + + 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(SalesorderHistoryItem, 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, SalesorderHistoryItem): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/schedule.py b/digikey/v4/ordersupport/models/schedule.py new file mode 100644 index 0000000..e5cb8df --- /dev/null +++ b/digikey/v4/ordersupport/models/schedule.py @@ -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 Schedule(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 = { + 'scheduled_quantity': 'int', + 'scheduled_date': 'str' + } + + attribute_map = { + 'scheduled_quantity': 'ScheduledQuantity', + 'scheduled_date': 'ScheduledDate' + } + + def __init__(self, scheduled_quantity=None, scheduled_date=None): # noqa: E501 + """Schedule - a model defined in Swagger""" # noqa: E501 + + self._scheduled_quantity = None + self._scheduled_date = None + self.discriminator = None + + if scheduled_quantity is not None: + self.scheduled_quantity = scheduled_quantity + if scheduled_date is not None: + self.scheduled_date = scheduled_date + + @property + def scheduled_quantity(self): + """Gets the scheduled_quantity of this Schedule. # noqa: E501 + + The total quantity for the schedule. # noqa: E501 + + :return: The scheduled_quantity of this Schedule. # noqa: E501 + :rtype: int + """ + return self._scheduled_quantity + + @scheduled_quantity.setter + def scheduled_quantity(self, scheduled_quantity): + """Sets the scheduled_quantity of this Schedule. + + The total quantity for the schedule. # noqa: E501 + + :param scheduled_quantity: The scheduled_quantity of this Schedule. # noqa: E501 + :type: int + """ + + self._scheduled_quantity = scheduled_quantity + + @property + def scheduled_date(self): + """Gets the scheduled_date of this Schedule. # noqa: E501 + + The Date of the Schedule ISO 8601 format # noqa: E501 + + :return: The scheduled_date of this Schedule. # noqa: E501 + :rtype: str + """ + return self._scheduled_date + + @scheduled_date.setter + def scheduled_date(self, scheduled_date): + """Sets the scheduled_date of this Schedule. + + The Date of the Schedule ISO 8601 format # noqa: E501 + + :param scheduled_date: The scheduled_date of this Schedule. # noqa: E501 + :type: str + """ + + self._scheduled_date = scheduled_date + + 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(Schedule, 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, Schedule): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/models/shipping_detail.py b/digikey/v4/ordersupport/models/shipping_detail.py new file mode 100644 index 0000000..ecc960c --- /dev/null +++ b/digikey/v4/ordersupport/models/shipping_detail.py @@ -0,0 +1,311 @@ +# 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 ShippingDetail(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 = { + 'carrier': 'str', + 'carrier_package_id': 'str', + 'date_transaction': 'str', + 'shipping_method': 'str', + 'tracking_url': 'str', + 'invoice_id': 'int', + 'canceled_or_voided': 'bool', + 'delivery_date': 'str' + } + + attribute_map = { + 'carrier': 'Carrier', + 'carrier_package_id': 'CarrierPackageId', + 'date_transaction': 'DateTransaction', + 'shipping_method': 'ShippingMethod', + 'tracking_url': 'TrackingUrl', + 'invoice_id': 'InvoiceId', + 'canceled_or_voided': 'CanceledOrVoided', + 'delivery_date': 'DeliveryDate' + } + + def __init__(self, carrier=None, carrier_package_id=None, date_transaction=None, shipping_method=None, tracking_url=None, invoice_id=None, canceled_or_voided=None, delivery_date=None): # noqa: E501 + """ShippingDetail - a model defined in Swagger""" # noqa: E501 + + self._carrier = None + self._carrier_package_id = None + self._date_transaction = None + self._shipping_method = None + self._tracking_url = None + self._invoice_id = None + self._canceled_or_voided = None + self._delivery_date = None + self.discriminator = None + + if carrier is not None: + self.carrier = carrier + if carrier_package_id is not None: + self.carrier_package_id = carrier_package_id + if date_transaction is not None: + self.date_transaction = date_transaction + if shipping_method is not None: + self.shipping_method = shipping_method + if tracking_url is not None: + self.tracking_url = tracking_url + if invoice_id is not None: + self.invoice_id = invoice_id + if canceled_or_voided is not None: + self.canceled_or_voided = canceled_or_voided + if delivery_date is not None: + self.delivery_date = delivery_date + + @property + def carrier(self): + """Gets the carrier of this ShippingDetail. # noqa: E501 + + Name of the carrier # noqa: E501 + + :return: The carrier of this ShippingDetail. # noqa: E501 + :rtype: str + """ + return self._carrier + + @carrier.setter + def carrier(self, carrier): + """Sets the carrier of this ShippingDetail. + + Name of the carrier # noqa: E501 + + :param carrier: The carrier of this ShippingDetail. # noqa: E501 + :type: str + """ + + self._carrier = carrier + + @property + def carrier_package_id(self): + """Gets the carrier_package_id of this ShippingDetail. # noqa: E501 + + Id assigned by the carrier # noqa: E501 + + :return: The carrier_package_id of this ShippingDetail. # noqa: E501 + :rtype: str + """ + return self._carrier_package_id + + @carrier_package_id.setter + def carrier_package_id(self, carrier_package_id): + """Sets the carrier_package_id of this ShippingDetail. + + Id assigned by the carrier # noqa: E501 + + :param carrier_package_id: The carrier_package_id of this ShippingDetail. # noqa: E501 + :type: str + """ + + self._carrier_package_id = carrier_package_id + + @property + def date_transaction(self): + """Gets the date_transaction of this ShippingDetail. # noqa: E501 + + Date that tracking number was generated in ISO 8601 format # noqa: E501 + + :return: The date_transaction of this ShippingDetail. # noqa: E501 + :rtype: str + """ + return self._date_transaction + + @date_transaction.setter + def date_transaction(self, date_transaction): + """Sets the date_transaction of this ShippingDetail. + + Date that tracking number was generated in ISO 8601 format # noqa: E501 + + :param date_transaction: The date_transaction of this ShippingDetail. # noqa: E501 + :type: str + """ + + self._date_transaction = date_transaction + + @property + def shipping_method(self): + """Gets the shipping_method of this ShippingDetail. # noqa: E501 + + Shipping method used by this shipment # noqa: E501 + + :return: The shipping_method of this ShippingDetail. # noqa: E501 + :rtype: str + """ + return self._shipping_method + + @shipping_method.setter + def shipping_method(self, shipping_method): + """Sets the shipping_method of this ShippingDetail. + + Shipping method used by this shipment # noqa: E501 + + :param shipping_method: The shipping_method of this ShippingDetail. # noqa: E501 + :type: str + """ + + self._shipping_method = shipping_method + + @property + def tracking_url(self): + """Gets the tracking_url of this ShippingDetail. # noqa: E501 + + + :return: The tracking_url of this ShippingDetail. # noqa: E501 + :rtype: str + """ + return self._tracking_url + + @tracking_url.setter + def tracking_url(self, tracking_url): + """Sets the tracking_url of this ShippingDetail. + + + :param tracking_url: The tracking_url of this ShippingDetail. # noqa: E501 + :type: str + """ + + self._tracking_url = tracking_url + + @property + def invoice_id(self): + """Gets the invoice_id of this ShippingDetail. # noqa: E501 + + The Invoice Id for this shipment # noqa: E501 + + :return: The invoice_id of this ShippingDetail. # noqa: E501 + :rtype: int + """ + return self._invoice_id + + @invoice_id.setter + def invoice_id(self, invoice_id): + """Sets the invoice_id of this ShippingDetail. + + The Invoice Id for this shipment # noqa: E501 + + :param invoice_id: The invoice_id of this ShippingDetail. # noqa: E501 + :type: int + """ + + self._invoice_id = invoice_id + + @property + def canceled_or_voided(self): + """Gets the canceled_or_voided of this ShippingDetail. # noqa: E501 + + Whether this individual detail has been canceled or voided. # noqa: E501 + + :return: The canceled_or_voided of this ShippingDetail. # noqa: E501 + :rtype: bool + """ + return self._canceled_or_voided + + @canceled_or_voided.setter + def canceled_or_voided(self, canceled_or_voided): + """Sets the canceled_or_voided of this ShippingDetail. + + Whether this individual detail has been canceled or voided. # noqa: E501 + + :param canceled_or_voided: The canceled_or_voided of this ShippingDetail. # noqa: E501 + :type: bool + """ + + self._canceled_or_voided = canceled_or_voided + + @property + def delivery_date(self): + """Gets the delivery_date of this ShippingDetail. # noqa: E501 + + Date that the tracking number reports of delivery. If Tracking Number is not initiated by carrier or if tracking number is expired the value of DeliveryDate will be empty \"\" # noqa: E501 + + :return: The delivery_date of this ShippingDetail. # noqa: E501 + :rtype: str + """ + return self._delivery_date + + @delivery_date.setter + def delivery_date(self, delivery_date): + """Sets the delivery_date of this ShippingDetail. + + Date that the tracking number reports of delivery. If Tracking Number is not initiated by carrier or if tracking number is expired the value of DeliveryDate will be empty \"\" # noqa: E501 + + :param delivery_date: The delivery_date of this ShippingDetail. # noqa: E501 + :type: str + """ + + self._delivery_date = delivery_date + + 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(ShippingDetail, 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, ShippingDetail): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/ordersupport/rest.py b/digikey/v4/ordersupport/rest.py new file mode 100644 index 0000000..8cbd28f --- /dev/null +++ b/digikey/v4/ordersupport/rest.py @@ -0,0 +1,323 @@ +# 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 +""" + + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = None + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/digikey/v4/productinformation/__init__.py b/digikey/v4/productinformation/__init__.py new file mode 100644 index 0000000..9c5fd7d --- /dev/null +++ b/digikey/v4/productinformation/__init__.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +# flake8: noqa + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from digikey.v4.productinformation.api.product_search_api import ProductSearchApi +# import ApiClient +from digikey.v4.productinformation.api_client import ApiClient +from digikey.v4.productinformation.configuration import Configuration +# import models into sdk package +from digikey.v4.productinformation.models.alternate_packaging import AlternatePackaging +from digikey.v4.productinformation.models.alternate_packaging_response import AlternatePackagingResponse +from digikey.v4.productinformation.models.base_filter_v4 import BaseFilterV4 +from digikey.v4.productinformation.models.base_product import BaseProduct +from digikey.v4.productinformation.models.break_price import BreakPrice +from digikey.v4.productinformation.models.categories_response import CategoriesResponse +from digikey.v4.productinformation.models.category import Category +from digikey.v4.productinformation.models.category_node import CategoryNode +from digikey.v4.productinformation.models.category_response import CategoryResponse +from digikey.v4.productinformation.models.category_type import CategoryType +from digikey.v4.productinformation.models.classifications import Classifications +from digikey.v4.productinformation.models.dk_problem_details import DKProblemDetails +from digikey.v4.productinformation.models.description import Description +from digikey.v4.productinformation.models.digi_reel_pricing import DigiReelPricing +from digikey.v4.productinformation.models.filter_id import FilterId +from digikey.v4.productinformation.models.filter_options import FilterOptions +from digikey.v4.productinformation.models.filter_options_request import FilterOptionsRequest +from digikey.v4.productinformation.models.filter_value import FilterValue +from digikey.v4.productinformation.models.filters import Filters +from digikey.v4.productinformation.models.iso_search_locale import IsoSearchLocale +from digikey.v4.productinformation.models.keyword_request import KeywordRequest +from digikey.v4.productinformation.models.keyword_response import KeywordResponse +from digikey.v4.productinformation.models.manufacturer import Manufacturer +from digikey.v4.productinformation.models.manufacturer_info import ManufacturerInfo +from digikey.v4.productinformation.models.manufacturers_response import ManufacturersResponse +from digikey.v4.productinformation.models.media_links import MediaLinks +from digikey.v4.productinformation.models.media_response import MediaResponse +from digikey.v4.productinformation.models.package_type import PackageType +from digikey.v4.productinformation.models.package_type_by_quantity_product import PackageTypeByQuantityProduct +from digikey.v4.productinformation.models.package_type_by_quantity_response import PackageTypeByQuantityResponse +from digikey.v4.productinformation.models.parameter import Parameter +from digikey.v4.productinformation.models.parameter_filter_options_response import ParameterFilterOptionsResponse +from digikey.v4.productinformation.models.parameter_filter_request import ParameterFilterRequest +from digikey.v4.productinformation.models.parameter_value import ParameterValue +from digikey.v4.productinformation.models.parametric_category import ParametricCategory +from digikey.v4.productinformation.models.price_break import PriceBreak +from digikey.v4.productinformation.models.product import Product +from digikey.v4.productinformation.models.product_associations import ProductAssociations +from digikey.v4.productinformation.models.product_associations_response import ProductAssociationsResponse +from digikey.v4.productinformation.models.product_details import ProductDetails +from digikey.v4.productinformation.models.product_pricing import ProductPricing +from digikey.v4.productinformation.models.product_pricing_response import ProductPricingResponse +from digikey.v4.productinformation.models.product_pricing_variation import ProductPricingVariation +from digikey.v4.productinformation.models.product_status_v4 import ProductStatusV4 +from digikey.v4.productinformation.models.product_substitute import ProductSubstitute +from digikey.v4.productinformation.models.product_substitutes_response import ProductSubstitutesResponse +from digikey.v4.productinformation.models.product_summary import ProductSummary +from digikey.v4.productinformation.models.product_variation import ProductVariation +from digikey.v4.productinformation.models.recommendation import Recommendation +from digikey.v4.productinformation.models.recommended_product import RecommendedProduct +from digikey.v4.productinformation.models.recommended_products_response import RecommendedProductsResponse +from digikey.v4.productinformation.models.series import Series +from digikey.v4.productinformation.models.settings_used import SettingsUsed +from digikey.v4.productinformation.models.sort_options import SortOptions +from digikey.v4.productinformation.models.supplier import Supplier +from digikey.v4.productinformation.models.top_category import TopCategory +from digikey.v4.productinformation.models.top_category_node import TopCategoryNode diff --git a/digikey/v4/productinformation/api/__init__.py b/digikey/v4/productinformation/api/__init__.py new file mode 100644 index 0000000..7ccf24e --- /dev/null +++ b/digikey/v4/productinformation/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from digikey.v4.productinformation.api.product_search_api import ProductSearchApi diff --git a/digikey/v4/productinformation/api/product_search_api.py b/digikey/v4/productinformation/api/product_search_api.py new file mode 100644 index 0000000..ebb58de --- /dev/null +++ b/digikey/v4/productinformation/api/product_search_api.py @@ -0,0 +1,1722 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from digikey.v4.productinformation.api_client import ApiClient + + +class ProductSearchApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def alternate_packaging(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve Alternate Packaging for a given product # noqa: E501 + + Works best with a Digi-Key Product number. Some manufacturer product numbers conflict with unrelated products and may not return the correct product. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.alternate_packaging(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: AlternatePackagingResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.alternate_packaging_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.alternate_packaging_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def alternate_packaging_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve Alternate Packaging for a given product # noqa: E501 + + Works best with a Digi-Key Product number. Some manufacturer product numbers conflict with unrelated products and may not return the correct product. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.alternate_packaging_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: AlternatePackagingResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method alternate_packaging" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `alternate_packaging`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `alternate_packaging`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/alternatepackaging', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='AlternatePackagingResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def associations(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve Associations for a given product # noqa: E501 + + Works best with a Digi-Key Product number. Some manufacturer product numbers conflict with unrelated products and may not return the correct product. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.associations(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The product to retrieve substitutions for. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ProductAssociationsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.associations_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.associations_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def associations_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve Associations for a given product # noqa: E501 + + Works best with a Digi-Key Product number. Some manufacturer product numbers conflict with unrelated products and may not return the correct product. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.associations_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The product to retrieve substitutions for. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ProductAssociationsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method associations" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `associations`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `associations`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/associations', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProductAssociationsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def categories(self, **kwargs): # noqa: E501 + """Returns all Product Categories. Category Id can be used in KeywordRequestDto.Filters.TaxonomyIds to restrict a keyword search to a given category # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.categories(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :return: CategoriesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.categories_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.categories_with_http_info(**kwargs) # noqa: E501 + return data + + def categories_with_http_info(self, **kwargs): # noqa: E501 + """Returns all Product Categories. Category Id can be used in KeywordRequestDto.Filters.TaxonomyIds to restrict a keyword search to a given category # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.categories_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :return: CategoriesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['authorization'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method categories" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/categories', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CategoriesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def categories_by_id(self, category_id, **kwargs): # noqa: E501 + """Returns Category for given Id. Category Id can be used in KeywordRequestDto.Filters.TaxonomyIds to restrict a keyword search to a given category # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.categories_by_id(category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int category_id: (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.categories_by_id_with_http_info(category_id, **kwargs) # noqa: E501 + else: + (data) = self.categories_by_id_with_http_info(category_id, **kwargs) # noqa: E501 + return data + + def categories_by_id_with_http_info(self, category_id, **kwargs): # noqa: E501 + """Returns Category for given Id. Category Id can be used in KeywordRequestDto.Filters.TaxonomyIds to restrict a keyword search to a given category # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.categories_by_id_with_http_info(category_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int category_id: (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :return: CategoryResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['category_id', 'authorization'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method categories_by_id" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'category_id' is set + if ('category_id' not in params or + params['category_id'] is None): + raise ValueError("Missing the required parameter `category_id` when calling `categories_by_id`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'category_id' in params: + path_params['categoryId'] = params['category_id'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/categories/{categoryId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CategoryResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def digi_reel_pricing(self, product_number, requested_quantity, x_digikey_client_id, **kwargs): # noqa: E501 + """Calculate the DigiReel pricing for the given DigiKeyProductNumber and RequestedQuantity # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.digi_reel_pricing(product_number, requested_quantity, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The Digi-Key ProductNumber requested for Digi-Reel price calculation. It must be a Digi-Key Product number that is for a Digi-Reel pack type. (required) + :param int requested_quantity: The quantity of the product you are looking to create a Digi-Reel with. Must be greater than 0. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: DigiReelPricing + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.digi_reel_pricing_with_http_info(product_number, requested_quantity, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.digi_reel_pricing_with_http_info(product_number, requested_quantity, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def digi_reel_pricing_with_http_info(self, product_number, requested_quantity, x_digikey_client_id, **kwargs): # noqa: E501 + """Calculate the DigiReel pricing for the given DigiKeyProductNumber and RequestedQuantity # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.digi_reel_pricing_with_http_info(product_number, requested_quantity, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The Digi-Key ProductNumber requested for Digi-Reel price calculation. It must be a Digi-Key Product number that is for a Digi-Reel pack type. (required) + :param int requested_quantity: The quantity of the product you are looking to create a Digi-Reel with. Must be greater than 0. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: DigiReelPricing + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'requested_quantity', 'x_digikey_client_id', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method digi_reel_pricing" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `digi_reel_pricing`") # noqa: E501 + # verify the required parameter 'requested_quantity' is set + if ('requested_quantity' not in params or + params['requested_quantity'] is None): + raise ValueError("Missing the required parameter `requested_quantity` when calling `digi_reel_pricing`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `digi_reel_pricing`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + if 'requested_quantity' in params: + query_params.append(('requestedQuantity', params['requested_quantity'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/digireelpricing', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='DigiReelPricing', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def keyword_search(self, x_digikey_client_id, **kwargs): # noqa: E501 + """Enter parameters, keywords, or a manufacturer part number/DigiKey part number and receive many fields of product information for each match. Note that MyPricing is not returned. # noqa: E501 + + Locale information is required in the headers for accurate pricing and currencies. Locale and currencies will be set to default values if not populated or populated with invalid values. Check the “Settings Used” fields to see which values we used for the response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.keyword_search(x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_digikey_client_id: The Client Id for your App. (required) + :param KeywordRequest body: + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site2: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language2: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency2: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str includes: + :return: KeywordResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.keyword_search_with_http_info(x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.keyword_search_with_http_info(x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def keyword_search_with_http_info(self, x_digikey_client_id, **kwargs): # noqa: E501 + """Enter parameters, keywords, or a manufacturer part number/DigiKey part number and receive many fields of product information for each match. Note that MyPricing is not returned. # noqa: E501 + + Locale information is required in the headers for accurate pricing and currencies. Locale and currencies will be set to default values if not populated or populated with invalid values. Check the “Settings Used” fields to see which values we used for the response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.keyword_search_with_http_info(x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_digikey_client_id: The Client Id for your App. (required) + :param KeywordRequest body: + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site2: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language2: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency2: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str includes: + :return: KeywordResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_digikey_client_id', 'body', 'authorization', 'x_digikey_locale_site2', 'x_digikey_locale_language2', 'x_digikey_locale_currency2', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'includes'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method keyword_search" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `keyword_search`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'includes' in params: + query_params.append(('includes', params['includes'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/keyword', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='KeywordResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def manufacturers(self, x_digikey_client_id, **kwargs): # noqa: E501 + """Returns all Product Manufacturers. ManufacturersId can be used in KeywordRequestDto.Filters.ManufacturerIds to restrict a keyword search to a given Manufacturer # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.manufacturers(x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ManufacturersResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.manufacturers_with_http_info(x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.manufacturers_with_http_info(x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def manufacturers_with_http_info(self, x_digikey_client_id, **kwargs): # noqa: E501 + """Returns all Product Manufacturers. ManufacturersId can be used in KeywordRequestDto.Filters.ManufacturerIds to restrict a keyword search to a given Manufacturer # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.manufacturers_with_http_info(x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ManufacturersResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['x_digikey_client_id', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method manufacturers" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `manufacturers`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/manufacturers', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ManufacturersResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def media(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve all media for a given product # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.media(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: MediaResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.media_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.media_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def media_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve all media for a given product # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.media_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: MediaResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method media" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `media`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `media`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/media', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='MediaResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def package_type_by_quantity(self, product_number, requested_quantity, x_digikey_client_id, **kwargs): # noqa: E501 + """Provide a product number and quantity to receive product information such as pricing, available quantity, and the best packaging type for the requested quantity of the product. For example, given a requested quantity larger than a standard reel, this will return information about the standard tape and reel as well as either cut tape or DKR depending on the provided preference. Made for Cut Tape, Tape and Reel, and Digi-Reel products only. Other packaging types can be searched for, but results may vary. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.package_type_by_quantity(product_number, requested_quantity, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: A product number. Can be either Digi-Key or Manufacturer, but some manufacturer product numbers are ambiguous and will not be found. A DKR product number will override a CT packagingPreference. (required) + :param int requested_quantity: The quantity of the product that you are interested in. This will be used to determined the quantity to purchase in standard tape and reel, and also in your product preference for the remainder. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str packaging_preference: Can be either \"CT\" for Cut Tape or \"DKR\" for Digi-Reel. This will select what package type to use for the remainder of quantity outside of a standard reel. + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: PackageTypeByQuantityResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.package_type_by_quantity_with_http_info(product_number, requested_quantity, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.package_type_by_quantity_with_http_info(product_number, requested_quantity, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def package_type_by_quantity_with_http_info(self, product_number, requested_quantity, x_digikey_client_id, **kwargs): # noqa: E501 + """Provide a product number and quantity to receive product information such as pricing, available quantity, and the best packaging type for the requested quantity of the product. For example, given a requested quantity larger than a standard reel, this will return information about the standard tape and reel as well as either cut tape or DKR depending on the provided preference. Made for Cut Tape, Tape and Reel, and Digi-Reel products only. Other packaging types can be searched for, but results may vary. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.package_type_by_quantity_with_http_info(product_number, requested_quantity, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: A product number. Can be either Digi-Key or Manufacturer, but some manufacturer product numbers are ambiguous and will not be found. A DKR product number will override a CT packagingPreference. (required) + :param int requested_quantity: The quantity of the product that you are interested in. This will be used to determined the quantity to purchase in standard tape and reel, and also in your product preference for the remainder. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str packaging_preference: Can be either \"CT\" for Cut Tape or \"DKR\" for Digi-Reel. This will select what package type to use for the remainder of quantity outside of a standard reel. + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: PackageTypeByQuantityResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'requested_quantity', 'x_digikey_client_id', 'packaging_preference', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method package_type_by_quantity" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `package_type_by_quantity`") # noqa: E501 + # verify the required parameter 'requested_quantity' is set + if ('requested_quantity' not in params or + params['requested_quantity'] is None): + raise ValueError("Missing the required parameter `requested_quantity` when calling `package_type_by_quantity`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `package_type_by_quantity`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + if 'requested_quantity' in params: + query_params.append(('requestedQuantity', params['requested_quantity'])) # noqa: E501 + if 'packaging_preference' in params: + query_params.append(('packagingPreference', params['packaging_preference'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/packagetypebyquantity/{productNumber}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='PackageTypeByQuantityResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def product_details(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Enter a manufacturer part number/DigiKey part number and receive all of the production information fields for a single-matched product. MyPricing is shown if applicable. If the manufacturer part number has more than one match, we will respond with an error. # noqa: E501 + + Works best with a Digi-Key product number. MyPricing is shown if applicable. Locale information is required in the headers for accurate pricing and currencies. Locale and currencies will be set to default values if not populated or populated with invalid values. Check the “Settings Used” fields to see which values we used for the response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.product_details(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The product to retrieve details for. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str includes: + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ProductDetails + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.product_details_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.product_details_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def product_details_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Enter a manufacturer part number/DigiKey part number and receive all of the production information fields for a single-matched product. MyPricing is shown if applicable. If the manufacturer part number has more than one match, we will respond with an error. # noqa: E501 + + Works best with a Digi-Key product number. MyPricing is shown if applicable. Locale information is required in the headers for accurate pricing and currencies. Locale and currencies will be set to default values if not populated or populated with invalid values. Check the “Settings Used” fields to see which values we used for the response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.product_details_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The product to retrieve details for. (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str includes: + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ProductDetails + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'includes', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method product_details" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `product_details`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `product_details`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + if 'includes' in params: + query_params.append(('includes', params['includes'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/productdetails', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProductDetails', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def product_pricing(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Enter a manufacturer part number/DigiKey part number or partial manufacturer part number/DigiKey part number and receive product information fields for each matched product. MyPricing is shown if applicable. # noqa: E501 + + Allows you to use inStock and excludeMarketplace as limit. If there are multiple matching parts, you can see the additional ones by incrementing your input using the offset and limit fields. Locale information is required in the headers for accurate pricing and currencies. Locale and currencies will be set to default values if not populated or populated with invalid values. Check the “Settings Used” fields to see which values we used for the response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.product_pricing(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: ProducuctNubmer to search on. Can be partial part number, manufacturer part number, or a Digi-Key part number. Enter the ProductNumber to be searched. You can enter a manufacturer part number or a DigiKey part number. You can enter a partial or complete product number. The search results are better when entering a DigiKey product number, as some manufacturers share the same manufacturer part number. (required) + :param str x_digikey_client_id: The Client Id for your App. Enter the ClientID for the Product App used to make the call. (required) + :param int limit: Enter the maximum number of products to be returned. The maximum amount is 10. Default value: 5 + :param int offset: Enter the starting index for the records to be returned. This is used when making subsequent calls for the same ProductNumber. Default value: 0 + :param bool in_stock: Enter true to exclude products that are not in stock. Default value : false + :param bool exclude_marketplace: Enter true to exclude Marketplace items and limit results to those fulfilled by DigiKey. Default value: false + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: This value determines which country’s prices are used for StandardPricing and MyPricing. Also, product restrictions can differ by country. Acceptable values include: AT, AU, BE, BG, BR, CA, CH, CN, CZ, DE, DK, EE, ES, FI, FR, GR, HK, HU, IE, IL, IN, IT, JP, KR, LT, LU, LV, MX, MY, NL, NO, NZ, PH, PL, PT, RO, SE, SG, SI, SK, TH, TW, UK, US, ZA Default value: US + :param str x_digikey_locale_language: This value determines which language is used for the links in reply. If the entered language is not valid for the entered Locale-Site, it will default to English. Acceptable values include: CS, DA, DE, EN, ES, FI, FR, HE, HU, IT, JA, KO, NL, NO, PL, PT, RO, SV, TH, ZHS, ZHT Default value: English + :param str x_digikey_locale_currency: This value determines which country’s prices are used for StandardPricing and MyPricing. If the value is not allowed for the entered Locale-Site, it defaults to the primary currency for that Locale-Site. Ex: If Locale-Currency = EUR and Locale-Site = US, then the system will default to USD and note that in the response. Acceptable values include: AUD, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, ILS, INR, JPY, KRW, MYR, NOK, NZD, PHP, PLN, RON, SEK, SGD, THB, TWD, USD, ZAR Default value: primary currency for the entered Locale-site. + :return: ProductPricingResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.product_pricing_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.product_pricing_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def product_pricing_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Enter a manufacturer part number/DigiKey part number or partial manufacturer part number/DigiKey part number and receive product information fields for each matched product. MyPricing is shown if applicable. # noqa: E501 + + Allows you to use inStock and excludeMarketplace as limit. If there are multiple matching parts, you can see the additional ones by incrementing your input using the offset and limit fields. Locale information is required in the headers for accurate pricing and currencies. Locale and currencies will be set to default values if not populated or populated with invalid values. Check the “Settings Used” fields to see which values we used for the response. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.product_pricing_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: ProducuctNubmer to search on. Can be partial part number, manufacturer part number, or a Digi-Key part number. Enter the ProductNumber to be searched. You can enter a manufacturer part number or a DigiKey part number. You can enter a partial or complete product number. The search results are better when entering a DigiKey product number, as some manufacturers share the same manufacturer part number. (required) + :param str x_digikey_client_id: The Client Id for your App. Enter the ClientID for the Product App used to make the call. (required) + :param int limit: Enter the maximum number of products to be returned. The maximum amount is 10. Default value: 5 + :param int offset: Enter the starting index for the records to be returned. This is used when making subsequent calls for the same ProductNumber. Default value: 0 + :param bool in_stock: Enter true to exclude products that are not in stock. Default value : false + :param bool exclude_marketplace: Enter true to exclude Marketplace items and limit results to those fulfilled by DigiKey. Default value: false + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: This value determines which country’s prices are used for StandardPricing and MyPricing. Also, product restrictions can differ by country. Acceptable values include: AT, AU, BE, BG, BR, CA, CH, CN, CZ, DE, DK, EE, ES, FI, FR, GR, HK, HU, IE, IL, IN, IT, JP, KR, LT, LU, LV, MX, MY, NL, NO, NZ, PH, PL, PT, RO, SE, SG, SI, SK, TH, TW, UK, US, ZA Default value: US + :param str x_digikey_locale_language: This value determines which language is used for the links in reply. If the entered language is not valid for the entered Locale-Site, it will default to English. Acceptable values include: CS, DA, DE, EN, ES, FI, FR, HE, HU, IT, JA, KO, NL, NO, PL, PT, RO, SV, TH, ZHS, ZHT Default value: English + :param str x_digikey_locale_currency: This value determines which country’s prices are used for StandardPricing and MyPricing. If the value is not allowed for the entered Locale-Site, it defaults to the primary currency for that Locale-Site. Ex: If Locale-Currency = EUR and Locale-Site = US, then the system will default to USD and note that in the response. Acceptable values include: AUD, CAD, CHF, CNY, CZK, DKK, EUR, GBP, HKD, HUF, ILS, INR, JPY, KRW, MYR, NOK, NZD, PHP, PLN, RON, SEK, SGD, THB, TWD, USD, ZAR Default value: primary currency for the entered Locale-site. + :return: ProductPricingResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'limit', 'offset', 'in_stock', 'exclude_marketplace', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method product_pricing" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `product_pricing`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `product_pricing`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + if 'in_stock' in params: + query_params.append(('inStock', params['in_stock'])) # noqa: E501 + if 'exclude_marketplace' in params: + query_params.append(('excludeMarketplace', params['exclude_marketplace'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/pricing', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProductPricingResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def recommended_products(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Returns a list of recommended products for the given Product number. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.recommended_products(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The Product being searched for (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param int limit: The number of records to be returned + :param str search_option_list: A comma delimited list of filters that can be used to limit results. Available filters are the following: LeadFree, CollapsePackingTypes, ExcludeNonStock, Has3DModel, InStock, ManufacturerPartSearch, NewProductsOnly, RoHSCompliant. + :param bool exclude_market_place_products: Used to exclude MarkPlace products from search results. Default is false + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: RecommendedProductsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.recommended_products_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.recommended_products_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def recommended_products_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Returns a list of recommended products for the given Product number. # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.recommended_products_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: The Product being searched for (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param int limit: The number of records to be returned + :param str search_option_list: A comma delimited list of filters that can be used to limit results. Available filters are the following: LeadFree, CollapsePackingTypes, ExcludeNonStock, Has3DModel, InStock, ManufacturerPartSearch, NewProductsOnly, RoHSCompliant. + :param bool exclude_market_place_products: Used to exclude MarkPlace products from search results. Default is false + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: RecommendedProductsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'limit', 'search_option_list', 'exclude_market_place_products', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method recommended_products" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `recommended_products`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `recommended_products`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'search_option_list' in params: + query_params.append(('searchOptionList', params['search_option_list'])) # noqa: E501 + if 'exclude_market_place_products' in params: + query_params.append(('excludeMarketPlaceProducts', params['exclude_market_place_products'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/recommendedproducts', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='RecommendedProductsResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def substitutions(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve Substitutions for a given product # noqa: E501 + + Works best with a Digi-Key Product number. Some manufacturer product numbers conflict with unrelated products and may not return the correct product. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.substitutions(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str includes: + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ProductSubstitutesResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.substitutions_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + else: + (data) = self.substitutions_with_http_info(product_number, x_digikey_client_id, **kwargs) # noqa: E501 + return data + + def substitutions_with_http_info(self, product_number, x_digikey_client_id, **kwargs): # noqa: E501 + """Retrieve Substitutions for a given product # noqa: E501 + + Works best with a Digi-Key Product number. Some manufacturer product numbers conflict with unrelated products and may not return the correct product. Locale information is required in the headers for accurate pricing and currencies. Locale defaults to United States. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.substitutions_with_http_info(product_number, x_digikey_client_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str product_number: (required) + :param str x_digikey_client_id: The Client Id for your App. (required) + :param str includes: + :param str authorization: OAuth Bearer Token. Please see OAuth 2.0 Documentation page for more info. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :param str x_digikey_customer_id: Your Digi-Key Customer id. If your account has multiple Customer Ids for different regions, this allows you to select one of them. + :param str x_digikey_locale_site: Two letter code for Digi-Key product website to search on. Different countries sites have different part restrictions, supported languages, and currencies. Acceptable values include: US, CA, JP, UK, DE, AT, BE, DK, FI, GR, IE, IT, LU, NL, NO, PT, ES, KR, HK, SG, CN, TW, AU, FR, IN, NZ, SE, MX, CH, IL, PL, SK, SI, LV, LT, EE, CZ, HU, BG, MY, ZA, RO, TH, PH. + :param str x_digikey_locale_language: Two letter code for language to search on. Langauge must be supported by the selected site. If searching on keyword, this language is used to find matches. Acceptable values include: en, ja, de, fr, ko, zhs, zht, it, es, he, nl, sv, pl, fi, da, no. + :param str x_digikey_locale_currency: Three letter code for Currency to return part pricing for. Currency must be supported by the selected site. Acceptable values include: USD, CAD, JPY, GBP, EUR, HKD, SGD, TWD, KRW, AUD, NZD, INR, DKK, NOK, SEK, ILS, CNY, PLN, CHF, CZK, HUF, RON, ZAR, MYR, THB, PHP. + :return: ProductSubstitutesResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['product_number', 'x_digikey_client_id', 'includes', 'authorization', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency', 'x_digikey_customer_id', 'x_digikey_locale_site', 'x_digikey_locale_language', 'x_digikey_locale_currency'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method substitutions" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'product_number' is set + if ('product_number' not in params or + params['product_number'] is None): + raise ValueError("Missing the required parameter `product_number` when calling `substitutions`") # noqa: E501 + # verify the required parameter 'x_digikey_client_id' is set + if ('x_digikey_client_id' not in params or + params['x_digikey_client_id'] is None): + raise ValueError("Missing the required parameter `x_digikey_client_id` when calling `substitutions`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'product_number' in params: + path_params['productNumber'] = params['product_number'] # noqa: E501 + + query_params = [] + if 'includes' in params: + query_params.append(('includes', params['includes'])) # noqa: E501 + + header_params = {} + if 'authorization' in params: + header_params['Authorization'] = params['authorization'] # noqa: E501 + if 'x_digikey_client_id' in params: + header_params['X-DIGIKEY-Client-Id'] = params['x_digikey_client_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + if 'x_digikey_customer_id' in params: + header_params['X-DIGIKEY-Customer-Id'] = params['x_digikey_customer_id'] # noqa: E501 + if 'x_digikey_locale_site' in params: + header_params['X-DIGIKEY-Locale-Site'] = params['x_digikey_locale_site'] # noqa: E501 + if 'x_digikey_locale_language' in params: + header_params['X-DIGIKEY-Locale-Language'] = params['x_digikey_locale_language'] # noqa: E501 + if 'x_digikey_locale_currency' in params: + header_params['X-DIGIKEY-Locale-Currency'] = params['x_digikey_locale_currency'] # noqa: E501 + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiKeySecurity', 'oauth2ApplicationSecurity'] # noqa: E501 + + return self.api_client.call_api( + '/search/{productNumber}/substitutions', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ProductSubstitutesResponse', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/digikey/v4/productinformation/api_client.py b/digikey/v4/productinformation/api_client.py new file mode 100644 index 0000000..65e68a3 --- /dev/null +++ b/digikey/v4/productinformation/api_client.py @@ -0,0 +1,632 @@ +# coding: utf-8 +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from digikey.v4.productinformation.configuration import Configuration +import digikey.v4.productinformation.models +from digikey.v4.productinformation import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(digikey.v4.productinformation.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + response_data = response.data + with open(path, "wb") as f: + if isinstance(response_data, str): + # change str to bytes so we can write it + response_data = response_data.encode('utf-8') + f.write(response_data) + else: + f.write(response_data) + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/digikey/v4/productinformation/configuration.py b/digikey/v4/productinformation/configuration.py new file mode 100644 index 0000000..1f0da7e --- /dev/null +++ b/digikey/v4/productinformation/configuration.py @@ -0,0 +1,263 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """Constructor""" + # Default Base url + self.host = "https://api.digikey.com/products/v4" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + # access token for OAuth + self.access_token = "" + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("digikey.v4.productinformation") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + token = "" + if self.username or self.password: + token = urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + return token + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'apiKeySecurity': + { + 'type': 'api_key', + 'in': 'header', + 'key': 'X-DIGIKEY-Client-Id', + 'value': self.get_api_key_with_prefix('X-DIGIKEY-Client-Id') + }, + 'oauth2ApplicationSecurity': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: v4\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/digikey/v4/productinformation/models/__init__.py b/digikey/v4/productinformation/models/__init__.py new file mode 100644 index 0000000..a48f03b --- /dev/null +++ b/digikey/v4/productinformation/models/__init__.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +# flake8: noqa +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from digikey.v4.productinformation.models.alternate_packaging import AlternatePackaging +from digikey.v4.productinformation.models.alternate_packaging_response import AlternatePackagingResponse +from digikey.v4.productinformation.models.base_filter_v4 import BaseFilterV4 +from digikey.v4.productinformation.models.base_product import BaseProduct +from digikey.v4.productinformation.models.break_price import BreakPrice +from digikey.v4.productinformation.models.categories_response import CategoriesResponse +from digikey.v4.productinformation.models.category import Category +from digikey.v4.productinformation.models.category_node import CategoryNode +from digikey.v4.productinformation.models.category_response import CategoryResponse +from digikey.v4.productinformation.models.category_type import CategoryType +from digikey.v4.productinformation.models.classifications import Classifications +from digikey.v4.productinformation.models.dk_problem_details import DKProblemDetails +from digikey.v4.productinformation.models.description import Description +from digikey.v4.productinformation.models.digi_reel_pricing import DigiReelPricing +from digikey.v4.productinformation.models.filter_id import FilterId +from digikey.v4.productinformation.models.filter_options import FilterOptions +from digikey.v4.productinformation.models.filter_options_request import FilterOptionsRequest +from digikey.v4.productinformation.models.filter_value import FilterValue +from digikey.v4.productinformation.models.filters import Filters +from digikey.v4.productinformation.models.iso_search_locale import IsoSearchLocale +from digikey.v4.productinformation.models.keyword_request import KeywordRequest +from digikey.v4.productinformation.models.keyword_response import KeywordResponse +from digikey.v4.productinformation.models.manufacturer import Manufacturer +from digikey.v4.productinformation.models.manufacturer_info import ManufacturerInfo +from digikey.v4.productinformation.models.manufacturers_response import ManufacturersResponse +from digikey.v4.productinformation.models.media_links import MediaLinks +from digikey.v4.productinformation.models.media_response import MediaResponse +from digikey.v4.productinformation.models.package_type import PackageType +from digikey.v4.productinformation.models.package_type_by_quantity_product import PackageTypeByQuantityProduct +from digikey.v4.productinformation.models.package_type_by_quantity_response import PackageTypeByQuantityResponse +from digikey.v4.productinformation.models.parameter import Parameter +from digikey.v4.productinformation.models.parameter_filter_options_response import ParameterFilterOptionsResponse +from digikey.v4.productinformation.models.parameter_filter_request import ParameterFilterRequest +from digikey.v4.productinformation.models.parameter_value import ParameterValue +from digikey.v4.productinformation.models.parametric_category import ParametricCategory +from digikey.v4.productinformation.models.price_break import PriceBreak +from digikey.v4.productinformation.models.product import Product +from digikey.v4.productinformation.models.product_associations import ProductAssociations +from digikey.v4.productinformation.models.product_associations_response import ProductAssociationsResponse +from digikey.v4.productinformation.models.product_details import ProductDetails +from digikey.v4.productinformation.models.product_pricing import ProductPricing +from digikey.v4.productinformation.models.product_pricing_response import ProductPricingResponse +from digikey.v4.productinformation.models.product_pricing_variation import ProductPricingVariation +from digikey.v4.productinformation.models.product_status_v4 import ProductStatusV4 +from digikey.v4.productinformation.models.product_substitute import ProductSubstitute +from digikey.v4.productinformation.models.product_substitutes_response import ProductSubstitutesResponse +from digikey.v4.productinformation.models.product_summary import ProductSummary +from digikey.v4.productinformation.models.product_variation import ProductVariation +from digikey.v4.productinformation.models.recommendation import Recommendation +from digikey.v4.productinformation.models.recommended_product import RecommendedProduct +from digikey.v4.productinformation.models.recommended_products_response import RecommendedProductsResponse +from digikey.v4.productinformation.models.series import Series +from digikey.v4.productinformation.models.settings_used import SettingsUsed +from digikey.v4.productinformation.models.sort_options import SortOptions +from digikey.v4.productinformation.models.supplier import Supplier +from digikey.v4.productinformation.models.top_category import TopCategory +from digikey.v4.productinformation.models.top_category_node import TopCategoryNode diff --git a/digikey/v4/productinformation/models/alternate_packaging.py b/digikey/v4/productinformation/models/alternate_packaging.py new file mode 100644 index 0000000..bb286d1 --- /dev/null +++ b/digikey/v4/productinformation/models/alternate_packaging.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AlternatePackaging(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 = { + 'alternate_packaging': 'list[ProductSummary]' + } + + attribute_map = { + 'alternate_packaging': 'AlternatePackaging' + } + + def __init__(self, alternate_packaging=None): # noqa: E501 + """AlternatePackaging - a model defined in Swagger""" # noqa: E501 + self._alternate_packaging = None + self.discriminator = None + if alternate_packaging is not None: + self.alternate_packaging = alternate_packaging + + @property + def alternate_packaging(self): + """Gets the alternate_packaging of this AlternatePackaging. # noqa: E501 + + Alternate packaging options for this product # noqa: E501 + + :return: The alternate_packaging of this AlternatePackaging. # noqa: E501 + :rtype: list[ProductSummary] + """ + return self._alternate_packaging + + @alternate_packaging.setter + def alternate_packaging(self, alternate_packaging): + """Sets the alternate_packaging of this AlternatePackaging. + + Alternate packaging options for this product # noqa: E501 + + :param alternate_packaging: The alternate_packaging of this AlternatePackaging. # noqa: E501 + :type: list[ProductSummary] + """ + + self._alternate_packaging = alternate_packaging + + 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(AlternatePackaging, 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, AlternatePackaging): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/alternate_packaging_response.py b/digikey/v4/productinformation/models/alternate_packaging_response.py new file mode 100644 index 0000000..3860359 --- /dev/null +++ b/digikey/v4/productinformation/models/alternate_packaging_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class AlternatePackagingResponse(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 = { + 'alternate_packagings': 'AlternatePackaging', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'alternate_packagings': 'AlternatePackagings', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, alternate_packagings=None, search_locale_used=None): # noqa: E501 + """AlternatePackagingResponse - a model defined in Swagger""" # noqa: E501 + self._alternate_packagings = None + self._search_locale_used = None + self.discriminator = None + if alternate_packagings is not None: + self.alternate_packagings = alternate_packagings + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def alternate_packagings(self): + """Gets the alternate_packagings of this AlternatePackagingResponse. # noqa: E501 + + + :return: The alternate_packagings of this AlternatePackagingResponse. # noqa: E501 + :rtype: AlternatePackaging + """ + return self._alternate_packagings + + @alternate_packagings.setter + def alternate_packagings(self, alternate_packagings): + """Sets the alternate_packagings of this AlternatePackagingResponse. + + + :param alternate_packagings: The alternate_packagings of this AlternatePackagingResponse. # noqa: E501 + :type: AlternatePackaging + """ + + self._alternate_packagings = alternate_packagings + + @property + def search_locale_used(self): + """Gets the search_locale_used of this AlternatePackagingResponse. # noqa: E501 + + + :return: The search_locale_used of this AlternatePackagingResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this AlternatePackagingResponse. + + + :param search_locale_used: The search_locale_used of this AlternatePackagingResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(AlternatePackagingResponse, 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, AlternatePackagingResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/api_error_response.py b/digikey/v4/productinformation/models/api_error_response.py new file mode 100644 index 0000000..43afc9f --- /dev/null +++ b/digikey/v4/productinformation/models/api_error_response.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 ApiErrorResponse(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 = { + 'error_response_version': 'str', + 'status_code': 'int', + 'error_message': 'str', + 'error_details': 'str', + 'request_id': 'str', + 'validation_errors': 'list[ApiValidationError]' + } + + attribute_map = { + 'error_response_version': 'ErrorResponseVersion', + 'status_code': 'StatusCode', + 'error_message': 'ErrorMessage', + 'error_details': 'ErrorDetails', + 'request_id': 'RequestId', + 'validation_errors': 'ValidationErrors' + } + + def __init__(self, error_response_version=None, status_code=None, error_message=None, error_details=None, request_id=None, validation_errors=None): # noqa: E501 + """ApiErrorResponse - a model defined in Swagger""" # noqa: E501 + + self._error_response_version = None + self._status_code = None + self._error_message = None + self._error_details = None + self._request_id = None + self._validation_errors = None + self.discriminator = None + + if error_response_version is not None: + self.error_response_version = error_response_version + if status_code is not None: + self.status_code = status_code + if error_message is not None: + self.error_message = error_message + if error_details is not None: + self.error_details = error_details + if request_id is not None: + self.request_id = request_id + if validation_errors is not None: + self.validation_errors = validation_errors + + @property + def error_response_version(self): + """Gets the error_response_version of this ApiErrorResponse. # noqa: E501 + + + :return: The error_response_version of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_response_version + + @error_response_version.setter + def error_response_version(self, error_response_version): + """Sets the error_response_version of this ApiErrorResponse. + + + :param error_response_version: The error_response_version of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_response_version = error_response_version + + @property + def status_code(self): + """Gets the status_code of this ApiErrorResponse. # noqa: E501 + + + :return: The status_code of this ApiErrorResponse. # noqa: E501 + :rtype: int + """ + return self._status_code + + @status_code.setter + def status_code(self, status_code): + """Sets the status_code of this ApiErrorResponse. + + + :param status_code: The status_code of this ApiErrorResponse. # noqa: E501 + :type: int + """ + + self._status_code = status_code + + @property + def error_message(self): + """Gets the error_message of this ApiErrorResponse. # noqa: E501 + + + :return: The error_message of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_message + + @error_message.setter + def error_message(self, error_message): + """Sets the error_message of this ApiErrorResponse. + + + :param error_message: The error_message of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_message = error_message + + @property + def error_details(self): + """Gets the error_details of this ApiErrorResponse. # noqa: E501 + + + :return: The error_details of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._error_details + + @error_details.setter + def error_details(self, error_details): + """Sets the error_details of this ApiErrorResponse. + + + :param error_details: The error_details of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._error_details = error_details + + @property + def request_id(self): + """Gets the request_id of this ApiErrorResponse. # noqa: E501 + + + :return: The request_id of this ApiErrorResponse. # noqa: E501 + :rtype: str + """ + return self._request_id + + @request_id.setter + def request_id(self, request_id): + """Sets the request_id of this ApiErrorResponse. + + + :param request_id: The request_id of this ApiErrorResponse. # noqa: E501 + :type: str + """ + + self._request_id = request_id + + @property + def validation_errors(self): + """Gets the validation_errors of this ApiErrorResponse. # noqa: E501 + + + :return: The validation_errors of this ApiErrorResponse. # noqa: E501 + :rtype: list[ApiValidationError] + """ + return self._validation_errors + + @validation_errors.setter + def validation_errors(self, validation_errors): + """Sets the validation_errors of this ApiErrorResponse. + + + :param validation_errors: The validation_errors of this ApiErrorResponse. # noqa: E501 + :type: list[ApiValidationError] + """ + + self._validation_errors = validation_errors + + 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(ApiErrorResponse, 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, ApiErrorResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/api_validation_error.py b/digikey/v4/productinformation/models/api_validation_error.py new file mode 100644 index 0000000..91f6e62 --- /dev/null +++ b/digikey/v4/productinformation/models/api_validation_error.py @@ -0,0 +1,141 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 ApiValidationError(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 = { + 'field': 'str', + 'message': 'str' + } + + attribute_map = { + 'field': 'Field', + 'message': 'Message' + } + + def __init__(self, field=None, message=None): # noqa: E501 + """ApiValidationError - a model defined in Swagger""" # noqa: E501 + + self._field = None + self._message = None + self.discriminator = None + + if field is not None: + self.field = field + if message is not None: + self.message = message + + @property + def field(self): + """Gets the field of this ApiValidationError. # noqa: E501 + + + :return: The field of this ApiValidationError. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this ApiValidationError. + + + :param field: The field of this ApiValidationError. # noqa: E501 + :type: str + """ + + self._field = field + + @property + def message(self): + """Gets the message of this ApiValidationError. # noqa: E501 + + + :return: The message of this ApiValidationError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this ApiValidationError. + + + :param message: The message of this ApiValidationError. # noqa: E501 + :type: str + """ + + self._message = message + + 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(ApiValidationError, 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, ApiValidationError): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/associated_product.py b/digikey/v4/productinformation/models/associated_product.py new file mode 100644 index 0000000..42bf947 --- /dev/null +++ b/digikey/v4/productinformation/models/associated_product.py @@ -0,0 +1,505 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 AssociatedProduct(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 = { + 'product_url': 'str', + 'manufacturer_part_number': 'str', + 'minimum_order_quantity': 'int', + 'non_stock': 'bool', + 'packaging': 'PidVid', + 'quantity_available': 'int', + 'digi_key_part_number': 'str', + 'product_description': 'str', + 'unit_price': 'float', + 'manufacturer': 'PidVid', + 'manufacturer_public_quantity': 'int', + 'quantity_on_order': 'int', + 'dk_plus_restriction': 'bool', + 'marketplace': 'bool', + 'supplier_direct_ship': 'bool' + } + + attribute_map = { + 'product_url': 'ProductUrl', + 'manufacturer_part_number': 'ManufacturerPartNumber', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'non_stock': 'NonStock', + 'packaging': 'Packaging', + 'quantity_available': 'QuantityAvailable', + 'digi_key_part_number': 'DigiKeyPartNumber', + 'product_description': 'ProductDescription', + 'unit_price': 'UnitPrice', + 'manufacturer': 'Manufacturer', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'quantity_on_order': 'QuantityOnOrder', + 'dk_plus_restriction': 'DKPlusRestriction', + 'marketplace': 'Marketplace', + 'supplier_direct_ship': 'SupplierDirectShip' + } + + def __init__(self, product_url=None, manufacturer_part_number=None, minimum_order_quantity=None, non_stock=None, packaging=None, quantity_available=None, digi_key_part_number=None, product_description=None, unit_price=None, manufacturer=None, manufacturer_public_quantity=None, quantity_on_order=None, dk_plus_restriction=None, marketplace=None, supplier_direct_ship=None): # noqa: E501 + """AssociatedProduct - a model defined in Swagger""" # noqa: E501 + + self._product_url = None + self._manufacturer_part_number = None + self._minimum_order_quantity = None + self._non_stock = None + self._packaging = None + self._quantity_available = None + self._digi_key_part_number = None + self._product_description = None + self._unit_price = None + self._manufacturer = None + self._manufacturer_public_quantity = None + self._quantity_on_order = None + self._dk_plus_restriction = None + self._marketplace = None + self._supplier_direct_ship = None + self.discriminator = None + + if product_url is not None: + self.product_url = product_url + if manufacturer_part_number is not None: + self.manufacturer_part_number = manufacturer_part_number + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if non_stock is not None: + self.non_stock = non_stock + if packaging is not None: + self.packaging = packaging + if quantity_available is not None: + self.quantity_available = quantity_available + if digi_key_part_number is not None: + self.digi_key_part_number = digi_key_part_number + if product_description is not None: + self.product_description = product_description + if unit_price is not None: + self.unit_price = unit_price + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if quantity_on_order is not None: + self.quantity_on_order = quantity_on_order + if dk_plus_restriction is not None: + self.dk_plus_restriction = dk_plus_restriction + if marketplace is not None: + self.marketplace = marketplace + if supplier_direct_ship is not None: + self.supplier_direct_ship = supplier_direct_ship + + @property + def product_url(self): + """Gets the product_url of this AssociatedProduct. # noqa: E501 + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :return: The product_url of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this AssociatedProduct. + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :param product_url: The product_url of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def manufacturer_part_number(self): + """Gets the manufacturer_part_number of this AssociatedProduct. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_part_number of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_part_number + + @manufacturer_part_number.setter + def manufacturer_part_number(self, manufacturer_part_number): + """Sets the manufacturer_part_number of this AssociatedProduct. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_part_number: The manufacturer_part_number of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_part_number = manufacturer_part_number + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this AssociatedProduct. # noqa: E501 + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :return: The minimum_order_quantity of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this AssociatedProduct. + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def non_stock(self): + """Gets the non_stock of this AssociatedProduct. # noqa: E501 + + Indicates this product is a non stock product. # noqa: E501 + + :return: The non_stock of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._non_stock + + @non_stock.setter + def non_stock(self, non_stock): + """Sets the non_stock of this AssociatedProduct. + + Indicates this product is a non stock product. # noqa: E501 + + :param non_stock: The non_stock of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._non_stock = non_stock + + @property + def packaging(self): + """Gets the packaging of this AssociatedProduct. # noqa: E501 + + + :return: The packaging of this AssociatedProduct. # noqa: E501 + :rtype: PidVid + """ + return self._packaging + + @packaging.setter + def packaging(self, packaging): + """Sets the packaging of this AssociatedProduct. + + + :param packaging: The packaging of this AssociatedProduct. # noqa: E501 + :type: PidVid + """ + + self._packaging = packaging + + @property + def quantity_available(self): + """Gets the quantity_available of this AssociatedProduct. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this AssociatedProduct. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def digi_key_part_number(self): + """Gets the digi_key_part_number of this AssociatedProduct. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_part_number of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._digi_key_part_number + + @digi_key_part_number.setter + def digi_key_part_number(self, digi_key_part_number): + """Sets the digi_key_part_number of this AssociatedProduct. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_part_number: The digi_key_part_number of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._digi_key_part_number = digi_key_part_number + + @property + def product_description(self): + """Gets the product_description of this AssociatedProduct. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this AssociatedProduct. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this AssociatedProduct. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this AssociatedProduct. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def unit_price(self): + """Gets the unit_price of this AssociatedProduct. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this AssociatedProduct. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this AssociatedProduct. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this AssociatedProduct. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def manufacturer(self): + """Gets the manufacturer of this AssociatedProduct. # noqa: E501 + + + :return: The manufacturer of this AssociatedProduct. # noqa: E501 + :rtype: PidVid + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this AssociatedProduct. + + + :param manufacturer: The manufacturer of this AssociatedProduct. # noqa: E501 + :type: PidVid + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this AssociatedProduct. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this AssociatedProduct. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def quantity_on_order(self): + """Gets the quantity_on_order of this AssociatedProduct. # noqa: E501 + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :return: The quantity_on_order of this AssociatedProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_on_order + + @quantity_on_order.setter + def quantity_on_order(self, quantity_on_order): + """Sets the quantity_on_order of this AssociatedProduct. + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :param quantity_on_order: The quantity_on_order of this AssociatedProduct. # noqa: E501 + :type: int + """ + + self._quantity_on_order = quantity_on_order + + @property + def dk_plus_restriction(self): + """Gets the dk_plus_restriction of this AssociatedProduct. # noqa: E501 + + Deprecated property - see Marketplace # noqa: E501 + + :return: The dk_plus_restriction of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._dk_plus_restriction + + @dk_plus_restriction.setter + def dk_plus_restriction(self, dk_plus_restriction): + """Sets the dk_plus_restriction of this AssociatedProduct. + + Deprecated property - see Marketplace # noqa: E501 + + :param dk_plus_restriction: The dk_plus_restriction of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._dk_plus_restriction = dk_plus_restriction + + @property + def marketplace(self): + """Gets the marketplace of this AssociatedProduct. # noqa: E501 + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :return: The marketplace of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._marketplace + + @marketplace.setter + def marketplace(self, marketplace): + """Sets the marketplace of this AssociatedProduct. + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :param marketplace: The marketplace of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._marketplace = marketplace + + @property + def supplier_direct_ship(self): + """Gets the supplier_direct_ship of this AssociatedProduct. # noqa: E501 + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :return: The supplier_direct_ship of this AssociatedProduct. # noqa: E501 + :rtype: bool + """ + return self._supplier_direct_ship + + @supplier_direct_ship.setter + def supplier_direct_ship(self, supplier_direct_ship): + """Sets the supplier_direct_ship of this AssociatedProduct. + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :param supplier_direct_ship: The supplier_direct_ship of this AssociatedProduct. # noqa: E501 + :type: bool + """ + + self._supplier_direct_ship = supplier_direct_ship + + 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(AssociatedProduct, 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, AssociatedProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/base_filter_v4.py b/digikey/v4/productinformation/models/base_filter_v4.py new file mode 100644 index 0000000..7d884ab --- /dev/null +++ b/digikey/v4/productinformation/models/base_filter_v4.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BaseFilterV4(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 = { + 'id': 'int', + 'value': 'str', + 'product_count': 'int' + } + + attribute_map = { + 'id': 'Id', + 'value': 'Value', + 'product_count': 'ProductCount' + } + + def __init__(self, id=None, value=None, product_count=None): # noqa: E501 + """BaseFilterV4 - a model defined in Swagger""" # noqa: E501 + self._id = None + self._value = None + self._product_count = None + self.discriminator = None + if id is not None: + self.id = id + if value is not None: + self.value = value + if product_count is not None: + self.product_count = product_count + + @property + def id(self): + """Gets the id of this BaseFilterV4. # noqa: E501 + + + :return: The id of this BaseFilterV4. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BaseFilterV4. + + + :param id: The id of this BaseFilterV4. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def value(self): + """Gets the value of this BaseFilterV4. # noqa: E501 + + + :return: The value of this BaseFilterV4. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this BaseFilterV4. + + + :param value: The value of this BaseFilterV4. # noqa: E501 + :type: str + """ + + self._value = value + + @property + def product_count(self): + """Gets the product_count of this BaseFilterV4. # noqa: E501 + + + :return: The product_count of this BaseFilterV4. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this BaseFilterV4. + + + :param product_count: The product_count of this BaseFilterV4. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + 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(BaseFilterV4, 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, BaseFilterV4): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/base_product.py b/digikey/v4/productinformation/models/base_product.py new file mode 100644 index 0000000..02ece21 --- /dev/null +++ b/digikey/v4/productinformation/models/base_product.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BaseProduct(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 = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """BaseProduct - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this BaseProduct. # noqa: E501 + + Manufacturer Id # noqa: E501 + + :return: The id of this BaseProduct. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this BaseProduct. + + Manufacturer Id # noqa: E501 + + :param id: The id of this BaseProduct. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this BaseProduct. # noqa: E501 + + Manufacturer Name # noqa: E501 + + :return: The name of this BaseProduct. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this BaseProduct. + + Manufacturer Name # noqa: E501 + + :param name: The name of this BaseProduct. # noqa: E501 + :type: str + """ + + self._name = name + + 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(BaseProduct, 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, BaseProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/basic_product.py b/digikey/v4/productinformation/models/basic_product.py new file mode 100644 index 0000000..80b1e18 --- /dev/null +++ b/digikey/v4/productinformation/models/basic_product.py @@ -0,0 +1,477 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 BasicProduct(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 = { + 'manufacturer_part_number': 'str', + 'minimum_order_quantity': 'int', + 'non_stock': 'bool', + 'packaging': 'PidVid', + 'quantity_available': 'int', + 'digi_key_part_number': 'str', + 'product_description': 'str', + 'unit_price': 'float', + 'manufacturer': 'PidVid', + 'manufacturer_public_quantity': 'int', + 'quantity_on_order': 'int', + 'dk_plus_restriction': 'bool', + 'marketplace': 'bool', + 'supplier_direct_ship': 'bool' + } + + attribute_map = { + 'manufacturer_part_number': 'ManufacturerPartNumber', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'non_stock': 'NonStock', + 'packaging': 'Packaging', + 'quantity_available': 'QuantityAvailable', + 'digi_key_part_number': 'DigiKeyPartNumber', + 'product_description': 'ProductDescription', + 'unit_price': 'UnitPrice', + 'manufacturer': 'Manufacturer', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'quantity_on_order': 'QuantityOnOrder', + 'dk_plus_restriction': 'DKPlusRestriction', + 'marketplace': 'Marketplace', + 'supplier_direct_ship': 'SupplierDirectShip' + } + + def __init__(self, manufacturer_part_number=None, minimum_order_quantity=None, non_stock=None, packaging=None, quantity_available=None, digi_key_part_number=None, product_description=None, unit_price=None, manufacturer=None, manufacturer_public_quantity=None, quantity_on_order=None, dk_plus_restriction=None, marketplace=None, supplier_direct_ship=None): # noqa: E501 + """BasicProduct - a model defined in Swagger""" # noqa: E501 + + self._manufacturer_part_number = None + self._minimum_order_quantity = None + self._non_stock = None + self._packaging = None + self._quantity_available = None + self._digi_key_part_number = None + self._product_description = None + self._unit_price = None + self._manufacturer = None + self._manufacturer_public_quantity = None + self._quantity_on_order = None + self._dk_plus_restriction = None + self._marketplace = None + self._supplier_direct_ship = None + self.discriminator = None + + if manufacturer_part_number is not None: + self.manufacturer_part_number = manufacturer_part_number + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if non_stock is not None: + self.non_stock = non_stock + if packaging is not None: + self.packaging = packaging + if quantity_available is not None: + self.quantity_available = quantity_available + if digi_key_part_number is not None: + self.digi_key_part_number = digi_key_part_number + if product_description is not None: + self.product_description = product_description + if unit_price is not None: + self.unit_price = unit_price + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if quantity_on_order is not None: + self.quantity_on_order = quantity_on_order + if dk_plus_restriction is not None: + self.dk_plus_restriction = dk_plus_restriction + if marketplace is not None: + self.marketplace = marketplace + if supplier_direct_ship is not None: + self.supplier_direct_ship = supplier_direct_ship + + @property + def manufacturer_part_number(self): + """Gets the manufacturer_part_number of this BasicProduct. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_part_number of this BasicProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_part_number + + @manufacturer_part_number.setter + def manufacturer_part_number(self, manufacturer_part_number): + """Sets the manufacturer_part_number of this BasicProduct. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_part_number: The manufacturer_part_number of this BasicProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_part_number = manufacturer_part_number + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this BasicProduct. # noqa: E501 + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :return: The minimum_order_quantity of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this BasicProduct. + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this BasicProduct. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def non_stock(self): + """Gets the non_stock of this BasicProduct. # noqa: E501 + + Indicates this product is a non stock product. # noqa: E501 + + :return: The non_stock of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._non_stock + + @non_stock.setter + def non_stock(self, non_stock): + """Sets the non_stock of this BasicProduct. + + Indicates this product is a non stock product. # noqa: E501 + + :param non_stock: The non_stock of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._non_stock = non_stock + + @property + def packaging(self): + """Gets the packaging of this BasicProduct. # noqa: E501 + + + :return: The packaging of this BasicProduct. # noqa: E501 + :rtype: PidVid + """ + return self._packaging + + @packaging.setter + def packaging(self, packaging): + """Sets the packaging of this BasicProduct. + + + :param packaging: The packaging of this BasicProduct. # noqa: E501 + :type: PidVid + """ + + self._packaging = packaging + + @property + def quantity_available(self): + """Gets the quantity_available of this BasicProduct. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this BasicProduct. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this BasicProduct. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def digi_key_part_number(self): + """Gets the digi_key_part_number of this BasicProduct. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_part_number of this BasicProduct. # noqa: E501 + :rtype: str + """ + return self._digi_key_part_number + + @digi_key_part_number.setter + def digi_key_part_number(self, digi_key_part_number): + """Sets the digi_key_part_number of this BasicProduct. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_part_number: The digi_key_part_number of this BasicProduct. # noqa: E501 + :type: str + """ + + self._digi_key_part_number = digi_key_part_number + + @property + def product_description(self): + """Gets the product_description of this BasicProduct. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this BasicProduct. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this BasicProduct. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this BasicProduct. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def unit_price(self): + """Gets the unit_price of this BasicProduct. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this BasicProduct. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this BasicProduct. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this BasicProduct. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def manufacturer(self): + """Gets the manufacturer of this BasicProduct. # noqa: E501 + + + :return: The manufacturer of this BasicProduct. # noqa: E501 + :rtype: PidVid + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this BasicProduct. + + + :param manufacturer: The manufacturer of this BasicProduct. # noqa: E501 + :type: PidVid + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this BasicProduct. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this BasicProduct. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this BasicProduct. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def quantity_on_order(self): + """Gets the quantity_on_order of this BasicProduct. # noqa: E501 + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :return: The quantity_on_order of this BasicProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_on_order + + @quantity_on_order.setter + def quantity_on_order(self, quantity_on_order): + """Sets the quantity_on_order of this BasicProduct. + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :param quantity_on_order: The quantity_on_order of this BasicProduct. # noqa: E501 + :type: int + """ + + self._quantity_on_order = quantity_on_order + + @property + def dk_plus_restriction(self): + """Gets the dk_plus_restriction of this BasicProduct. # noqa: E501 + + Deprecated property - see Marketplace # noqa: E501 + + :return: The dk_plus_restriction of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._dk_plus_restriction + + @dk_plus_restriction.setter + def dk_plus_restriction(self, dk_plus_restriction): + """Sets the dk_plus_restriction of this BasicProduct. + + Deprecated property - see Marketplace # noqa: E501 + + :param dk_plus_restriction: The dk_plus_restriction of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._dk_plus_restriction = dk_plus_restriction + + @property + def marketplace(self): + """Gets the marketplace of this BasicProduct. # noqa: E501 + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :return: The marketplace of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._marketplace + + @marketplace.setter + def marketplace(self, marketplace): + """Sets the marketplace of this BasicProduct. + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :param marketplace: The marketplace of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._marketplace = marketplace + + @property + def supplier_direct_ship(self): + """Gets the supplier_direct_ship of this BasicProduct. # noqa: E501 + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :return: The supplier_direct_ship of this BasicProduct. # noqa: E501 + :rtype: bool + """ + return self._supplier_direct_ship + + @supplier_direct_ship.setter + def supplier_direct_ship(self, supplier_direct_ship): + """Sets the supplier_direct_ship of this BasicProduct. + + If true- this product is shipped directly from the Supplier # noqa: E501 + + :param supplier_direct_ship: The supplier_direct_ship of this BasicProduct. # noqa: E501 + :type: bool + """ + + self._supplier_direct_ship = supplier_direct_ship + + 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(BasicProduct, 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, BasicProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/break_price.py b/digikey/v4/productinformation/models/break_price.py new file mode 100644 index 0000000..8e867f6 --- /dev/null +++ b/digikey/v4/productinformation/models/break_price.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class BreakPrice(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 = { + 'price': 'float', + 'quantity': 'int' + } + + attribute_map = { + 'price': 'Price', + 'quantity': 'Quantity' + } + + def __init__(self, price=None, quantity=None): # noqa: E501 + """BreakPrice - a model defined in Swagger""" # noqa: E501 + self._price = None + self._quantity = None + self.discriminator = None + if price is not None: + self.price = price + if quantity is not None: + self.quantity = quantity + + @property + def price(self): + """Gets the price of this BreakPrice. # noqa: E501 + + Price of a single unit of the product at this quantity. # noqa: E501 + + :return: The price of this BreakPrice. # noqa: E501 + :rtype: float + """ + return self._price + + @price.setter + def price(self, price): + """Sets the price of this BreakPrice. + + Price of a single unit of the product at this quantity. # noqa: E501 + + :param price: The price of this BreakPrice. # noqa: E501 + :type: float + """ + + self._price = price + + @property + def quantity(self): + """Gets the quantity of this BreakPrice. # noqa: E501 + + Price tiers based on the available quantities of the product. # noqa: E501 + + :return: The quantity of this BreakPrice. # noqa: E501 + :rtype: int + """ + return self._quantity + + @quantity.setter + def quantity(self, quantity): + """Sets the quantity of this BreakPrice. + + Price tiers based on the available quantities of the product. # noqa: E501 + + :param quantity: The quantity of this BreakPrice. # noqa: E501 + :type: int + """ + + self._quantity = quantity + + 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(BreakPrice, 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, BreakPrice): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/categories_response.py b/digikey/v4/productinformation/models/categories_response.py new file mode 100644 index 0000000..46bea3f --- /dev/null +++ b/digikey/v4/productinformation/models/categories_response.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CategoriesResponse(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 = { + 'product_count': 'int', + 'categories': 'list[Category]', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'product_count': 'ProductCount', + 'categories': 'Categories', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, product_count=None, categories=None, search_locale_used=None): # noqa: E501 + """CategoriesResponse - a model defined in Swagger""" # noqa: E501 + self._product_count = None + self._categories = None + self._search_locale_used = None + self.discriminator = None + if product_count is not None: + self.product_count = product_count + if categories is not None: + self.categories = categories + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def product_count(self): + """Gets the product_count of this CategoriesResponse. # noqa: E501 + + Count of Products # noqa: E501 + + :return: The product_count of this CategoriesResponse. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this CategoriesResponse. + + Count of Products # noqa: E501 + + :param product_count: The product_count of this CategoriesResponse. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + @property + def categories(self): + """Gets the categories of this CategoriesResponse. # noqa: E501 + + List of Categories # noqa: E501 + + :return: The categories of this CategoriesResponse. # noqa: E501 + :rtype: list[Category] + """ + return self._categories + + @categories.setter + def categories(self, categories): + """Sets the categories of this CategoriesResponse. + + List of Categories # noqa: E501 + + :param categories: The categories of this CategoriesResponse. # noqa: E501 + :type: list[Category] + """ + + self._categories = categories + + @property + def search_locale_used(self): + """Gets the search_locale_used of this CategoriesResponse. # noqa: E501 + + + :return: The search_locale_used of this CategoriesResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this CategoriesResponse. + + + :param search_locale_used: The search_locale_used of this CategoriesResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(CategoriesResponse, 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, CategoriesResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/category.py b/digikey/v4/productinformation/models/category.py new file mode 100644 index 0000000..657b431 --- /dev/null +++ b/digikey/v4/productinformation/models/category.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Category(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 = { + 'category_id': 'int', + 'parent_id': 'int', + 'name': 'str', + 'product_count': 'int', + 'children': 'list[Category]' + } + + attribute_map = { + 'category_id': 'CategoryId', + 'parent_id': 'ParentId', + 'name': 'Name', + 'product_count': 'ProductCount', + 'children': 'Children' + } + + def __init__(self, category_id=None, parent_id=None, name=None, product_count=None, children=None): # noqa: E501 + """Category - a model defined in Swagger""" # noqa: E501 + self._category_id = None + self._parent_id = None + self._name = None + self._product_count = None + self._children = None + self.discriminator = None + if category_id is not None: + self.category_id = category_id + if parent_id is not None: + self.parent_id = parent_id + if name is not None: + self.name = name + if product_count is not None: + self.product_count = product_count + if children is not None: + self.children = children + + @property + def category_id(self): + """Gets the category_id of this Category. # noqa: E501 + + CategoryId # noqa: E501 + + :return: The category_id of this Category. # noqa: E501 + :rtype: int + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this Category. + + CategoryId # noqa: E501 + + :param category_id: The category_id of this Category. # noqa: E501 + :type: int + """ + + self._category_id = category_id + + @property + def parent_id(self): + """Gets the parent_id of this Category. # noqa: E501 + + The Id of the Parent Category if the given category is a child of another category # noqa: E501 + + :return: The parent_id of this Category. # noqa: E501 + :rtype: int + """ + return self._parent_id + + @parent_id.setter + def parent_id(self, parent_id): + """Sets the parent_id of this Category. + + The Id of the Parent Category if the given category is a child of another category # noqa: E501 + + :param parent_id: The parent_id of this Category. # noqa: E501 + :type: int + """ + + self._parent_id = parent_id + + @property + def name(self): + """Gets the name of this Category. # noqa: E501 + + Category Name # noqa: E501 + + :return: The name of this Category. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Category. + + Category Name # noqa: E501 + + :param name: The name of this Category. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def product_count(self): + """Gets the product_count of this Category. # noqa: E501 + + Number of Products in the Category # noqa: E501 + + :return: The product_count of this Category. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this Category. + + Number of Products in the Category # noqa: E501 + + :param product_count: The product_count of this Category. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + @property + def children(self): + """Gets the children of this Category. # noqa: E501 + + List of Child Categories # noqa: E501 + + :return: The children of this Category. # noqa: E501 + :rtype: list[Category] + """ + return self._children + + @children.setter + def children(self, children): + """Sets the children of this Category. + + List of Child Categories # noqa: E501 + + :param children: The children of this Category. # noqa: E501 + :type: list[Category] + """ + + self._children = children + + 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(Category, 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, Category): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/category_node.py b/digikey/v4/productinformation/models/category_node.py new file mode 100644 index 0000000..a33d056 --- /dev/null +++ b/digikey/v4/productinformation/models/category_node.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CategoryNode(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 = { + 'category_id': 'int', + 'parent_id': 'int', + 'name': 'str', + 'product_count': 'int', + 'new_product_count': 'int', + 'image_url': 'str', + 'seo_description': 'str', + 'child_categories': 'list[CategoryNode]' + } + + attribute_map = { + 'category_id': 'CategoryId', + 'parent_id': 'ParentId', + 'name': 'Name', + 'product_count': 'ProductCount', + 'new_product_count': 'NewProductCount', + 'image_url': 'ImageUrl', + 'seo_description': 'SeoDescription', + 'child_categories': 'ChildCategories' + } + + def __init__(self, category_id=None, parent_id=None, name=None, product_count=None, new_product_count=None, image_url=None, seo_description=None, child_categories=None): # noqa: E501 + """CategoryNode - a model defined in Swagger""" # noqa: E501 + self._category_id = None + self._parent_id = None + self._name = None + self._product_count = None + self._new_product_count = None + self._image_url = None + self._seo_description = None + self._child_categories = None + self.discriminator = None + if category_id is not None: + self.category_id = category_id + if parent_id is not None: + self.parent_id = parent_id + if name is not None: + self.name = name + if product_count is not None: + self.product_count = product_count + if new_product_count is not None: + self.new_product_count = new_product_count + if image_url is not None: + self.image_url = image_url + if seo_description is not None: + self.seo_description = seo_description + if child_categories is not None: + self.child_categories = child_categories + + @property + def category_id(self): + """Gets the category_id of this CategoryNode. # noqa: E501 + + The Category Id # noqa: E501 + + :return: The category_id of this CategoryNode. # noqa: E501 + :rtype: int + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this CategoryNode. + + The Category Id # noqa: E501 + + :param category_id: The category_id of this CategoryNode. # noqa: E501 + :type: int + """ + + self._category_id = category_id + + @property + def parent_id(self): + """Gets the parent_id of this CategoryNode. # noqa: E501 + + If this is a child category, this is the Id of the parent category # noqa: E501 + + :return: The parent_id of this CategoryNode. # noqa: E501 + :rtype: int + """ + return self._parent_id + + @parent_id.setter + def parent_id(self, parent_id): + """Sets the parent_id of this CategoryNode. + + If this is a child category, this is the Id of the parent category # noqa: E501 + + :param parent_id: The parent_id of this CategoryNode. # noqa: E501 + :type: int + """ + + self._parent_id = parent_id + + @property + def name(self): + """Gets the name of this CategoryNode. # noqa: E501 + + Category name # noqa: E501 + + :return: The name of this CategoryNode. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CategoryNode. + + Category name # noqa: E501 + + :param name: The name of this CategoryNode. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def product_count(self): + """Gets the product_count of this CategoryNode. # noqa: E501 + + The number of products in the category # noqa: E501 + + :return: The product_count of this CategoryNode. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this CategoryNode. + + The number of products in the category # noqa: E501 + + :param product_count: The product_count of this CategoryNode. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + @property + def new_product_count(self): + """Gets the new_product_count of this CategoryNode. # noqa: E501 + + The number of new products in the category # noqa: E501 + + :return: The new_product_count of this CategoryNode. # noqa: E501 + :rtype: int + """ + return self._new_product_count + + @new_product_count.setter + def new_product_count(self, new_product_count): + """Sets the new_product_count of this CategoryNode. + + The number of new products in the category # noqa: E501 + + :param new_product_count: The new_product_count of this CategoryNode. # noqa: E501 + :type: int + """ + + self._new_product_count = new_product_count + + @property + def image_url(self): + """Gets the image_url of this CategoryNode. # noqa: E501 + + The URL of the image of the category # noqa: E501 + + :return: The image_url of this CategoryNode. # noqa: E501 + :rtype: str + """ + return self._image_url + + @image_url.setter + def image_url(self, image_url): + """Sets the image_url of this CategoryNode. + + The URL of the image of the category # noqa: E501 + + :param image_url: The image_url of this CategoryNode. # noqa: E501 + :type: str + """ + + self._image_url = image_url + + @property + def seo_description(self): + """Gets the seo_description of this CategoryNode. # noqa: E501 + + The SEO description for the category # noqa: E501 + + :return: The seo_description of this CategoryNode. # noqa: E501 + :rtype: str + """ + return self._seo_description + + @seo_description.setter + def seo_description(self, seo_description): + """Sets the seo_description of this CategoryNode. + + The SEO description for the category # noqa: E501 + + :param seo_description: The seo_description of this CategoryNode. # noqa: E501 + :type: str + """ + + self._seo_description = seo_description + + @property + def child_categories(self): + """Gets the child_categories of this CategoryNode. # noqa: E501 + + A list of all children of the category - Their parent Id will be Category Id # noqa: E501 + + :return: The child_categories of this CategoryNode. # noqa: E501 + :rtype: list[CategoryNode] + """ + return self._child_categories + + @child_categories.setter + def child_categories(self, child_categories): + """Sets the child_categories of this CategoryNode. + + A list of all children of the category - Their parent Id will be Category Id # noqa: E501 + + :param child_categories: The child_categories of this CategoryNode. # noqa: E501 + :type: list[CategoryNode] + """ + + self._child_categories = child_categories + + 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(CategoryNode, 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, CategoryNode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/category_response.py b/digikey/v4/productinformation/models/category_response.py new file mode 100644 index 0000000..119d75c --- /dev/null +++ b/digikey/v4/productinformation/models/category_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CategoryResponse(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 = { + 'category': 'Category', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'category': 'Category', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, category=None, search_locale_used=None): # noqa: E501 + """CategoryResponse - a model defined in Swagger""" # noqa: E501 + self._category = None + self._search_locale_used = None + self.discriminator = None + if category is not None: + self.category = category + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def category(self): + """Gets the category of this CategoryResponse. # noqa: E501 + + + :return: The category of this CategoryResponse. # noqa: E501 + :rtype: Category + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this CategoryResponse. + + + :param category: The category of this CategoryResponse. # noqa: E501 + :type: Category + """ + + self._category = category + + @property + def search_locale_used(self): + """Gets the search_locale_used of this CategoryResponse. # noqa: E501 + + + :return: The search_locale_used of this CategoryResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this CategoryResponse. + + + :param search_locale_used: The search_locale_used of this CategoryResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(CategoryResponse, 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, CategoryResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/category_type.py b/digikey/v4/productinformation/models/category_type.py new file mode 100644 index 0000000..54fa397 --- /dev/null +++ b/digikey/v4/productinformation/models/category_type.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class CategoryType(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 = { + 'category_id': 'int', + 'level': 'int', + 'name': 'str' + } + + attribute_map = { + 'category_id': 'CategoryId', + 'level': 'Level', + 'name': 'Name' + } + + def __init__(self, category_id=None, level=None, name=None): # noqa: E501 + """CategoryType - a model defined in Swagger""" # noqa: E501 + self._category_id = None + self._level = None + self._name = None + self.discriminator = None + if category_id is not None: + self.category_id = category_id + if level is not None: + self.level = level + if name is not None: + self.name = name + + @property + def category_id(self): + """Gets the category_id of this CategoryType. # noqa: E501 + + ID for DigiKey product category # noqa: E501 + + :return: The category_id of this CategoryType. # noqa: E501 + :rtype: int + """ + return self._category_id + + @category_id.setter + def category_id(self, category_id): + """Sets the category_id of this CategoryType. + + ID for DigiKey product category # noqa: E501 + + :param category_id: The category_id of this CategoryType. # noqa: E501 + :type: int + """ + + self._category_id = category_id + + @property + def level(self): + """Gets the level of this CategoryType. # noqa: E501 + + DigiKey Product Category level # noqa: E501 + + :return: The level of this CategoryType. # noqa: E501 + :rtype: int + """ + return self._level + + @level.setter + def level(self, level): + """Sets the level of this CategoryType. + + DigiKey Product Category level # noqa: E501 + + :param level: The level of this CategoryType. # noqa: E501 + :type: int + """ + + self._level = level + + @property + def name(self): + """Gets the name of this CategoryType. # noqa: E501 + + Name of DigiKey product category # noqa: E501 + + :return: The name of this CategoryType. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this CategoryType. + + Name of DigiKey product category # noqa: E501 + + :param name: The name of this CategoryType. # noqa: E501 + :type: str + """ + + self._name = name + + 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(CategoryType, 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, CategoryType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/classifications.py b/digikey/v4/productinformation/models/classifications.py new file mode 100644 index 0000000..7728d25 --- /dev/null +++ b/digikey/v4/productinformation/models/classifications.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Classifications(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 = { + 'reach_status': 'str', + 'rohs_status': 'str', + 'moisture_sensitivity_level': 'str', + 'export_control_class_number': 'str', + 'htsus_code': 'str' + } + + attribute_map = { + 'reach_status': 'ReachStatus', + 'rohs_status': 'RohsStatus', + 'moisture_sensitivity_level': 'MoistureSensitivityLevel', + 'export_control_class_number': 'ExportControlClassNumber', + 'htsus_code': 'HtsusCode' + } + + def __init__(self, reach_status=None, rohs_status=None, moisture_sensitivity_level=None, export_control_class_number=None, htsus_code=None): # noqa: E501 + """Classifications - a model defined in Swagger""" # noqa: E501 + self._reach_status = None + self._rohs_status = None + self._moisture_sensitivity_level = None + self._export_control_class_number = None + self._htsus_code = None + self.discriminator = None + if reach_status is not None: + self.reach_status = reach_status + if rohs_status is not None: + self.rohs_status = rohs_status + if moisture_sensitivity_level is not None: + self.moisture_sensitivity_level = moisture_sensitivity_level + if export_control_class_number is not None: + self.export_control_class_number = export_control_class_number + if htsus_code is not None: + self.htsus_code = htsus_code + + @property + def reach_status(self): + """Gets the reach_status of this Classifications. # noqa: E501 + + ReachStatus # noqa: E501 + + :return: The reach_status of this Classifications. # noqa: E501 + :rtype: str + """ + return self._reach_status + + @reach_status.setter + def reach_status(self, reach_status): + """Sets the reach_status of this Classifications. + + ReachStatus # noqa: E501 + + :param reach_status: The reach_status of this Classifications. # noqa: E501 + :type: str + """ + + self._reach_status = reach_status + + @property + def rohs_status(self): + """Gets the rohs_status of this Classifications. # noqa: E501 + + RohsStatus # noqa: E501 + + :return: The rohs_status of this Classifications. # noqa: E501 + :rtype: str + """ + return self._rohs_status + + @rohs_status.setter + def rohs_status(self, rohs_status): + """Sets the rohs_status of this Classifications. + + RohsStatus # noqa: E501 + + :param rohs_status: The rohs_status of this Classifications. # noqa: E501 + :type: str + """ + + self._rohs_status = rohs_status + + @property + def moisture_sensitivity_level(self): + """Gets the moisture_sensitivity_level of this Classifications. # noqa: E501 + + Code for Moisture Sensitivity Level of the product # noqa: E501 + + :return: The moisture_sensitivity_level of this Classifications. # noqa: E501 + :rtype: str + """ + return self._moisture_sensitivity_level + + @moisture_sensitivity_level.setter + def moisture_sensitivity_level(self, moisture_sensitivity_level): + """Sets the moisture_sensitivity_level of this Classifications. + + Code for Moisture Sensitivity Level of the product # noqa: E501 + + :param moisture_sensitivity_level: The moisture_sensitivity_level of this Classifications. # noqa: E501 + :type: str + """ + + self._moisture_sensitivity_level = moisture_sensitivity_level + + @property + def export_control_class_number(self): + """Gets the export_control_class_number of this Classifications. # noqa: E501 + + Export control class number. See documentation from the U.S. Department of Commerce. # noqa: E501 + + :return: The export_control_class_number of this Classifications. # noqa: E501 + :rtype: str + """ + return self._export_control_class_number + + @export_control_class_number.setter + def export_control_class_number(self, export_control_class_number): + """Sets the export_control_class_number of this Classifications. + + Export control class number. See documentation from the U.S. Department of Commerce. # noqa: E501 + + :param export_control_class_number: The export_control_class_number of this Classifications. # noqa: E501 + :type: str + """ + + self._export_control_class_number = export_control_class_number + + @property + def htsus_code(self): + """Gets the htsus_code of this Classifications. # noqa: E501 + + Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. # noqa: E501 + + :return: The htsus_code of this Classifications. # noqa: E501 + :rtype: str + """ + return self._htsus_code + + @htsus_code.setter + def htsus_code(self, htsus_code): + """Sets the htsus_code of this Classifications. + + Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. # noqa: E501 + + :param htsus_code: The htsus_code of this Classifications. # noqa: E501 + :type: str + """ + + self._htsus_code = htsus_code + + 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(Classifications, 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, Classifications): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/description.py b/digikey/v4/productinformation/models/description.py new file mode 100644 index 0000000..ad2b2ac --- /dev/null +++ b/digikey/v4/productinformation/models/description.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Description(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 = { + 'product_description': 'str', + 'detailed_description': 'str' + } + + attribute_map = { + 'product_description': 'ProductDescription', + 'detailed_description': 'DetailedDescription' + } + + def __init__(self, product_description=None, detailed_description=None): # noqa: E501 + """Description - a model defined in Swagger""" # noqa: E501 + self._product_description = None + self._detailed_description = None + self.discriminator = None + if product_description is not None: + self.product_description = product_description + if detailed_description is not None: + self.detailed_description = detailed_description + + @property + def product_description(self): + """Gets the product_description of this Description. # noqa: E501 + + Description of the product. If you entered a valid Locale and Language in the input, we will return the description in that language. Otherwise, we’ll return the English description. # noqa: E501 + + :return: The product_description of this Description. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this Description. + + Description of the product. If you entered a valid Locale and Language in the input, we will return the description in that language. Otherwise, we’ll return the English description. # noqa: E501 + + :param product_description: The product_description of this Description. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def detailed_description(self): + """Gets the detailed_description of this Description. # noqa: E501 + + Detailed description of the product. If you entered a valid Locale and Language in the input, we will return the description in that language. Otherwise, we’ll return the English description. # noqa: E501 + + :return: The detailed_description of this Description. # noqa: E501 + :rtype: str + """ + return self._detailed_description + + @detailed_description.setter + def detailed_description(self, detailed_description): + """Sets the detailed_description of this Description. + + Detailed description of the product. If you entered a valid Locale and Language in the input, we will return the description in that language. Otherwise, we’ll return the English description. # noqa: E501 + + :param detailed_description: The detailed_description of this Description. # noqa: E501 + :type: str + """ + + self._detailed_description = detailed_description + + 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(Description, 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, Description): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/digi_reel_pricing.py b/digikey/v4/productinformation/models/digi_reel_pricing.py new file mode 100644 index 0000000..dd42856 --- /dev/null +++ b/digikey/v4/productinformation/models/digi_reel_pricing.py @@ -0,0 +1,222 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DigiReelPricing(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 = { + 'reeling_fee': 'float', + 'unit_price': 'float', + 'extended_price': 'float', + 'requested_quantity': 'int', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'reeling_fee': 'ReelingFee', + 'unit_price': 'UnitPrice', + 'extended_price': 'ExtendedPrice', + 'requested_quantity': 'RequestedQuantity', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, reeling_fee=None, unit_price=None, extended_price=None, requested_quantity=None, search_locale_used=None): # noqa: E501 + """DigiReelPricing - a model defined in Swagger""" # noqa: E501 + self._reeling_fee = None + self._unit_price = None + self._extended_price = None + self._requested_quantity = None + self._search_locale_used = None + self.discriminator = None + if reeling_fee is not None: + self.reeling_fee = reeling_fee + if unit_price is not None: + self.unit_price = unit_price + if extended_price is not None: + self.extended_price = extended_price + if requested_quantity is not None: + self.requested_quantity = requested_quantity + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def reeling_fee(self): + """Gets the reeling_fee of this DigiReelPricing. # noqa: E501 + + Fee per reel ordered. # noqa: E501 + + :return: The reeling_fee of this DigiReelPricing. # noqa: E501 + :rtype: float + """ + return self._reeling_fee + + @reeling_fee.setter + def reeling_fee(self, reeling_fee): + """Sets the reeling_fee of this DigiReelPricing. + + Fee per reel ordered. # noqa: E501 + + :param reeling_fee: The reeling_fee of this DigiReelPricing. # noqa: E501 + :type: float + """ + + self._reeling_fee = reeling_fee + + @property + def unit_price(self): + """Gets the unit_price of this DigiReelPricing. # noqa: E501 + + Price of a single unit of the product. # noqa: E501 + + :return: The unit_price of this DigiReelPricing. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this DigiReelPricing. + + Price of a single unit of the product. # noqa: E501 + + :param unit_price: The unit_price of this DigiReelPricing. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def extended_price(self): + """Gets the extended_price of this DigiReelPricing. # noqa: E501 + + The total price of the requested reels and the reeling fee. # noqa: E501 + + :return: The extended_price of this DigiReelPricing. # noqa: E501 + :rtype: float + """ + return self._extended_price + + @extended_price.setter + def extended_price(self, extended_price): + """Sets the extended_price of this DigiReelPricing. + + The total price of the requested reels and the reeling fee. # noqa: E501 + + :param extended_price: The extended_price of this DigiReelPricing. # noqa: E501 + :type: float + """ + + self._extended_price = extended_price + + @property + def requested_quantity(self): + """Gets the requested_quantity of this DigiReelPricing. # noqa: E501 + + The passed in quantity of the product you are looking to create a Digi-Reel with. # noqa: E501 + + :return: The requested_quantity of this DigiReelPricing. # noqa: E501 + :rtype: int + """ + return self._requested_quantity + + @requested_quantity.setter + def requested_quantity(self, requested_quantity): + """Sets the requested_quantity of this DigiReelPricing. + + The passed in quantity of the product you are looking to create a Digi-Reel with. # noqa: E501 + + :param requested_quantity: The requested_quantity of this DigiReelPricing. # noqa: E501 + :type: int + """ + + self._requested_quantity = requested_quantity + + @property + def search_locale_used(self): + """Gets the search_locale_used of this DigiReelPricing. # noqa: E501 + + + :return: The search_locale_used of this DigiReelPricing. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this DigiReelPricing. + + + :param search_locale_used: The search_locale_used of this DigiReelPricing. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(DigiReelPricing, 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, DigiReelPricing): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/dk_problem_details.py b/digikey/v4/productinformation/models/dk_problem_details.py new file mode 100644 index 0000000..6017b32 --- /dev/null +++ b/digikey/v4/productinformation/models/dk_problem_details.py @@ -0,0 +1,266 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class DKProblemDetails(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 = { + 'type': 'str', + 'title': 'str', + 'status': 'int', + 'detail': 'str', + 'instance': 'str', + 'correlation_id': 'str', + 'errors': 'dict(str, list[str])' + } + + attribute_map = { + 'type': 'type', + 'title': 'title', + 'status': 'status', + 'detail': 'detail', + 'instance': 'instance', + 'correlation_id': 'correlationId', + 'errors': 'errors' + } + + def __init__(self, type=None, title=None, status=None, detail=None, instance=None, correlation_id=None, errors=None): # noqa: E501 + """DKProblemDetails - a model defined in Swagger""" # noqa: E501 + self._type = None + self._title = None + self._status = None + self._detail = None + self._instance = None + self._correlation_id = None + self._errors = None + self.discriminator = None + if type is not None: + self.type = type + if title is not None: + self.title = title + if status is not None: + self.status = status + if detail is not None: + self.detail = detail + if instance is not None: + self.instance = instance + if correlation_id is not None: + self.correlation_id = correlation_id + if errors is not None: + self.errors = errors + + @property + def type(self): + """Gets the type of this DKProblemDetails. # noqa: E501 + + + :return: The type of this DKProblemDetails. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this DKProblemDetails. + + + :param type: The type of this DKProblemDetails. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def title(self): + """Gets the title of this DKProblemDetails. # noqa: E501 + + + :return: The title of this DKProblemDetails. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this DKProblemDetails. + + + :param title: The title of this DKProblemDetails. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def status(self): + """Gets the status of this DKProblemDetails. # noqa: E501 + + + :return: The status of this DKProblemDetails. # noqa: E501 + :rtype: int + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DKProblemDetails. + + + :param status: The status of this DKProblemDetails. # noqa: E501 + :type: int + """ + + self._status = status + + @property + def detail(self): + """Gets the detail of this DKProblemDetails. # noqa: E501 + + + :return: The detail of this DKProblemDetails. # noqa: E501 + :rtype: str + """ + return self._detail + + @detail.setter + def detail(self, detail): + """Sets the detail of this DKProblemDetails. + + + :param detail: The detail of this DKProblemDetails. # noqa: E501 + :type: str + """ + + self._detail = detail + + @property + def instance(self): + """Gets the instance of this DKProblemDetails. # noqa: E501 + + + :return: The instance of this DKProblemDetails. # noqa: E501 + :rtype: str + """ + return self._instance + + @instance.setter + def instance(self, instance): + """Sets the instance of this DKProblemDetails. + + + :param instance: The instance of this DKProblemDetails. # noqa: E501 + :type: str + """ + + self._instance = instance + + @property + def correlation_id(self): + """Gets the correlation_id of this DKProblemDetails. # noqa: E501 + + + :return: The correlation_id of this DKProblemDetails. # noqa: E501 + :rtype: str + """ + return self._correlation_id + + @correlation_id.setter + def correlation_id(self, correlation_id): + """Sets the correlation_id of this DKProblemDetails. + + + :param correlation_id: The correlation_id of this DKProblemDetails. # noqa: E501 + :type: str + """ + + self._correlation_id = correlation_id + + @property + def errors(self): + """Gets the errors of this DKProblemDetails. # noqa: E501 + + + :return: The errors of this DKProblemDetails. # noqa: E501 + :rtype: dict(str, list[str]) + """ + return self._errors + + @errors.setter + def errors(self, errors): + """Sets the errors of this DKProblemDetails. + + + :param errors: The errors of this DKProblemDetails. # noqa: E501 + :type: dict(str, list[str]) + """ + + self._errors = errors + + 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(DKProblemDetails, 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, DKProblemDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/filter_id.py b/digikey/v4/productinformation/models/filter_id.py new file mode 100644 index 0000000..c161dc7 --- /dev/null +++ b/digikey/v4/productinformation/models/filter_id.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FilterId(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 = { + 'id': 'str' + } + + attribute_map = { + 'id': 'Id' + } + + def __init__(self, id=None): # noqa: E501 + """FilterId - a model defined in Swagger""" # noqa: E501 + self._id = None + self.discriminator = None + if id is not None: + self.id = id + + @property + def id(self): + """Gets the id of this FilterId. # noqa: E501 + + The Id of the Filter # noqa: E501 + + :return: The id of this FilterId. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this FilterId. + + The Id of the Filter # noqa: E501 + + :param id: The id of this FilterId. # noqa: E501 + :type: str + """ + + self._id = id + + 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(FilterId, 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, FilterId): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/filter_options.py b/digikey/v4/productinformation/models/filter_options.py new file mode 100644 index 0000000..a1c15a7 --- /dev/null +++ b/digikey/v4/productinformation/models/filter_options.py @@ -0,0 +1,287 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FilterOptions(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 = { + 'manufacturers': 'list[BaseFilterV4]', + 'packaging': 'list[BaseFilterV4]', + 'status': 'list[BaseFilterV4]', + 'series': 'list[BaseFilterV4]', + 'parametric_filters': 'list[ParameterFilterOptionsResponse]', + 'top_categories': 'list[TopCategory]', + 'market_place_filters': 'list[str]' + } + + attribute_map = { + 'manufacturers': 'Manufacturers', + 'packaging': 'Packaging', + 'status': 'Status', + 'series': 'Series', + 'parametric_filters': 'ParametricFilters', + 'top_categories': 'TopCategories', + 'market_place_filters': 'MarketPlaceFilters' + } + + def __init__(self, manufacturers=None, packaging=None, status=None, series=None, parametric_filters=None, top_categories=None, market_place_filters=None): # noqa: E501 + """FilterOptions - a model defined in Swagger""" # noqa: E501 + self._manufacturers = None + self._packaging = None + self._status = None + self._series = None + self._parametric_filters = None + self._top_categories = None + self._market_place_filters = None + self.discriminator = None + if manufacturers is not None: + self.manufacturers = manufacturers + if packaging is not None: + self.packaging = packaging + if status is not None: + self.status = status + if series is not None: + self.series = series + if parametric_filters is not None: + self.parametric_filters = parametric_filters + if top_categories is not None: + self.top_categories = top_categories + if market_place_filters is not None: + self.market_place_filters = market_place_filters + + @property + def manufacturers(self): + """Gets the manufacturers of this FilterOptions. # noqa: E501 + + The Manufacturers that can be filtered to narrow next search request # noqa: E501 + + :return: The manufacturers of this FilterOptions. # noqa: E501 + :rtype: list[BaseFilterV4] + """ + return self._manufacturers + + @manufacturers.setter + def manufacturers(self, manufacturers): + """Sets the manufacturers of this FilterOptions. + + The Manufacturers that can be filtered to narrow next search request # noqa: E501 + + :param manufacturers: The manufacturers of this FilterOptions. # noqa: E501 + :type: list[BaseFilterV4] + """ + + self._manufacturers = manufacturers + + @property + def packaging(self): + """Gets the packaging of this FilterOptions. # noqa: E501 + + Packaging that can be filtered to narrow next search request # noqa: E501 + + :return: The packaging of this FilterOptions. # noqa: E501 + :rtype: list[BaseFilterV4] + """ + return self._packaging + + @packaging.setter + def packaging(self, packaging): + """Sets the packaging of this FilterOptions. + + Packaging that can be filtered to narrow next search request # noqa: E501 + + :param packaging: The packaging of this FilterOptions. # noqa: E501 + :type: list[BaseFilterV4] + """ + + self._packaging = packaging + + @property + def status(self): + """Gets the status of this FilterOptions. # noqa: E501 + + Status that can be filtered to narrow next search request # noqa: E501 + + :return: The status of this FilterOptions. # noqa: E501 + :rtype: list[BaseFilterV4] + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this FilterOptions. + + Status that can be filtered to narrow next search request # noqa: E501 + + :param status: The status of this FilterOptions. # noqa: E501 + :type: list[BaseFilterV4] + """ + + self._status = status + + @property + def series(self): + """Gets the series of this FilterOptions. # noqa: E501 + + Series that can be filtered to narrow next search request # noqa: E501 + + :return: The series of this FilterOptions. # noqa: E501 + :rtype: list[BaseFilterV4] + """ + return self._series + + @series.setter + def series(self, series): + """Sets the series of this FilterOptions. + + Series that can be filtered to narrow next search request # noqa: E501 + + :param series: The series of this FilterOptions. # noqa: E501 + :type: list[BaseFilterV4] + """ + + self._series = series + + @property + def parametric_filters(self): + """Gets the parametric_filters of this FilterOptions. # noqa: E501 + + ParaetricFilter that can be filtered to narrow next search request # noqa: E501 + + :return: The parametric_filters of this FilterOptions. # noqa: E501 + :rtype: list[ParameterFilterOptionsResponse] + """ + return self._parametric_filters + + @parametric_filters.setter + def parametric_filters(self, parametric_filters): + """Sets the parametric_filters of this FilterOptions. + + ParaetricFilter that can be filtered to narrow next search request # noqa: E501 + + :param parametric_filters: The parametric_filters of this FilterOptions. # noqa: E501 + :type: list[ParameterFilterOptionsResponse] + """ + + self._parametric_filters = parametric_filters + + @property + def top_categories(self): + """Gets the top_categories of this FilterOptions. # noqa: E501 + + the top Categories to filter # noqa: E501 + + :return: The top_categories of this FilterOptions. # noqa: E501 + :rtype: list[TopCategory] + """ + return self._top_categories + + @top_categories.setter + def top_categories(self, top_categories): + """Sets the top_categories of this FilterOptions. + + the top Categories to filter # noqa: E501 + + :param top_categories: The top_categories of this FilterOptions. # noqa: E501 + :type: list[TopCategory] + """ + + self._top_categories = top_categories + + @property + def market_place_filters(self): + """Gets the market_place_filters of this FilterOptions. # noqa: E501 + + Marketplace Filter # noqa: E501 + + :return: The market_place_filters of this FilterOptions. # noqa: E501 + :rtype: list[str] + """ + return self._market_place_filters + + @market_place_filters.setter + def market_place_filters(self, market_place_filters): + """Sets the market_place_filters of this FilterOptions. + + Marketplace Filter # noqa: E501 + + :param market_place_filters: The market_place_filters of this FilterOptions. # noqa: E501 + :type: list[str] + """ + allowed_values = ["NoFilter", "ExcludeMarketPlace", "MarketPlaceOnly"] # noqa: E501 + if not set(market_place_filters).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `market_place_filters` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(market_place_filters) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._market_place_filters = market_place_filters + + 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(FilterOptions, 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, FilterOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/filter_options_request.py b/digikey/v4/productinformation/models/filter_options_request.py new file mode 100644 index 0000000..e8dc6aa --- /dev/null +++ b/digikey/v4/productinformation/models/filter_options_request.py @@ -0,0 +1,347 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FilterOptionsRequest(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 = { + 'manufacturer_filter': 'list[FilterId]', + 'category_filter': 'list[FilterId]', + 'status_filter': 'list[FilterId]', + 'packaging_filter': 'list[FilterId]', + 'market_place_filter': 'str', + 'series_filter': 'list[FilterId]', + 'minimum_quantity_available': 'int', + 'parameter_filter_request': 'ParameterFilterRequest', + 'search_options': 'list[str]' + } + + attribute_map = { + 'manufacturer_filter': 'ManufacturerFilter', + 'category_filter': 'CategoryFilter', + 'status_filter': 'StatusFilter', + 'packaging_filter': 'PackagingFilter', + 'market_place_filter': 'MarketPlaceFilter', + 'series_filter': 'SeriesFilter', + 'minimum_quantity_available': 'MinimumQuantityAvailable', + 'parameter_filter_request': 'ParameterFilterRequest', + 'search_options': 'SearchOptions' + } + + def __init__(self, manufacturer_filter=None, category_filter=None, status_filter=None, packaging_filter=None, market_place_filter=None, series_filter=None, minimum_quantity_available=None, parameter_filter_request=None, search_options=None): # noqa: E501 + """FilterOptionsRequest - a model defined in Swagger""" # noqa: E501 + self._manufacturer_filter = None + self._category_filter = None + self._status_filter = None + self._packaging_filter = None + self._market_place_filter = None + self._series_filter = None + self._minimum_quantity_available = None + self._parameter_filter_request = None + self._search_options = None + self.discriminator = None + if manufacturer_filter is not None: + self.manufacturer_filter = manufacturer_filter + if category_filter is not None: + self.category_filter = category_filter + if status_filter is not None: + self.status_filter = status_filter + if packaging_filter is not None: + self.packaging_filter = packaging_filter + if market_place_filter is not None: + self.market_place_filter = market_place_filter + if series_filter is not None: + self.series_filter = series_filter + if minimum_quantity_available is not None: + self.minimum_quantity_available = minimum_quantity_available + if parameter_filter_request is not None: + self.parameter_filter_request = parameter_filter_request + if search_options is not None: + self.search_options = search_options + + @property + def manufacturer_filter(self): + """Gets the manufacturer_filter of this FilterOptionsRequest. # noqa: E501 + + Filter on Manufacturer # noqa: E501 + + :return: The manufacturer_filter of this FilterOptionsRequest. # noqa: E501 + :rtype: list[FilterId] + """ + return self._manufacturer_filter + + @manufacturer_filter.setter + def manufacturer_filter(self, manufacturer_filter): + """Sets the manufacturer_filter of this FilterOptionsRequest. + + Filter on Manufacturer # noqa: E501 + + :param manufacturer_filter: The manufacturer_filter of this FilterOptionsRequest. # noqa: E501 + :type: list[FilterId] + """ + + self._manufacturer_filter = manufacturer_filter + + @property + def category_filter(self): + """Gets the category_filter of this FilterOptionsRequest. # noqa: E501 + + Category # noqa: E501 + + :return: The category_filter of this FilterOptionsRequest. # noqa: E501 + :rtype: list[FilterId] + """ + return self._category_filter + + @category_filter.setter + def category_filter(self, category_filter): + """Sets the category_filter of this FilterOptionsRequest. + + Category # noqa: E501 + + :param category_filter: The category_filter of this FilterOptionsRequest. # noqa: E501 + :type: list[FilterId] + """ + + self._category_filter = category_filter + + @property + def status_filter(self): + """Gets the status_filter of this FilterOptionsRequest. # noqa: E501 + + Status # noqa: E501 + + :return: The status_filter of this FilterOptionsRequest. # noqa: E501 + :rtype: list[FilterId] + """ + return self._status_filter + + @status_filter.setter + def status_filter(self, status_filter): + """Sets the status_filter of this FilterOptionsRequest. + + Status # noqa: E501 + + :param status_filter: The status_filter of this FilterOptionsRequest. # noqa: E501 + :type: list[FilterId] + """ + + self._status_filter = status_filter + + @property + def packaging_filter(self): + """Gets the packaging_filter of this FilterOptionsRequest. # noqa: E501 + + Packaging # noqa: E501 + + :return: The packaging_filter of this FilterOptionsRequest. # noqa: E501 + :rtype: list[FilterId] + """ + return self._packaging_filter + + @packaging_filter.setter + def packaging_filter(self, packaging_filter): + """Sets the packaging_filter of this FilterOptionsRequest. + + Packaging # noqa: E501 + + :param packaging_filter: The packaging_filter of this FilterOptionsRequest. # noqa: E501 + :type: list[FilterId] + """ + + self._packaging_filter = packaging_filter + + @property + def market_place_filter(self): + """Gets the market_place_filter of this FilterOptionsRequest. # noqa: E501 + + MarketPlaceFilter # noqa: E501 + + :return: The market_place_filter of this FilterOptionsRequest. # noqa: E501 + :rtype: str + """ + return self._market_place_filter + + @market_place_filter.setter + def market_place_filter(self, market_place_filter): + """Sets the market_place_filter of this FilterOptionsRequest. + + MarketPlaceFilter # noqa: E501 + + :param market_place_filter: The market_place_filter of this FilterOptionsRequest. # noqa: E501 + :type: str + """ + allowed_values = ["NoFilter", "ExcludeMarketPlace", "MarketPlaceOnly"] # noqa: E501 + if market_place_filter not in allowed_values: + raise ValueError( + "Invalid value for `market_place_filter` ({0}), must be one of {1}" # noqa: E501 + .format(market_place_filter, allowed_values) + ) + + self._market_place_filter = market_place_filter + + @property + def series_filter(self): + """Gets the series_filter of this FilterOptionsRequest. # noqa: E501 + + SeriesFilter # noqa: E501 + + :return: The series_filter of this FilterOptionsRequest. # noqa: E501 + :rtype: list[FilterId] + """ + return self._series_filter + + @series_filter.setter + def series_filter(self, series_filter): + """Sets the series_filter of this FilterOptionsRequest. + + SeriesFilter # noqa: E501 + + :param series_filter: The series_filter of this FilterOptionsRequest. # noqa: E501 + :type: list[FilterId] + """ + + self._series_filter = series_filter + + @property + def minimum_quantity_available(self): + """Gets the minimum_quantity_available of this FilterOptionsRequest. # noqa: E501 + + The MinimumQuantityAvailable for the result to display # noqa: E501 + + :return: The minimum_quantity_available of this FilterOptionsRequest. # noqa: E501 + :rtype: int + """ + return self._minimum_quantity_available + + @minimum_quantity_available.setter + def minimum_quantity_available(self, minimum_quantity_available): + """Sets the minimum_quantity_available of this FilterOptionsRequest. + + The MinimumQuantityAvailable for the result to display # noqa: E501 + + :param minimum_quantity_available: The minimum_quantity_available of this FilterOptionsRequest. # noqa: E501 + :type: int + """ + + self._minimum_quantity_available = minimum_quantity_available + + @property + def parameter_filter_request(self): + """Gets the parameter_filter_request of this FilterOptionsRequest. # noqa: E501 + + + :return: The parameter_filter_request of this FilterOptionsRequest. # noqa: E501 + :rtype: ParameterFilterRequest + """ + return self._parameter_filter_request + + @parameter_filter_request.setter + def parameter_filter_request(self, parameter_filter_request): + """Sets the parameter_filter_request of this FilterOptionsRequest. + + + :param parameter_filter_request: The parameter_filter_request of this FilterOptionsRequest. # noqa: E501 + :type: ParameterFilterRequest + """ + + self._parameter_filter_request = parameter_filter_request + + @property + def search_options(self): + """Gets the search_options of this FilterOptionsRequest. # noqa: E501 + + /SearchOptions # noqa: E501 + + :return: The search_options of this FilterOptionsRequest. # noqa: E501 + :rtype: list[str] + """ + return self._search_options + + @search_options.setter + def search_options(self, search_options): + """Sets the search_options of this FilterOptionsRequest. + + /SearchOptions # noqa: E501 + + :param search_options: The search_options of this FilterOptionsRequest. # noqa: E501 + :type: list[str] + """ + allowed_values = ["ChipOutpost", "Has3DModel", "HasCadModel", "HasDatasheet", "HasProductPhoto", "InStock", "NewProduct", "NonRohsCompliant", "NormallyStocking", "RohsCompliant"] # noqa: E501 + if not set(search_options).issubset(set(allowed_values)): + raise ValueError( + "Invalid values for `search_options` [{0}], must be a subset of [{1}]" # noqa: E501 + .format(", ".join(map(str, set(search_options) - set(allowed_values))), # noqa: E501 + ", ".join(map(str, allowed_values))) + ) + + self._search_options = search_options + + 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(FilterOptionsRequest, 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, FilterOptionsRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/filter_value.py b/digikey/v4/productinformation/models/filter_value.py new file mode 100644 index 0000000..d5fcd95 --- /dev/null +++ b/digikey/v4/productinformation/models/filter_value.py @@ -0,0 +1,202 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class FilterValue(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 = { + 'product_count': 'int', + 'value_id': 'str', + 'value_name': 'str', + 'range_filter_type': 'str' + } + + attribute_map = { + 'product_count': 'ProductCount', + 'value_id': 'ValueId', + 'value_name': 'ValueName', + 'range_filter_type': 'RangeFilterType' + } + + def __init__(self, product_count=None, value_id=None, value_name=None, range_filter_type=None): # noqa: E501 + """FilterValue - a model defined in Swagger""" # noqa: E501 + self._product_count = None + self._value_id = None + self._value_name = None + self._range_filter_type = None + self.discriminator = None + if product_count is not None: + self.product_count = product_count + if value_id is not None: + self.value_id = value_id + if value_name is not None: + self.value_name = value_name + if range_filter_type is not None: + self.range_filter_type = range_filter_type + + @property + def product_count(self): + """Gets the product_count of this FilterValue. # noqa: E501 + + Number of products with this filter # noqa: E501 + + :return: The product_count of this FilterValue. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this FilterValue. + + Number of products with this filter # noqa: E501 + + :param product_count: The product_count of this FilterValue. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + @property + def value_id(self): + """Gets the value_id of this FilterValue. # noqa: E501 + + Filter Value Id # noqa: E501 + + :return: The value_id of this FilterValue. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this FilterValue. + + Filter Value Id # noqa: E501 + + :param value_id: The value_id of this FilterValue. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def value_name(self): + """Gets the value_name of this FilterValue. # noqa: E501 + + Filter Value Name # noqa: E501 + + :return: The value_name of this FilterValue. # noqa: E501 + :rtype: str + """ + return self._value_name + + @value_name.setter + def value_name(self, value_name): + """Sets the value_name of this FilterValue. + + Filter Value Name # noqa: E501 + + :param value_name: The value_name of this FilterValue. # noqa: E501 + :type: str + """ + + self._value_name = value_name + + @property + def range_filter_type(self): + """Gets the range_filter_type of this FilterValue. # noqa: E501 + + Filter Range - possible values: Min, Max, Range # noqa: E501 + + :return: The range_filter_type of this FilterValue. # noqa: E501 + :rtype: str + """ + return self._range_filter_type + + @range_filter_type.setter + def range_filter_type(self, range_filter_type): + """Sets the range_filter_type of this FilterValue. + + Filter Range - possible values: Min, Max, Range # noqa: E501 + + :param range_filter_type: The range_filter_type of this FilterValue. # noqa: E501 + :type: str + """ + allowed_values = ["Min", "Max", "Range"] # noqa: E501 + if range_filter_type not in allowed_values: + raise ValueError( + "Invalid value for `range_filter_type` ({0}), must be one of {1}" # noqa: E501 + .format(range_filter_type, allowed_values) + ) + + self._range_filter_type = range_filter_type + + 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(FilterValue, 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, FilterValue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/filters.py b/digikey/v4/productinformation/models/filters.py new file mode 100644 index 0000000..1e5d7b3 --- /dev/null +++ b/digikey/v4/productinformation/models/filters.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Filters(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 = { + 'is_in_stock': 'bool', + 'exclude_marketplace': 'bool' + } + + attribute_map = { + 'is_in_stock': 'IsInStock', + 'exclude_marketplace': 'ExcludeMarketplace' + } + + def __init__(self, is_in_stock=None, exclude_marketplace=None): # noqa: E501 + """Filters - a model defined in Swagger""" # noqa: E501 + self._is_in_stock = None + self._exclude_marketplace = None + self.discriminator = None + if is_in_stock is not None: + self.is_in_stock = is_in_stock + if exclude_marketplace is not None: + self.exclude_marketplace = exclude_marketplace + + @property + def is_in_stock(self): + """Gets the is_in_stock of this Filters. # noqa: E501 + + Did we use the “IsInStock” limit? # noqa: E501 + + :return: The is_in_stock of this Filters. # noqa: E501 + :rtype: bool + """ + return self._is_in_stock + + @is_in_stock.setter + def is_in_stock(self, is_in_stock): + """Sets the is_in_stock of this Filters. + + Did we use the “IsInStock” limit? # noqa: E501 + + :param is_in_stock: The is_in_stock of this Filters. # noqa: E501 + :type: bool + """ + + self._is_in_stock = is_in_stock + + @property + def exclude_marketplace(self): + """Gets the exclude_marketplace of this Filters. # noqa: E501 + + Did we use the “ExcludeMarketplace” limit? # noqa: E501 + + :return: The exclude_marketplace of this Filters. # noqa: E501 + :rtype: bool + """ + return self._exclude_marketplace + + @exclude_marketplace.setter + def exclude_marketplace(self, exclude_marketplace): + """Sets the exclude_marketplace of this Filters. + + Did we use the “ExcludeMarketplace” limit? # noqa: E501 + + :param exclude_marketplace: The exclude_marketplace of this Filters. # noqa: E501 + :type: bool + """ + + self._exclude_marketplace = exclude_marketplace + + 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(Filters, 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, Filters): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/iso_search_locale.py b/digikey/v4/productinformation/models/iso_search_locale.py new file mode 100644 index 0000000..c11814a --- /dev/null +++ b/digikey/v4/productinformation/models/iso_search_locale.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IsoSearchLocale(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 = { + 'site': 'str', + 'language': 'str', + 'currency': 'str' + } + + attribute_map = { + 'site': 'Site', + 'language': 'Language', + 'currency': 'Currency' + } + + def __init__(self, site=None, language=None, currency=None): # noqa: E501 + """IsoSearchLocale - a model defined in Swagger""" # noqa: E501 + self._site = None + self._language = None + self._currency = None + self.discriminator = None + if site is not None: + self.site = site + if language is not None: + self.language = language + if currency is not None: + self.currency = currency + + @property + def site(self): + """Gets the site of this IsoSearchLocale. # noqa: E501 + + The site we used for the API call. Note this may be different than the value you entered if that value was not one of our allowed values. # noqa: E501 + + :return: The site of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._site + + @site.setter + def site(self, site): + """Sets the site of this IsoSearchLocale. + + The site we used for the API call. Note this may be different than the value you entered if that value was not one of our allowed values. # noqa: E501 + + :param site: The site of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._site = site + + @property + def language(self): + """Gets the language of this IsoSearchLocale. # noqa: E501 + + The language we used for the API call. Note this may be different than the value you entered if that value was not one of our allowed values or not valid for the entered site. # noqa: E501 + + :return: The language of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this IsoSearchLocale. + + The language we used for the API call. Note this may be different than the value you entered if that value was not one of our allowed values or not valid for the entered site. # noqa: E501 + + :param language: The language of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._language = language + + @property + def currency(self): + """Gets the currency of this IsoSearchLocale. # noqa: E501 + + The currency we used for the API call. Note this may be different than the value you entered if that value was not one of our allowed values or not valid for the entered site. # noqa: E501 + + :return: The currency of this IsoSearchLocale. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this IsoSearchLocale. + + The currency we used for the API call. Note this may be different than the value you entered if that value was not one of our allowed values or not valid for the entered site. # noqa: E501 + + :param currency: The currency of this IsoSearchLocale. # noqa: E501 + :type: str + """ + + self._currency = currency + + 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(IsoSearchLocale, 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, IsoSearchLocale): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/keyword_request.py b/digikey/v4/productinformation/models/keyword_request.py new file mode 100644 index 0000000..aa0454f --- /dev/null +++ b/digikey/v4/productinformation/models/keyword_request.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class KeywordRequest(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 = { + 'keywords': 'str', + 'limit': 'int', + 'offset': 'int', + 'filter_options_request': 'FilterOptionsRequest', + 'sort_options': 'SortOptions' + } + + attribute_map = { + 'keywords': 'Keywords', + 'limit': 'Limit', + 'offset': 'Offset', + 'filter_options_request': 'FilterOptionsRequest', + 'sort_options': 'SortOptions' + } + + def __init__(self, keywords=None, limit=None, offset=None, filter_options_request=None, sort_options=None): # noqa: E501 + """KeywordRequest - a model defined in Swagger""" # noqa: E501 + self._keywords = None + self._limit = None + self._offset = None + self._filter_options_request = None + self._sort_options = None + self.discriminator = None + if keywords is not None: + self.keywords = keywords + if limit is not None: + self.limit = limit + if offset is not None: + self.offset = offset + if filter_options_request is not None: + self.filter_options_request = filter_options_request + if sort_options is not None: + self.sort_options = sort_options + + @property + def keywords(self): + """Gets the keywords of this KeywordRequest. # noqa: E501 + + A String of Keywords, up to 250 characters # noqa: E501 + + :return: The keywords of this KeywordRequest. # noqa: E501 + :rtype: str + """ + return self._keywords + + @keywords.setter + def keywords(self, keywords): + """Sets the keywords of this KeywordRequest. + + A String of Keywords, up to 250 characters # noqa: E501 + + :param keywords: The keywords of this KeywordRequest. # noqa: E501 + :type: str + """ + + self._keywords = keywords + + @property + def limit(self): + """Gets the limit of this KeywordRequest. # noqa: E501 + + Number of products to return between 1 and 50. # noqa: E501 + + :return: The limit of this KeywordRequest. # noqa: E501 + :rtype: int + """ + return self._limit + + @limit.setter + def limit(self, limit): + """Sets the limit of this KeywordRequest. + + Number of products to return between 1 and 50. # noqa: E501 + + :param limit: The limit of this KeywordRequest. # noqa: E501 + :type: int + """ + + self._limit = limit + + @property + def offset(self): + """Gets the offset of this KeywordRequest. # noqa: E501 + + The starting index of the records returned. This is used to paginate beyond RecordCount number of results. # noqa: E501 + + :return: The offset of this KeywordRequest. # noqa: E501 + :rtype: int + """ + return self._offset + + @offset.setter + def offset(self, offset): + """Sets the offset of this KeywordRequest. + + The starting index of the records returned. This is used to paginate beyond RecordCount number of results. # noqa: E501 + + :param offset: The offset of this KeywordRequest. # noqa: E501 + :type: int + """ + + self._offset = offset + + @property + def filter_options_request(self): + """Gets the filter_options_request of this KeywordRequest. # noqa: E501 + + + :return: The filter_options_request of this KeywordRequest. # noqa: E501 + :rtype: FilterOptionsRequest + """ + return self._filter_options_request + + @filter_options_request.setter + def filter_options_request(self, filter_options_request): + """Sets the filter_options_request of this KeywordRequest. + + + :param filter_options_request: The filter_options_request of this KeywordRequest. # noqa: E501 + :type: FilterOptionsRequest + """ + + self._filter_options_request = filter_options_request + + @property + def sort_options(self): + """Gets the sort_options of this KeywordRequest. # noqa: E501 + + + :return: The sort_options of this KeywordRequest. # noqa: E501 + :rtype: SortOptions + """ + return self._sort_options + + @sort_options.setter + def sort_options(self, sort_options): + """Sets the sort_options of this KeywordRequest. + + + :param sort_options: The sort_options of this KeywordRequest. # noqa: E501 + :type: SortOptions + """ + + self._sort_options = sort_options + + 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(KeywordRequest, 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, KeywordRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/keyword_response.py b/digikey/v4/productinformation/models/keyword_response.py new file mode 100644 index 0000000..3ee36b1 --- /dev/null +++ b/digikey/v4/productinformation/models/keyword_response.py @@ -0,0 +1,242 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class KeywordResponse(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 = { + 'products': 'list[Product]', + 'products_count': 'int', + 'exact_matches': 'list[Product]', + 'filter_options': 'FilterOptions', + 'search_locale_used': 'IsoSearchLocale', + 'applied_parametric_filters_dto': 'list[Parameter]' + } + + attribute_map = { + 'products': 'Products', + 'products_count': 'ProductsCount', + 'exact_matches': 'ExactMatches', + 'filter_options': 'FilterOptions', + 'search_locale_used': 'SearchLocaleUsed', + 'applied_parametric_filters_dto': 'AppliedParametricFiltersDto' + } + + def __init__(self, products=None, products_count=None, exact_matches=None, filter_options=None, search_locale_used=None, applied_parametric_filters_dto=None): # noqa: E501 + """KeywordResponse - a model defined in Swagger""" # noqa: E501 + self._products = None + self._products_count = None + self._exact_matches = None + self._filter_options = None + self._search_locale_used = None + self._applied_parametric_filters_dto = None + self.discriminator = None + if products is not None: + self.products = products + if products_count is not None: + self.products_count = products_count + if exact_matches is not None: + self.exact_matches = exact_matches + if filter_options is not None: + self.filter_options = filter_options + if search_locale_used is not None: + self.search_locale_used = search_locale_used + if applied_parametric_filters_dto is not None: + self.applied_parametric_filters_dto = applied_parametric_filters_dto + + @property + def products(self): + """Gets the products of this KeywordResponse. # noqa: E501 + + + :return: The products of this KeywordResponse. # noqa: E501 + :rtype: list[Product] + """ + return self._products + + @products.setter + def products(self, products): + """Sets the products of this KeywordResponse. + + + :param products: The products of this KeywordResponse. # noqa: E501 + :type: list[Product] + """ + + self._products = products + + @property + def products_count(self): + """Gets the products_count of this KeywordResponse. # noqa: E501 + + Total number of matching products found. # noqa: E501 + + :return: The products_count of this KeywordResponse. # noqa: E501 + :rtype: int + """ + return self._products_count + + @products_count.setter + def products_count(self, products_count): + """Sets the products_count of this KeywordResponse. + + Total number of matching products found. # noqa: E501 + + :param products_count: The products_count of this KeywordResponse. # noqa: E501 + :type: int + """ + + self._products_count = products_count + + @property + def exact_matches(self): + """Gets the exact_matches of this KeywordResponse. # noqa: E501 + + + :return: The exact_matches of this KeywordResponse. # noqa: E501 + :rtype: list[Product] + """ + return self._exact_matches + + @exact_matches.setter + def exact_matches(self, exact_matches): + """Sets the exact_matches of this KeywordResponse. + + + :param exact_matches: The exact_matches of this KeywordResponse. # noqa: E501 + :type: list[Product] + """ + + self._exact_matches = exact_matches + + @property + def filter_options(self): + """Gets the filter_options of this KeywordResponse. # noqa: E501 + + + :return: The filter_options of this KeywordResponse. # noqa: E501 + :rtype: FilterOptions + """ + return self._filter_options + + @filter_options.setter + def filter_options(self, filter_options): + """Sets the filter_options of this KeywordResponse. + + + :param filter_options: The filter_options of this KeywordResponse. # noqa: E501 + :type: FilterOptions + """ + + self._filter_options = filter_options + + @property + def search_locale_used(self): + """Gets the search_locale_used of this KeywordResponse. # noqa: E501 + + + :return: The search_locale_used of this KeywordResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this KeywordResponse. + + + :param search_locale_used: The search_locale_used of this KeywordResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + @property + def applied_parametric_filters_dto(self): + """Gets the applied_parametric_filters_dto of this KeywordResponse. # noqa: E501 + + + :return: The applied_parametric_filters_dto of this KeywordResponse. # noqa: E501 + :rtype: list[Parameter] + """ + return self._applied_parametric_filters_dto + + @applied_parametric_filters_dto.setter + def applied_parametric_filters_dto(self, applied_parametric_filters_dto): + """Sets the applied_parametric_filters_dto of this KeywordResponse. + + + :param applied_parametric_filters_dto: The applied_parametric_filters_dto of this KeywordResponse. # noqa: E501 + :type: list[Parameter] + """ + + self._applied_parametric_filters_dto = applied_parametric_filters_dto + + 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(KeywordResponse, 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, KeywordResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/keyword_search_request.py b/digikey/v4/productinformation/models/keyword_search_request.py new file mode 100644 index 0000000..550196c --- /dev/null +++ b/digikey/v4/productinformation/models/keyword_search_request.py @@ -0,0 +1,318 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 KeywordSearchRequest(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 = { + 'keywords': 'str', + 'record_count': 'int', + 'record_start_position': 'int', + 'filters': 'Filters', + 'sort': 'SortParameters', + 'requested_quantity': 'int', + 'search_options': 'list[SearchOption]', + 'exclude_market_place_products': 'bool' + } + + attribute_map = { + 'keywords': 'Keywords', + 'record_count': 'RecordCount', + 'record_start_position': 'RecordStartPosition', + 'filters': 'Filters', + 'sort': 'Sort', + 'requested_quantity': 'RequestedQuantity', + 'search_options': 'SearchOptions', + 'exclude_market_place_products': 'ExcludeMarketPlaceProducts' + } + + def __init__(self, keywords=None, record_count=None, record_start_position=None, filters=None, sort=None, requested_quantity=None, search_options=None, exclude_market_place_products=None): # noqa: E501 + """KeywordSearchRequest - a model defined in Swagger""" # noqa: E501 + + self._keywords = None + self._record_count = None + self._record_start_position = None + self._filters = None + self._sort = None + self._requested_quantity = None + self._search_options = None + self._exclude_market_place_products = None + self.discriminator = None + + self.keywords = keywords + if record_count is not None: + self.record_count = record_count + if record_start_position is not None: + self.record_start_position = record_start_position + if filters is not None: + self.filters = filters + if sort is not None: + self.sort = sort + if requested_quantity is not None: + self.requested_quantity = requested_quantity + if search_options is not None: + self.search_options = search_options + if exclude_market_place_products is not None: + self.exclude_market_place_products = exclude_market_place_products + + @property + def keywords(self): + """Gets the keywords of this KeywordSearchRequest. # noqa: E501 + + Keywords to search on. Can be a description, partial part number, manufacturer part number, or a Digi-Key part number. # noqa: E501 + + :return: The keywords of this KeywordSearchRequest. # noqa: E501 + :rtype: str + """ + return self._keywords + + @keywords.setter + def keywords(self, keywords): + """Sets the keywords of this KeywordSearchRequest. + + Keywords to search on. Can be a description, partial part number, manufacturer part number, or a Digi-Key part number. # noqa: E501 + + :param keywords: The keywords of this KeywordSearchRequest. # noqa: E501 + :type: str + """ + if keywords is None: + raise ValueError("Invalid value for `keywords`, must not be `None`") # noqa: E501 + if keywords is not None and len(keywords) > 250: + raise ValueError("Invalid value for `keywords`, length must be less than or equal to `250`") # noqa: E501 + if keywords is not None and len(keywords) < 1: + raise ValueError("Invalid value for `keywords`, length must be greater than or equal to `1`") # noqa: E501 + + self._keywords = keywords + + @property + def record_count(self): + """Gets the record_count of this KeywordSearchRequest. # noqa: E501 + + Number of products to return between 1 and 50. # noqa: E501 + + :return: The record_count of this KeywordSearchRequest. # noqa: E501 + :rtype: int + """ + return self._record_count + + @record_count.setter + def record_count(self, record_count): + """Sets the record_count of this KeywordSearchRequest. + + Number of products to return between 1 and 50. # noqa: E501 + + :param record_count: The record_count of this KeywordSearchRequest. # noqa: E501 + :type: int + """ + if record_count is not None and record_count > 50: # noqa: E501 + raise ValueError("Invalid value for `record_count`, must be a value less than or equal to `50`") # noqa: E501 + if record_count is not None and record_count < 1: # noqa: E501 + raise ValueError("Invalid value for `record_count`, must be a value greater than or equal to `1`") # noqa: E501 + + self._record_count = record_count + + @property + def record_start_position(self): + """Gets the record_start_position of this KeywordSearchRequest. # noqa: E501 + + The starting index of the records returned. This is used to paginate beyond 50 results. # noqa: E501 + + :return: The record_start_position of this KeywordSearchRequest. # noqa: E501 + :rtype: int + """ + return self._record_start_position + + @record_start_position.setter + def record_start_position(self, record_start_position): + """Sets the record_start_position of this KeywordSearchRequest. + + The starting index of the records returned. This is used to paginate beyond 50 results. # noqa: E501 + + :param record_start_position: The record_start_position of this KeywordSearchRequest. # noqa: E501 + :type: int + """ + + self._record_start_position = record_start_position + + @property + def filters(self): + """Gets the filters of this KeywordSearchRequest. # noqa: E501 + + + :return: The filters of this KeywordSearchRequest. # noqa: E501 + :rtype: Filters + """ + return self._filters + + @filters.setter + def filters(self, filters): + """Sets the filters of this KeywordSearchRequest. + + + :param filters: The filters of this KeywordSearchRequest. # noqa: E501 + :type: Filters + """ + + self._filters = filters + + @property + def sort(self): + """Gets the sort of this KeywordSearchRequest. # noqa: E501 + + + :return: The sort of this KeywordSearchRequest. # noqa: E501 + :rtype: SortParameters + """ + return self._sort + + @sort.setter + def sort(self, sort): + """Sets the sort of this KeywordSearchRequest. + + + :param sort: The sort of this KeywordSearchRequest. # noqa: E501 + :type: SortParameters + """ + + self._sort = sort + + @property + def requested_quantity(self): + """Gets the requested_quantity of this KeywordSearchRequest. # noqa: E501 + + The quantity of the product you are looking to purchase. This is used with the SortByUnitPrice SortOption as price varies at differing quantities. # noqa: E501 + + :return: The requested_quantity of this KeywordSearchRequest. # noqa: E501 + :rtype: int + """ + return self._requested_quantity + + @requested_quantity.setter + def requested_quantity(self, requested_quantity): + """Sets the requested_quantity of this KeywordSearchRequest. + + The quantity of the product you are looking to purchase. This is used with the SortByUnitPrice SortOption as price varies at differing quantities. # noqa: E501 + + :param requested_quantity: The requested_quantity of this KeywordSearchRequest. # noqa: E501 + :type: int + """ + + self._requested_quantity = requested_quantity + + @property + def search_options(self): + """Gets the search_options of this KeywordSearchRequest. # noqa: E501 + + Filters the search results by the included SearchOption. # noqa: E501 + + :return: The search_options of this KeywordSearchRequest. # noqa: E501 + :rtype: list[SearchOption] + """ + return self._search_options + + @search_options.setter + def search_options(self, search_options): + """Sets the search_options of this KeywordSearchRequest. + + Filters the search results by the included SearchOption. # noqa: E501 + + :param search_options: The search_options of this KeywordSearchRequest. # noqa: E501 + :type: list[SearchOption] + """ + + self._search_options = search_options + + @property + def exclude_market_place_products(self): + """Gets the exclude_market_place_products of this KeywordSearchRequest. # noqa: E501 + + Used to exclude MarkPlace products from search results. Default is false # noqa: E501 + + :return: The exclude_market_place_products of this KeywordSearchRequest. # noqa: E501 + :rtype: bool + """ + return self._exclude_market_place_products + + @exclude_market_place_products.setter + def exclude_market_place_products(self, exclude_market_place_products): + """Sets the exclude_market_place_products of this KeywordSearchRequest. + + Used to exclude MarkPlace products from search results. Default is false # noqa: E501 + + :param exclude_market_place_products: The exclude_market_place_products of this KeywordSearchRequest. # noqa: E501 + :type: bool + """ + + self._exclude_market_place_products = exclude_market_place_products + + 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(KeywordSearchRequest, 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, KeywordSearchRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/keyword_search_response.py b/digikey/v4/productinformation/models/keyword_search_response.py new file mode 100644 index 0000000..917156f --- /dev/null +++ b/digikey/v4/productinformation/models/keyword_search_response.py @@ -0,0 +1,307 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 KeywordSearchResponse(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 = { + 'limited_taxonomy': 'LimitedTaxonomy', + 'filter_options': 'list[LimitedParameter]', + 'products': 'list[Product]', + 'products_count': 'int', + 'exact_manufacturer_products_count': 'int', + 'exact_manufacturer_products': 'list[Product]', + 'exact_digi_key_product': 'Product', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'limited_taxonomy': 'LimitedTaxonomy', + 'filter_options': 'FilterOptions', + 'products': 'Products', + 'products_count': 'ProductsCount', + 'exact_manufacturer_products_count': 'ExactManufacturerProductsCount', + 'exact_manufacturer_products': 'ExactManufacturerProducts', + 'exact_digi_key_product': 'ExactDigiKeyProduct', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, limited_taxonomy=None, filter_options=None, products=None, products_count=None, exact_manufacturer_products_count=None, exact_manufacturer_products=None, exact_digi_key_product=None, search_locale_used=None): # noqa: E501 + """KeywordSearchResponse - a model defined in Swagger""" # noqa: E501 + + self._limited_taxonomy = None + self._filter_options = None + self._products = None + self._products_count = None + self._exact_manufacturer_products_count = None + self._exact_manufacturer_products = None + self._exact_digi_key_product = None + self._search_locale_used = None + self.discriminator = None + + if limited_taxonomy is not None: + self.limited_taxonomy = limited_taxonomy + if filter_options is not None: + self.filter_options = filter_options + if products is not None: + self.products = products + if products_count is not None: + self.products_count = products_count + if exact_manufacturer_products_count is not None: + self.exact_manufacturer_products_count = exact_manufacturer_products_count + if exact_manufacturer_products is not None: + self.exact_manufacturer_products = exact_manufacturer_products + if exact_digi_key_product is not None: + self.exact_digi_key_product = exact_digi_key_product + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def limited_taxonomy(self): + """Gets the limited_taxonomy of this KeywordSearchResponse. # noqa: E501 + + + :return: The limited_taxonomy of this KeywordSearchResponse. # noqa: E501 + :rtype: LimitedTaxonomy + """ + return self._limited_taxonomy + + @limited_taxonomy.setter + def limited_taxonomy(self, limited_taxonomy): + """Sets the limited_taxonomy of this KeywordSearchResponse. + + + :param limited_taxonomy: The limited_taxonomy of this KeywordSearchResponse. # noqa: E501 + :type: LimitedTaxonomy + """ + + self._limited_taxonomy = limited_taxonomy + + @property + def filter_options(self): + """Gets the filter_options of this KeywordSearchResponse. # noqa: E501 + + Available filters for narrowing down results. # noqa: E501 + + :return: The filter_options of this KeywordSearchResponse. # noqa: E501 + :rtype: list[LimitedParameter] + """ + return self._filter_options + + @filter_options.setter + def filter_options(self, filter_options): + """Sets the filter_options of this KeywordSearchResponse. + + Available filters for narrowing down results. # noqa: E501 + + :param filter_options: The filter_options of this KeywordSearchResponse. # noqa: E501 + :type: list[LimitedParameter] + """ + + self._filter_options = filter_options + + @property + def products(self): + """Gets the products of this KeywordSearchResponse. # noqa: E501 + + List of products returned by KeywordSearch # noqa: E501 + + :return: The products of this KeywordSearchResponse. # noqa: E501 + :rtype: list[Product] + """ + return self._products + + @products.setter + def products(self, products): + """Sets the products of this KeywordSearchResponse. + + List of products returned by KeywordSearch # noqa: E501 + + :param products: The products of this KeywordSearchResponse. # noqa: E501 + :type: list[Product] + """ + + self._products = products + + @property + def products_count(self): + """Gets the products_count of this KeywordSearchResponse. # noqa: E501 + + Total number of matching products found. # noqa: E501 + + :return: The products_count of this KeywordSearchResponse. # noqa: E501 + :rtype: int + """ + return self._products_count + + @products_count.setter + def products_count(self, products_count): + """Sets the products_count of this KeywordSearchResponse. + + Total number of matching products found. # noqa: E501 + + :param products_count: The products_count of this KeywordSearchResponse. # noqa: E501 + :type: int + """ + + self._products_count = products_count + + @property + def exact_manufacturer_products_count(self): + """Gets the exact_manufacturer_products_count of this KeywordSearchResponse. # noqa: E501 + + Number of exact ManufacturerPartNumber matches. # noqa: E501 + + :return: The exact_manufacturer_products_count of this KeywordSearchResponse. # noqa: E501 + :rtype: int + """ + return self._exact_manufacturer_products_count + + @exact_manufacturer_products_count.setter + def exact_manufacturer_products_count(self, exact_manufacturer_products_count): + """Sets the exact_manufacturer_products_count of this KeywordSearchResponse. + + Number of exact ManufacturerPartNumber matches. # noqa: E501 + + :param exact_manufacturer_products_count: The exact_manufacturer_products_count of this KeywordSearchResponse. # noqa: E501 + :type: int + """ + + self._exact_manufacturer_products_count = exact_manufacturer_products_count + + @property + def exact_manufacturer_products(self): + """Gets the exact_manufacturer_products of this KeywordSearchResponse. # noqa: E501 + + List of products that are exact ManufacturerPartNumber matches. # noqa: E501 + + :return: The exact_manufacturer_products of this KeywordSearchResponse. # noqa: E501 + :rtype: list[Product] + """ + return self._exact_manufacturer_products + + @exact_manufacturer_products.setter + def exact_manufacturer_products(self, exact_manufacturer_products): + """Sets the exact_manufacturer_products of this KeywordSearchResponse. + + List of products that are exact ManufacturerPartNumber matches. # noqa: E501 + + :param exact_manufacturer_products: The exact_manufacturer_products of this KeywordSearchResponse. # noqa: E501 + :type: list[Product] + """ + + self._exact_manufacturer_products = exact_manufacturer_products + + @property + def exact_digi_key_product(self): + """Gets the exact_digi_key_product of this KeywordSearchResponse. # noqa: E501 + + + :return: The exact_digi_key_product of this KeywordSearchResponse. # noqa: E501 + :rtype: Product + """ + return self._exact_digi_key_product + + @exact_digi_key_product.setter + def exact_digi_key_product(self, exact_digi_key_product): + """Sets the exact_digi_key_product of this KeywordSearchResponse. + + + :param exact_digi_key_product: The exact_digi_key_product of this KeywordSearchResponse. # noqa: E501 + :type: Product + """ + + self._exact_digi_key_product = exact_digi_key_product + + @property + def search_locale_used(self): + """Gets the search_locale_used of this KeywordSearchResponse. # noqa: E501 + + + :return: The search_locale_used of this KeywordSearchResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this KeywordSearchResponse. + + + :param search_locale_used: The search_locale_used of this KeywordSearchResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(KeywordSearchResponse, 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, KeywordSearchResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/kit_part.py b/digikey/v4/productinformation/models/kit_part.py new file mode 100644 index 0000000..8f4f9ce --- /dev/null +++ b/digikey/v4/productinformation/models/kit_part.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 KitPart(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 = { + 'associated_product': 'AssociatedProduct', + 'kit_part_quantity': 'int' + } + + attribute_map = { + 'associated_product': 'AssociatedProduct', + 'kit_part_quantity': 'KitPartQuantity' + } + + def __init__(self, associated_product=None, kit_part_quantity=None): # noqa: E501 + """KitPart - a model defined in Swagger""" # noqa: E501 + + self._associated_product = None + self._kit_part_quantity = None + self.discriminator = None + + if associated_product is not None: + self.associated_product = associated_product + if kit_part_quantity is not None: + self.kit_part_quantity = kit_part_quantity + + @property + def associated_product(self): + """Gets the associated_product of this KitPart. # noqa: E501 + + + :return: The associated_product of this KitPart. # noqa: E501 + :rtype: AssociatedProduct + """ + return self._associated_product + + @associated_product.setter + def associated_product(self, associated_product): + """Sets the associated_product of this KitPart. + + + :param associated_product: The associated_product of this KitPart. # noqa: E501 + :type: AssociatedProduct + """ + + self._associated_product = associated_product + + @property + def kit_part_quantity(self): + """Gets the kit_part_quantity of this KitPart. # noqa: E501 + + Number of the product in the Kit. # noqa: E501 + + :return: The kit_part_quantity of this KitPart. # noqa: E501 + :rtype: int + """ + return self._kit_part_quantity + + @kit_part_quantity.setter + def kit_part_quantity(self, kit_part_quantity): + """Sets the kit_part_quantity of this KitPart. + + Number of the product in the Kit. # noqa: E501 + + :param kit_part_quantity: The kit_part_quantity of this KitPart. # noqa: E501 + :type: int + """ + + self._kit_part_quantity = kit_part_quantity + + 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(KitPart, 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, KitPart): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/limited_parameter.py b/digikey/v4/productinformation/models/limited_parameter.py new file mode 100644 index 0000000..3956a37 --- /dev/null +++ b/digikey/v4/productinformation/models/limited_parameter.py @@ -0,0 +1,173 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 LimitedParameter(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 = { + 'values': 'list[ValuePair]', + 'parameter_id': 'int', + 'parameter': 'str' + } + + attribute_map = { + 'values': 'Values', + 'parameter_id': 'ParameterId', + 'parameter': 'Parameter' + } + + def __init__(self, values=None, parameter_id=None, parameter=None): # noqa: E501 + """LimitedParameter - a model defined in Swagger""" # noqa: E501 + + self._values = None + self._parameter_id = None + self._parameter = None + self.discriminator = None + + if values is not None: + self.values = values + if parameter_id is not None: + self.parameter_id = parameter_id + if parameter is not None: + self.parameter = parameter + + @property + def values(self): + """Gets the values of this LimitedParameter. # noqa: E501 + + List of values for the parameter that are contained in the products. # noqa: E501 + + :return: The values of this LimitedParameter. # noqa: E501 + :rtype: list[ValuePair] + """ + return self._values + + @values.setter + def values(self, values): + """Sets the values of this LimitedParameter. + + List of values for the parameter that are contained in the products. # noqa: E501 + + :param values: The values of this LimitedParameter. # noqa: E501 + :type: list[ValuePair] + """ + + self._values = values + + @property + def parameter_id(self): + """Gets the parameter_id of this LimitedParameter. # noqa: E501 + + The Id of the parameter. # noqa: E501 + + :return: The parameter_id of this LimitedParameter. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this LimitedParameter. + + The Id of the parameter. # noqa: E501 + + :param parameter_id: The parameter_id of this LimitedParameter. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def parameter(self): + """Gets the parameter of this LimitedParameter. # noqa: E501 + + The name of the parameter. # noqa: E501 + + :return: The parameter of this LimitedParameter. # noqa: E501 + :rtype: str + """ + return self._parameter + + @parameter.setter + def parameter(self, parameter): + """Sets the parameter of this LimitedParameter. + + The name of the parameter. # noqa: E501 + + :param parameter: The parameter of this LimitedParameter. # noqa: E501 + :type: str + """ + + self._parameter = parameter + + 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(LimitedParameter, 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, LimitedParameter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/limited_taxonomy.py b/digikey/v4/productinformation/models/limited_taxonomy.py new file mode 100644 index 0000000..69a8979 --- /dev/null +++ b/digikey/v4/productinformation/models/limited_taxonomy.py @@ -0,0 +1,285 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 LimitedTaxonomy(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 = { + 'children': 'list[LimitedTaxonomy]', + 'product_count': 'int', + 'new_product_count': 'int', + 'parameter_id': 'int', + 'value_id': 'str', + 'parameter': 'str', + 'value': 'str' + } + + attribute_map = { + 'children': 'Children', + 'product_count': 'ProductCount', + 'new_product_count': 'NewProductCount', + 'parameter_id': 'ParameterId', + 'value_id': 'ValueId', + 'parameter': 'Parameter', + 'value': 'Value' + } + + def __init__(self, children=None, product_count=None, new_product_count=None, parameter_id=None, value_id=None, parameter=None, value=None): # noqa: E501 + """LimitedTaxonomy - a model defined in Swagger""" # noqa: E501 + + self._children = None + self._product_count = None + self._new_product_count = None + self._parameter_id = None + self._value_id = None + self._parameter = None + self._value = None + self.discriminator = None + + if children is not None: + self.children = children + if product_count is not None: + self.product_count = product_count + if new_product_count is not None: + self.new_product_count = new_product_count + if parameter_id is not None: + self.parameter_id = parameter_id + if value_id is not None: + self.value_id = value_id + if parameter is not None: + self.parameter = parameter + if value is not None: + self.value = value + + @property + def children(self): + """Gets the children of this LimitedTaxonomy. # noqa: E501 + + List of taxonomies contained within this taxonomy. # noqa: E501 + + :return: The children of this LimitedTaxonomy. # noqa: E501 + :rtype: list[LimitedTaxonomy] + """ + return self._children + + @children.setter + def children(self, children): + """Sets the children of this LimitedTaxonomy. + + List of taxonomies contained within this taxonomy. # noqa: E501 + + :param children: The children of this LimitedTaxonomy. # noqa: E501 + :type: list[LimitedTaxonomy] + """ + + self._children = children + + @property + def product_count(self): + """Gets the product_count of this LimitedTaxonomy. # noqa: E501 + + The number of products contained within this taxonomy. # noqa: E501 + + :return: The product_count of this LimitedTaxonomy. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this LimitedTaxonomy. + + The number of products contained within this taxonomy. # noqa: E501 + + :param product_count: The product_count of this LimitedTaxonomy. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + @property + def new_product_count(self): + """Gets the new_product_count of this LimitedTaxonomy. # noqa: E501 + + The number of new products contained within this taxonomy. # noqa: E501 + + :return: The new_product_count of this LimitedTaxonomy. # noqa: E501 + :rtype: int + """ + return self._new_product_count + + @new_product_count.setter + def new_product_count(self, new_product_count): + """Sets the new_product_count of this LimitedTaxonomy. + + The number of new products contained within this taxonomy. # noqa: E501 + + :param new_product_count: The new_product_count of this LimitedTaxonomy. # noqa: E501 + :type: int + """ + + self._new_product_count = new_product_count + + @property + def parameter_id(self): + """Gets the parameter_id of this LimitedTaxonomy. # noqa: E501 + + The Id of the parameter. # noqa: E501 + + :return: The parameter_id of this LimitedTaxonomy. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this LimitedTaxonomy. + + The Id of the parameter. # noqa: E501 + + :param parameter_id: The parameter_id of this LimitedTaxonomy. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def value_id(self): + """Gets the value_id of this LimitedTaxonomy. # noqa: E501 + + The Id of the value. # noqa: E501 + + :return: The value_id of this LimitedTaxonomy. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this LimitedTaxonomy. + + The Id of the value. # noqa: E501 + + :param value_id: The value_id of this LimitedTaxonomy. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def parameter(self): + """Gets the parameter of this LimitedTaxonomy. # noqa: E501 + + The name of the parameter. # noqa: E501 + + :return: The parameter of this LimitedTaxonomy. # noqa: E501 + :rtype: str + """ + return self._parameter + + @parameter.setter + def parameter(self, parameter): + """Sets the parameter of this LimitedTaxonomy. + + The name of the parameter. # noqa: E501 + + :param parameter: The parameter of this LimitedTaxonomy. # noqa: E501 + :type: str + """ + + self._parameter = parameter + + @property + def value(self): + """Gets the value of this LimitedTaxonomy. # noqa: E501 + + The name of the value. # noqa: E501 + + :return: The value of this LimitedTaxonomy. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this LimitedTaxonomy. + + The name of the value. # noqa: E501 + + :param value: The value of this LimitedTaxonomy. # noqa: E501 + :type: str + """ + + self._value = value + + 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(LimitedTaxonomy, 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, LimitedTaxonomy): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/manufacturer.py b/digikey/v4/productinformation/models/manufacturer.py new file mode 100644 index 0000000..4d1cef5 --- /dev/null +++ b/digikey/v4/productinformation/models/manufacturer.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Manufacturer(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 = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """Manufacturer - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Manufacturer. # noqa: E501 + + Manufacturer Id # noqa: E501 + + :return: The id of this Manufacturer. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Manufacturer. + + Manufacturer Id # noqa: E501 + + :param id: The id of this Manufacturer. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Manufacturer. # noqa: E501 + + Manufacturer Name # noqa: E501 + + :return: The name of this Manufacturer. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Manufacturer. + + Manufacturer Name # noqa: E501 + + :param name: The name of this Manufacturer. # noqa: E501 + :type: str + """ + + self._name = name + + 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(Manufacturer, 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, Manufacturer): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/manufacturer_info.py b/digikey/v4/productinformation/models/manufacturer_info.py new file mode 100644 index 0000000..f162fc1 --- /dev/null +++ b/digikey/v4/productinformation/models/manufacturer_info.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ManufacturerInfo(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 = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """ManufacturerInfo - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this ManufacturerInfo. # noqa: E501 + + Manufacturer Id # noqa: E501 + + :return: The id of this ManufacturerInfo. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ManufacturerInfo. + + Manufacturer Id # noqa: E501 + + :param id: The id of this ManufacturerInfo. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this ManufacturerInfo. # noqa: E501 + + Manufacturer Name # noqa: E501 + + :return: The name of this ManufacturerInfo. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this ManufacturerInfo. + + Manufacturer Name # noqa: E501 + + :param name: The name of this ManufacturerInfo. # noqa: E501 + :type: str + """ + + self._name = name + + 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(ManufacturerInfo, 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, ManufacturerInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/manufacturer_product_details_request.py b/digikey/v4/productinformation/models/manufacturer_product_details_request.py new file mode 100644 index 0000000..d82d939 --- /dev/null +++ b/digikey/v4/productinformation/models/manufacturer_product_details_request.py @@ -0,0 +1,290 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 ManufacturerProductDetailsRequest(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 = { + 'manufacturer_product': 'str', + 'record_count': 'int', + 'record_start_position': 'int', + 'filters': 'Filters', + 'sort': 'SortParameters', + 'requested_quantity': 'int', + 'search_options': 'list[SearchOption]' + } + + attribute_map = { + 'manufacturer_product': 'ManufacturerProduct', + 'record_count': 'RecordCount', + 'record_start_position': 'RecordStartPosition', + 'filters': 'Filters', + 'sort': 'Sort', + 'requested_quantity': 'RequestedQuantity', + 'search_options': 'SearchOptions' + } + + def __init__(self, manufacturer_product=None, record_count=None, record_start_position=None, filters=None, sort=None, requested_quantity=None, search_options=None): # noqa: E501 + """ManufacturerProductDetailsRequest - a model defined in Swagger""" # noqa: E501 + + self._manufacturer_product = None + self._record_count = None + self._record_start_position = None + self._filters = None + self._sort = None + self._requested_quantity = None + self._search_options = None + self.discriminator = None + + self.manufacturer_product = manufacturer_product + if record_count is not None: + self.record_count = record_count + if record_start_position is not None: + self.record_start_position = record_start_position + if filters is not None: + self.filters = filters + if sort is not None: + self.sort = sort + if requested_quantity is not None: + self.requested_quantity = requested_quantity + if search_options is not None: + self.search_options = search_options + + @property + def manufacturer_product(self): + """Gets the manufacturer_product of this ManufacturerProductDetailsRequest. # noqa: E501 + + Manufacturer product name to search on. # noqa: E501 + + :return: The manufacturer_product of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product + + @manufacturer_product.setter + def manufacturer_product(self, manufacturer_product): + """Sets the manufacturer_product of this ManufacturerProductDetailsRequest. + + Manufacturer product name to search on. # noqa: E501 + + :param manufacturer_product: The manufacturer_product of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: str + """ + if manufacturer_product is None: + raise ValueError("Invalid value for `manufacturer_product`, must not be `None`") # noqa: E501 + if manufacturer_product is not None and len(manufacturer_product) > 250: + raise ValueError("Invalid value for `manufacturer_product`, length must be less than or equal to `250`") # noqa: E501 + if manufacturer_product is not None and len(manufacturer_product) < 1: + raise ValueError("Invalid value for `manufacturer_product`, length must be greater than or equal to `1`") # noqa: E501 + + self._manufacturer_product = manufacturer_product + + @property + def record_count(self): + """Gets the record_count of this ManufacturerProductDetailsRequest. # noqa: E501 + + Number of products to return between 1 and 50. # noqa: E501 + + :return: The record_count of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: int + """ + return self._record_count + + @record_count.setter + def record_count(self, record_count): + """Sets the record_count of this ManufacturerProductDetailsRequest. + + Number of products to return between 1 and 50. # noqa: E501 + + :param record_count: The record_count of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: int + """ + if record_count is not None and record_count > 50: # noqa: E501 + raise ValueError("Invalid value for `record_count`, must be a value less than or equal to `50`") # noqa: E501 + if record_count is not None and record_count < 1: # noqa: E501 + raise ValueError("Invalid value for `record_count`, must be a value greater than or equal to `1`") # noqa: E501 + + self._record_count = record_count + + @property + def record_start_position(self): + """Gets the record_start_position of this ManufacturerProductDetailsRequest. # noqa: E501 + + The starting index of the records returned. This is used to paginate beyond 50 results. # noqa: E501 + + :return: The record_start_position of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: int + """ + return self._record_start_position + + @record_start_position.setter + def record_start_position(self, record_start_position): + """Sets the record_start_position of this ManufacturerProductDetailsRequest. + + The starting index of the records returned. This is used to paginate beyond 50 results. # noqa: E501 + + :param record_start_position: The record_start_position of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: int + """ + + self._record_start_position = record_start_position + + @property + def filters(self): + """Gets the filters of this ManufacturerProductDetailsRequest. # noqa: E501 + + + :return: The filters of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: Filters + """ + return self._filters + + @filters.setter + def filters(self, filters): + """Sets the filters of this ManufacturerProductDetailsRequest. + + + :param filters: The filters of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: Filters + """ + + self._filters = filters + + @property + def sort(self): + """Gets the sort of this ManufacturerProductDetailsRequest. # noqa: E501 + + + :return: The sort of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: SortParameters + """ + return self._sort + + @sort.setter + def sort(self, sort): + """Sets the sort of this ManufacturerProductDetailsRequest. + + + :param sort: The sort of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: SortParameters + """ + + self._sort = sort + + @property + def requested_quantity(self): + """Gets the requested_quantity of this ManufacturerProductDetailsRequest. # noqa: E501 + + The quantity of the product you are looking to purchase. This is used with the SortByUnitPrice SortOption as price varies at differing quantities. # noqa: E501 + + :return: The requested_quantity of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: int + """ + return self._requested_quantity + + @requested_quantity.setter + def requested_quantity(self, requested_quantity): + """Sets the requested_quantity of this ManufacturerProductDetailsRequest. + + The quantity of the product you are looking to purchase. This is used with the SortByUnitPrice SortOption as price varies at differing quantities. # noqa: E501 + + :param requested_quantity: The requested_quantity of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: int + """ + + self._requested_quantity = requested_quantity + + @property + def search_options(self): + """Gets the search_options of this ManufacturerProductDetailsRequest. # noqa: E501 + + Filters the search results by the included SearchOption. # noqa: E501 + + :return: The search_options of this ManufacturerProductDetailsRequest. # noqa: E501 + :rtype: list[SearchOption] + """ + return self._search_options + + @search_options.setter + def search_options(self, search_options): + """Sets the search_options of this ManufacturerProductDetailsRequest. + + Filters the search results by the included SearchOption. # noqa: E501 + + :param search_options: The search_options of this ManufacturerProductDetailsRequest. # noqa: E501 + :type: list[SearchOption] + """ + + self._search_options = search_options + + 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(ManufacturerProductDetailsRequest, 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, ManufacturerProductDetailsRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/manufacturers_response.py b/digikey/v4/productinformation/models/manufacturers_response.py new file mode 100644 index 0000000..a902964 --- /dev/null +++ b/digikey/v4/productinformation/models/manufacturers_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ManufacturersResponse(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 = { + 'manufacturers': 'list[ManufacturerInfo]' + } + + attribute_map = { + 'manufacturers': 'Manufacturers' + } + + def __init__(self, manufacturers=None): # noqa: E501 + """ManufacturersResponse - a model defined in Swagger""" # noqa: E501 + self._manufacturers = None + self.discriminator = None + if manufacturers is not None: + self.manufacturers = manufacturers + + @property + def manufacturers(self): + """Gets the manufacturers of this ManufacturersResponse. # noqa: E501 + + List of Manufacturer Information # noqa: E501 + + :return: The manufacturers of this ManufacturersResponse. # noqa: E501 + :rtype: list[ManufacturerInfo] + """ + return self._manufacturers + + @manufacturers.setter + def manufacturers(self, manufacturers): + """Sets the manufacturers of this ManufacturersResponse. + + List of Manufacturer Information # noqa: E501 + + :param manufacturers: The manufacturers of this ManufacturersResponse. # noqa: E501 + :type: list[ManufacturerInfo] + """ + + self._manufacturers = manufacturers + + 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(ManufacturersResponse, 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, ManufacturersResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/media_links.py b/digikey/v4/productinformation/models/media_links.py new file mode 100644 index 0000000..a8c54bb --- /dev/null +++ b/digikey/v4/productinformation/models/media_links.py @@ -0,0 +1,224 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MediaLinks(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 = { + 'media_type': 'str', + 'title': 'str', + 'small_photo': 'str', + 'thumbnail': 'str', + 'url': 'str' + } + + attribute_map = { + 'media_type': 'MediaType', + 'title': 'Title', + 'small_photo': 'SmallPhoto', + 'thumbnail': 'Thumbnail', + 'url': 'Url' + } + + def __init__(self, media_type=None, title=None, small_photo=None, thumbnail=None, url=None): # noqa: E501 + """MediaLinks - a model defined in Swagger""" # noqa: E501 + self._media_type = None + self._title = None + self._small_photo = None + self._thumbnail = None + self._url = None + self.discriminator = None + if media_type is not None: + self.media_type = media_type + if title is not None: + self.title = title + if small_photo is not None: + self.small_photo = small_photo + if thumbnail is not None: + self.thumbnail = thumbnail + if url is not None: + self.url = url + + @property + def media_type(self): + """Gets the media_type of this MediaLinks. # noqa: E501 + + The type of media. # noqa: E501 + + :return: The media_type of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._media_type + + @media_type.setter + def media_type(self, media_type): + """Sets the media_type of this MediaLinks. + + The type of media. # noqa: E501 + + :param media_type: The media_type of this MediaLinks. # noqa: E501 + :type: str + """ + + self._media_type = media_type + + @property + def title(self): + """Gets the title of this MediaLinks. # noqa: E501 + + The title of the media. # noqa: E501 + + :return: The title of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._title + + @title.setter + def title(self, title): + """Sets the title of this MediaLinks. + + The title of the media. # noqa: E501 + + :param title: The title of this MediaLinks. # noqa: E501 + :type: str + """ + + self._title = title + + @property + def small_photo(self): + """Gets the small_photo of this MediaLinks. # noqa: E501 + + URL to a small photo. # noqa: E501 + + :return: The small_photo of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._small_photo + + @small_photo.setter + def small_photo(self, small_photo): + """Sets the small_photo of this MediaLinks. + + URL to a small photo. # noqa: E501 + + :param small_photo: The small_photo of this MediaLinks. # noqa: E501 + :type: str + """ + + self._small_photo = small_photo + + @property + def thumbnail(self): + """Gets the thumbnail of this MediaLinks. # noqa: E501 + + URL to the thumbnail image of the media. # noqa: E501 + + :return: The thumbnail of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._thumbnail + + @thumbnail.setter + def thumbnail(self, thumbnail): + """Sets the thumbnail of this MediaLinks. + + URL to the thumbnail image of the media. # noqa: E501 + + :param thumbnail: The thumbnail of this MediaLinks. # noqa: E501 + :type: str + """ + + self._thumbnail = thumbnail + + @property + def url(self): + """Gets the url of this MediaLinks. # noqa: E501 + + URL of the media. # noqa: E501 + + :return: The url of this MediaLinks. # noqa: E501 + :rtype: str + """ + return self._url + + @url.setter + def url(self, url): + """Sets the url of this MediaLinks. + + URL of the media. # noqa: E501 + + :param url: The url of this MediaLinks. # noqa: E501 + :type: str + """ + + self._url = url + + 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(MediaLinks, 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, MediaLinks): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/media_response.py b/digikey/v4/productinformation/models/media_response.py new file mode 100644 index 0000000..c4fc510 --- /dev/null +++ b/digikey/v4/productinformation/models/media_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class MediaResponse(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 = { + 'media_links': 'list[MediaLinks]' + } + + attribute_map = { + 'media_links': 'MediaLinks' + } + + def __init__(self, media_links=None): # noqa: E501 + """MediaResponse - a model defined in Swagger""" # noqa: E501 + self._media_links = None + self.discriminator = None + if media_links is not None: + self.media_links = media_links + + @property + def media_links(self): + """Gets the media_links of this MediaResponse. # noqa: E501 + + List of Media Links # noqa: E501 + + :return: The media_links of this MediaResponse. # noqa: E501 + :rtype: list[MediaLinks] + """ + return self._media_links + + @media_links.setter + def media_links(self, media_links): + """Sets the media_links of this MediaResponse. + + List of Media Links # noqa: E501 + + :param media_links: The media_links of this MediaResponse. # noqa: E501 + :type: list[MediaLinks] + """ + + self._media_links = media_links + + 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(MediaResponse, 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, MediaResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/package_type.py b/digikey/v4/productinformation/models/package_type.py new file mode 100644 index 0000000..ad7204a --- /dev/null +++ b/digikey/v4/productinformation/models/package_type.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PackageType(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 = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """PackageType - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this PackageType. # noqa: E501 + + PackageType Id # noqa: E501 + + :return: The id of this PackageType. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PackageType. + + PackageType Id # noqa: E501 + + :param id: The id of this PackageType. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this PackageType. # noqa: E501 + + PackageType Name # noqa: E501 + + :return: The name of this PackageType. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this PackageType. + + PackageType Name # noqa: E501 + + :param name: The name of this PackageType. # noqa: E501 + :type: str + """ + + self._name = name + + 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(PackageType, 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, PackageType): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/package_type_by_quantity_product.py b/digikey/v4/productinformation/models/package_type_by_quantity_product.py new file mode 100644 index 0000000..8dfd3ae --- /dev/null +++ b/digikey/v4/productinformation/models/package_type_by_quantity_product.py @@ -0,0 +1,726 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PackageTypeByQuantityProduct(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 = { + 'recommended_quantity': 'int', + 'digi_key_product_number': 'str', + 'quantity_available': 'int', + 'product_description': 'str', + 'detailed_description': 'str', + 'manufacturer_name': 'str', + 'manufacturer_product_number': 'str', + 'minimum_order_quantity': 'int', + 'primary_datasheet_url': 'str', + 'primary_photo_url': 'str', + 'product_status': 'str', + 'manufacturer_lead_weeks': 'str', + 'manufacturer_warehouse_quantity': 'int', + 'rohs_status': 'str', + 'ro_hs_compliant': 'bool', + 'quantity_on_order': 'int', + 'standard_pricing': 'list[BreakPrice]', + 'my_pricing': 'list[BreakPrice]', + 'product_url': 'str', + 'market_place': 'bool', + 'supplier': 'str', + 'stock_note': 'str', + 'package_types': 'list[str]' + } + + attribute_map = { + 'recommended_quantity': 'RecommendedQuantity', + 'digi_key_product_number': 'DigiKeyProductNumber', + 'quantity_available': 'QuantityAvailable', + 'product_description': 'ProductDescription', + 'detailed_description': 'DetailedDescription', + 'manufacturer_name': 'ManufacturerName', + 'manufacturer_product_number': 'ManufacturerProductNumber', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'primary_datasheet_url': 'PrimaryDatasheetUrl', + 'primary_photo_url': 'PrimaryPhotoUrl', + 'product_status': 'ProductStatus', + 'manufacturer_lead_weeks': 'ManufacturerLeadWeeks', + 'manufacturer_warehouse_quantity': 'ManufacturerWarehouseQuantity', + 'rohs_status': 'RohsStatus', + 'ro_hs_compliant': 'RoHSCompliant', + 'quantity_on_order': 'QuantityOnOrder', + 'standard_pricing': 'StandardPricing', + 'my_pricing': 'MyPricing', + 'product_url': 'ProductUrl', + 'market_place': 'MarketPlace', + 'supplier': 'Supplier', + 'stock_note': 'StockNote', + 'package_types': 'PackageTypes' + } + + def __init__(self, recommended_quantity=None, digi_key_product_number=None, quantity_available=None, product_description=None, detailed_description=None, manufacturer_name=None, manufacturer_product_number=None, minimum_order_quantity=None, primary_datasheet_url=None, primary_photo_url=None, product_status=None, manufacturer_lead_weeks=None, manufacturer_warehouse_quantity=None, rohs_status=None, ro_hs_compliant=None, quantity_on_order=None, standard_pricing=None, my_pricing=None, product_url=None, market_place=None, supplier=None, stock_note=None, package_types=None): # noqa: E501 + """PackageTypeByQuantityProduct - a model defined in Swagger""" # noqa: E501 + self._recommended_quantity = None + self._digi_key_product_number = None + self._quantity_available = None + self._product_description = None + self._detailed_description = None + self._manufacturer_name = None + self._manufacturer_product_number = None + self._minimum_order_quantity = None + self._primary_datasheet_url = None + self._primary_photo_url = None + self._product_status = None + self._manufacturer_lead_weeks = None + self._manufacturer_warehouse_quantity = None + self._rohs_status = None + self._ro_hs_compliant = None + self._quantity_on_order = None + self._standard_pricing = None + self._my_pricing = None + self._product_url = None + self._market_place = None + self._supplier = None + self._stock_note = None + self._package_types = None + self.discriminator = None + if recommended_quantity is not None: + self.recommended_quantity = recommended_quantity + if digi_key_product_number is not None: + self.digi_key_product_number = digi_key_product_number + if quantity_available is not None: + self.quantity_available = quantity_available + if product_description is not None: + self.product_description = product_description + if detailed_description is not None: + self.detailed_description = detailed_description + if manufacturer_name is not None: + self.manufacturer_name = manufacturer_name + if manufacturer_product_number is not None: + self.manufacturer_product_number = manufacturer_product_number + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if primary_datasheet_url is not None: + self.primary_datasheet_url = primary_datasheet_url + if primary_photo_url is not None: + self.primary_photo_url = primary_photo_url + if product_status is not None: + self.product_status = product_status + if manufacturer_lead_weeks is not None: + self.manufacturer_lead_weeks = manufacturer_lead_weeks + if manufacturer_warehouse_quantity is not None: + self.manufacturer_warehouse_quantity = manufacturer_warehouse_quantity + if rohs_status is not None: + self.rohs_status = rohs_status + if ro_hs_compliant is not None: + self.ro_hs_compliant = ro_hs_compliant + if quantity_on_order is not None: + self.quantity_on_order = quantity_on_order + if standard_pricing is not None: + self.standard_pricing = standard_pricing + if my_pricing is not None: + self.my_pricing = my_pricing + if product_url is not None: + self.product_url = product_url + if market_place is not None: + self.market_place = market_place + if supplier is not None: + self.supplier = supplier + if stock_note is not None: + self.stock_note = stock_note + if package_types is not None: + self.package_types = package_types + + @property + def recommended_quantity(self): + """Gets the recommended_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + + Recommended quantity for product # noqa: E501 + + :return: The recommended_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: int + """ + return self._recommended_quantity + + @recommended_quantity.setter + def recommended_quantity(self, recommended_quantity): + """Sets the recommended_quantity of this PackageTypeByQuantityProduct. + + Recommended quantity for product # noqa: E501 + + :param recommended_quantity: The recommended_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + :type: int + """ + + self._recommended_quantity = recommended_quantity + + @property + def digi_key_product_number(self): + """Gets the digi_key_product_number of this PackageTypeByQuantityProduct. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_product_number of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._digi_key_product_number + + @digi_key_product_number.setter + def digi_key_product_number(self, digi_key_product_number): + """Sets the digi_key_product_number of this PackageTypeByQuantityProduct. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_product_number: The digi_key_product_number of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._digi_key_product_number = digi_key_product_number + + @property + def quantity_available(self): + """Gets the quantity_available of this PackageTypeByQuantityProduct. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this PackageTypeByQuantityProduct. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this PackageTypeByQuantityProduct. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def product_description(self): + """Gets the product_description of this PackageTypeByQuantityProduct. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this PackageTypeByQuantityProduct. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def detailed_description(self): + """Gets the detailed_description of this PackageTypeByQuantityProduct. # noqa: E501 + + Extended catalog description of the product. # noqa: E501 + + :return: The detailed_description of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._detailed_description + + @detailed_description.setter + def detailed_description(self, detailed_description): + """Sets the detailed_description of this PackageTypeByQuantityProduct. + + Extended catalog description of the product. # noqa: E501 + + :param detailed_description: The detailed_description of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._detailed_description = detailed_description + + @property + def manufacturer_name(self): + """Gets the manufacturer_name of this PackageTypeByQuantityProduct. # noqa: E501 + + Manufacturer of the product. # noqa: E501 + + :return: The manufacturer_name of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_name + + @manufacturer_name.setter + def manufacturer_name(self, manufacturer_name): + """Sets the manufacturer_name of this PackageTypeByQuantityProduct. + + Manufacturer of the product. # noqa: E501 + + :param manufacturer_name: The manufacturer_name of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_name = manufacturer_name + + @property + def manufacturer_product_number(self): + """Gets the manufacturer_product_number of this PackageTypeByQuantityProduct. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_product_number of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product_number + + @manufacturer_product_number.setter + def manufacturer_product_number(self, manufacturer_product_number): + """Sets the manufacturer_product_number of this PackageTypeByQuantityProduct. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_product_number: The manufacturer_product_number of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_product_number = manufacturer_product_number + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :return: The minimum_order_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this PackageTypeByQuantityProduct. + + The minimum quantity to order from Digi-Key. # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def primary_datasheet_url(self): + """Gets the primary_datasheet_url of this PackageTypeByQuantityProduct. # noqa: E501 + + The URL to the product's datasheet. # noqa: E501 + + :return: The primary_datasheet_url of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._primary_datasheet_url + + @primary_datasheet_url.setter + def primary_datasheet_url(self, primary_datasheet_url): + """Sets the primary_datasheet_url of this PackageTypeByQuantityProduct. + + The URL to the product's datasheet. # noqa: E501 + + :param primary_datasheet_url: The primary_datasheet_url of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._primary_datasheet_url = primary_datasheet_url + + @property + def primary_photo_url(self): + """Gets the primary_photo_url of this PackageTypeByQuantityProduct. # noqa: E501 + + The URL to the product's image. # noqa: E501 + + :return: The primary_photo_url of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._primary_photo_url + + @primary_photo_url.setter + def primary_photo_url(self, primary_photo_url): + """Sets the primary_photo_url of this PackageTypeByQuantityProduct. + + The URL to the product's image. # noqa: E501 + + :param primary_photo_url: The primary_photo_url of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._primary_photo_url = primary_photo_url + + @property + def product_status(self): + """Gets the product_status of this PackageTypeByQuantityProduct. # noqa: E501 + + Status of the product. Options include: Active, Obsolete, Discontinued at Digi-Key, Last Time Buy, Not For New Designs, Preliminary. For obsolete parts the part will become a non-stocking item when stock is depleted; minimums will apply. Order the quantity available or the quantity available plus a multiple of the minimum order quantity. /// # noqa: E501 + + :return: The product_status of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._product_status + + @product_status.setter + def product_status(self, product_status): + """Sets the product_status of this PackageTypeByQuantityProduct. + + Status of the product. Options include: Active, Obsolete, Discontinued at Digi-Key, Last Time Buy, Not For New Designs, Preliminary. For obsolete parts the part will become a non-stocking item when stock is depleted; minimums will apply. Order the quantity available or the quantity available plus a multiple of the minimum order quantity. /// # noqa: E501 + + :param product_status: The product_status of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._product_status = product_status + + @property + def manufacturer_lead_weeks(self): + """Gets the manufacturer_lead_weeks of this PackageTypeByQuantityProduct. # noqa: E501 + + The number of weeks expected to receive stock from manufacturer. # noqa: E501 + + :return: The manufacturer_lead_weeks of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_lead_weeks + + @manufacturer_lead_weeks.setter + def manufacturer_lead_weeks(self, manufacturer_lead_weeks): + """Sets the manufacturer_lead_weeks of this PackageTypeByQuantityProduct. + + The number of weeks expected to receive stock from manufacturer. # noqa: E501 + + :param manufacturer_lead_weeks: The manufacturer_lead_weeks of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_lead_weeks = manufacturer_lead_weeks + + @property + def manufacturer_warehouse_quantity(self): + """Gets the manufacturer_warehouse_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_warehouse_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: int + """ + return self._manufacturer_warehouse_quantity + + @manufacturer_warehouse_quantity.setter + def manufacturer_warehouse_quantity(self, manufacturer_warehouse_quantity): + """Sets the manufacturer_warehouse_quantity of this PackageTypeByQuantityProduct. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_warehouse_quantity: The manufacturer_warehouse_quantity of this PackageTypeByQuantityProduct. # noqa: E501 + :type: int + """ + + self._manufacturer_warehouse_quantity = manufacturer_warehouse_quantity + + @property + def rohs_status(self): + """Gets the rohs_status of this PackageTypeByQuantityProduct. # noqa: E501 + + RoHS status. Can be RoHS Compliant, RoHS non-compliant, RoHS Compliant By Exemption, Not Applicable, Vendor undefined, Request Inventory Verification, or ROHS3 Compliant. # noqa: E501 + + :return: The rohs_status of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._rohs_status + + @rohs_status.setter + def rohs_status(self, rohs_status): + """Sets the rohs_status of this PackageTypeByQuantityProduct. + + RoHS status. Can be RoHS Compliant, RoHS non-compliant, RoHS Compliant By Exemption, Not Applicable, Vendor undefined, Request Inventory Verification, or ROHS3 Compliant. # noqa: E501 + + :param rohs_status: The rohs_status of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._rohs_status = rohs_status + + @property + def ro_hs_compliant(self): + """Gets the ro_hs_compliant of this PackageTypeByQuantityProduct. # noqa: E501 + + Boolean value for RoHS compliance. # noqa: E501 + + :return: The ro_hs_compliant of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: bool + """ + return self._ro_hs_compliant + + @ro_hs_compliant.setter + def ro_hs_compliant(self, ro_hs_compliant): + """Sets the ro_hs_compliant of this PackageTypeByQuantityProduct. + + Boolean value for RoHS compliance. # noqa: E501 + + :param ro_hs_compliant: The ro_hs_compliant of this PackageTypeByQuantityProduct. # noqa: E501 + :type: bool + """ + + self._ro_hs_compliant = ro_hs_compliant + + @property + def quantity_on_order(self): + """Gets the quantity_on_order of this PackageTypeByQuantityProduct. # noqa: E501 + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :return: The quantity_on_order of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_on_order + + @quantity_on_order.setter + def quantity_on_order(self, quantity_on_order): + """Sets the quantity_on_order of this PackageTypeByQuantityProduct. + + Quantity of this product ordered but not immediately available. # noqa: E501 + + :param quantity_on_order: The quantity_on_order of this PackageTypeByQuantityProduct. # noqa: E501 + :type: int + """ + + self._quantity_on_order = quantity_on_order + + @property + def standard_pricing(self): + """Gets the standard_pricing of this PackageTypeByQuantityProduct. # noqa: E501 + + Standard pricing for the validated locale. # noqa: E501 + + :return: The standard_pricing of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: list[BreakPrice] + """ + return self._standard_pricing + + @standard_pricing.setter + def standard_pricing(self, standard_pricing): + """Sets the standard_pricing of this PackageTypeByQuantityProduct. + + Standard pricing for the validated locale. # noqa: E501 + + :param standard_pricing: The standard_pricing of this PackageTypeByQuantityProduct. # noqa: E501 + :type: list[BreakPrice] + """ + + self._standard_pricing = standard_pricing + + @property + def my_pricing(self): + """Gets the my_pricing of this PackageTypeByQuantityProduct. # noqa: E501 + + My pricing for the validated locale. # noqa: E501 + + :return: The my_pricing of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: list[BreakPrice] + """ + return self._my_pricing + + @my_pricing.setter + def my_pricing(self, my_pricing): + """Sets the my_pricing of this PackageTypeByQuantityProduct. + + My pricing for the validated locale. # noqa: E501 + + :param my_pricing: The my_pricing of this PackageTypeByQuantityProduct. # noqa: E501 + :type: list[BreakPrice] + """ + + self._my_pricing = my_pricing + + @property + def product_url(self): + """Gets the product_url of this PackageTypeByQuantityProduct. # noqa: E501 + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :return: The product_url of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this PackageTypeByQuantityProduct. + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :param product_url: The product_url of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def market_place(self): + """Gets the market_place of this PackageTypeByQuantityProduct. # noqa: E501 + + Is this product a marketplace product # noqa: E501 + + :return: The market_place of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: bool + """ + return self._market_place + + @market_place.setter + def market_place(self, market_place): + """Sets the market_place of this PackageTypeByQuantityProduct. + + Is this product a marketplace product # noqa: E501 + + :param market_place: The market_place of this PackageTypeByQuantityProduct. # noqa: E501 + :type: bool + """ + + self._market_place = market_place + + @property + def supplier(self): + """Gets the supplier of this PackageTypeByQuantityProduct. # noqa: E501 + + Name of product supplier # noqa: E501 + + :return: The supplier of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._supplier + + @supplier.setter + def supplier(self, supplier): + """Sets the supplier of this PackageTypeByQuantityProduct. + + Name of product supplier # noqa: E501 + + :param supplier: The supplier of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._supplier = supplier + + @property + def stock_note(self): + """Gets the stock_note of this PackageTypeByQuantityProduct. # noqa: E501 + + Description of Digi-Key's current stocking status for the product. Possible values include: In Stock, Temporarily Out of Stock, and Limited Supply - Call. # noqa: E501 + + :return: The stock_note of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: str + """ + return self._stock_note + + @stock_note.setter + def stock_note(self, stock_note): + """Sets the stock_note of this PackageTypeByQuantityProduct. + + Description of Digi-Key's current stocking status for the product. Possible values include: In Stock, Temporarily Out of Stock, and Limited Supply - Call. # noqa: E501 + + :param stock_note: The stock_note of this PackageTypeByQuantityProduct. # noqa: E501 + :type: str + """ + + self._stock_note = stock_note + + @property + def package_types(self): + """Gets the package_types of this PackageTypeByQuantityProduct. # noqa: E501 + + + :return: The package_types of this PackageTypeByQuantityProduct. # noqa: E501 + :rtype: list[str] + """ + return self._package_types + + @package_types.setter + def package_types(self, package_types): + """Sets the package_types of this PackageTypeByQuantityProduct. + + + :param package_types: The package_types of this PackageTypeByQuantityProduct. # noqa: E501 + :type: list[str] + """ + + self._package_types = package_types + + 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(PackageTypeByQuantityProduct, 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, PackageTypeByQuantityProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/package_type_by_quantity_response.py b/digikey/v4/productinformation/models/package_type_by_quantity_response.py new file mode 100644 index 0000000..272b2ce --- /dev/null +++ b/digikey/v4/productinformation/models/package_type_by_quantity_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PackageTypeByQuantityResponse(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 = { + 'products': 'list[PackageTypeByQuantityProduct]' + } + + attribute_map = { + 'products': 'Products' + } + + def __init__(self, products=None): # noqa: E501 + """PackageTypeByQuantityResponse - a model defined in Swagger""" # noqa: E501 + self._products = None + self.discriminator = None + if products is not None: + self.products = products + + @property + def products(self): + """Gets the products of this PackageTypeByQuantityResponse. # noqa: E501 + + List of products that matched the PackageTypeByQuantitySearchService request. # noqa: E501 + + :return: The products of this PackageTypeByQuantityResponse. # noqa: E501 + :rtype: list[PackageTypeByQuantityProduct] + """ + return self._products + + @products.setter + def products(self, products): + """Sets the products of this PackageTypeByQuantityResponse. + + List of products that matched the PackageTypeByQuantitySearchService request. # noqa: E501 + + :param products: The products of this PackageTypeByQuantityResponse. # noqa: E501 + :type: list[PackageTypeByQuantityProduct] + """ + + self._products = products + + 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(PackageTypeByQuantityResponse, 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, PackageTypeByQuantityResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/parameter.py b/digikey/v4/productinformation/models/parameter.py new file mode 100644 index 0000000..47c5858 --- /dev/null +++ b/digikey/v4/productinformation/models/parameter.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Parameter(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 = { + 'id': 'int', + 'text': 'str', + 'priority': 'int' + } + + attribute_map = { + 'id': 'Id', + 'text': 'Text', + 'priority': 'Priority' + } + + def __init__(self, id=None, text=None, priority=None): # noqa: E501 + """Parameter - a model defined in Swagger""" # noqa: E501 + self._id = None + self._text = None + self._priority = None + self.discriminator = None + if id is not None: + self.id = id + if text is not None: + self.text = text + if priority is not None: + self.priority = priority + + @property + def id(self): + """Gets the id of this Parameter. # noqa: E501 + + Parameter Id # noqa: E501 + + :return: The id of this Parameter. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Parameter. + + Parameter Id # noqa: E501 + + :param id: The id of this Parameter. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def text(self): + """Gets the text of this Parameter. # noqa: E501 + + Parameter Description # noqa: E501 + + :return: The text of this Parameter. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this Parameter. + + Parameter Description # noqa: E501 + + :param text: The text of this Parameter. # noqa: E501 + :type: str + """ + + self._text = text + + @property + def priority(self): + """Gets the priority of this Parameter. # noqa: E501 + + Parameter priority # noqa: E501 + + :return: The priority of this Parameter. # noqa: E501 + :rtype: int + """ + return self._priority + + @priority.setter + def priority(self, priority): + """Sets the priority of this Parameter. + + Parameter priority # noqa: E501 + + :param priority: The priority of this Parameter. # noqa: E501 + :type: int + """ + + self._priority = priority + + 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(Parameter, 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, Parameter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/parameter_filter_options_response.py b/digikey/v4/productinformation/models/parameter_filter_options_response.py new file mode 100644 index 0000000..0488336 --- /dev/null +++ b/digikey/v4/productinformation/models/parameter_filter_options_response.py @@ -0,0 +1,222 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParameterFilterOptionsResponse(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 = { + 'category': 'BaseFilterV4', + 'parameter_type': 'str', + 'parameter_id': 'int', + 'parameter_name': 'str', + 'filter_values': 'list[FilterValue]' + } + + attribute_map = { + 'category': 'Category', + 'parameter_type': 'ParameterType', + 'parameter_id': 'ParameterId', + 'parameter_name': 'ParameterName', + 'filter_values': 'FilterValues' + } + + def __init__(self, category=None, parameter_type=None, parameter_id=None, parameter_name=None, filter_values=None): # noqa: E501 + """ParameterFilterOptionsResponse - a model defined in Swagger""" # noqa: E501 + self._category = None + self._parameter_type = None + self._parameter_id = None + self._parameter_name = None + self._filter_values = None + self.discriminator = None + if category is not None: + self.category = category + if parameter_type is not None: + self.parameter_type = parameter_type + if parameter_id is not None: + self.parameter_id = parameter_id + if parameter_name is not None: + self.parameter_name = parameter_name + if filter_values is not None: + self.filter_values = filter_values + + @property + def category(self): + """Gets the category of this ParameterFilterOptionsResponse. # noqa: E501 + + + :return: The category of this ParameterFilterOptionsResponse. # noqa: E501 + :rtype: BaseFilterV4 + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this ParameterFilterOptionsResponse. + + + :param category: The category of this ParameterFilterOptionsResponse. # noqa: E501 + :type: BaseFilterV4 + """ + + self._category = category + + @property + def parameter_type(self): + """Gets the parameter_type of this ParameterFilterOptionsResponse. # noqa: E501 + + Parameter Type # noqa: E501 + + :return: The parameter_type of this ParameterFilterOptionsResponse. # noqa: E501 + :rtype: str + """ + return self._parameter_type + + @parameter_type.setter + def parameter_type(self, parameter_type): + """Sets the parameter_type of this ParameterFilterOptionsResponse. + + Parameter Type # noqa: E501 + + :param parameter_type: The parameter_type of this ParameterFilterOptionsResponse. # noqa: E501 + :type: str + """ + + self._parameter_type = parameter_type + + @property + def parameter_id(self): + """Gets the parameter_id of this ParameterFilterOptionsResponse. # noqa: E501 + + Parameter Id # noqa: E501 + + :return: The parameter_id of this ParameterFilterOptionsResponse. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this ParameterFilterOptionsResponse. + + Parameter Id # noqa: E501 + + :param parameter_id: The parameter_id of this ParameterFilterOptionsResponse. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def parameter_name(self): + """Gets the parameter_name of this ParameterFilterOptionsResponse. # noqa: E501 + + Parameter Name # noqa: E501 + + :return: The parameter_name of this ParameterFilterOptionsResponse. # noqa: E501 + :rtype: str + """ + return self._parameter_name + + @parameter_name.setter + def parameter_name(self, parameter_name): + """Sets the parameter_name of this ParameterFilterOptionsResponse. + + Parameter Name # noqa: E501 + + :param parameter_name: The parameter_name of this ParameterFilterOptionsResponse. # noqa: E501 + :type: str + """ + + self._parameter_name = parameter_name + + @property + def filter_values(self): + """Gets the filter_values of this ParameterFilterOptionsResponse. # noqa: E501 + + List of Filter Values for the Parameter # noqa: E501 + + :return: The filter_values of this ParameterFilterOptionsResponse. # noqa: E501 + :rtype: list[FilterValue] + """ + return self._filter_values + + @filter_values.setter + def filter_values(self, filter_values): + """Sets the filter_values of this ParameterFilterOptionsResponse. + + List of Filter Values for the Parameter # noqa: E501 + + :param filter_values: The filter_values of this ParameterFilterOptionsResponse. # noqa: E501 + :type: list[FilterValue] + """ + + self._filter_values = filter_values + + 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(ParameterFilterOptionsResponse, 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, ParameterFilterOptionsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/parameter_filter_request.py b/digikey/v4/productinformation/models/parameter_filter_request.py new file mode 100644 index 0000000..70b44ac --- /dev/null +++ b/digikey/v4/productinformation/models/parameter_filter_request.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParameterFilterRequest(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 = { + 'category_filter': 'FilterId', + 'parameter_filters': 'list[ParametricCategory]' + } + + attribute_map = { + 'category_filter': 'CategoryFilter', + 'parameter_filters': 'ParameterFilters' + } + + def __init__(self, category_filter=None, parameter_filters=None): # noqa: E501 + """ParameterFilterRequest - a model defined in Swagger""" # noqa: E501 + self._category_filter = None + self._parameter_filters = None + self.discriminator = None + if category_filter is not None: + self.category_filter = category_filter + if parameter_filters is not None: + self.parameter_filters = parameter_filters + + @property + def category_filter(self): + """Gets the category_filter of this ParameterFilterRequest. # noqa: E501 + + + :return: The category_filter of this ParameterFilterRequest. # noqa: E501 + :rtype: FilterId + """ + return self._category_filter + + @category_filter.setter + def category_filter(self, category_filter): + """Sets the category_filter of this ParameterFilterRequest. + + + :param category_filter: The category_filter of this ParameterFilterRequest. # noqa: E501 + :type: FilterId + """ + + self._category_filter = category_filter + + @property + def parameter_filters(self): + """Gets the parameter_filters of this ParameterFilterRequest. # noqa: E501 + + The list of search parameters # noqa: E501 + + :return: The parameter_filters of this ParameterFilterRequest. # noqa: E501 + :rtype: list[ParametricCategory] + """ + return self._parameter_filters + + @parameter_filters.setter + def parameter_filters(self, parameter_filters): + """Sets the parameter_filters of this ParameterFilterRequest. + + The list of search parameters # noqa: E501 + + :param parameter_filters: The parameter_filters of this ParameterFilterRequest. # noqa: E501 + :type: list[ParametricCategory] + """ + + self._parameter_filters = parameter_filters + + 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(ParameterFilterRequest, 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, ParameterFilterRequest): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/parameter_value.py b/digikey/v4/productinformation/models/parameter_value.py new file mode 100644 index 0000000..9423ea9 --- /dev/null +++ b/digikey/v4/productinformation/models/parameter_value.py @@ -0,0 +1,230 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParameterValue(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 = { + 'parameter_id': 'int', + 'parameter_text': 'str', + 'parameter_type': 'str', + 'value_id': 'str', + 'value_text': 'str' + } + + attribute_map = { + 'parameter_id': 'ParameterId', + 'parameter_text': 'ParameterText', + 'parameter_type': 'ParameterType', + 'value_id': 'ValueId', + 'value_text': 'ValueText' + } + + def __init__(self, parameter_id=None, parameter_text=None, parameter_type=None, value_id=None, value_text=None): # noqa: E501 + """ParameterValue - a model defined in Swagger""" # noqa: E501 + self._parameter_id = None + self._parameter_text = None + self._parameter_type = None + self._value_id = None + self._value_text = None + self.discriminator = None + if parameter_id is not None: + self.parameter_id = parameter_id + if parameter_text is not None: + self.parameter_text = parameter_text + if parameter_type is not None: + self.parameter_type = parameter_type + if value_id is not None: + self.value_id = value_id + if value_text is not None: + self.value_text = value_text + + @property + def parameter_id(self): + """Gets the parameter_id of this ParameterValue. # noqa: E501 + + Parameter Id # noqa: E501 + + :return: The parameter_id of this ParameterValue. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this ParameterValue. + + Parameter Id # noqa: E501 + + :param parameter_id: The parameter_id of this ParameterValue. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def parameter_text(self): + """Gets the parameter_text of this ParameterValue. # noqa: E501 + + Parameter Text # noqa: E501 + + :return: The parameter_text of this ParameterValue. # noqa: E501 + :rtype: str + """ + return self._parameter_text + + @parameter_text.setter + def parameter_text(self, parameter_text): + """Sets the parameter_text of this ParameterValue. + + Parameter Text # noqa: E501 + + :param parameter_text: The parameter_text of this ParameterValue. # noqa: E501 + :type: str + """ + + self._parameter_text = parameter_text + + @property + def parameter_type(self): + """Gets the parameter_type of this ParameterValue. # noqa: E501 + + Parameter Data Type # noqa: E501 + + :return: The parameter_type of this ParameterValue. # noqa: E501 + :rtype: str + """ + return self._parameter_type + + @parameter_type.setter + def parameter_type(self, parameter_type): + """Sets the parameter_type of this ParameterValue. + + Parameter Data Type # noqa: E501 + + :param parameter_type: The parameter_type of this ParameterValue. # noqa: E501 + :type: str + """ + allowed_values = ["String", "Integer", "Double", "UnitOfMeasure", "CoupledUnitOfMeasure", "RangeUnitOfMeasure"] # noqa: E501 + if parameter_type not in allowed_values: + raise ValueError( + "Invalid value for `parameter_type` ({0}), must be one of {1}" # noqa: E501 + .format(parameter_type, allowed_values) + ) + + self._parameter_type = parameter_type + + @property + def value_id(self): + """Gets the value_id of this ParameterValue. # noqa: E501 + + The Id of the Parameter value # noqa: E501 + + :return: The value_id of this ParameterValue. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this ParameterValue. + + The Id of the Parameter value # noqa: E501 + + :param value_id: The value_id of this ParameterValue. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def value_text(self): + """Gets the value_text of this ParameterValue. # noqa: E501 + + The text of the Parameter value # noqa: E501 + + :return: The value_text of this ParameterValue. # noqa: E501 + :rtype: str + """ + return self._value_text + + @value_text.setter + def value_text(self, value_text): + """Sets the value_text of this ParameterValue. + + The text of the Parameter value # noqa: E501 + + :param value_text: The value_text of this ParameterValue. # noqa: E501 + :type: str + """ + + self._value_text = value_text + + 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(ParameterValue, 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, ParameterValue): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/parametric_category.py b/digikey/v4/productinformation/models/parametric_category.py new file mode 100644 index 0000000..615bb6e --- /dev/null +++ b/digikey/v4/productinformation/models/parametric_category.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ParametricCategory(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 = { + 'parameter_id': 'int', + 'filter_values': 'list[FilterId]' + } + + attribute_map = { + 'parameter_id': 'ParameterId', + 'filter_values': 'FilterValues' + } + + def __init__(self, parameter_id=None, filter_values=None): # noqa: E501 + """ParametricCategory - a model defined in Swagger""" # noqa: E501 + self._parameter_id = None + self._filter_values = None + self.discriminator = None + if parameter_id is not None: + self.parameter_id = parameter_id + if filter_values is not None: + self.filter_values = filter_values + + @property + def parameter_id(self): + """Gets the parameter_id of this ParametricCategory. # noqa: E501 + + Parameter Id # noqa: E501 + + :return: The parameter_id of this ParametricCategory. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this ParametricCategory. + + Parameter Id # noqa: E501 + + :param parameter_id: The parameter_id of this ParametricCategory. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def filter_values(self): + """Gets the filter_values of this ParametricCategory. # noqa: E501 + + List of FilterIdDtos # noqa: E501 + + :return: The filter_values of this ParametricCategory. # noqa: E501 + :rtype: list[FilterId] + """ + return self._filter_values + + @filter_values.setter + def filter_values(self, filter_values): + """Sets the filter_values of this ParametricCategory. + + List of FilterIdDtos # noqa: E501 + + :param filter_values: The filter_values of this ParametricCategory. # noqa: E501 + :type: list[FilterId] + """ + + self._filter_values = filter_values + + 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(ParametricCategory, 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, ParametricCategory): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/parametric_filter.py b/digikey/v4/productinformation/models/parametric_filter.py new file mode 100644 index 0000000..e36c7ee --- /dev/null +++ b/digikey/v4/productinformation/models/parametric_filter.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 ParametricFilter(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 = { + 'parameter_id': 'int', + 'value_id': 'str' + } + + attribute_map = { + 'parameter_id': 'ParameterId', + 'value_id': 'ValueId' + } + + def __init__(self, parameter_id=None, value_id=None): # noqa: E501 + """ParametricFilter - a model defined in Swagger""" # noqa: E501 + + self._parameter_id = None + self._value_id = None + self.discriminator = None + + if parameter_id is not None: + self.parameter_id = parameter_id + if value_id is not None: + self.value_id = value_id + + @property + def parameter_id(self): + """Gets the parameter_id of this ParametricFilter. # noqa: E501 + + The parameter identifier. # noqa: E501 + + :return: The parameter_id of this ParametricFilter. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this ParametricFilter. + + The parameter identifier. # noqa: E501 + + :param parameter_id: The parameter_id of this ParametricFilter. # noqa: E501 + :type: int + """ + if parameter_id is not None and parameter_id > 2147483647: # noqa: E501 + raise ValueError("Invalid value for `parameter_id`, must be a value less than or equal to `2147483647`") # noqa: E501 + if parameter_id is not None and parameter_id < -2147483648: # noqa: E501 + raise ValueError("Invalid value for `parameter_id`, must be a value greater than or equal to `-2147483648`") # noqa: E501 + + self._parameter_id = parameter_id + + @property + def value_id(self): + """Gets the value_id of this ParametricFilter. # noqa: E501 + + The value identifier. # noqa: E501 + + :return: The value_id of this ParametricFilter. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this ParametricFilter. + + The value identifier. # noqa: E501 + + :param value_id: The value_id of this ParametricFilter. # noqa: E501 + :type: str + """ + if value_id is not None and len(value_id) > 100: + raise ValueError("Invalid value for `value_id`, length must be less than or equal to `100`") # noqa: E501 + if value_id is not None and len(value_id) < 1: + raise ValueError("Invalid value for `value_id`, length must be greater than or equal to `1`") # noqa: E501 + + self._value_id = value_id + + 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(ParametricFilter, 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, ParametricFilter): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/pid_vid.py b/digikey/v4/productinformation/models/pid_vid.py new file mode 100644 index 0000000..04c0a48 --- /dev/null +++ b/digikey/v4/productinformation/models/pid_vid.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 PidVid(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 = { + 'parameter_id': 'int', + 'value_id': 'str', + 'parameter': 'str', + 'value': 'str' + } + + attribute_map = { + 'parameter_id': 'ParameterId', + 'value_id': 'ValueId', + 'parameter': 'Parameter', + 'value': 'Value' + } + + def __init__(self, parameter_id=None, value_id=None, parameter=None, value=None): # noqa: E501 + """PidVid - a model defined in Swagger""" # noqa: E501 + + self._parameter_id = None + self._value_id = None + self._parameter = None + self._value = None + self.discriminator = None + + if parameter_id is not None: + self.parameter_id = parameter_id + if value_id is not None: + self.value_id = value_id + if parameter is not None: + self.parameter = parameter + if value is not None: + self.value = value + + @property + def parameter_id(self): + """Gets the parameter_id of this PidVid. # noqa: E501 + + The Id of the parameter. # noqa: E501 + + :return: The parameter_id of this PidVid. # noqa: E501 + :rtype: int + """ + return self._parameter_id + + @parameter_id.setter + def parameter_id(self, parameter_id): + """Sets the parameter_id of this PidVid. + + The Id of the parameter. # noqa: E501 + + :param parameter_id: The parameter_id of this PidVid. # noqa: E501 + :type: int + """ + + self._parameter_id = parameter_id + + @property + def value_id(self): + """Gets the value_id of this PidVid. # noqa: E501 + + The Id of the value. # noqa: E501 + + :return: The value_id of this PidVid. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this PidVid. + + The Id of the value. # noqa: E501 + + :param value_id: The value_id of this PidVid. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def parameter(self): + """Gets the parameter of this PidVid. # noqa: E501 + + The name of the parameter. # noqa: E501 + + :return: The parameter of this PidVid. # noqa: E501 + :rtype: str + """ + return self._parameter + + @parameter.setter + def parameter(self, parameter): + """Sets the parameter of this PidVid. + + The name of the parameter. # noqa: E501 + + :param parameter: The parameter of this PidVid. # noqa: E501 + :type: str + """ + + self._parameter = parameter + + @property + def value(self): + """Gets the value of this PidVid. # noqa: E501 + + The name of the value. # noqa: E501 + + :return: The value of this PidVid. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this PidVid. + + The name of the value. # noqa: E501 + + :param value: The value of this PidVid. # noqa: E501 + :type: str + """ + + self._value = value + + 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(PidVid, 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, PidVid): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/price_break.py b/digikey/v4/productinformation/models/price_break.py new file mode 100644 index 0000000..5aad763 --- /dev/null +++ b/digikey/v4/productinformation/models/price_break.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PriceBreak(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 = { + 'break_quantity': 'int', + 'unit_price': 'float', + 'total_price': 'float' + } + + attribute_map = { + 'break_quantity': 'BreakQuantity', + 'unit_price': 'UnitPrice', + 'total_price': 'TotalPrice' + } + + def __init__(self, break_quantity=None, unit_price=None, total_price=None): # noqa: E501 + """PriceBreak - a model defined in Swagger""" # noqa: E501 + self._break_quantity = None + self._unit_price = None + self._total_price = None + self.discriminator = None + if break_quantity is not None: + self.break_quantity = break_quantity + if unit_price is not None: + self.unit_price = unit_price + if total_price is not None: + self.total_price = total_price + + @property + def break_quantity(self): + """Gets the break_quantity of this PriceBreak. # noqa: E501 + + The quantity at which the price takes effect # noqa: E501 + + :return: The break_quantity of this PriceBreak. # noqa: E501 + :rtype: int + """ + return self._break_quantity + + @break_quantity.setter + def break_quantity(self, break_quantity): + """Sets the break_quantity of this PriceBreak. + + The quantity at which the price takes effect # noqa: E501 + + :param break_quantity: The break_quantity of this PriceBreak. # noqa: E501 + :type: int + """ + + self._break_quantity = break_quantity + + @property + def unit_price(self): + """Gets the unit_price of this PriceBreak. # noqa: E501 + + The unit price for the quantity # noqa: E501 + + :return: The unit_price of this PriceBreak. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this PriceBreak. + + The unit price for the quantity # noqa: E501 + + :param unit_price: The unit_price of this PriceBreak. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def total_price(self): + """Gets the total_price of this PriceBreak. # noqa: E501 + + The total price # noqa: E501 + + :return: The total_price of this PriceBreak. # noqa: E501 + :rtype: float + """ + return self._total_price + + @total_price.setter + def total_price(self, total_price): + """Sets the total_price of this PriceBreak. + + The total price # noqa: E501 + + :param total_price: The total_price of this PriceBreak. # noqa: E501 + :type: float + """ + + self._total_price = total_price + + 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(PriceBreak, 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, PriceBreak): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product.py b/digikey/v4/productinformation/models/product.py new file mode 100644 index 0000000..7b60697 --- /dev/null +++ b/digikey/v4/productinformation/models/product.py @@ -0,0 +1,766 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Product(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 = { + 'description': 'Description', + 'manufacturer': 'Manufacturer', + 'manufacturer_product_number': 'str', + 'unit_price': 'float', + 'product_url': 'str', + 'datasheet_url': 'str', + 'photo_url': 'str', + 'product_variations': 'list[ProductVariation]', + 'quantity_available': 'int', + 'product_status': 'ProductStatusV4', + 'back_order_not_allowed': 'bool', + 'normally_stocking': 'bool', + 'discontinued': 'bool', + 'end_of_life': 'bool', + 'ncnr': 'bool', + 'primary_video_url': 'str', + 'parameters': 'list[ParameterValue]', + 'base_product_number': 'BaseProduct', + 'category': 'CategoryNode', + 'date_last_buy_chance': 'datetime', + 'manufacturer_lead_weeks': 'str', + 'manufacturer_public_quantity': 'int', + 'series': 'Series', + 'shipping_info': 'str', + 'classifications': 'Classifications' + } + + attribute_map = { + 'description': 'Description', + 'manufacturer': 'Manufacturer', + 'manufacturer_product_number': 'ManufacturerProductNumber', + 'unit_price': 'UnitPrice', + 'product_url': 'ProductUrl', + 'datasheet_url': 'DatasheetUrl', + 'photo_url': 'PhotoUrl', + 'product_variations': 'ProductVariations', + 'quantity_available': 'QuantityAvailable', + 'product_status': 'ProductStatus', + 'back_order_not_allowed': 'BackOrderNotAllowed', + 'normally_stocking': 'NormallyStocking', + 'discontinued': 'Discontinued', + 'end_of_life': 'EndOfLife', + 'ncnr': 'Ncnr', + 'primary_video_url': 'PrimaryVideoUrl', + 'parameters': 'Parameters', + 'base_product_number': 'BaseProductNumber', + 'category': 'Category', + 'date_last_buy_chance': 'DateLastBuyChance', + 'manufacturer_lead_weeks': 'ManufacturerLeadWeeks', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'series': 'Series', + 'shipping_info': 'ShippingInfo', + 'classifications': 'Classifications' + } + + def __init__(self, description=None, manufacturer=None, manufacturer_product_number=None, unit_price=None, product_url=None, datasheet_url=None, photo_url=None, product_variations=None, quantity_available=None, product_status=None, back_order_not_allowed=None, normally_stocking=None, discontinued=None, end_of_life=None, ncnr=None, primary_video_url=None, parameters=None, base_product_number=None, category=None, date_last_buy_chance=None, manufacturer_lead_weeks=None, manufacturer_public_quantity=None, series=None, shipping_info=None, classifications=None): # noqa: E501 + """Product - a model defined in Swagger""" # noqa: E501 + self._description = None + self._manufacturer = None + self._manufacturer_product_number = None + self._unit_price = None + self._product_url = None + self._datasheet_url = None + self._photo_url = None + self._product_variations = None + self._quantity_available = None + self._product_status = None + self._back_order_not_allowed = None + self._normally_stocking = None + self._discontinued = None + self._end_of_life = None + self._ncnr = None + self._primary_video_url = None + self._parameters = None + self._base_product_number = None + self._category = None + self._date_last_buy_chance = None + self._manufacturer_lead_weeks = None + self._manufacturer_public_quantity = None + self._series = None + self._shipping_info = None + self._classifications = None + self.discriminator = None + if description is not None: + self.description = description + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_product_number is not None: + self.manufacturer_product_number = manufacturer_product_number + if unit_price is not None: + self.unit_price = unit_price + if product_url is not None: + self.product_url = product_url + if datasheet_url is not None: + self.datasheet_url = datasheet_url + if photo_url is not None: + self.photo_url = photo_url + if product_variations is not None: + self.product_variations = product_variations + if quantity_available is not None: + self.quantity_available = quantity_available + if product_status is not None: + self.product_status = product_status + if back_order_not_allowed is not None: + self.back_order_not_allowed = back_order_not_allowed + if normally_stocking is not None: + self.normally_stocking = normally_stocking + if discontinued is not None: + self.discontinued = discontinued + if end_of_life is not None: + self.end_of_life = end_of_life + if ncnr is not None: + self.ncnr = ncnr + if primary_video_url is not None: + self.primary_video_url = primary_video_url + if parameters is not None: + self.parameters = parameters + if base_product_number is not None: + self.base_product_number = base_product_number + if category is not None: + self.category = category + if date_last_buy_chance is not None: + self.date_last_buy_chance = date_last_buy_chance + if manufacturer_lead_weeks is not None: + self.manufacturer_lead_weeks = manufacturer_lead_weeks + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if series is not None: + self.series = series + if shipping_info is not None: + self.shipping_info = shipping_info + if classifications is not None: + self.classifications = classifications + + @property + def description(self): + """Gets the description of this Product. # noqa: E501 + + + :return: The description of this Product. # noqa: E501 + :rtype: Description + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this Product. + + + :param description: The description of this Product. # noqa: E501 + :type: Description + """ + + self._description = description + + @property + def manufacturer(self): + """Gets the manufacturer of this Product. # noqa: E501 + + + :return: The manufacturer of this Product. # noqa: E501 + :rtype: Manufacturer + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this Product. + + + :param manufacturer: The manufacturer of this Product. # noqa: E501 + :type: Manufacturer + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_product_number(self): + """Gets the manufacturer_product_number of this Product. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_product_number of this Product. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product_number + + @manufacturer_product_number.setter + def manufacturer_product_number(self, manufacturer_product_number): + """Sets the manufacturer_product_number of this Product. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_product_number: The manufacturer_product_number of this Product. # noqa: E501 + :type: str + """ + + self._manufacturer_product_number = manufacturer_product_number + + @property + def unit_price(self): + """Gets the unit_price of this Product. # noqa: E501 + + The price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this Product. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this Product. + + The price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this Product. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def product_url(self): + """Gets the product_url of this Product. # noqa: E501 + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :return: The product_url of this Product. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this Product. + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :param product_url: The product_url of this Product. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def datasheet_url(self): + """Gets the datasheet_url of this Product. # noqa: E501 + + The URL to the product's datasheet. # noqa: E501 + + :return: The datasheet_url of this Product. # noqa: E501 + :rtype: str + """ + return self._datasheet_url + + @datasheet_url.setter + def datasheet_url(self, datasheet_url): + """Sets the datasheet_url of this Product. + + The URL to the product's datasheet. # noqa: E501 + + :param datasheet_url: The datasheet_url of this Product. # noqa: E501 + :type: str + """ + + self._datasheet_url = datasheet_url + + @property + def photo_url(self): + """Gets the photo_url of this Product. # noqa: E501 + + The URL to the product's image. # noqa: E501 + + :return: The photo_url of this Product. # noqa: E501 + :rtype: str + """ + return self._photo_url + + @photo_url.setter + def photo_url(self, photo_url): + """Sets the photo_url of this Product. + + The URL to the product's image. # noqa: E501 + + :param photo_url: The photo_url of this Product. # noqa: E501 + :type: str + """ + + self._photo_url = photo_url + + @property + def product_variations(self): + """Gets the product_variations of this Product. # noqa: E501 + + + :return: The product_variations of this Product. # noqa: E501 + :rtype: list[ProductVariation] + """ + return self._product_variations + + @product_variations.setter + def product_variations(self, product_variations): + """Sets the product_variations of this Product. + + + :param product_variations: The product_variations of this Product. # noqa: E501 + :type: list[ProductVariation] + """ + + self._product_variations = product_variations + + @property + def quantity_available(self): + """Gets the quantity_available of this Product. # noqa: E501 + + The sum of the quantity for all package types that are found in ProductVariations. # noqa: E501 + + :return: The quantity_available of this Product. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this Product. + + The sum of the quantity for all package types that are found in ProductVariations. # noqa: E501 + + :param quantity_available: The quantity_available of this Product. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def product_status(self): + """Gets the product_status of this Product. # noqa: E501 + + + :return: The product_status of this Product. # noqa: E501 + :rtype: ProductStatusV4 + """ + return self._product_status + + @product_status.setter + def product_status(self, product_status): + """Sets the product_status of this Product. + + + :param product_status: The product_status of this Product. # noqa: E501 + :type: ProductStatusV4 + """ + + self._product_status = product_status + + @property + def back_order_not_allowed(self): + """Gets the back_order_not_allowed of this Product. # noqa: E501 + + True if back order is not allowed for this product # noqa: E501 + + :return: The back_order_not_allowed of this Product. # noqa: E501 + :rtype: bool + """ + return self._back_order_not_allowed + + @back_order_not_allowed.setter + def back_order_not_allowed(self, back_order_not_allowed): + """Sets the back_order_not_allowed of this Product. + + True if back order is not allowed for this product # noqa: E501 + + :param back_order_not_allowed: The back_order_not_allowed of this Product. # noqa: E501 + :type: bool + """ + + self._back_order_not_allowed = back_order_not_allowed + + @property + def normally_stocking(self): + """Gets the normally_stocking of this Product. # noqa: E501 + + Indicates if a product is normally stocked. # noqa: E501 + + :return: The normally_stocking of this Product. # noqa: E501 + :rtype: bool + """ + return self._normally_stocking + + @normally_stocking.setter + def normally_stocking(self, normally_stocking): + """Sets the normally_stocking of this Product. + + Indicates if a product is normally stocked. # noqa: E501 + + :param normally_stocking: The normally_stocking of this Product. # noqa: E501 + :type: bool + """ + + self._normally_stocking = normally_stocking + + @property + def discontinued(self): + """Gets the discontinued of this Product. # noqa: E501 + + This product is no longer sold at Digi-Key and will no longer be stocked. # noqa: E501 + + :return: The discontinued of this Product. # noqa: E501 + :rtype: bool + """ + return self._discontinued + + @discontinued.setter + def discontinued(self, discontinued): + """Sets the discontinued of this Product. + + This product is no longer sold at Digi-Key and will no longer be stocked. # noqa: E501 + + :param discontinued: The discontinued of this Product. # noqa: E501 + :type: bool + """ + + self._discontinued = discontinued + + @property + def end_of_life(self): + """Gets the end_of_life of this Product. # noqa: E501 + + This product is no longer manufactured and will no longer be stocked once stock is depleted. # noqa: E501 + + :return: The end_of_life of this Product. # noqa: E501 + :rtype: bool + """ + return self._end_of_life + + @end_of_life.setter + def end_of_life(self, end_of_life): + """Sets the end_of_life of this Product. + + This product is no longer manufactured and will no longer be stocked once stock is depleted. # noqa: E501 + + :param end_of_life: The end_of_life of this Product. # noqa: E501 + :type: bool + """ + + self._end_of_life = end_of_life + + @property + def ncnr(self): + """Gets the ncnr of this Product. # noqa: E501 + + Is product non-cancellable and non-returnable # noqa: E501 + + :return: The ncnr of this Product. # noqa: E501 + :rtype: bool + """ + return self._ncnr + + @ncnr.setter + def ncnr(self, ncnr): + """Sets the ncnr of this Product. + + Is product non-cancellable and non-returnable # noqa: E501 + + :param ncnr: The ncnr of this Product. # noqa: E501 + :type: bool + """ + + self._ncnr = ncnr + + @property + def primary_video_url(self): + """Gets the primary_video_url of this Product. # noqa: E501 + + The URL to the product's video # noqa: E501 + + :return: The primary_video_url of this Product. # noqa: E501 + :rtype: str + """ + return self._primary_video_url + + @primary_video_url.setter + def primary_video_url(self, primary_video_url): + """Sets the primary_video_url of this Product. + + The URL to the product's video # noqa: E501 + + :param primary_video_url: The primary_video_url of this Product. # noqa: E501 + :type: str + """ + + self._primary_video_url = primary_video_url + + @property + def parameters(self): + """Gets the parameters of this Product. # noqa: E501 + + + :return: The parameters of this Product. # noqa: E501 + :rtype: list[ParameterValue] + """ + return self._parameters + + @parameters.setter + def parameters(self, parameters): + """Sets the parameters of this Product. + + + :param parameters: The parameters of this Product. # noqa: E501 + :type: list[ParameterValue] + """ + + self._parameters = parameters + + @property + def base_product_number(self): + """Gets the base_product_number of this Product. # noqa: E501 + + + :return: The base_product_number of this Product. # noqa: E501 + :rtype: BaseProduct + """ + return self._base_product_number + + @base_product_number.setter + def base_product_number(self, base_product_number): + """Sets the base_product_number of this Product. + + + :param base_product_number: The base_product_number of this Product. # noqa: E501 + :type: BaseProduct + """ + + self._base_product_number = base_product_number + + @property + def category(self): + """Gets the category of this Product. # noqa: E501 + + + :return: The category of this Product. # noqa: E501 + :rtype: CategoryNode + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this Product. + + + :param category: The category of this Product. # noqa: E501 + :type: CategoryNode + """ + + self._category = category + + @property + def date_last_buy_chance(self): + """Gets the date_last_buy_chance of this Product. # noqa: E501 + + Last date that the product will be available for purchase. Date is in ISO 8601. # noqa: E501 + + :return: The date_last_buy_chance of this Product. # noqa: E501 + :rtype: datetime + """ + return self._date_last_buy_chance + + @date_last_buy_chance.setter + def date_last_buy_chance(self, date_last_buy_chance): + """Sets the date_last_buy_chance of this Product. + + Last date that the product will be available for purchase. Date is in ISO 8601. # noqa: E501 + + :param date_last_buy_chance: The date_last_buy_chance of this Product. # noqa: E501 + :type: datetime + """ + + self._date_last_buy_chance = date_last_buy_chance + + @property + def manufacturer_lead_weeks(self): + """Gets the manufacturer_lead_weeks of this Product. # noqa: E501 + + The number of weeks expected to receive stock from manufacturer. # noqa: E501 + + :return: The manufacturer_lead_weeks of this Product. # noqa: E501 + :rtype: str + """ + return self._manufacturer_lead_weeks + + @manufacturer_lead_weeks.setter + def manufacturer_lead_weeks(self, manufacturer_lead_weeks): + """Sets the manufacturer_lead_weeks of this Product. + + The number of weeks expected to receive stock from manufacturer. # noqa: E501 + + :param manufacturer_lead_weeks: The manufacturer_lead_weeks of this Product. # noqa: E501 + :type: str + """ + + self._manufacturer_lead_weeks = manufacturer_lead_weeks + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this Product. # noqa: E501 + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this Product. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this Product. + + Quantity of this product available to order from manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this Product. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def series(self): + """Gets the series of this Product. # noqa: E501 + + + :return: The series of this Product. # noqa: E501 + :rtype: Series + """ + return self._series + + @series.setter + def series(self, series): + """Sets the series of this Product. + + + :param series: The series of this Product. # noqa: E501 + :type: Series + """ + + self._series = series + + @property + def shipping_info(self): + """Gets the shipping_info of this Product. # noqa: E501 + + Additional shipping information - if available # noqa: E501 + + :return: The shipping_info of this Product. # noqa: E501 + :rtype: str + """ + return self._shipping_info + + @shipping_info.setter + def shipping_info(self, shipping_info): + """Sets the shipping_info of this Product. + + Additional shipping information - if available # noqa: E501 + + :param shipping_info: The shipping_info of this Product. # noqa: E501 + :type: str + """ + + self._shipping_info = shipping_info + + @property + def classifications(self): + """Gets the classifications of this Product. # noqa: E501 + + + :return: The classifications of this Product. # noqa: E501 + :rtype: Classifications + """ + return self._classifications + + @classifications.setter + def classifications(self, classifications): + """Sets the classifications of this Product. + + + :param classifications: The classifications of this Product. # noqa: E501 + :type: Classifications + """ + + self._classifications = classifications + + 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(Product, 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, Product): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_associations.py b/digikey/v4/productinformation/models/product_associations.py new file mode 100644 index 0000000..2298389 --- /dev/null +++ b/digikey/v4/productinformation/models/product_associations.py @@ -0,0 +1,196 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductAssociations(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 = { + 'kits': 'list[ProductSummary]', + 'mating_products': 'list[ProductSummary]', + 'associated_products': 'list[ProductSummary]', + 'for_use_with_products': 'list[ProductSummary]' + } + + attribute_map = { + 'kits': 'Kits', + 'mating_products': 'MatingProducts', + 'associated_products': 'AssociatedProducts', + 'for_use_with_products': 'ForUseWithProducts' + } + + def __init__(self, kits=None, mating_products=None, associated_products=None, for_use_with_products=None): # noqa: E501 + """ProductAssociations - a model defined in Swagger""" # noqa: E501 + self._kits = None + self._mating_products = None + self._associated_products = None + self._for_use_with_products = None + self.discriminator = None + if kits is not None: + self.kits = kits + if mating_products is not None: + self.mating_products = mating_products + if associated_products is not None: + self.associated_products = associated_products + if for_use_with_products is not None: + self.for_use_with_products = for_use_with_products + + @property + def kits(self): + """Gets the kits of this ProductAssociations. # noqa: E501 + + Kits that this product is contained in. # noqa: E501 + + :return: The kits of this ProductAssociations. # noqa: E501 + :rtype: list[ProductSummary] + """ + return self._kits + + @kits.setter + def kits(self, kits): + """Sets the kits of this ProductAssociations. + + Kits that this product is contained in. # noqa: E501 + + :param kits: The kits of this ProductAssociations. # noqa: E501 + :type: list[ProductSummary] + """ + + self._kits = kits + + @property + def mating_products(self): + """Gets the mating_products of this ProductAssociations. # noqa: E501 + + An association of same manufacturer products that mate with each other. # noqa: E501 + + :return: The mating_products of this ProductAssociations. # noqa: E501 + :rtype: list[ProductSummary] + """ + return self._mating_products + + @mating_products.setter + def mating_products(self, mating_products): + """Sets the mating_products of this ProductAssociations. + + An association of same manufacturer products that mate with each other. # noqa: E501 + + :param mating_products: The mating_products of this ProductAssociations. # noqa: E501 + :type: list[ProductSummary] + """ + + self._mating_products = mating_products + + @property + def associated_products(self): + """Gets the associated_products of this ProductAssociations. # noqa: E501 + + Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. # noqa: E501 + + :return: The associated_products of this ProductAssociations. # noqa: E501 + :rtype: list[ProductSummary] + """ + return self._associated_products + + @associated_products.setter + def associated_products(self, associated_products): + """Sets the associated_products of this ProductAssociations. + + Products that are directly correlated to complete the intended function of the product. These products may be either same manufacturer or differ. # noqa: E501 + + :param associated_products: The associated_products of this ProductAssociations. # noqa: E501 + :type: list[ProductSummary] + """ + + self._associated_products = associated_products + + @property + def for_use_with_products(self): + """Gets the for_use_with_products of this ProductAssociations. # noqa: E501 + + Products that are directly correlated to complete the intended function of th product. These products may be either same manufacturer or differ. # noqa: E501 + + :return: The for_use_with_products of this ProductAssociations. # noqa: E501 + :rtype: list[ProductSummary] + """ + return self._for_use_with_products + + @for_use_with_products.setter + def for_use_with_products(self, for_use_with_products): + """Sets the for_use_with_products of this ProductAssociations. + + Products that are directly correlated to complete the intended function of th product. These products may be either same manufacturer or differ. # noqa: E501 + + :param for_use_with_products: The for_use_with_products of this ProductAssociations. # noqa: E501 + :type: list[ProductSummary] + """ + + self._for_use_with_products = for_use_with_products + + 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(ProductAssociations, 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, ProductAssociations): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_associations_response.py b/digikey/v4/productinformation/models/product_associations_response.py new file mode 100644 index 0000000..d35754b --- /dev/null +++ b/digikey/v4/productinformation/models/product_associations_response.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductAssociationsResponse(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 = { + 'product_associations': 'ProductAssociations', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'product_associations': 'ProductAssociations', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, product_associations=None, search_locale_used=None): # noqa: E501 + """ProductAssociationsResponse - a model defined in Swagger""" # noqa: E501 + self._product_associations = None + self._search_locale_used = None + self.discriminator = None + if product_associations is not None: + self.product_associations = product_associations + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def product_associations(self): + """Gets the product_associations of this ProductAssociationsResponse. # noqa: E501 + + + :return: The product_associations of this ProductAssociationsResponse. # noqa: E501 + :rtype: ProductAssociations + """ + return self._product_associations + + @product_associations.setter + def product_associations(self, product_associations): + """Sets the product_associations of this ProductAssociationsResponse. + + + :param product_associations: The product_associations of this ProductAssociationsResponse. # noqa: E501 + :type: ProductAssociations + """ + + self._product_associations = product_associations + + @property + def search_locale_used(self): + """Gets the search_locale_used of this ProductAssociationsResponse. # noqa: E501 + + + :return: The search_locale_used of this ProductAssociationsResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this ProductAssociationsResponse. + + + :param search_locale_used: The search_locale_used of this ProductAssociationsResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(ProductAssociationsResponse, 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, ProductAssociationsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_details.py b/digikey/v4/productinformation/models/product_details.py new file mode 100644 index 0000000..4c21a27 --- /dev/null +++ b/digikey/v4/productinformation/models/product_details.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductDetails(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 = { + 'search_locale_used': 'IsoSearchLocale', + 'product': 'Product' + } + + attribute_map = { + 'search_locale_used': 'SearchLocaleUsed', + 'product': 'Product' + } + + def __init__(self, search_locale_used=None, product=None): # noqa: E501 + """ProductDetails - a model defined in Swagger""" # noqa: E501 + self._search_locale_used = None + self._product = None + self.discriminator = None + if search_locale_used is not None: + self.search_locale_used = search_locale_used + if product is not None: + self.product = product + + @property + def search_locale_used(self): + """Gets the search_locale_used of this ProductDetails. # noqa: E501 + + + :return: The search_locale_used of this ProductDetails. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this ProductDetails. + + + :param search_locale_used: The search_locale_used of this ProductDetails. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + @property + def product(self): + """Gets the product of this ProductDetails. # noqa: E501 + + + :return: The product of this ProductDetails. # noqa: E501 + :rtype: Product + """ + return self._product + + @product.setter + def product(self, product): + """Sets the product of this ProductDetails. + + + :param product: The product of this ProductDetails. # noqa: E501 + :type: Product + """ + + self._product = product + + 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(ProductDetails, 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, ProductDetails): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_details_response.py b/digikey/v4/productinformation/models/product_details_response.py new file mode 100644 index 0000000..26022b0 --- /dev/null +++ b/digikey/v4/productinformation/models/product_details_response.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 ProductDetailsResponse(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 = { + 'product_details': 'list[ProductDetails]' + } + + attribute_map = { + 'product_details': 'ProductDetails' + } + + def __init__(self, product_details=None): # noqa: E501 + """ProductDetailsResponse - a model defined in Swagger""" # noqa: E501 + + self._product_details = None + self.discriminator = None + + if product_details is not None: + self.product_details = product_details + + @property + def product_details(self): + """Gets the product_details of this ProductDetailsResponse. # noqa: E501 + + List of ProductDetails # noqa: E501 + + :return: The product_details of this ProductDetailsResponse. # noqa: E501 + :rtype: list[ProductDetails] + """ + return self._product_details + + @product_details.setter + def product_details(self, product_details): + """Sets the product_details of this ProductDetailsResponse. + + List of ProductDetails # noqa: E501 + + :param product_details: The product_details of this ProductDetailsResponse. # noqa: E501 + :type: list[ProductDetails] + """ + + self._product_details = product_details + + 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(ProductDetailsResponse, 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, ProductDetailsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_pricing.py b/digikey/v4/productinformation/models/product_pricing.py new file mode 100644 index 0000000..a162c90 --- /dev/null +++ b/digikey/v4/productinformation/models/product_pricing.py @@ -0,0 +1,668 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductPricing(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 = { + 'manufacturer_product_number': 'str', + 'manufacturer': 'Manufacturer', + 'description': 'Description', + 'quantity_available': 'int', + 'product_url': 'str', + 'is_discontinued': 'bool', + 'normally_stocking': 'bool', + 'is_obsolete': 'bool', + 'manufacturer_lead_weeks': 'str', + 'manufacturer_public_quantity': 'int', + 'standard_package': 'int', + 'export_control_class_number': 'str', + 'htsus_code': 'str', + 'moisture_sensitivity_level': 'str', + 'is_bo_not_allowed': 'bool', + 'is_ncnr': 'bool', + 'categories': 'list[CategoryType]', + 'contains_lithium': 'bool', + 'contains_mercury': 'bool', + 'is_end_of_life': 'bool', + 'product_variations': 'list[ProductPricingVariation]' + } + + attribute_map = { + 'manufacturer_product_number': 'ManufacturerProductNumber', + 'manufacturer': 'Manufacturer', + 'description': 'Description', + 'quantity_available': 'QuantityAvailable', + 'product_url': 'ProductUrl', + 'is_discontinued': 'IsDiscontinued', + 'normally_stocking': 'NormallyStocking', + 'is_obsolete': 'IsObsolete', + 'manufacturer_lead_weeks': 'ManufacturerLeadWeeks', + 'manufacturer_public_quantity': 'ManufacturerPublicQuantity', + 'standard_package': 'StandardPackage', + 'export_control_class_number': 'ExportControlClassNumber', + 'htsus_code': 'HtsusCode', + 'moisture_sensitivity_level': 'MoistureSensitivityLevel', + 'is_bo_not_allowed': 'IsBoNotAllowed', + 'is_ncnr': 'IsNcnr', + 'categories': 'Categories', + 'contains_lithium': 'ContainsLithium', + 'contains_mercury': 'ContainsMercury', + 'is_end_of_life': 'IsEndOfLife', + 'product_variations': 'ProductVariations' + } + + def __init__(self, manufacturer_product_number=None, manufacturer=None, description=None, quantity_available=None, product_url=None, is_discontinued=None, normally_stocking=None, is_obsolete=None, manufacturer_lead_weeks=None, manufacturer_public_quantity=None, standard_package=None, export_control_class_number=None, htsus_code=None, moisture_sensitivity_level=None, is_bo_not_allowed=None, is_ncnr=None, categories=None, contains_lithium=None, contains_mercury=None, is_end_of_life=None, product_variations=None): # noqa: E501 + """ProductPricing - a model defined in Swagger""" # noqa: E501 + self._manufacturer_product_number = None + self._manufacturer = None + self._description = None + self._quantity_available = None + self._product_url = None + self._is_discontinued = None + self._normally_stocking = None + self._is_obsolete = None + self._manufacturer_lead_weeks = None + self._manufacturer_public_quantity = None + self._standard_package = None + self._export_control_class_number = None + self._htsus_code = None + self._moisture_sensitivity_level = None + self._is_bo_not_allowed = None + self._is_ncnr = None + self._categories = None + self._contains_lithium = None + self._contains_mercury = None + self._is_end_of_life = None + self._product_variations = None + self.discriminator = None + if manufacturer_product_number is not None: + self.manufacturer_product_number = manufacturer_product_number + if manufacturer is not None: + self.manufacturer = manufacturer + if description is not None: + self.description = description + if quantity_available is not None: + self.quantity_available = quantity_available + if product_url is not None: + self.product_url = product_url + if is_discontinued is not None: + self.is_discontinued = is_discontinued + if normally_stocking is not None: + self.normally_stocking = normally_stocking + if is_obsolete is not None: + self.is_obsolete = is_obsolete + if manufacturer_lead_weeks is not None: + self.manufacturer_lead_weeks = manufacturer_lead_weeks + if manufacturer_public_quantity is not None: + self.manufacturer_public_quantity = manufacturer_public_quantity + if standard_package is not None: + self.standard_package = standard_package + if export_control_class_number is not None: + self.export_control_class_number = export_control_class_number + if htsus_code is not None: + self.htsus_code = htsus_code + if moisture_sensitivity_level is not None: + self.moisture_sensitivity_level = moisture_sensitivity_level + if is_bo_not_allowed is not None: + self.is_bo_not_allowed = is_bo_not_allowed + if is_ncnr is not None: + self.is_ncnr = is_ncnr + if categories is not None: + self.categories = categories + if contains_lithium is not None: + self.contains_lithium = contains_lithium + if contains_mercury is not None: + self.contains_mercury = contains_mercury + if is_end_of_life is not None: + self.is_end_of_life = is_end_of_life + if product_variations is not None: + self.product_variations = product_variations + + @property + def manufacturer_product_number(self): + """Gets the manufacturer_product_number of this ProductPricing. # noqa: E501 + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :return: The manufacturer_product_number of this ProductPricing. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product_number + + @manufacturer_product_number.setter + def manufacturer_product_number(self, manufacturer_product_number): + """Sets the manufacturer_product_number of this ProductPricing. + + The manufacturer part number. Note that some manufacturer part numbers may be used by multiple manufacturers for different parts. # noqa: E501 + + :param manufacturer_product_number: The manufacturer_product_number of this ProductPricing. # noqa: E501 + :type: str + """ + + self._manufacturer_product_number = manufacturer_product_number + + @property + def manufacturer(self): + """Gets the manufacturer of this ProductPricing. # noqa: E501 + + + :return: The manufacturer of this ProductPricing. # noqa: E501 + :rtype: Manufacturer + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this ProductPricing. + + + :param manufacturer: The manufacturer of this ProductPricing. # noqa: E501 + :type: Manufacturer + """ + + self._manufacturer = manufacturer + + @property + def description(self): + """Gets the description of this ProductPricing. # noqa: E501 + + + :return: The description of this ProductPricing. # noqa: E501 + :rtype: Description + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ProductPricing. + + + :param description: The description of this ProductPricing. # noqa: E501 + :type: Description + """ + + self._description = description + + @property + def quantity_available(self): + """Gets the quantity_available of this ProductPricing. # noqa: E501 + + In-stock quantity that is available for immediate shipping. # noqa: E501 + + :return: The quantity_available of this ProductPricing. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this ProductPricing. + + In-stock quantity that is available for immediate shipping. # noqa: E501 + + :param quantity_available: The quantity_available of this ProductPricing. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def product_url(self): + """Gets the product_url of this ProductPricing. # noqa: E501 + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :return: The product_url of this ProductPricing. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this ProductPricing. + + Full URL of the Digi-Key catalog page to purchase the product. This is based on your provided Locale values. # noqa: E501 + + :param product_url: The product_url of this ProductPricing. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def is_discontinued(self): + """Gets the is_discontinued of this ProductPricing. # noqa: E501 + + This product is no longer sold at DigiKey and will no longer be restocked. # noqa: E501 + + :return: The is_discontinued of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._is_discontinued + + @is_discontinued.setter + def is_discontinued(self, is_discontinued): + """Sets the is_discontinued of this ProductPricing. + + This product is no longer sold at DigiKey and will no longer be restocked. # noqa: E501 + + :param is_discontinued: The is_discontinued of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._is_discontinued = is_discontinued + + @property + def normally_stocking(self): + """Gets the normally_stocking of this ProductPricing. # noqa: E501 + + Indicates if a product is normally stocked. # noqa: E501 + + :return: The normally_stocking of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._normally_stocking + + @normally_stocking.setter + def normally_stocking(self, normally_stocking): + """Sets the normally_stocking of this ProductPricing. + + Indicates if a product is normally stocked. # noqa: E501 + + :param normally_stocking: The normally_stocking of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._normally_stocking = normally_stocking + + @property + def is_obsolete(self): + """Gets the is_obsolete of this ProductPricing. # noqa: E501 + + Product is obsolete # noqa: E501 + + :return: The is_obsolete of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._is_obsolete + + @is_obsolete.setter + def is_obsolete(self, is_obsolete): + """Sets the is_obsolete of this ProductPricing. + + Product is obsolete # noqa: E501 + + :param is_obsolete: The is_obsolete of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._is_obsolete = is_obsolete + + @property + def manufacturer_lead_weeks(self): + """Gets the manufacturer_lead_weeks of this ProductPricing. # noqa: E501 + + The number of weeks expected to receive stock from manufacturer to DigiKey. # noqa: E501 + + :return: The manufacturer_lead_weeks of this ProductPricing. # noqa: E501 + :rtype: str + """ + return self._manufacturer_lead_weeks + + @manufacturer_lead_weeks.setter + def manufacturer_lead_weeks(self, manufacturer_lead_weeks): + """Sets the manufacturer_lead_weeks of this ProductPricing. + + The number of weeks expected to receive stock from manufacturer to DigiKey. # noqa: E501 + + :param manufacturer_lead_weeks: The manufacturer_lead_weeks of this ProductPricing. # noqa: E501 + :type: str + """ + + self._manufacturer_lead_weeks = manufacturer_lead_weeks + + @property + def manufacturer_public_quantity(self): + """Gets the manufacturer_public_quantity of this ProductPricing. # noqa: E501 + + The manufacturer’s factory stock that can be ordered and will ship once DigiKey receives it from the manufacturer. # noqa: E501 + + :return: The manufacturer_public_quantity of this ProductPricing. # noqa: E501 + :rtype: int + """ + return self._manufacturer_public_quantity + + @manufacturer_public_quantity.setter + def manufacturer_public_quantity(self, manufacturer_public_quantity): + """Sets the manufacturer_public_quantity of this ProductPricing. + + The manufacturer’s factory stock that can be ordered and will ship once DigiKey receives it from the manufacturer. # noqa: E501 + + :param manufacturer_public_quantity: The manufacturer_public_quantity of this ProductPricing. # noqa: E501 + :type: int + """ + + self._manufacturer_public_quantity = manufacturer_public_quantity + + @property + def standard_package(self): + """Gets the standard_package of this ProductPricing. # noqa: E501 + + The number of products in the manufacturer's standard package. # noqa: E501 + + :return: The standard_package of this ProductPricing. # noqa: E501 + :rtype: int + """ + return self._standard_package + + @standard_package.setter + def standard_package(self, standard_package): + """Sets the standard_package of this ProductPricing. + + The number of products in the manufacturer's standard package. # noqa: E501 + + :param standard_package: The standard_package of this ProductPricing. # noqa: E501 + :type: int + """ + + self._standard_package = standard_package + + @property + def export_control_class_number(self): + """Gets the export_control_class_number of this ProductPricing. # noqa: E501 + + Export control class number. See documentation from the U.S. Department of Commerce. # noqa: E501 + + :return: The export_control_class_number of this ProductPricing. # noqa: E501 + :rtype: str + """ + return self._export_control_class_number + + @export_control_class_number.setter + def export_control_class_number(self, export_control_class_number): + """Sets the export_control_class_number of this ProductPricing. + + Export control class number. See documentation from the U.S. Department of Commerce. # noqa: E501 + + :param export_control_class_number: The export_control_class_number of this ProductPricing. # noqa: E501 + :type: str + """ + + self._export_control_class_number = export_control_class_number + + @property + def htsus_code(self): + """Gets the htsus_code of this ProductPricing. # noqa: E501 + + Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. # noqa: E501 + + :return: The htsus_code of this ProductPricing. # noqa: E501 + :rtype: str + """ + return self._htsus_code + + @htsus_code.setter + def htsus_code(self, htsus_code): + """Sets the htsus_code of this ProductPricing. + + Harmonized Tariff Schedule of the United States. See documentation from the U.S. International Trade Commission. # noqa: E501 + + :param htsus_code: The htsus_code of this ProductPricing. # noqa: E501 + :type: str + """ + + self._htsus_code = htsus_code + + @property + def moisture_sensitivity_level(self): + """Gets the moisture_sensitivity_level of this ProductPricing. # noqa: E501 + + Code for Moisture Sensitivity Level of the product # noqa: E501 + + :return: The moisture_sensitivity_level of this ProductPricing. # noqa: E501 + :rtype: str + """ + return self._moisture_sensitivity_level + + @moisture_sensitivity_level.setter + def moisture_sensitivity_level(self, moisture_sensitivity_level): + """Sets the moisture_sensitivity_level of this ProductPricing. + + Code for Moisture Sensitivity Level of the product # noqa: E501 + + :param moisture_sensitivity_level: The moisture_sensitivity_level of this ProductPricing. # noqa: E501 + :type: str + """ + + self._moisture_sensitivity_level = moisture_sensitivity_level + + @property + def is_bo_not_allowed(self): + """Gets the is_bo_not_allowed of this ProductPricing. # noqa: E501 + + Is Back Order not allowed? True if you cannot place a backorder; false if we will allow the product to be back-ordered. # noqa: E501 + + :return: The is_bo_not_allowed of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._is_bo_not_allowed + + @is_bo_not_allowed.setter + def is_bo_not_allowed(self, is_bo_not_allowed): + """Sets the is_bo_not_allowed of this ProductPricing. + + Is Back Order not allowed? True if you cannot place a backorder; false if we will allow the product to be back-ordered. # noqa: E501 + + :param is_bo_not_allowed: The is_bo_not_allowed of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._is_bo_not_allowed = is_bo_not_allowed + + @property + def is_ncnr(self): + """Gets the is_ncnr of this ProductPricing. # noqa: E501 + + Is product non-cancellable and non-returnable # noqa: E501 + + :return: The is_ncnr of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._is_ncnr + + @is_ncnr.setter + def is_ncnr(self, is_ncnr): + """Sets the is_ncnr of this ProductPricing. + + Is product non-cancellable and non-returnable # noqa: E501 + + :param is_ncnr: The is_ncnr of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._is_ncnr = is_ncnr + + @property + def categories(self): + """Gets the categories of this ProductPricing. # noqa: E501 + + The main category that the part is in(this does not include sub categories) # noqa: E501 + + :return: The categories of this ProductPricing. # noqa: E501 + :rtype: list[CategoryType] + """ + return self._categories + + @categories.setter + def categories(self, categories): + """Sets the categories of this ProductPricing. + + The main category that the part is in(this does not include sub categories) # noqa: E501 + + :param categories: The categories of this ProductPricing. # noqa: E501 + :type: list[CategoryType] + """ + + self._categories = categories + + @property + def contains_lithium(self): + """Gets the contains_lithium of this ProductPricing. # noqa: E501 + + Indicates if product contains lithium # noqa: E501 + + :return: The contains_lithium of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._contains_lithium + + @contains_lithium.setter + def contains_lithium(self, contains_lithium): + """Sets the contains_lithium of this ProductPricing. + + Indicates if product contains lithium # noqa: E501 + + :param contains_lithium: The contains_lithium of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._contains_lithium = contains_lithium + + @property + def contains_mercury(self): + """Gets the contains_mercury of this ProductPricing. # noqa: E501 + + Indicates if product contains mercury # noqa: E501 + + :return: The contains_mercury of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._contains_mercury + + @contains_mercury.setter + def contains_mercury(self, contains_mercury): + """Sets the contains_mercury of this ProductPricing. + + Indicates if product contains mercury # noqa: E501 + + :param contains_mercury: The contains_mercury of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._contains_mercury = contains_mercury + + @property + def is_end_of_life(self): + """Gets the is_end_of_life of this ProductPricing. # noqa: E501 + + This product is no longer manufactured and will no longer be stocked once stock is depleted. # noqa: E501 + + :return: The is_end_of_life of this ProductPricing. # noqa: E501 + :rtype: bool + """ + return self._is_end_of_life + + @is_end_of_life.setter + def is_end_of_life(self, is_end_of_life): + """Sets the is_end_of_life of this ProductPricing. + + This product is no longer manufactured and will no longer be stocked once stock is depleted. # noqa: E501 + + :param is_end_of_life: The is_end_of_life of this ProductPricing. # noqa: E501 + :type: bool + """ + + self._is_end_of_life = is_end_of_life + + @property + def product_variations(self): + """Gets the product_variations of this ProductPricing. # noqa: E501 + + Variations of the requested ProductPricing # noqa: E501 + + :return: The product_variations of this ProductPricing. # noqa: E501 + :rtype: list[ProductPricingVariation] + """ + return self._product_variations + + @product_variations.setter + def product_variations(self, product_variations): + """Sets the product_variations of this ProductPricing. + + Variations of the requested ProductPricing # noqa: E501 + + :param product_variations: The product_variations of this ProductPricing. # noqa: E501 + :type: list[ProductPricingVariation] + """ + + self._product_variations = product_variations + + 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(ProductPricing, 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, ProductPricing): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_pricing_response.py b/digikey/v4/productinformation/models/product_pricing_response.py new file mode 100644 index 0000000..92f17b4 --- /dev/null +++ b/digikey/v4/productinformation/models/product_pricing_response.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductPricingResponse(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 = { + 'product_pricings': 'list[ProductPricing]', + 'products_count': 'int', + 'settings_used': 'SettingsUsed' + } + + attribute_map = { + 'product_pricings': 'ProductPricings', + 'products_count': 'ProductsCount', + 'settings_used': 'SettingsUsed' + } + + def __init__(self, product_pricings=None, products_count=None, settings_used=None): # noqa: E501 + """ProductPricingResponse - a model defined in Swagger""" # noqa: E501 + self._product_pricings = None + self._products_count = None + self._settings_used = None + self.discriminator = None + if product_pricings is not None: + self.product_pricings = product_pricings + if products_count is not None: + self.products_count = products_count + if settings_used is not None: + self.settings_used = settings_used + + @property + def product_pricings(self): + """Gets the product_pricings of this ProductPricingResponse. # noqa: E501 + + List of Products # noqa: E501 + + :return: The product_pricings of this ProductPricingResponse. # noqa: E501 + :rtype: list[ProductPricing] + """ + return self._product_pricings + + @product_pricings.setter + def product_pricings(self, product_pricings): + """Sets the product_pricings of this ProductPricingResponse. + + List of Products # noqa: E501 + + :param product_pricings: The product_pricings of this ProductPricingResponse. # noqa: E501 + :type: list[ProductPricing] + """ + + self._product_pricings = product_pricings + + @property + def products_count(self): + """Gets the products_count of this ProductPricingResponse. # noqa: E501 + + Total number of matching products found. # noqa: E501 + + :return: The products_count of this ProductPricingResponse. # noqa: E501 + :rtype: int + """ + return self._products_count + + @products_count.setter + def products_count(self, products_count): + """Sets the products_count of this ProductPricingResponse. + + Total number of matching products found. # noqa: E501 + + :param products_count: The products_count of this ProductPricingResponse. # noqa: E501 + :type: int + """ + + self._products_count = products_count + + @property + def settings_used(self): + """Gets the settings_used of this ProductPricingResponse. # noqa: E501 + + + :return: The settings_used of this ProductPricingResponse. # noqa: E501 + :rtype: SettingsUsed + """ + return self._settings_used + + @settings_used.setter + def settings_used(self, settings_used): + """Sets the settings_used of this ProductPricingResponse. + + + :param settings_used: The settings_used of this ProductPricingResponse. # noqa: E501 + :type: SettingsUsed + """ + + self._settings_used = settings_used + + 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(ProductPricingResponse, 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, ProductPricingResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_pricing_variation.py b/digikey/v4/productinformation/models/product_pricing_variation.py new file mode 100644 index 0000000..a53d2a0 --- /dev/null +++ b/digikey/v4/productinformation/models/product_pricing_variation.py @@ -0,0 +1,306 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductPricingVariation(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 = { + 'digi_key_product_number': 'str', + 'quantity_availablefor_package_type': 'int', + 'package_type': 'PackageType', + 'market_place': 'bool', + 'standard_pricing': 'list[PriceBreak]', + 'my_pricing': 'list[PriceBreak]', + 'is_tariff_active': 'bool', + 'digi_reeling_fee': 'float' + } + + attribute_map = { + 'digi_key_product_number': 'DigiKeyProductNumber', + 'quantity_availablefor_package_type': 'QuantityAvailableforPackageType', + 'package_type': 'PackageType', + 'market_place': 'MarketPlace', + 'standard_pricing': 'StandardPricing', + 'my_pricing': 'MyPricing', + 'is_tariff_active': 'IsTariffActive', + 'digi_reeling_fee': 'DigiReelingFee' + } + + def __init__(self, digi_key_product_number=None, quantity_availablefor_package_type=None, package_type=None, market_place=None, standard_pricing=None, my_pricing=None, is_tariff_active=None, digi_reeling_fee=None): # noqa: E501 + """ProductPricingVariation - a model defined in Swagger""" # noqa: E501 + self._digi_key_product_number = None + self._quantity_availablefor_package_type = None + self._package_type = None + self._market_place = None + self._standard_pricing = None + self._my_pricing = None + self._is_tariff_active = None + self._digi_reeling_fee = None + self.discriminator = None + if digi_key_product_number is not None: + self.digi_key_product_number = digi_key_product_number + if quantity_availablefor_package_type is not None: + self.quantity_availablefor_package_type = quantity_availablefor_package_type + if package_type is not None: + self.package_type = package_type + if market_place is not None: + self.market_place = market_place + if standard_pricing is not None: + self.standard_pricing = standard_pricing + if my_pricing is not None: + self.my_pricing = my_pricing + if is_tariff_active is not None: + self.is_tariff_active = is_tariff_active + if digi_reeling_fee is not None: + self.digi_reeling_fee = digi_reeling_fee + + @property + def digi_key_product_number(self): + """Gets the digi_key_product_number of this ProductPricingVariation. # noqa: E501 + + DigiKey Product number of the variation # noqa: E501 + + :return: The digi_key_product_number of this ProductPricingVariation. # noqa: E501 + :rtype: str + """ + return self._digi_key_product_number + + @digi_key_product_number.setter + def digi_key_product_number(self, digi_key_product_number): + """Sets the digi_key_product_number of this ProductPricingVariation. + + DigiKey Product number of the variation # noqa: E501 + + :param digi_key_product_number: The digi_key_product_number of this ProductPricingVariation. # noqa: E501 + :type: str + """ + + self._digi_key_product_number = digi_key_product_number + + @property + def quantity_availablefor_package_type(self): + """Gets the quantity_availablefor_package_type of this ProductPricingVariation. # noqa: E501 + + The quantity available for the specified variation. # noqa: E501 + + :return: The quantity_availablefor_package_type of this ProductPricingVariation. # noqa: E501 + :rtype: int + """ + return self._quantity_availablefor_package_type + + @quantity_availablefor_package_type.setter + def quantity_availablefor_package_type(self, quantity_availablefor_package_type): + """Sets the quantity_availablefor_package_type of this ProductPricingVariation. + + The quantity available for the specified variation. # noqa: E501 + + :param quantity_availablefor_package_type: The quantity_availablefor_package_type of this ProductPricingVariation. # noqa: E501 + :type: int + """ + + self._quantity_availablefor_package_type = quantity_availablefor_package_type + + @property + def package_type(self): + """Gets the package_type of this ProductPricingVariation. # noqa: E501 + + + :return: The package_type of this ProductPricingVariation. # noqa: E501 + :rtype: PackageType + """ + return self._package_type + + @package_type.setter + def package_type(self, package_type): + """Sets the package_type of this ProductPricingVariation. + + + :param package_type: The package_type of this ProductPricingVariation. # noqa: E501 + :type: PackageType + """ + + self._package_type = package_type + + @property + def market_place(self): + """Gets the market_place of this ProductPricingVariation. # noqa: E501 + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :return: The market_place of this ProductPricingVariation. # noqa: E501 + :rtype: bool + """ + return self._market_place + + @market_place.setter + def market_place(self, market_place): + """Sets the market_place of this ProductPricingVariation. + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :param market_place: The market_place of this ProductPricingVariation. # noqa: E501 + :type: bool + """ + + self._market_place = market_place + + @property + def standard_pricing(self): + """Gets the standard_pricing of this ProductPricingVariation. # noqa: E501 + + Standard pricing for the validated locale. # noqa: E501 + + :return: The standard_pricing of this ProductPricingVariation. # noqa: E501 + :rtype: list[PriceBreak] + """ + return self._standard_pricing + + @standard_pricing.setter + def standard_pricing(self, standard_pricing): + """Sets the standard_pricing of this ProductPricingVariation. + + Standard pricing for the validated locale. # noqa: E501 + + :param standard_pricing: The standard_pricing of this ProductPricingVariation. # noqa: E501 + :type: list[PriceBreak] + """ + + self._standard_pricing = standard_pricing + + @property + def my_pricing(self): + """Gets the my_pricing of this ProductPricingVariation. # noqa: E501 + + Your pricing for the DigiKey customer number with which you authenticated. Also dependent on locale information. # noqa: E501 + + :return: The my_pricing of this ProductPricingVariation. # noqa: E501 + :rtype: list[PriceBreak] + """ + return self._my_pricing + + @my_pricing.setter + def my_pricing(self, my_pricing): + """Sets the my_pricing of this ProductPricingVariation. + + Your pricing for the DigiKey customer number with which you authenticated. Also dependent on locale information. # noqa: E501 + + :param my_pricing: The my_pricing of this ProductPricingVariation. # noqa: E501 + :type: list[PriceBreak] + """ + + self._my_pricing = my_pricing + + @property + def is_tariff_active(self): + """Gets the is_tariff_active of this ProductPricingVariation. # noqa: E501 + + Indicates if tariff is active for variation # noqa: E501 + + :return: The is_tariff_active of this ProductPricingVariation. # noqa: E501 + :rtype: bool + """ + return self._is_tariff_active + + @is_tariff_active.setter + def is_tariff_active(self, is_tariff_active): + """Sets the is_tariff_active of this ProductPricingVariation. + + Indicates if tariff is active for variation # noqa: E501 + + :param is_tariff_active: The is_tariff_active of this ProductPricingVariation. # noqa: E501 + :type: bool + """ + + self._is_tariff_active = is_tariff_active + + @property + def digi_reeling_fee(self): + """Gets the digi_reeling_fee of this ProductPricingVariation. # noqa: E501 + + Reeling fee per product ordered # noqa: E501 + + :return: The digi_reeling_fee of this ProductPricingVariation. # noqa: E501 + :rtype: float + """ + return self._digi_reeling_fee + + @digi_reeling_fee.setter + def digi_reeling_fee(self, digi_reeling_fee): + """Sets the digi_reeling_fee of this ProductPricingVariation. + + Reeling fee per product ordered # noqa: E501 + + :param digi_reeling_fee: The digi_reeling_fee of this ProductPricingVariation. # noqa: E501 + :type: float + """ + + self._digi_reeling_fee = digi_reeling_fee + + 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(ProductPricingVariation, 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, ProductPricingVariation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_status_v4.py b/digikey/v4/productinformation/models/product_status_v4.py new file mode 100644 index 0000000..d1c616f --- /dev/null +++ b/digikey/v4/productinformation/models/product_status_v4.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductStatusV4(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 = { + 'id': 'int', + 'status': 'str' + } + + attribute_map = { + 'id': 'Id', + 'status': 'Status' + } + + def __init__(self, id=None, status=None): # noqa: E501 + """ProductStatusV4 - a model defined in Swagger""" # noqa: E501 + self._id = None + self._status = None + self.discriminator = None + if id is not None: + self.id = id + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this ProductStatusV4. # noqa: E501 + + + :return: The id of this ProductStatusV4. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this ProductStatusV4. + + + :param id: The id of this ProductStatusV4. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def status(self): + """Gets the status of this ProductStatusV4. # noqa: E501 + + + :return: The status of this ProductStatusV4. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this ProductStatusV4. + + + :param status: The status of this ProductStatusV4. # noqa: E501 + :type: str + """ + + self._status = status + + 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(ProductStatusV4, 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, ProductStatusV4): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_substitute.py b/digikey/v4/productinformation/models/product_substitute.py new file mode 100644 index 0000000..1eb648b --- /dev/null +++ b/digikey/v4/productinformation/models/product_substitute.py @@ -0,0 +1,278 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductSubstitute(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 = { + 'substitute_type': 'str', + 'product_url': 'str', + 'description': 'str', + 'manufacturer': 'Manufacturer', + 'manufacturer_product_number': 'str', + 'unit_price': 'str', + 'quantity_available': 'int' + } + + attribute_map = { + 'substitute_type': 'SubstituteType', + 'product_url': 'ProductUrl', + 'description': 'Description', + 'manufacturer': 'Manufacturer', + 'manufacturer_product_number': 'ManufacturerProductNumber', + 'unit_price': 'UnitPrice', + 'quantity_available': 'QuantityAvailable' + } + + def __init__(self, substitute_type=None, product_url=None, description=None, manufacturer=None, manufacturer_product_number=None, unit_price=None, quantity_available=None): # noqa: E501 + """ProductSubstitute - a model defined in Swagger""" # noqa: E501 + self._substitute_type = None + self._product_url = None + self._description = None + self._manufacturer = None + self._manufacturer_product_number = None + self._unit_price = None + self._quantity_available = None + self.discriminator = None + if substitute_type is not None: + self.substitute_type = substitute_type + if product_url is not None: + self.product_url = product_url + if description is not None: + self.description = description + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_product_number is not None: + self.manufacturer_product_number = manufacturer_product_number + if unit_price is not None: + self.unit_price = unit_price + if quantity_available is not None: + self.quantity_available = quantity_available + + @property + def substitute_type(self): + """Gets the substitute_type of this ProductSubstitute. # noqa: E501 + + Substitute type # noqa: E501 + + :return: The substitute_type of this ProductSubstitute. # noqa: E501 + :rtype: str + """ + return self._substitute_type + + @substitute_type.setter + def substitute_type(self, substitute_type): + """Sets the substitute_type of this ProductSubstitute. + + Substitute type # noqa: E501 + + :param substitute_type: The substitute_type of this ProductSubstitute. # noqa: E501 + :type: str + """ + + self._substitute_type = substitute_type + + @property + def product_url(self): + """Gets the product_url of this ProductSubstitute. # noqa: E501 + + Product url # noqa: E501 + + :return: The product_url of this ProductSubstitute. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this ProductSubstitute. + + Product url # noqa: E501 + + :param product_url: The product_url of this ProductSubstitute. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def description(self): + """Gets the description of this ProductSubstitute. # noqa: E501 + + Product Description # noqa: E501 + + :return: The description of this ProductSubstitute. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ProductSubstitute. + + Product Description # noqa: E501 + + :param description: The description of this ProductSubstitute. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def manufacturer(self): + """Gets the manufacturer of this ProductSubstitute. # noqa: E501 + + + :return: The manufacturer of this ProductSubstitute. # noqa: E501 + :rtype: Manufacturer + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this ProductSubstitute. + + + :param manufacturer: The manufacturer of this ProductSubstitute. # noqa: E501 + :type: Manufacturer + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_product_number(self): + """Gets the manufacturer_product_number of this ProductSubstitute. # noqa: E501 + + Manufacturer Product Number # noqa: E501 + + :return: The manufacturer_product_number of this ProductSubstitute. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product_number + + @manufacturer_product_number.setter + def manufacturer_product_number(self, manufacturer_product_number): + """Sets the manufacturer_product_number of this ProductSubstitute. + + Manufacturer Product Number # noqa: E501 + + :param manufacturer_product_number: The manufacturer_product_number of this ProductSubstitute. # noqa: E501 + :type: str + """ + + self._manufacturer_product_number = manufacturer_product_number + + @property + def unit_price(self): + """Gets the unit_price of this ProductSubstitute. # noqa: E501 + + Unit Price # noqa: E501 + + :return: The unit_price of this ProductSubstitute. # noqa: E501 + :rtype: str + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this ProductSubstitute. + + Unit Price # noqa: E501 + + :param unit_price: The unit_price of this ProductSubstitute. # noqa: E501 + :type: str + """ + + self._unit_price = unit_price + + @property + def quantity_available(self): + """Gets the quantity_available of this ProductSubstitute. # noqa: E501 + + Quantity Available # noqa: E501 + + :return: The quantity_available of this ProductSubstitute. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this ProductSubstitute. + + Quantity Available # noqa: E501 + + :param quantity_available: The quantity_available of this ProductSubstitute. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + 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(ProductSubstitute, 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, ProductSubstitute): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_substitutes_response.py b/digikey/v4/productinformation/models/product_substitutes_response.py new file mode 100644 index 0000000..390c4a7 --- /dev/null +++ b/digikey/v4/productinformation/models/product_substitutes_response.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductSubstitutesResponse(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 = { + 'product_substitutes_count': 'int', + 'product_substitutes': 'list[ProductSubstitute]', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'product_substitutes_count': 'ProductSubstitutesCount', + 'product_substitutes': 'ProductSubstitutes', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, product_substitutes_count=None, product_substitutes=None, search_locale_used=None): # noqa: E501 + """ProductSubstitutesResponse - a model defined in Swagger""" # noqa: E501 + self._product_substitutes_count = None + self._product_substitutes = None + self._search_locale_used = None + self.discriminator = None + if product_substitutes_count is not None: + self.product_substitutes_count = product_substitutes_count + if product_substitutes is not None: + self.product_substitutes = product_substitutes + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def product_substitutes_count(self): + """Gets the product_substitutes_count of this ProductSubstitutesResponse. # noqa: E501 + + Count of ProductSubstitutes # noqa: E501 + + :return: The product_substitutes_count of this ProductSubstitutesResponse. # noqa: E501 + :rtype: int + """ + return self._product_substitutes_count + + @product_substitutes_count.setter + def product_substitutes_count(self, product_substitutes_count): + """Sets the product_substitutes_count of this ProductSubstitutesResponse. + + Count of ProductSubstitutes # noqa: E501 + + :param product_substitutes_count: The product_substitutes_count of this ProductSubstitutesResponse. # noqa: E501 + :type: int + """ + + self._product_substitutes_count = product_substitutes_count + + @property + def product_substitutes(self): + """Gets the product_substitutes of this ProductSubstitutesResponse. # noqa: E501 + + List of ProductSubstitutes # noqa: E501 + + :return: The product_substitutes of this ProductSubstitutesResponse. # noqa: E501 + :rtype: list[ProductSubstitute] + """ + return self._product_substitutes + + @product_substitutes.setter + def product_substitutes(self, product_substitutes): + """Sets the product_substitutes of this ProductSubstitutesResponse. + + List of ProductSubstitutes # noqa: E501 + + :param product_substitutes: The product_substitutes of this ProductSubstitutesResponse. # noqa: E501 + :type: list[ProductSubstitute] + """ + + self._product_substitutes = product_substitutes + + @property + def search_locale_used(self): + """Gets the search_locale_used of this ProductSubstitutesResponse. # noqa: E501 + + + :return: The search_locale_used of this ProductSubstitutesResponse. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this ProductSubstitutesResponse. + + + :param search_locale_used: The search_locale_used of this ProductSubstitutesResponse. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(ProductSubstitutesResponse, 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, ProductSubstitutesResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_summary.py b/digikey/v4/productinformation/models/product_summary.py new file mode 100644 index 0000000..c94313c --- /dev/null +++ b/digikey/v4/productinformation/models/product_summary.py @@ -0,0 +1,250 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductSummary(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 = { + 'product_url': 'str', + 'description': 'str', + 'manufacturer': 'Manufacturer', + 'manufacturer_product_number': 'str', + 'unit_price': 'str', + 'quantity_available': 'int' + } + + attribute_map = { + 'product_url': 'ProductUrl', + 'description': 'Description', + 'manufacturer': 'Manufacturer', + 'manufacturer_product_number': 'ManufacturerProductNumber', + 'unit_price': 'UnitPrice', + 'quantity_available': 'QuantityAvailable' + } + + def __init__(self, product_url=None, description=None, manufacturer=None, manufacturer_product_number=None, unit_price=None, quantity_available=None): # noqa: E501 + """ProductSummary - a model defined in Swagger""" # noqa: E501 + self._product_url = None + self._description = None + self._manufacturer = None + self._manufacturer_product_number = None + self._unit_price = None + self._quantity_available = None + self.discriminator = None + if product_url is not None: + self.product_url = product_url + if description is not None: + self.description = description + if manufacturer is not None: + self.manufacturer = manufacturer + if manufacturer_product_number is not None: + self.manufacturer_product_number = manufacturer_product_number + if unit_price is not None: + self.unit_price = unit_price + if quantity_available is not None: + self.quantity_available = quantity_available + + @property + def product_url(self): + """Gets the product_url of this ProductSummary. # noqa: E501 + + Product url # noqa: E501 + + :return: The product_url of this ProductSummary. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this ProductSummary. + + Product url # noqa: E501 + + :param product_url: The product_url of this ProductSummary. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + @property + def description(self): + """Gets the description of this ProductSummary. # noqa: E501 + + Product Description # noqa: E501 + + :return: The description of this ProductSummary. # noqa: E501 + :rtype: str + """ + return self._description + + @description.setter + def description(self, description): + """Sets the description of this ProductSummary. + + Product Description # noqa: E501 + + :param description: The description of this ProductSummary. # noqa: E501 + :type: str + """ + + self._description = description + + @property + def manufacturer(self): + """Gets the manufacturer of this ProductSummary. # noqa: E501 + + + :return: The manufacturer of this ProductSummary. # noqa: E501 + :rtype: Manufacturer + """ + return self._manufacturer + + @manufacturer.setter + def manufacturer(self, manufacturer): + """Sets the manufacturer of this ProductSummary. + + + :param manufacturer: The manufacturer of this ProductSummary. # noqa: E501 + :type: Manufacturer + """ + + self._manufacturer = manufacturer + + @property + def manufacturer_product_number(self): + """Gets the manufacturer_product_number of this ProductSummary. # noqa: E501 + + Manufacturer Product Number # noqa: E501 + + :return: The manufacturer_product_number of this ProductSummary. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product_number + + @manufacturer_product_number.setter + def manufacturer_product_number(self, manufacturer_product_number): + """Sets the manufacturer_product_number of this ProductSummary. + + Manufacturer Product Number # noqa: E501 + + :param manufacturer_product_number: The manufacturer_product_number of this ProductSummary. # noqa: E501 + :type: str + """ + + self._manufacturer_product_number = manufacturer_product_number + + @property + def unit_price(self): + """Gets the unit_price of this ProductSummary. # noqa: E501 + + Unit Price # noqa: E501 + + :return: The unit_price of this ProductSummary. # noqa: E501 + :rtype: str + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this ProductSummary. + + Unit Price # noqa: E501 + + :param unit_price: The unit_price of this ProductSummary. # noqa: E501 + :type: str + """ + + self._unit_price = unit_price + + @property + def quantity_available(self): + """Gets the quantity_available of this ProductSummary. # noqa: E501 + + Quantity Available # noqa: E501 + + :return: The quantity_available of this ProductSummary. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this ProductSummary. + + Quantity Available # noqa: E501 + + :param quantity_available: The quantity_available of this ProductSummary. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + 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(ProductSummary, 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, ProductSummary): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/product_variation.py b/digikey/v4/productinformation/models/product_variation.py new file mode 100644 index 0000000..3beb346 --- /dev/null +++ b/digikey/v4/productinformation/models/product_variation.py @@ -0,0 +1,416 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ProductVariation(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 = { + 'digi_key_product_number': 'str', + 'package_type': 'PackageType', + 'standard_pricing': 'list[PriceBreak]', + 'my_pricing': 'list[PriceBreak]', + 'market_place': 'bool', + 'tariff_active': 'bool', + 'supplier': 'Supplier', + 'quantity_availablefor_package_type': 'int', + 'max_quantity_for_distribution': 'int', + 'minimum_order_quantity': 'int', + 'standard_package': 'int', + 'digi_reel_fee': 'float' + } + + attribute_map = { + 'digi_key_product_number': 'DigiKeyProductNumber', + 'package_type': 'PackageType', + 'standard_pricing': 'StandardPricing', + 'my_pricing': 'MyPricing', + 'market_place': 'MarketPlace', + 'tariff_active': 'TariffActive', + 'supplier': 'Supplier', + 'quantity_availablefor_package_type': 'QuantityAvailableforPackageType', + 'max_quantity_for_distribution': 'MaxQuantityForDistribution', + 'minimum_order_quantity': 'MinimumOrderQuantity', + 'standard_package': 'StandardPackage', + 'digi_reel_fee': 'DigiReelFee' + } + + def __init__(self, digi_key_product_number=None, package_type=None, standard_pricing=None, my_pricing=None, market_place=None, tariff_active=None, supplier=None, quantity_availablefor_package_type=None, max_quantity_for_distribution=None, minimum_order_quantity=None, standard_package=None, digi_reel_fee=None): # noqa: E501 + """ProductVariation - a model defined in Swagger""" # noqa: E501 + self._digi_key_product_number = None + self._package_type = None + self._standard_pricing = None + self._my_pricing = None + self._market_place = None + self._tariff_active = None + self._supplier = None + self._quantity_availablefor_package_type = None + self._max_quantity_for_distribution = None + self._minimum_order_quantity = None + self._standard_package = None + self._digi_reel_fee = None + self.discriminator = None + if digi_key_product_number is not None: + self.digi_key_product_number = digi_key_product_number + if package_type is not None: + self.package_type = package_type + if standard_pricing is not None: + self.standard_pricing = standard_pricing + if my_pricing is not None: + self.my_pricing = my_pricing + if market_place is not None: + self.market_place = market_place + if tariff_active is not None: + self.tariff_active = tariff_active + if supplier is not None: + self.supplier = supplier + if quantity_availablefor_package_type is not None: + self.quantity_availablefor_package_type = quantity_availablefor_package_type + if max_quantity_for_distribution is not None: + self.max_quantity_for_distribution = max_quantity_for_distribution + if minimum_order_quantity is not None: + self.minimum_order_quantity = minimum_order_quantity + if standard_package is not None: + self.standard_package = standard_package + if digi_reel_fee is not None: + self.digi_reel_fee = digi_reel_fee + + @property + def digi_key_product_number(self): + """Gets the digi_key_product_number of this ProductVariation. # noqa: E501 + + DigiKey Product number of the variation # noqa: E501 + + :return: The digi_key_product_number of this ProductVariation. # noqa: E501 + :rtype: str + """ + return self._digi_key_product_number + + @digi_key_product_number.setter + def digi_key_product_number(self, digi_key_product_number): + """Sets the digi_key_product_number of this ProductVariation. + + DigiKey Product number of the variation # noqa: E501 + + :param digi_key_product_number: The digi_key_product_number of this ProductVariation. # noqa: E501 + :type: str + """ + + self._digi_key_product_number = digi_key_product_number + + @property + def package_type(self): + """Gets the package_type of this ProductVariation. # noqa: E501 + + + :return: The package_type of this ProductVariation. # noqa: E501 + :rtype: PackageType + """ + return self._package_type + + @package_type.setter + def package_type(self, package_type): + """Sets the package_type of this ProductVariation. + + + :param package_type: The package_type of this ProductVariation. # noqa: E501 + :type: PackageType + """ + + self._package_type = package_type + + @property + def standard_pricing(self): + """Gets the standard_pricing of this ProductVariation. # noqa: E501 + + Standard pricing for the validated locale. # noqa: E501 + + :return: The standard_pricing of this ProductVariation. # noqa: E501 + :rtype: list[PriceBreak] + """ + return self._standard_pricing + + @standard_pricing.setter + def standard_pricing(self, standard_pricing): + """Sets the standard_pricing of this ProductVariation. + + Standard pricing for the validated locale. # noqa: E501 + + :param standard_pricing: The standard_pricing of this ProductVariation. # noqa: E501 + :type: list[PriceBreak] + """ + + self._standard_pricing = standard_pricing + + @property + def my_pricing(self): + """Gets the my_pricing of this ProductVariation. # noqa: E501 + + Your pricing for the account with which you authenticated. Also dependent on locale information. # noqa: E501 + + :return: The my_pricing of this ProductVariation. # noqa: E501 + :rtype: list[PriceBreak] + """ + return self._my_pricing + + @my_pricing.setter + def my_pricing(self, my_pricing): + """Sets the my_pricing of this ProductVariation. + + Your pricing for the account with which you authenticated. Also dependent on locale information. # noqa: E501 + + :param my_pricing: The my_pricing of this ProductVariation. # noqa: E501 + :type: list[PriceBreak] + """ + + self._my_pricing = my_pricing + + @property + def market_place(self): + """Gets the market_place of this ProductVariation. # noqa: E501 + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :return: The market_place of this ProductVariation. # noqa: E501 + :rtype: bool + """ + return self._market_place + + @market_place.setter + def market_place(self, market_place): + """Sets the market_place of this ProductVariation. + + Product is a Marketplace product that ships direct from the supplier. A separate shipping fee may apply # noqa: E501 + + :param market_place: The market_place of this ProductVariation. # noqa: E501 + :type: bool + """ + + self._market_place = market_place + + @property + def tariff_active(self): + """Gets the tariff_active of this ProductVariation. # noqa: E501 + + Indicates if there is a tariff on the item. # noqa: E501 + + :return: The tariff_active of this ProductVariation. # noqa: E501 + :rtype: bool + """ + return self._tariff_active + + @tariff_active.setter + def tariff_active(self, tariff_active): + """Sets the tariff_active of this ProductVariation. + + Indicates if there is a tariff on the item. # noqa: E501 + + :param tariff_active: The tariff_active of this ProductVariation. # noqa: E501 + :type: bool + """ + + self._tariff_active = tariff_active + + @property + def supplier(self): + """Gets the supplier of this ProductVariation. # noqa: E501 + + + :return: The supplier of this ProductVariation. # noqa: E501 + :rtype: Supplier + """ + return self._supplier + + @supplier.setter + def supplier(self, supplier): + """Sets the supplier of this ProductVariation. + + + :param supplier: The supplier of this ProductVariation. # noqa: E501 + :type: Supplier + """ + + self._supplier = supplier + + @property + def quantity_availablefor_package_type(self): + """Gets the quantity_availablefor_package_type of this ProductVariation. # noqa: E501 + + The quantity available for the specified variation. # noqa: E501 + + :return: The quantity_availablefor_package_type of this ProductVariation. # noqa: E501 + :rtype: int + """ + return self._quantity_availablefor_package_type + + @quantity_availablefor_package_type.setter + def quantity_availablefor_package_type(self, quantity_availablefor_package_type): + """Sets the quantity_availablefor_package_type of this ProductVariation. + + The quantity available for the specified variation. # noqa: E501 + + :param quantity_availablefor_package_type: The quantity_availablefor_package_type of this ProductVariation. # noqa: E501 + :type: int + """ + + self._quantity_availablefor_package_type = quantity_availablefor_package_type + + @property + def max_quantity_for_distribution(self): + """Gets the max_quantity_for_distribution of this ProductVariation. # noqa: E501 + + Maximum order quantity for Distribution # noqa: E501 + + :return: The max_quantity_for_distribution of this ProductVariation. # noqa: E501 + :rtype: int + """ + return self._max_quantity_for_distribution + + @max_quantity_for_distribution.setter + def max_quantity_for_distribution(self, max_quantity_for_distribution): + """Sets the max_quantity_for_distribution of this ProductVariation. + + Maximum order quantity for Distribution # noqa: E501 + + :param max_quantity_for_distribution: The max_quantity_for_distribution of this ProductVariation. # noqa: E501 + :type: int + """ + + self._max_quantity_for_distribution = max_quantity_for_distribution + + @property + def minimum_order_quantity(self): + """Gets the minimum_order_quantity of this ProductVariation. # noqa: E501 + + The Minimum Order Quantity # noqa: E501 + + :return: The minimum_order_quantity of this ProductVariation. # noqa: E501 + :rtype: int + """ + return self._minimum_order_quantity + + @minimum_order_quantity.setter + def minimum_order_quantity(self, minimum_order_quantity): + """Sets the minimum_order_quantity of this ProductVariation. + + The Minimum Order Quantity # noqa: E501 + + :param minimum_order_quantity: The minimum_order_quantity of this ProductVariation. # noqa: E501 + :type: int + """ + + self._minimum_order_quantity = minimum_order_quantity + + @property + def standard_package(self): + """Gets the standard_package of this ProductVariation. # noqa: E501 + + The number of products in the manufacturer's standard package. # noqa: E501 + + :return: The standard_package of this ProductVariation. # noqa: E501 + :rtype: int + """ + return self._standard_package + + @standard_package.setter + def standard_package(self, standard_package): + """Sets the standard_package of this ProductVariation. + + The number of products in the manufacturer's standard package. # noqa: E501 + + :param standard_package: The standard_package of this ProductVariation. # noqa: E501 + :type: int + """ + + self._standard_package = standard_package + + @property + def digi_reel_fee(self): + """Gets the digi_reel_fee of this ProductVariation. # noqa: E501 + + Fee per reel ordered. # noqa: E501 + + :return: The digi_reel_fee of this ProductVariation. # noqa: E501 + :rtype: float + """ + return self._digi_reel_fee + + @digi_reel_fee.setter + def digi_reel_fee(self, digi_reel_fee): + """Sets the digi_reel_fee of this ProductVariation. + + Fee per reel ordered. # noqa: E501 + + :param digi_reel_fee: The digi_reel_fee of this ProductVariation. # noqa: E501 + :type: float + """ + + self._digi_reel_fee = digi_reel_fee + + 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(ProductVariation, 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, ProductVariation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/recommendation.py b/digikey/v4/productinformation/models/recommendation.py new file mode 100644 index 0000000..54fdd7c --- /dev/null +++ b/digikey/v4/productinformation/models/recommendation.py @@ -0,0 +1,166 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Recommendation(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 = { + 'product_number': 'str', + 'recommended_products': 'list[RecommendedProduct]', + 'search_locale_used': 'IsoSearchLocale' + } + + attribute_map = { + 'product_number': 'ProductNumber', + 'recommended_products': 'RecommendedProducts', + 'search_locale_used': 'SearchLocaleUsed' + } + + def __init__(self, product_number=None, recommended_products=None, search_locale_used=None): # noqa: E501 + """Recommendation - a model defined in Swagger""" # noqa: E501 + self._product_number = None + self._recommended_products = None + self._search_locale_used = None + self.discriminator = None + if product_number is not None: + self.product_number = product_number + if recommended_products is not None: + self.recommended_products = recommended_products + if search_locale_used is not None: + self.search_locale_used = search_locale_used + + @property + def product_number(self): + """Gets the product_number of this Recommendation. # noqa: E501 + + The product number that the recommendations are for. # noqa: E501 + + :return: The product_number of this Recommendation. # noqa: E501 + :rtype: str + """ + return self._product_number + + @product_number.setter + def product_number(self, product_number): + """Sets the product_number of this Recommendation. + + The product number that the recommendations are for. # noqa: E501 + + :param product_number: The product_number of this Recommendation. # noqa: E501 + :type: str + """ + + self._product_number = product_number + + @property + def recommended_products(self): + """Gets the recommended_products of this Recommendation. # noqa: E501 + + The list of recommended products. # noqa: E501 + + :return: The recommended_products of this Recommendation. # noqa: E501 + :rtype: list[RecommendedProduct] + """ + return self._recommended_products + + @recommended_products.setter + def recommended_products(self, recommended_products): + """Sets the recommended_products of this Recommendation. + + The list of recommended products. # noqa: E501 + + :param recommended_products: The recommended_products of this Recommendation. # noqa: E501 + :type: list[RecommendedProduct] + """ + + self._recommended_products = recommended_products + + @property + def search_locale_used(self): + """Gets the search_locale_used of this Recommendation. # noqa: E501 + + + :return: The search_locale_used of this Recommendation. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale_used + + @search_locale_used.setter + def search_locale_used(self, search_locale_used): + """Sets the search_locale_used of this Recommendation. + + + :param search_locale_used: The search_locale_used of this Recommendation. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale_used = search_locale_used + + 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(Recommendation, 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, Recommendation): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/recommended_product.py b/digikey/v4/productinformation/models/recommended_product.py new file mode 100644 index 0000000..3112e1d --- /dev/null +++ b/digikey/v4/productinformation/models/recommended_product.py @@ -0,0 +1,308 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RecommendedProduct(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 = { + 'digi_key_product_number': 'str', + 'manufacturer_product_number': 'str', + 'manufacturer_name': 'str', + 'primary_photo': 'str', + 'product_description': 'str', + 'quantity_available': 'int', + 'unit_price': 'float', + 'product_url': 'str' + } + + attribute_map = { + 'digi_key_product_number': 'DigiKeyProductNumber', + 'manufacturer_product_number': 'ManufacturerProductNumber', + 'manufacturer_name': 'ManufacturerName', + 'primary_photo': 'PrimaryPhoto', + 'product_description': 'ProductDescription', + 'quantity_available': 'QuantityAvailable', + 'unit_price': 'UnitPrice', + 'product_url': 'ProductUrl' + } + + def __init__(self, digi_key_product_number=None, manufacturer_product_number=None, manufacturer_name=None, primary_photo=None, product_description=None, quantity_available=None, unit_price=None, product_url=None): # noqa: E501 + """RecommendedProduct - a model defined in Swagger""" # noqa: E501 + self._digi_key_product_number = None + self._manufacturer_product_number = None + self._manufacturer_name = None + self._primary_photo = None + self._product_description = None + self._quantity_available = None + self._unit_price = None + self._product_url = None + self.discriminator = None + if digi_key_product_number is not None: + self.digi_key_product_number = digi_key_product_number + if manufacturer_product_number is not None: + self.manufacturer_product_number = manufacturer_product_number + if manufacturer_name is not None: + self.manufacturer_name = manufacturer_name + if primary_photo is not None: + self.primary_photo = primary_photo + if product_description is not None: + self.product_description = product_description + if quantity_available is not None: + self.quantity_available = quantity_available + if unit_price is not None: + self.unit_price = unit_price + if product_url is not None: + self.product_url = product_url + + @property + def digi_key_product_number(self): + """Gets the digi_key_product_number of this RecommendedProduct. # noqa: E501 + + The Digi-Key part number. # noqa: E501 + + :return: The digi_key_product_number of this RecommendedProduct. # noqa: E501 + :rtype: str + """ + return self._digi_key_product_number + + @digi_key_product_number.setter + def digi_key_product_number(self, digi_key_product_number): + """Sets the digi_key_product_number of this RecommendedProduct. + + The Digi-Key part number. # noqa: E501 + + :param digi_key_product_number: The digi_key_product_number of this RecommendedProduct. # noqa: E501 + :type: str + """ + + self._digi_key_product_number = digi_key_product_number + + @property + def manufacturer_product_number(self): + """Gets the manufacturer_product_number of this RecommendedProduct. # noqa: E501 + + The manufacturer part number. # noqa: E501 + + :return: The manufacturer_product_number of this RecommendedProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_product_number + + @manufacturer_product_number.setter + def manufacturer_product_number(self, manufacturer_product_number): + """Sets the manufacturer_product_number of this RecommendedProduct. + + The manufacturer part number. # noqa: E501 + + :param manufacturer_product_number: The manufacturer_product_number of this RecommendedProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_product_number = manufacturer_product_number + + @property + def manufacturer_name(self): + """Gets the manufacturer_name of this RecommendedProduct. # noqa: E501 + + The name of the manufacturer. # noqa: E501 + + :return: The manufacturer_name of this RecommendedProduct. # noqa: E501 + :rtype: str + """ + return self._manufacturer_name + + @manufacturer_name.setter + def manufacturer_name(self, manufacturer_name): + """Sets the manufacturer_name of this RecommendedProduct. + + The name of the manufacturer. # noqa: E501 + + :param manufacturer_name: The manufacturer_name of this RecommendedProduct. # noqa: E501 + :type: str + """ + + self._manufacturer_name = manufacturer_name + + @property + def primary_photo(self): + """Gets the primary_photo of this RecommendedProduct. # noqa: E501 + + The URL to the product’s image. # noqa: E501 + + :return: The primary_photo of this RecommendedProduct. # noqa: E501 + :rtype: str + """ + return self._primary_photo + + @primary_photo.setter + def primary_photo(self, primary_photo): + """Sets the primary_photo of this RecommendedProduct. + + The URL to the product’s image. # noqa: E501 + + :param primary_photo: The primary_photo of this RecommendedProduct. # noqa: E501 + :type: str + """ + + self._primary_photo = primary_photo + + @property + def product_description(self): + """Gets the product_description of this RecommendedProduct. # noqa: E501 + + Catalog description of the product. # noqa: E501 + + :return: The product_description of this RecommendedProduct. # noqa: E501 + :rtype: str + """ + return self._product_description + + @product_description.setter + def product_description(self, product_description): + """Sets the product_description of this RecommendedProduct. + + Catalog description of the product. # noqa: E501 + + :param product_description: The product_description of this RecommendedProduct. # noqa: E501 + :type: str + """ + + self._product_description = product_description + + @property + def quantity_available(self): + """Gets the quantity_available of this RecommendedProduct. # noqa: E501 + + Quantity of the product available for immediate sale. # noqa: E501 + + :return: The quantity_available of this RecommendedProduct. # noqa: E501 + :rtype: int + """ + return self._quantity_available + + @quantity_available.setter + def quantity_available(self, quantity_available): + """Sets the quantity_available of this RecommendedProduct. + + Quantity of the product available for immediate sale. # noqa: E501 + + :param quantity_available: The quantity_available of this RecommendedProduct. # noqa: E501 + :type: int + """ + + self._quantity_available = quantity_available + + @property + def unit_price(self): + """Gets the unit_price of this RecommendedProduct. # noqa: E501 + + The catalog price for a single unit of this product. # noqa: E501 + + :return: The unit_price of this RecommendedProduct. # noqa: E501 + :rtype: float + """ + return self._unit_price + + @unit_price.setter + def unit_price(self, unit_price): + """Sets the unit_price of this RecommendedProduct. + + The catalog price for a single unit of this product. # noqa: E501 + + :param unit_price: The unit_price of this RecommendedProduct. # noqa: E501 + :type: float + """ + + self._unit_price = unit_price + + @property + def product_url(self): + """Gets the product_url of this RecommendedProduct. # noqa: E501 + + URL of the Digi-Key catalog page to purchase the product. This is based on your provided header Locale values. # noqa: E501 + + :return: The product_url of this RecommendedProduct. # noqa: E501 + :rtype: str + """ + return self._product_url + + @product_url.setter + def product_url(self, product_url): + """Sets the product_url of this RecommendedProduct. + + URL of the Digi-Key catalog page to purchase the product. This is based on your provided header Locale values. # noqa: E501 + + :param product_url: The product_url of this RecommendedProduct. # noqa: E501 + :type: str + """ + + self._product_url = product_url + + 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(RecommendedProduct, 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, RecommendedProduct): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/recommended_products_response.py b/digikey/v4/productinformation/models/recommended_products_response.py new file mode 100644 index 0000000..378fc8f --- /dev/null +++ b/digikey/v4/productinformation/models/recommended_products_response.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class RecommendedProductsResponse(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 = { + 'recommendations': 'list[Recommendation]' + } + + attribute_map = { + 'recommendations': 'Recommendations' + } + + def __init__(self, recommendations=None): # noqa: E501 + """RecommendedProductsResponse - a model defined in Swagger""" # noqa: E501 + self._recommendations = None + self.discriminator = None + if recommendations is not None: + self.recommendations = recommendations + + @property + def recommendations(self): + """Gets the recommendations of this RecommendedProductsResponse. # noqa: E501 + + The list of RecommendedProductsCollections - each containing a Product and its recommendations. # noqa: E501 + + :return: The recommendations of this RecommendedProductsResponse. # noqa: E501 + :rtype: list[Recommendation] + """ + return self._recommendations + + @recommendations.setter + def recommendations(self, recommendations): + """Sets the recommendations of this RecommendedProductsResponse. + + The list of RecommendedProductsCollections - each containing a Product and its recommendations. # noqa: E501 + + :param recommendations: The recommendations of this RecommendedProductsResponse. # noqa: E501 + :type: list[Recommendation] + """ + + self._recommendations = recommendations + + 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(RecommendedProductsResponse, 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, RecommendedProductsResponse): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/result_code.py b/digikey/v4/productinformation/models/result_code.py new file mode 100644 index 0000000..99ad714 --- /dev/null +++ b/digikey/v4/productinformation/models/result_code.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # noqa: E501 + + OpenAPI spec version: v3 + Contact: api.support@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class ResultCode(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + RESULTCODESUCCESS = "ResultCodeSuccess" + RESULTCODEFAIL = "ResultCodeFail" + RESULTCODERESTRICTEDBYCUSTOMERCLASS = "ResultCodeRestrictedByCustomerClass" + RESULTCODERESTRICTEDBYCUSTOMERROOT = "ResultCodeRestrictedByCustomerRoot" + RESULTCODERESTRICTEDBYCURRENCY = "ResultCodeRestrictedByCurrency" + RESULTCODERESTRICTEDBYVENDOR = "ResultCodeRestrictedByVendor" + RESULTCODERESTRICTEDBYDK = "ResultCodeRestrictedByDK" + RESULTCODERESTRICTEDBYCERTIFICATE = "ResultCodeRestrictedByCertificate" + RESULTCODERESTRICTEDBYCOUNTRY = "ResultCodeRestrictedByCountry" + RESULTCODENOMPOFFERS = "ResultCodeNoMpOffers" + RESULTCODEMPPARTNOTALLOWED = "ResultCodeMpPartNotAllowed" + + """ + 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 = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """ResultCode - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + 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(ResultCode, 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, ResultCode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/search_option.py b/digikey/v4/productinformation/models/search_option.py new file mode 100644 index 0000000..f2af825 --- /dev/null +++ b/digikey/v4/productinformation/models/search_option.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 SearchOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + MANUFACTURERPARTSEARCH = "ManufacturerPartSearch" + INSTOCK = "InStock" + NEWPRODUCTSONLY = "NewProductsOnly" + ROHSCOMPLIANT = "RoHSCompliant" + LEADFREE = "LeadFree" + COLLAPSEPACKAGINGTYPES = "CollapsePackagingTypes" + EXCLUDENONSTOCK = "ExcludeNonStock" + HAS3DMODEL = "Has3DModel" + HASMENTORFOOTPRINT = "HasMentorFootprint" + + """ + 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 = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SearchOption - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + 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(SearchOption, 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, SearchOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/series.py b/digikey/v4/productinformation/models/series.py new file mode 100644 index 0000000..eb7357c --- /dev/null +++ b/digikey/v4/productinformation/models/series.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Series(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 = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """Series - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Series. # noqa: E501 + + Series Id # noqa: E501 + + :return: The id of this Series. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Series. + + Series Id # noqa: E501 + + :param id: The id of this Series. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Series. # noqa: E501 + + Series Name # noqa: E501 + + :return: The name of this Series. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Series. + + Series Name # noqa: E501 + + :param name: The name of this Series. # noqa: E501 + :type: str + """ + + self._name = name + + 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(Series, 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, Series): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/settings_used.py b/digikey/v4/productinformation/models/settings_used.py new file mode 100644 index 0000000..95917bc --- /dev/null +++ b/digikey/v4/productinformation/models/settings_used.py @@ -0,0 +1,164 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SettingsUsed(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 = { + 'customer_id': 'int', + 'search_locale': 'IsoSearchLocale', + 'filters': 'Filters' + } + + attribute_map = { + 'customer_id': 'CustomerId', + 'search_locale': 'SearchLocale', + 'filters': 'Filters' + } + + def __init__(self, customer_id=None, search_locale=None, filters=None): # noqa: E501 + """SettingsUsed - a model defined in Swagger""" # noqa: E501 + self._customer_id = None + self._search_locale = None + self._filters = None + self.discriminator = None + if customer_id is not None: + self.customer_id = customer_id + if search_locale is not None: + self.search_locale = search_locale + if filters is not None: + self.filters = filters + + @property + def customer_id(self): + """Gets the customer_id of this SettingsUsed. # noqa: E501 + + The CustomerId that was used for the search and pricing # noqa: E501 + + :return: The customer_id of this SettingsUsed. # noqa: E501 + :rtype: int + """ + return self._customer_id + + @customer_id.setter + def customer_id(self, customer_id): + """Sets the customer_id of this SettingsUsed. + + The CustomerId that was used for the search and pricing # noqa: E501 + + :param customer_id: The customer_id of this SettingsUsed. # noqa: E501 + :type: int + """ + + self._customer_id = customer_id + + @property + def search_locale(self): + """Gets the search_locale of this SettingsUsed. # noqa: E501 + + + :return: The search_locale of this SettingsUsed. # noqa: E501 + :rtype: IsoSearchLocale + """ + return self._search_locale + + @search_locale.setter + def search_locale(self, search_locale): + """Sets the search_locale of this SettingsUsed. + + + :param search_locale: The search_locale of this SettingsUsed. # noqa: E501 + :type: IsoSearchLocale + """ + + self._search_locale = search_locale + + @property + def filters(self): + """Gets the filters of this SettingsUsed. # noqa: E501 + + + :return: The filters of this SettingsUsed. # noqa: E501 + :rtype: Filters + """ + return self._filters + + @filters.setter + def filters(self, filters): + """Sets the filters of this SettingsUsed. + + + :param filters: The filters of this SettingsUsed. # noqa: E501 + :type: Filters + """ + + self._filters = filters + + 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(SettingsUsed, 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, SettingsUsed): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/sort_direction.py b/digikey/v4/productinformation/models/sort_direction.py new file mode 100644 index 0000000..8ad00a4 --- /dev/null +++ b/digikey/v4/productinformation/models/sort_direction.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 SortDirection(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + ASCENDING = "Ascending" + DESCENDING = "Descending" + + """ + 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 = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SortDirection - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + 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(SortDirection, 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, SortDirection): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/sort_option.py b/digikey/v4/productinformation/models/sort_option.py new file mode 100644 index 0000000..38233e9 --- /dev/null +++ b/digikey/v4/productinformation/models/sort_option.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 SortOption(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + SORTBYDIGIKEYPARTNUMBER = "SortByDigiKeyPartNumber" + SORTBYMANUFACTURERPARTNUMBER = "SortByManufacturerPartNumber" + SORTBYDESCRIPTION = "SortByDescription" + SORTBYMANUFACTURER = "SortByManufacturer" + SORTBYMINIMUMORDERQUANTITY = "SortByMinimumOrderQuantity" + SORTBYQUANTITYAVAILABLE = "SortByQuantityAvailable" + SORTBYUNITPRICE = "SortByUnitPrice" + SORTBYPARAMETER = "SortByParameter" + + """ + 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 = { + } + + attribute_map = { + } + + def __init__(self): # noqa: E501 + """SortOption - a model defined in Swagger""" # noqa: E501 + self.discriminator = None + + 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(SortOption, 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, SortOption): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/sort_options.py b/digikey/v4/productinformation/models/sort_options.py new file mode 100644 index 0000000..c129b4a --- /dev/null +++ b/digikey/v4/productinformation/models/sort_options.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class SortOptions(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 = { + 'field': 'str', + 'sort_order': 'str' + } + + attribute_map = { + 'field': 'Field', + 'sort_order': 'SortOrder' + } + + def __init__(self, field=None, sort_order=None): # noqa: E501 + """SortOptions - a model defined in Swagger""" # noqa: E501 + self._field = None + self._sort_order = None + self.discriminator = None + if field is not None: + self.field = field + if sort_order is not None: + self.sort_order = sort_order + + @property + def field(self): + """Gets the field of this SortOptions. # noqa: E501 + + Field in response to sort by # noqa: E501 + + :return: The field of this SortOptions. # noqa: E501 + :rtype: str + """ + return self._field + + @field.setter + def field(self, field): + """Sets the field of this SortOptions. + + Field in response to sort by # noqa: E501 + + :param field: The field of this SortOptions. # noqa: E501 + :type: str + """ + allowed_values = ["None", "Packaging", "ProductStatus", "DigiKeyProductNumber", "ManufacturerProductNumber", "Manufacturer", "MinimumQuantity", "QuantityAvailable", "Price", "Supplier", "PriceManufacturerStandardPackage"] # noqa: E501 + if field not in allowed_values: + raise ValueError( + "Invalid value for `field` ({0}), must be one of {1}" # noqa: E501 + .format(field, allowed_values) + ) + + self._field = field + + @property + def sort_order(self): + """Gets the sort_order of this SortOptions. # noqa: E501 + + Direction to sort by Ascending or Descending # noqa: E501 + + :return: The sort_order of this SortOptions. # noqa: E501 + :rtype: str + """ + return self._sort_order + + @sort_order.setter + def sort_order(self, sort_order): + """Sets the sort_order of this SortOptions. + + Direction to sort by Ascending or Descending # noqa: E501 + + :param sort_order: The sort_order of this SortOptions. # noqa: E501 + :type: str + """ + allowed_values = ["Ascending", "Descending"] # noqa: E501 + if sort_order not in allowed_values: + raise ValueError( + "Invalid value for `sort_order` ({0}), must be one of {1}" # noqa: E501 + .format(sort_order, allowed_values) + ) + + self._sort_order = sort_order + + 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(SortOptions, 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, SortOptions): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/sort_parameters.py b/digikey/v4/productinformation/models/sort_parameters.py new file mode 100644 index 0000000..9052055 --- /dev/null +++ b/digikey/v4/productinformation/models/sort_parameters.py @@ -0,0 +1,171 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 SortParameters(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 = { + 'sort_option': 'SortOption', + 'direction': 'SortDirection', + 'sort_parameter_id': 'int' + } + + attribute_map = { + 'sort_option': 'SortOption', + 'direction': 'Direction', + 'sort_parameter_id': 'SortParameterId' + } + + def __init__(self, sort_option=None, direction=None, sort_parameter_id=None): # noqa: E501 + """SortParameters - a model defined in Swagger""" # noqa: E501 + + self._sort_option = None + self._direction = None + self._sort_parameter_id = None + self.discriminator = None + + self.sort_option = sort_option + self.direction = direction + if sort_parameter_id is not None: + self.sort_parameter_id = sort_parameter_id + + @property + def sort_option(self): + """Gets the sort_option of this SortParameters. # noqa: E501 + + + :return: The sort_option of this SortParameters. # noqa: E501 + :rtype: SortOption + """ + return self._sort_option + + @sort_option.setter + def sort_option(self, sort_option): + """Sets the sort_option of this SortParameters. + + + :param sort_option: The sort_option of this SortParameters. # noqa: E501 + :type: SortOption + """ + if sort_option is None: + raise ValueError("Invalid value for `sort_option`, must not be `None`") # noqa: E501 + + self._sort_option = sort_option + + @property + def direction(self): + """Gets the direction of this SortParameters. # noqa: E501 + + + :return: The direction of this SortParameters. # noqa: E501 + :rtype: SortDirection + """ + return self._direction + + @direction.setter + def direction(self, direction): + """Sets the direction of this SortParameters. + + + :param direction: The direction of this SortParameters. # noqa: E501 + :type: SortDirection + """ + if direction is None: + raise ValueError("Invalid value for `direction`, must not be `None`") # noqa: E501 + + self._direction = direction + + @property + def sort_parameter_id(self): + """Gets the sort_parameter_id of this SortParameters. # noqa: E501 + + The ParameterId of the parameter to sort on. The ParameterId can be found in the Search response. This is only used with SortByParameter. # noqa: E501 + + :return: The sort_parameter_id of this SortParameters. # noqa: E501 + :rtype: int + """ + return self._sort_parameter_id + + @sort_parameter_id.setter + def sort_parameter_id(self, sort_parameter_id): + """Sets the sort_parameter_id of this SortParameters. + + The ParameterId of the parameter to sort on. The ParameterId can be found in the Search response. This is only used with SortByParameter. # noqa: E501 + + :param sort_parameter_id: The sort_parameter_id of this SortParameters. # noqa: E501 + :type: int + """ + + self._sort_parameter_id = sort_parameter_id + + 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(SortParameters, 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, SortParameters): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/supplier.py b/digikey/v4/productinformation/models/supplier.py new file mode 100644 index 0000000..01d4087 --- /dev/null +++ b/digikey/v4/productinformation/models/supplier.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Supplier(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 = { + 'id': 'int', + 'name': 'str' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name' + } + + def __init__(self, id=None, name=None): # noqa: E501 + """Supplier - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + + @property + def id(self): + """Gets the id of this Supplier. # noqa: E501 + + Supplier Id # noqa: E501 + + :return: The id of this Supplier. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this Supplier. + + Supplier Id # noqa: E501 + + :param id: The id of this Supplier. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this Supplier. # noqa: E501 + + Supplier Name # noqa: E501 + + :return: The name of this Supplier. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this Supplier. + + Supplier Name # noqa: E501 + + :param name: The name of this Supplier. # noqa: E501 + :type: str + """ + + self._name = name + + 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(Supplier, 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, Supplier): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/top_category.py b/digikey/v4/productinformation/models/top_category.py new file mode 100644 index 0000000..4cef92d --- /dev/null +++ b/digikey/v4/productinformation/models/top_category.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TopCategory(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 = { + 'root_category': 'TopCategoryNode', + 'category': 'TopCategoryNode', + 'score': 'float', + 'image_url': 'str' + } + + attribute_map = { + 'root_category': 'RootCategory', + 'category': 'Category', + 'score': 'Score', + 'image_url': 'ImageUrl' + } + + def __init__(self, root_category=None, category=None, score=None, image_url=None): # noqa: E501 + """TopCategory - a model defined in Swagger""" # noqa: E501 + self._root_category = None + self._category = None + self._score = None + self._image_url = None + self.discriminator = None + if root_category is not None: + self.root_category = root_category + if category is not None: + self.category = category + if score is not None: + self.score = score + if image_url is not None: + self.image_url = image_url + + @property + def root_category(self): + """Gets the root_category of this TopCategory. # noqa: E501 + + + :return: The root_category of this TopCategory. # noqa: E501 + :rtype: TopCategoryNode + """ + return self._root_category + + @root_category.setter + def root_category(self, root_category): + """Sets the root_category of this TopCategory. + + + :param root_category: The root_category of this TopCategory. # noqa: E501 + :type: TopCategoryNode + """ + + self._root_category = root_category + + @property + def category(self): + """Gets the category of this TopCategory. # noqa: E501 + + + :return: The category of this TopCategory. # noqa: E501 + :rtype: TopCategoryNode + """ + return self._category + + @category.setter + def category(self, category): + """Sets the category of this TopCategory. + + + :param category: The category of this TopCategory. # noqa: E501 + :type: TopCategoryNode + """ + + self._category = category + + @property + def score(self): + """Gets the score of this TopCategory. # noqa: E501 + + Category Score # noqa: E501 + + :return: The score of this TopCategory. # noqa: E501 + :rtype: float + """ + return self._score + + @score.setter + def score(self, score): + """Sets the score of this TopCategory. + + Category Score # noqa: E501 + + :param score: The score of this TopCategory. # noqa: E501 + :type: float + """ + + self._score = score + + @property + def image_url(self): + """Gets the image_url of this TopCategory. # noqa: E501 + + URL for the Category image # noqa: E501 + + :return: The image_url of this TopCategory. # noqa: E501 + :rtype: str + """ + return self._image_url + + @image_url.setter + def image_url(self, image_url): + """Sets the image_url of this TopCategory. + + URL for the Category image # noqa: E501 + + :param image_url: The image_url of this TopCategory. # noqa: E501 + :type: str + """ + + self._image_url = image_url + + 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(TopCategory, 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, TopCategory): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/top_category_node.py b/digikey/v4/productinformation/models/top_category_node.py new file mode 100644 index 0000000..66f9b0f --- /dev/null +++ b/digikey/v4/productinformation/models/top_category_node.py @@ -0,0 +1,168 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class TopCategoryNode(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 = { + 'id': 'int', + 'name': 'str', + 'product_count': 'int' + } + + attribute_map = { + 'id': 'Id', + 'name': 'Name', + 'product_count': 'ProductCount' + } + + def __init__(self, id=None, name=None, product_count=None): # noqa: E501 + """TopCategoryNode - a model defined in Swagger""" # noqa: E501 + self._id = None + self._name = None + self._product_count = None + self.discriminator = None + if id is not None: + self.id = id + if name is not None: + self.name = name + if product_count is not None: + self.product_count = product_count + + @property + def id(self): + """Gets the id of this TopCategoryNode. # noqa: E501 + + Category Id # noqa: E501 + + :return: The id of this TopCategoryNode. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this TopCategoryNode. + + Category Id # noqa: E501 + + :param id: The id of this TopCategoryNode. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def name(self): + """Gets the name of this TopCategoryNode. # noqa: E501 + + Category Name # noqa: E501 + + :return: The name of this TopCategoryNode. # noqa: E501 + :rtype: str + """ + return self._name + + @name.setter + def name(self, name): + """Sets the name of this TopCategoryNode. + + Category Name # noqa: E501 + + :param name: The name of this TopCategoryNode. # noqa: E501 + :type: str + """ + + self._name = name + + @property + def product_count(self): + """Gets the product_count of this TopCategoryNode. # noqa: E501 + + Product count for the Category # noqa: E501 + + :return: The product_count of this TopCategoryNode. # noqa: E501 + :rtype: int + """ + return self._product_count + + @product_count.setter + def product_count(self, product_count): + """Sets the product_count of this TopCategoryNode. + + Product count for the Category # noqa: E501 + + :param product_count: The product_count of this TopCategoryNode. # noqa: E501 + :type: int + """ + + self._product_count = product_count + + 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(TopCategoryNode, 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, TopCategoryNode): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/models/value_pair.py b/digikey/v4/productinformation/models/value_pair.py new file mode 100644 index 0000000..12f2e96 --- /dev/null +++ b/digikey/v4/productinformation/models/value_pair.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + PartSearch Api + + Search for products and retrieve details and pricing. # 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 ValuePair(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 = { + 'value_id': 'str', + 'value': 'str' + } + + attribute_map = { + 'value_id': 'ValueId', + 'value': 'Value' + } + + def __init__(self, value_id=None, value=None): # noqa: E501 + """ValuePair - a model defined in Swagger""" # noqa: E501 + + self._value_id = None + self._value = None + self.discriminator = None + + if value_id is not None: + self.value_id = value_id + if value is not None: + self.value = value + + @property + def value_id(self): + """Gets the value_id of this ValuePair. # noqa: E501 + + The Id of the value. # noqa: E501 + + :return: The value_id of this ValuePair. # noqa: E501 + :rtype: str + """ + return self._value_id + + @value_id.setter + def value_id(self, value_id): + """Sets the value_id of this ValuePair. + + The Id of the value. # noqa: E501 + + :param value_id: The value_id of this ValuePair. # noqa: E501 + :type: str + """ + + self._value_id = value_id + + @property + def value(self): + """Gets the value of this ValuePair. # noqa: E501 + + The name of the value. # noqa: E501 + + :return: The value of this ValuePair. # noqa: E501 + :rtype: str + """ + return self._value + + @value.setter + def value(self, value): + """Sets the value of this ValuePair. + + The name of the value. # noqa: E501 + + :param value: The value of this ValuePair. # noqa: E501 + :type: str + """ + + self._value = value + + 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(ValuePair, 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, ValuePair): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/digikey/v4/productinformation/rest.py b/digikey/v4/productinformation/rest.py new file mode 100644 index 0000000..f12358f --- /dev/null +++ b/digikey/v4/productinformation/rest.py @@ -0,0 +1,317 @@ +# coding: utf-8 + +""" + ProductSearch Api + + ProductSearch Api # noqa: E501 + + OpenAPI spec version: v4 + Contact: dl_Agile_Team_B2B_API@digikey.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.headers.get(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message