From 634585522274629bcf006e2fff007dc69fa9cb2b Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Fri, 7 Nov 2025 12:59:09 -0800 Subject: [PATCH] Remove remaining estimates --- CHANGELOG.md | 7 + README.md | 61 - patch_api/__init__.py | 4 +- patch_api/api/__init__.py | 3 +- patch_api/api/estimates_api.py | 1844 ----------------- patch_api/api_client.py | 4 +- patch_api/configuration.py | 2 +- patch_api/models/__init__.py | 21 +- .../create_air_shipping_estimate_request.py | 347 ---- .../models/create_bitcoin_estimate_request.py | 232 --- .../create_ecommerce_estimate_request.py | 294 --- .../models/create_flight_estimate_request.py | 326 --- .../models/create_mass_estimate_request.py | 199 -- .../create_rail_shipping_estimate_request.py | 425 ---- .../create_road_shipping_estimate_request.py | 601 ------ .../create_sea_shipping_estimate_request.py | 520 ----- patch_api/models/estimate.py | 259 --- patch_api/models/estimate_list_response.py | 224 -- patch_api/models/estimate_response.py | 180 -- setup.cfg | 2 + setup.py | 2 +- test/test_estimates_api.py | 284 --- 22 files changed, 18 insertions(+), 5823 deletions(-) delete mode 100644 patch_api/api/estimates_api.py delete mode 100644 patch_api/models/create_air_shipping_estimate_request.py delete mode 100644 patch_api/models/create_bitcoin_estimate_request.py delete mode 100644 patch_api/models/create_ecommerce_estimate_request.py delete mode 100644 patch_api/models/create_flight_estimate_request.py delete mode 100644 patch_api/models/create_mass_estimate_request.py delete mode 100644 patch_api/models/create_rail_shipping_estimate_request.py delete mode 100644 patch_api/models/create_road_shipping_estimate_request.py delete mode 100644 patch_api/models/create_sea_shipping_estimate_request.py delete mode 100644 patch_api/models/estimate.py delete mode 100644 patch_api/models/estimate_list_response.py delete mode 100644 patch_api/models/estimate_response.py create mode 100644 setup.cfg delete mode 100644 test/test_estimates_api.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ad9cf91..a7b907a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.6.0] - 2025-11-07 + +### Removed + +- Removes `create_mass_estimate` and `create_bitcoin_estimate` method +- Retires all remaining estimates functionalities + ## [2.4.0] - 2025-05-16 ### Removed diff --git a/README.md b/README.md index 1a1c24d..8441ecb 100644 --- a/README.md +++ b/README.md @@ -49,12 +49,6 @@ orders = patch.orders.retrieve_orders() ### Orders -In Patch, orders represent a purchase of carbon offsets or negative emissions by mass. -Place orders directly if you know the amount of carbon dioxide you would like to sequester. -If you do not know how much to purchase, use an estimate. -You can also create an order with a maximum desired price, and we'll allocate enough mass to -fulfill the order for you. - [API Reference](https://docs.patch.io/#/orders) #### Examples @@ -114,61 +108,6 @@ page = 1 # Pass in which page of orders you'd like patch.orders.retrieve_orders(page=page) ``` -### Estimates - -Estimates allow API users to get a quote for the cost of compensating a certain amount of CO2. When creating an estimate, an order in the `draft` state will also be created, reserving the allocation of a project for 5 minutes. If you don't place your draft order within those 5 minutes, the order will automatically be cancelled. - -[API Reference](https://docs.patch.io/#/estimates) - -#### Examples - -```python -import patch_api - -patch = patch_api.ApiClient(api_key=os.environ.get('SANDBOX_API_KEY')) - -# Create an estimate -mass_g = 1_000_000 # Pass in the mass in grams (i.e. 1 metric tonne) -patch.estimates.create_mass_estimate(mass_g=mass_g) - -## You can also specify a project-id field (optional) to be used instead of the preferred one -project_id = 'pro_test_1234' # Pass in the project's ID -patch.estimates.create_mass_estimate(mass_g=mass_g, project_id=project_id) - -# Create a flight estimate -distance_m = 1_000_000 # Pass in the distance traveled in meters -patch.estimates.create_flight_estimate(distance_m=distance_m) - -# Create an ecommerce estimate -distance_m = 1_000_000 # Pass in the distance traveled in meters -transportation_method = "rail" -package_mass_g = 5000 -patch.estimates.create_ecommerce_estimate( - distance_m=distance_m, - transportation_method=transportation_method, - package_mass_g=package_mass_g -) - -# Create a vehicle estimate -distance_m = 1_000_000 # Pass in the distance traveled in meters -make = "Toyota" -model = "Corolla" -year = 1995 -patch.estimates.create_vehicle_estimate(distance_m=distance_m, make=make, model=model, year=year) - -# Create a bitcoin estimate -transaction_value_btc_sats = 1000 # [Optional] Pass in the transaction value in satoshis -patch.estimates.create_bitcoin_estimate(transaction_value_btc_sats=transaction_value_btc_sats) - -# Retrieve an estimate -estimate_id = 'est_test_1234' -patch.estimates.retrieve_estimate(id=estimate_id) - -# Retrieve a list of estimates -page = 1 # Pass in which page of estimates you'd like -patch.estimates.retrieve_estimates(page=page) -``` - ### Projects Projects are the ways Patch takes CO2 out of the air. They can represent reforestation, enhanced weathering, direct air carbon capture, etc. When you place an order via Patch, it is allocated to a project. diff --git a/patch_api/__init__.py b/patch_api/__init__.py index 17fe4d9..3e39257 100644 --- a/patch_api/__init__.py +++ b/patch_api/__init__.py @@ -1,5 +1,7 @@ # coding: utf-8 +# flake8: noqa + """ Patch API V2 @@ -13,7 +15,7 @@ from __future__ import absolute_import -__version__ = "2.4.0" +__version__ = "2.6.0" # import ApiClient from patch_api.api_client import ApiClient diff --git a/patch_api/api/__init__.py b/patch_api/api/__init__.py index f25d081..c61f886 100644 --- a/patch_api/api/__init__.py +++ b/patch_api/api/__init__.py @@ -1,7 +1,8 @@ from __future__ import absolute_import +# flake8: noqa + # import apis into api package -from patch_api.api.estimates_api import EstimatesApi from patch_api.api.order_line_items_api import OrderLineItemsApi from patch_api.api.orders_api import OrdersApi from patch_api.api.projects_api import ProjectsApi diff --git a/patch_api/api/estimates_api.py b/patch_api/api/estimates_api.py deleted file mode 100644 index 5a129b1..0000000 --- a/patch_api/api/estimates_api.py +++ /dev/null @@ -1,1844 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from patch_api.exceptions import ApiTypeError, ApiValueError - - -class EstimatesApi(object): - """NOTE: This class is auto generated by OpenAPI Generator - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - ALLOWED_QUERY_PARAMS = [ - "mass_g", - "total_price_cents_usd", - "project_id", - "page", - "distance_m", - "transportation_method", - "package_mass_g", - "create_order", - "model", - "make", - "year", - "transaction_value_btc_sats", - "transaction_value_eth_gwei", - "gas_used", - "average_daily_balance_btc_sats", - "average_daily_balance_eth_gwei", - "timestamp", - "origin_airport", - "destination_airport", - "aircraft_code", - "cabin_class", - "passenger_count", - "state", - "country_code", - "city", - "region", - "star_rating", - "number_of_nights", - "number_of_rooms", - "vintage_year", - "total_price", - "currency", - "amount", - "unit", - "issued_to", - "cargo_type", - "container_size_code", - "destination_country_code", - "destination_locode", - "destination_postal_code", - "emissions_scope", - "freight_mass_g", - "freight_volume_cubic_m", - "fuel_type", - "number_of_containers", - "origin_country_code", - "origin_locode", - "origin_postal_code", - "truck_weight_t", - "vessel_imo", - "vintage_start_year", - "vintage_end_year", - ] - - def __init__(self, api_client=None): - self.api_client = api_client - - def create_air_shipping_estimate( - self, create_air_shipping_estimate_request={}, **kwargs - ): # noqa: E501 - """Creates a GLEC air shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_air_shipping_estimate(create_air_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateAirShippingEstimateRequest create_air_shipping_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_air_shipping_estimate_with_http_info( - create_air_shipping_estimate_request, **kwargs - ) # noqa: E501 - - def create_air_shipping_estimate_with_http_info( - self, create_air_shipping_estimate_request, **kwargs - ): # noqa: E501 - """Creates a GLEC air shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC air shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_air_shipping_estimate_with_http_info(create_air_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateAirShippingEstimateRequest create_air_shipping_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - "create_air_shipping_estimate_request", - "patch_version", - ] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_air_shipping_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_air_shipping_estimate_request' is set - if ( - "create_air_shipping_estimate_request" not in local_var_params - or local_var_params["create_air_shipping_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_air_shipping_estimate_request` when calling `create_air_shipping_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_air_shipping_estimate_request" in local_var_params: - body_params = local_var_params["create_air_shipping_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/shipping/air", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def create_bitcoin_estimate( - self, create_bitcoin_estimate_request={}, **kwargs - ): # noqa: E501 - """Create a bitcoin estimate given a timestamp and transaction value # noqa: E501 - - Creates a bitcoin estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_bitcoin_estimate(create_bitcoin_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateBitcoinEstimateRequest create_bitcoin_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_bitcoin_estimate_with_http_info( - create_bitcoin_estimate_request, **kwargs - ) # noqa: E501 - - def create_bitcoin_estimate_with_http_info( - self, create_bitcoin_estimate_request, **kwargs - ): # noqa: E501 - """Create a bitcoin estimate given a timestamp and transaction value # noqa: E501 - - Creates a bitcoin estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_bitcoin_estimate_with_http_info(create_bitcoin_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateBitcoinEstimateRequest create_bitcoin_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ["create_bitcoin_estimate_request", "patch_version"] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_bitcoin_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_bitcoin_estimate_request' is set - if ( - "create_bitcoin_estimate_request" not in local_var_params - or local_var_params["create_bitcoin_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_bitcoin_estimate_request` when calling `create_bitcoin_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_bitcoin_estimate_request" in local_var_params: - body_params = local_var_params["create_bitcoin_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/crypto/btc", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def create_flight_estimate( - self, create_flight_estimate_request={}, **kwargs - ): # noqa: E501 - """Create a flight estimate given the distance traveled in meters # noqa: E501 - - Creates a flight estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_flight_estimate(create_flight_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateFlightEstimateRequest create_flight_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_flight_estimate_with_http_info( - create_flight_estimate_request, **kwargs - ) # noqa: E501 - - def create_flight_estimate_with_http_info( - self, create_flight_estimate_request, **kwargs - ): # noqa: E501 - """Create a flight estimate given the distance traveled in meters # noqa: E501 - - Creates a flight estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_flight_estimate_with_http_info(create_flight_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateFlightEstimateRequest create_flight_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ["create_flight_estimate_request", "patch_version"] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_flight_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_flight_estimate_request' is set - if ( - "create_flight_estimate_request" not in local_var_params - or local_var_params["create_flight_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_flight_estimate_request` when calling `create_flight_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_flight_estimate_request" in local_var_params: - body_params = local_var_params["create_flight_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/flight", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def create_mass_estimate( - self, create_mass_estimate_request={}, **kwargs - ): # noqa: E501 - """Create an estimate based on mass of CO2 # noqa: E501 - - Creates an estimate for the mass of CO2 to be compensated. An order in the `draft` state will also be created, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_mass_estimate(create_mass_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateMassEstimateRequest create_mass_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_mass_estimate_with_http_info( - create_mass_estimate_request, **kwargs - ) # noqa: E501 - - def create_mass_estimate_with_http_info( - self, create_mass_estimate_request, **kwargs - ): # noqa: E501 - """Create an estimate based on mass of CO2 # noqa: E501 - - Creates an estimate for the mass of CO2 to be compensated. An order in the `draft` state will also be created, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_mass_estimate_with_http_info(create_mass_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateMassEstimateRequest create_mass_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ["create_mass_estimate_request", "patch_version"] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_mass_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_mass_estimate_request' is set - if ( - "create_mass_estimate_request" not in local_var_params - or local_var_params["create_mass_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_mass_estimate_request` when calling `create_mass_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_mass_estimate_request" in local_var_params: - body_params = local_var_params["create_mass_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/mass", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def create_rail_shipping_estimate( - self, create_rail_shipping_estimate_request={}, **kwargs - ): # noqa: E501 - """Creates a GLEC rail shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC rail shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_rail_shipping_estimate(create_rail_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateRailShippingEstimateRequest create_rail_shipping_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_rail_shipping_estimate_with_http_info( - create_rail_shipping_estimate_request, **kwargs - ) # noqa: E501 - - def create_rail_shipping_estimate_with_http_info( - self, create_rail_shipping_estimate_request, **kwargs - ): # noqa: E501 - """Creates a GLEC rail shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC rail shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_rail_shipping_estimate_with_http_info(create_rail_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateRailShippingEstimateRequest create_rail_shipping_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - "create_rail_shipping_estimate_request", - "patch_version", - ] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_rail_shipping_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_rail_shipping_estimate_request' is set - if ( - "create_rail_shipping_estimate_request" not in local_var_params - or local_var_params["create_rail_shipping_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_rail_shipping_estimate_request` when calling `create_rail_shipping_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_rail_shipping_estimate_request" in local_var_params: - body_params = local_var_params["create_rail_shipping_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/shipping/rail", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def create_road_shipping_estimate( - self, create_road_shipping_estimate_request={}, **kwargs - ): # noqa: E501 - """Creates a GLEC road shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC road shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_road_shipping_estimate(create_road_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateRoadShippingEstimateRequest create_road_shipping_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_road_shipping_estimate_with_http_info( - create_road_shipping_estimate_request, **kwargs - ) # noqa: E501 - - def create_road_shipping_estimate_with_http_info( - self, create_road_shipping_estimate_request, **kwargs - ): # noqa: E501 - """Creates a GLEC road shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC road shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_road_shipping_estimate_with_http_info(create_road_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateRoadShippingEstimateRequest create_road_shipping_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - "create_road_shipping_estimate_request", - "patch_version", - ] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_road_shipping_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_road_shipping_estimate_request' is set - if ( - "create_road_shipping_estimate_request" not in local_var_params - or local_var_params["create_road_shipping_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_road_shipping_estimate_request` when calling `create_road_shipping_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_road_shipping_estimate_request" in local_var_params: - body_params = local_var_params["create_road_shipping_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/shipping/road", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def create_sea_shipping_estimate( - self, create_sea_shipping_estimate_request={}, **kwargs - ): # noqa: E501 - """Creates a GLEC sea shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC sea shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_sea_shipping_estimate(create_sea_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateSeaShippingEstimateRequest create_sea_shipping_estimate_request: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.create_sea_shipping_estimate_with_http_info( - create_sea_shipping_estimate_request, **kwargs - ) # noqa: E501 - - def create_sea_shipping_estimate_with_http_info( - self, create_sea_shipping_estimate_request, **kwargs - ): # noqa: E501 - """Creates a GLEC sea shipping estimate given freight mass and logistics # noqa: E501 - - Creates a GLEC sea shipping estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters, linked to the estimate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_sea_shipping_estimate_with_http_info(create_sea_shipping_estimate_request, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param CreateSeaShippingEstimateRequest create_sea_shipping_estimate_request: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [ - "create_sea_shipping_estimate_request", - "patch_version", - ] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_sea_shipping_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'create_sea_shipping_estimate_request' is set - if ( - "create_sea_shipping_estimate_request" not in local_var_params - or local_var_params["create_sea_shipping_estimate_request"] is None - ): - raise ApiValueError( - "Missing the required parameter `create_sea_shipping_estimate_request` when calling `create_sea_shipping_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # noqa: E501 - - form_params = [] - local_var_files = {} - - body_params = None - if "create_sea_shipping_estimate_request" in local_var_params: - body_params = local_var_params["create_sea_shipping_estimate_request"] - # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/shipping/sea", - "POST", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def retrieve_estimate(self, id={}, **kwargs): # noqa: E501 - """Retrieves an estimate # noqa: E501 - - Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_estimate(id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param str id: (required) - :param int patch_version: - :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: EstimateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.retrieve_estimate_with_http_info(id, **kwargs) # noqa: E501 - - def retrieve_estimate_with_http_info(self, id, **kwargs): # noqa: E501 - """Retrieves an estimate # noqa: E501 - - Retrieves a given estimate and its associated order. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_estimate_with_http_info(id, async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param str id: (required) - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ["id", "patch_version"] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_estimate" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - # verify the required parameter 'id' is set - if "id" not in local_var_params or local_var_params["id"] is None: - raise ApiValueError( - "Missing the required parameter `id` when calling `retrieve_estimate`" - ) # noqa: E501 - - collection_formats = {} - - path_params = {} - if "id" in local_var_params: - path_params["id"] = local_var_params["id"] # noqa: E501 - - query_params = [] - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates/{id}", - "GET", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) - - def retrieve_estimates(self, **kwargs): # noqa: E501 - """Retrieves a list of estimates # noqa: E501 - - Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_estimates(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param int page: - :param int patch_version: - :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: EstimateListResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs["_return_http_data_only"] = True - return self.retrieve_estimates_with_http_info(**kwargs) # noqa: E501 - - def retrieve_estimates_with_http_info(self, **kwargs): # noqa: E501 - """Retrieves a list of estimates # noqa: E501 - - Retrieves a list of estimates and their associated orders. You can only retrieve estimates associated with the organization you are querying for. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_estimates_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool: execute request asynchronously - :param int page: - :param int patch_version: - :param _return_http_data_only: response data without head status code - and headers - :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: tuple(EstimateListResponse, status_code(int), headers(HTTPHeaderDict)) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ["page", "patch_version"] # noqa: E501 - all_params.append("async_req") - all_params.append("_return_http_data_only") - all_params.append("_preload_content") - all_params.append("_request_timeout") - all_params.append("mass_g") - all_params.append("total_price_cents_usd") - all_params.append("project_id") - all_params.append("metadata") - all_params.append("distance_m") - all_params.append("transportation_method") - all_params.append("package_mass_g") - all_params.append("create_order") - all_params.append("make") - all_params.append("model") - all_params.append("year") - all_params.append("transaction_value_btc_sats") - all_params.append("transaction_value_eth_gwei") - all_params.append("gas_used") - all_params.append("transaction_value_btc_sats") - all_params.append("average_daily_balance_btc_sats") - all_params.append("average_daily_balance_eth_gwei") - all_params.append("timestamp") - all_params.append("origin_airport") - all_params.append("destination_airport") - all_params.append("aircraft_code") - all_params.append("cabin_class") - all_params.append("passenger_count") - all_params.append("state") - all_params.append("country_code") - all_params.append("city") - all_params.append("region") - all_params.append("star_rating") - all_params.append("number_of_nights") - all_params.append("number_of_rooms") - all_params.append("vintage_year") - all_params.append("total_price") - all_params.append("currency") - all_params.append("amount") - all_params.append("unit") - all_params.append("issued_to") - all_params.append("cargo_type") - all_params.append("container_size_code") - all_params.append("destination_country_code") - all_params.append("destination_locode") - all_params.append("destination_postal_code") - all_params.append("emissions_scope") - all_params.append("freight_mass_g") - all_params.append("freight_volume_cubic_m") - all_params.append("fuel_type") - all_params.append("number_of_containers") - all_params.append("origin_country_code") - all_params.append("origin_locode") - all_params.append("origin_postal_code") - all_params.append("truck_weight_t") - all_params.append("vessel_imo") - all_params.append("vintage_start_year") - all_params.append("vintage_end_year") - - for key, val in six.iteritems(local_var_params["kwargs"]): - if key not in all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_estimates" % key - ) - local_var_params[key] = val - del local_var_params["kwargs"] - - collection_formats = {} - - path_params = {} - - query_params = [] - if "page" in local_var_params: - query_params.append(("page", local_var_params["page"])) # noqa: E501 - - # do not add duplicate keys to query_params list - existing_keys = [] - for param in query_params: - existing_keys.append(param[0]) - - for key in kwargs: - if key not in existing_keys: - query_params.append([key, kwargs.get(key)]) - - header_params = {} - if "patch_version" in local_var_params: - header_params["Patch-Version"] = local_var_params[ - "patch_version" - ] # 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 = ["bearer_auth"] # noqa: E501 - - return self.api_client.call_api( - "/v1/estimates", - "GET", - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type="EstimateListResponse", # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get("async_req"), - _return_http_data_only=local_var_params.get( - "_return_http_data_only" - ), # noqa: E501 - _preload_content=local_var_params.get("_preload_content", True), - _request_timeout=local_var_params.get("_request_timeout"), - collection_formats=collection_formats, - ) diff --git a/patch_api/api_client.py b/patch_api/api_client.py index d1bfdaf..da24558 100644 --- a/patch_api/api_client.py +++ b/patch_api/api_client.py @@ -25,7 +25,6 @@ from patch_api.configuration import Configuration import patch_api.models -from patch_api.api.estimates_api import EstimatesApi from patch_api.api.order_line_items_api import OrderLineItemsApi from patch_api.api.orders_api import OrdersApi from patch_api.api.projects_api import ProjectsApi @@ -92,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "patch-python/2.4.0" + self.user_agent = "patch-python/2.6.0" # Set default Patch-Version self.patch_version = 2 @@ -107,7 +106,6 @@ def __getattr__(self, method): "projects": ProjectsApi, "orders": OrdersApi, "order_line_items": OrderLineItemsApi, - "estimates": EstimatesApi, "technology_types": TechnologyTypesApi, }[method] return resource(api_client=self) diff --git a/patch_api/configuration.py b/patch_api/configuration.py index 64fefdd..b3a2058 100644 --- a/patch_api/configuration.py +++ b/patch_api/configuration.py @@ -341,7 +341,7 @@ def to_debug_report(self): "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 2\n" - "SDK Package Version: 2.4.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 2.6.0".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/patch_api/models/__init__.py b/patch_api/models/__init__.py index 79f4d84..6a211a5 100644 --- a/patch_api/models/__init__.py +++ b/patch_api/models/__init__.py @@ -1,5 +1,6 @@ # coding: utf-8 +# flake8: noqa """ Patch API V2 @@ -14,32 +15,12 @@ from __future__ import absolute_import # import models into model package -from patch_api.models.create_air_shipping_estimate_request import ( - CreateAirShippingEstimateRequest, -) -from patch_api.models.create_bitcoin_estimate_request import ( - CreateBitcoinEstimateRequest, -) -from patch_api.models.create_flight_estimate_request import CreateFlightEstimateRequest -from patch_api.models.create_mass_estimate_request import CreateMassEstimateRequest from patch_api.models.create_order_line_item_request import CreateOrderLineItemRequest from patch_api.models.create_order_request import CreateOrderRequest -from patch_api.models.create_rail_shipping_estimate_request import ( - CreateRailShippingEstimateRequest, -) -from patch_api.models.create_road_shipping_estimate_request import ( - CreateRoadShippingEstimateRequest, -) -from patch_api.models.create_sea_shipping_estimate_request import ( - CreateSeaShippingEstimateRequest, -) from patch_api.models.create_success_response import CreateSuccessResponse from patch_api.models.delete_order_response import DeleteOrderResponse from patch_api.models.disclaimer import Disclaimer from patch_api.models.error_response import ErrorResponse -from patch_api.models.estimate import Estimate -from patch_api.models.estimate_list_response import EstimateListResponse -from patch_api.models.estimate_response import EstimateResponse from patch_api.models.highlight import Highlight from patch_api.models.inventory import Inventory from patch_api.models.meta_index_object import MetaIndexObject diff --git a/patch_api/models/create_air_shipping_estimate_request.py b/patch_api/models/create_air_shipping_estimate_request.py deleted file mode 100644 index afacbe2..0000000 --- a/patch_api/models/create_air_shipping_estimate_request.py +++ /dev/null @@ -1,347 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateAirShippingEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "destination_airport": "str", - "origin_airport": "str", - "aircraft_code": "str", - "aircraft_type": "str", - "freight_mass_g": "int", - "emissions_scope": "str", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "destination_airport": "destination_airport", - "origin_airport": "origin_airport", - "aircraft_code": "aircraft_code", - "aircraft_type": "aircraft_type", - "freight_mass_g": "freight_mass_g", - "emissions_scope": "emissions_scope", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - destination_airport=None, - origin_airport=None, - aircraft_code=None, - aircraft_type="unknown", - freight_mass_g=None, - emissions_scope="ttw", - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateAirShippingEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._destination_airport = None - self._origin_airport = None - self._aircraft_code = None - self._aircraft_type = None - self._freight_mass_g = None - self._emissions_scope = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.destination_airport = destination_airport - self.origin_airport = origin_airport - self.aircraft_code = aircraft_code - self.aircraft_type = aircraft_type - if freight_mass_g is not None: - self.freight_mass_g = freight_mass_g - self.emissions_scope = emissions_scope - self.project_id = project_id - self.create_order = create_order - - @property - def destination_airport(self): - """Gets the destination_airport of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The destination_airport of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_airport - - @destination_airport.setter - def destination_airport(self, destination_airport): - """Sets the destination_airport of this CreateAirShippingEstimateRequest. - - - :param destination_airport: The destination_airport of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_airport = destination_airport - - @property - def origin_airport(self): - """Gets the origin_airport of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The origin_airport of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_airport - - @origin_airport.setter - def origin_airport(self, origin_airport): - """Sets the origin_airport of this CreateAirShippingEstimateRequest. - - - :param origin_airport: The origin_airport of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_airport = origin_airport - - @property - def aircraft_code(self): - """Gets the aircraft_code of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The aircraft_code of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._aircraft_code - - @aircraft_code.setter - def aircraft_code(self, aircraft_code): - """Sets the aircraft_code of this CreateAirShippingEstimateRequest. - - - :param aircraft_code: The aircraft_code of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._aircraft_code = aircraft_code - - @property - def aircraft_type(self): - """Gets the aircraft_type of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The aircraft_type of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._aircraft_type - - @aircraft_type.setter - def aircraft_type(self, aircraft_type): - """Sets the aircraft_type of this CreateAirShippingEstimateRequest. - - - :param aircraft_type: The aircraft_type of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "passenger", "cargo", "unknown"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and aircraft_type not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `aircraft_type` ({0}), must be one of {1}".format( # noqa: E501 - aircraft_type, allowed_values - ) - ) - - self._aircraft_type = aircraft_type - - @property - def freight_mass_g(self): - """Gets the freight_mass_g of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The freight_mass_g of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._freight_mass_g - - @freight_mass_g.setter - def freight_mass_g(self, freight_mass_g): - """Sets the freight_mass_g of this CreateAirShippingEstimateRequest. - - - :param freight_mass_g: The freight_mass_g of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g > 2000000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value less than or equal to `2000000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._freight_mass_g = freight_mass_g - - @property - def emissions_scope(self): - """Gets the emissions_scope of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The emissions_scope of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._emissions_scope - - @emissions_scope.setter - def emissions_scope(self, emissions_scope): - """Sets the emissions_scope of this CreateAirShippingEstimateRequest. - - - :param emissions_scope: The emissions_scope of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "wtt", "ttw", "wtw"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and emissions_scope not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `emissions_scope` ({0}), must be one of {1}".format( # noqa: E501 - emissions_scope, allowed_values - ) - ) - - self._emissions_scope = emissions_scope - - @property - def project_id(self): - """Gets the project_id of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateAirShippingEstimateRequest. - - - :param project_id: The project_id of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateAirShippingEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateAirShippingEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateAirShippingEstimateRequest. - - - :param create_order: The create_order of this CreateAirShippingEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateAirShippingEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateAirShippingEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_bitcoin_estimate_request.py b/patch_api/models/create_bitcoin_estimate_request.py deleted file mode 100644 index 46789f7..0000000 --- a/patch_api/models/create_bitcoin_estimate_request.py +++ /dev/null @@ -1,232 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateBitcoinEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "timestamp": "datetime", - "transaction_value_btc_sats": "int", - "average_daily_balance_btc_sats": "int", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "timestamp": "timestamp", - "transaction_value_btc_sats": "transaction_value_btc_sats", - "average_daily_balance_btc_sats": "average_daily_balance_btc_sats", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - timestamp=None, - transaction_value_btc_sats=None, - average_daily_balance_btc_sats=None, - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateBitcoinEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._timestamp = None - self._transaction_value_btc_sats = None - self._average_daily_balance_btc_sats = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.timestamp = timestamp - self.transaction_value_btc_sats = transaction_value_btc_sats - self.average_daily_balance_btc_sats = average_daily_balance_btc_sats - self.project_id = project_id - self.create_order = create_order - - @property - def timestamp(self): - """Gets the timestamp of this CreateBitcoinEstimateRequest. # noqa: E501 - - - :return: The timestamp of this CreateBitcoinEstimateRequest. # noqa: E501 - :rtype: datetime - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp): - """Sets the timestamp of this CreateBitcoinEstimateRequest. - - - :param timestamp: The timestamp of this CreateBitcoinEstimateRequest. # noqa: E501 - :type: datetime - """ - - self._timestamp = timestamp - - @property - def transaction_value_btc_sats(self): - """Gets the transaction_value_btc_sats of this CreateBitcoinEstimateRequest. # noqa: E501 - - - :return: The transaction_value_btc_sats of this CreateBitcoinEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._transaction_value_btc_sats - - @transaction_value_btc_sats.setter - def transaction_value_btc_sats(self, transaction_value_btc_sats): - """Sets the transaction_value_btc_sats of this CreateBitcoinEstimateRequest. - - - :param transaction_value_btc_sats: The transaction_value_btc_sats of this CreateBitcoinEstimateRequest. # noqa: E501 - :type: int - """ - - self._transaction_value_btc_sats = transaction_value_btc_sats - - @property - def average_daily_balance_btc_sats(self): - """Gets the average_daily_balance_btc_sats of this CreateBitcoinEstimateRequest. # noqa: E501 - - - :return: The average_daily_balance_btc_sats of this CreateBitcoinEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._average_daily_balance_btc_sats - - @average_daily_balance_btc_sats.setter - def average_daily_balance_btc_sats(self, average_daily_balance_btc_sats): - """Sets the average_daily_balance_btc_sats of this CreateBitcoinEstimateRequest. - - - :param average_daily_balance_btc_sats: The average_daily_balance_btc_sats of this CreateBitcoinEstimateRequest. # noqa: E501 - :type: int - """ - - self._average_daily_balance_btc_sats = average_daily_balance_btc_sats - - @property - def project_id(self): - """Gets the project_id of this CreateBitcoinEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateBitcoinEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateBitcoinEstimateRequest. - - - :param project_id: The project_id of this CreateBitcoinEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateBitcoinEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateBitcoinEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateBitcoinEstimateRequest. - - - :param create_order: The create_order of this CreateBitcoinEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateBitcoinEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateBitcoinEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_ecommerce_estimate_request.py b/patch_api/models/create_ecommerce_estimate_request.py deleted file mode 100644 index e59d297..0000000 --- a/patch_api/models/create_ecommerce_estimate_request.py +++ /dev/null @@ -1,294 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateEcommerceEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "distance_m": "int", - "package_mass_g": "int", - "transportation_method": "str", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "distance_m": "distance_m", - "package_mass_g": "package_mass_g", - "transportation_method": "transportation_method", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - distance_m=None, - package_mass_g=None, - transportation_method=None, - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateEcommerceEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._distance_m = None - self._package_mass_g = None - self._transportation_method = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.distance_m = distance_m - self.package_mass_g = package_mass_g - self.transportation_method = transportation_method - self.project_id = project_id - self.create_order = create_order - - @property - def distance_m(self): - """Gets the distance_m of this CreateEcommerceEstimateRequest. # noqa: E501 - - - :return: The distance_m of this CreateEcommerceEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._distance_m - - @distance_m.setter - def distance_m(self, distance_m): - """Sets the distance_m of this CreateEcommerceEstimateRequest. - - - :param distance_m: The distance_m of this CreateEcommerceEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation and distance_m is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `distance_m`, must not be `None`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and distance_m is not None - and distance_m > 400000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `distance_m`, must be a value less than or equal to `400000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and distance_m is not None - and distance_m < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `distance_m`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._distance_m = distance_m - - @property - def package_mass_g(self): - """Gets the package_mass_g of this CreateEcommerceEstimateRequest. # noqa: E501 - - - :return: The package_mass_g of this CreateEcommerceEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._package_mass_g - - @package_mass_g.setter - def package_mass_g(self, package_mass_g): - """Sets the package_mass_g of this CreateEcommerceEstimateRequest. - - - :param package_mass_g: The package_mass_g of this CreateEcommerceEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and package_mass_g is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `package_mass_g`, must not be `None`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and package_mass_g is not None - and package_mass_g > 2000000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `package_mass_g`, must be a value less than or equal to `2000000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and package_mass_g is not None - and package_mass_g < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `package_mass_g`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._package_mass_g = package_mass_g - - @property - def transportation_method(self): - """Gets the transportation_method of this CreateEcommerceEstimateRequest. # noqa: E501 - - - :return: The transportation_method of this CreateEcommerceEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._transportation_method - - @transportation_method.setter - def transportation_method(self, transportation_method): - """Sets the transportation_method of this CreateEcommerceEstimateRequest. - - - :param transportation_method: The transportation_method of this CreateEcommerceEstimateRequest. # noqa: E501 - :type: str - """ - if ( - self.local_vars_configuration.client_side_validation - and transportation_method is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `transportation_method`, must not be `None`" - ) # noqa: E501 - allowed_values = ["air", "rail", "road", "sea"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and transportation_method not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `transportation_method` ({0}), must be one of {1}".format( # noqa: E501 - transportation_method, allowed_values - ) - ) - - self._transportation_method = transportation_method - - @property - def project_id(self): - """Gets the project_id of this CreateEcommerceEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateEcommerceEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateEcommerceEstimateRequest. - - - :param project_id: The project_id of this CreateEcommerceEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateEcommerceEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateEcommerceEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateEcommerceEstimateRequest. - - - :param create_order: The create_order of this CreateEcommerceEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateEcommerceEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateEcommerceEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_flight_estimate_request.py b/patch_api/models/create_flight_estimate_request.py deleted file mode 100644 index e01bedf..0000000 --- a/patch_api/models/create_flight_estimate_request.py +++ /dev/null @@ -1,326 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateFlightEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "distance_m": "int", - "origin_airport": "str", - "destination_airport": "str", - "aircraft_code": "str", - "cabin_class": "str", - "passenger_count": "int", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "distance_m": "distance_m", - "origin_airport": "origin_airport", - "destination_airport": "destination_airport", - "aircraft_code": "aircraft_code", - "cabin_class": "cabin_class", - "passenger_count": "passenger_count", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - distance_m=None, - origin_airport=None, - destination_airport=None, - aircraft_code=None, - cabin_class=None, - passenger_count=None, - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateFlightEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._distance_m = None - self._origin_airport = None - self._destination_airport = None - self._aircraft_code = None - self._cabin_class = None - self._passenger_count = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.distance_m = distance_m - self.origin_airport = origin_airport - self.destination_airport = destination_airport - self.aircraft_code = aircraft_code - self.cabin_class = cabin_class - self.passenger_count = passenger_count - self.project_id = project_id - self.create_order = create_order - - @property - def distance_m(self): - """Gets the distance_m of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The distance_m of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._distance_m - - @distance_m.setter - def distance_m(self, distance_m): - """Sets the distance_m of this CreateFlightEstimateRequest. - - - :param distance_m: The distance_m of this CreateFlightEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and distance_m is not None - and distance_m > 400000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `distance_m`, must be a value less than or equal to `400000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and distance_m is not None - and distance_m < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `distance_m`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._distance_m = distance_m - - @property - def origin_airport(self): - """Gets the origin_airport of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The origin_airport of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_airport - - @origin_airport.setter - def origin_airport(self, origin_airport): - """Sets the origin_airport of this CreateFlightEstimateRequest. - - - :param origin_airport: The origin_airport of this CreateFlightEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_airport = origin_airport - - @property - def destination_airport(self): - """Gets the destination_airport of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The destination_airport of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_airport - - @destination_airport.setter - def destination_airport(self, destination_airport): - """Sets the destination_airport of this CreateFlightEstimateRequest. - - - :param destination_airport: The destination_airport of this CreateFlightEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_airport = destination_airport - - @property - def aircraft_code(self): - """Gets the aircraft_code of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The aircraft_code of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._aircraft_code - - @aircraft_code.setter - def aircraft_code(self, aircraft_code): - """Sets the aircraft_code of this CreateFlightEstimateRequest. - - - :param aircraft_code: The aircraft_code of this CreateFlightEstimateRequest. # noqa: E501 - :type: str - """ - - self._aircraft_code = aircraft_code - - @property - def cabin_class(self): - """Gets the cabin_class of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The cabin_class of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._cabin_class - - @cabin_class.setter - def cabin_class(self, cabin_class): - """Sets the cabin_class of this CreateFlightEstimateRequest. - - - :param cabin_class: The cabin_class of this CreateFlightEstimateRequest. # noqa: E501 - :type: str - """ - - self._cabin_class = cabin_class - - @property - def passenger_count(self): - """Gets the passenger_count of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The passenger_count of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._passenger_count - - @passenger_count.setter - def passenger_count(self, passenger_count): - """Sets the passenger_count of this CreateFlightEstimateRequest. - - - :param passenger_count: The passenger_count of this CreateFlightEstimateRequest. # noqa: E501 - :type: int - """ - - self._passenger_count = passenger_count - - @property - def project_id(self): - """Gets the project_id of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateFlightEstimateRequest. - - - :param project_id: The project_id of this CreateFlightEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateFlightEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateFlightEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateFlightEstimateRequest. - - - :param create_order: The create_order of this CreateFlightEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateFlightEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateFlightEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_mass_estimate_request.py b/patch_api/models/create_mass_estimate_request.py deleted file mode 100644 index f236871..0000000 --- a/patch_api/models/create_mass_estimate_request.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateMassEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = {"mass_g": "int", "create_order": "bool", "project_id": "str"} - - attribute_map = { - "mass_g": "mass_g", - "create_order": "create_order", - "project_id": "project_id", - } - - def __init__( - self, - mass_g=None, - create_order=False, - project_id=None, - local_vars_configuration=None, - ): # noqa: E501 - """CreateMassEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._mass_g = None - self._create_order = None - self._project_id = None - self.discriminator = None - - self.mass_g = mass_g - self.create_order = create_order - if project_id is not None: - self.project_id = project_id - - @property - def mass_g(self): - """Gets the mass_g of this CreateMassEstimateRequest. # noqa: E501 - - - :return: The mass_g of this CreateMassEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._mass_g - - @mass_g.setter - def mass_g(self, mass_g): - """Sets the mass_g of this CreateMassEstimateRequest. - - - :param mass_g: The mass_g of this CreateMassEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation and mass_g is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `mass_g`, must not be `None`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and mass_g is not None - and mass_g > 100000000000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `mass_g`, must be a value less than or equal to `100000000000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and mass_g is not None - and mass_g < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `mass_g`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._mass_g = mass_g - - @property - def create_order(self): - """Gets the create_order of this CreateMassEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateMassEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateMassEstimateRequest. - - - :param create_order: The create_order of this CreateMassEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - @property - def project_id(self): - """Gets the project_id of this CreateMassEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateMassEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateMassEstimateRequest. - - - :param project_id: The project_id of this CreateMassEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateMassEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateMassEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_rail_shipping_estimate_request.py b/patch_api/models/create_rail_shipping_estimate_request.py deleted file mode 100644 index bf91797..0000000 --- a/patch_api/models/create_rail_shipping_estimate_request.py +++ /dev/null @@ -1,425 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateRailShippingEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "destination_country_code": "str", - "destination_locode": "str", - "destination_postal_code": "str", - "origin_country_code": "str", - "origin_locode": "str", - "origin_postal_code": "str", - "fuel_type": "str", - "freight_mass_g": "int", - "emissions_scope": "str", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "destination_country_code": "destination_country_code", - "destination_locode": "destination_locode", - "destination_postal_code": "destination_postal_code", - "origin_country_code": "origin_country_code", - "origin_locode": "origin_locode", - "origin_postal_code": "origin_postal_code", - "fuel_type": "fuel_type", - "freight_mass_g": "freight_mass_g", - "emissions_scope": "emissions_scope", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - destination_country_code=None, - destination_locode=None, - destination_postal_code=None, - origin_country_code=None, - origin_locode=None, - origin_postal_code=None, - fuel_type="default", - freight_mass_g=None, - emissions_scope="ttw", - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateRailShippingEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._destination_country_code = None - self._destination_locode = None - self._destination_postal_code = None - self._origin_country_code = None - self._origin_locode = None - self._origin_postal_code = None - self._fuel_type = None - self._freight_mass_g = None - self._emissions_scope = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.destination_country_code = destination_country_code - self.destination_locode = destination_locode - self.destination_postal_code = destination_postal_code - self.origin_country_code = origin_country_code - self.origin_locode = origin_locode - self.origin_postal_code = origin_postal_code - self.fuel_type = fuel_type - if freight_mass_g is not None: - self.freight_mass_g = freight_mass_g - self.emissions_scope = emissions_scope - self.project_id = project_id - self.create_order = create_order - - @property - def destination_country_code(self): - """Gets the destination_country_code of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The destination_country_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_country_code - - @destination_country_code.setter - def destination_country_code(self, destination_country_code): - """Sets the destination_country_code of this CreateRailShippingEstimateRequest. - - - :param destination_country_code: The destination_country_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_country_code = destination_country_code - - @property - def destination_locode(self): - """Gets the destination_locode of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The destination_locode of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_locode - - @destination_locode.setter - def destination_locode(self, destination_locode): - """Sets the destination_locode of this CreateRailShippingEstimateRequest. - - - :param destination_locode: The destination_locode of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_locode = destination_locode - - @property - def destination_postal_code(self): - """Gets the destination_postal_code of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The destination_postal_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_postal_code - - @destination_postal_code.setter - def destination_postal_code(self, destination_postal_code): - """Sets the destination_postal_code of this CreateRailShippingEstimateRequest. - - - :param destination_postal_code: The destination_postal_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_postal_code = destination_postal_code - - @property - def origin_country_code(self): - """Gets the origin_country_code of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The origin_country_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_country_code - - @origin_country_code.setter - def origin_country_code(self, origin_country_code): - """Sets the origin_country_code of this CreateRailShippingEstimateRequest. - - - :param origin_country_code: The origin_country_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_country_code = origin_country_code - - @property - def origin_locode(self): - """Gets the origin_locode of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The origin_locode of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_locode - - @origin_locode.setter - def origin_locode(self, origin_locode): - """Sets the origin_locode of this CreateRailShippingEstimateRequest. - - - :param origin_locode: The origin_locode of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_locode = origin_locode - - @property - def origin_postal_code(self): - """Gets the origin_postal_code of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The origin_postal_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_postal_code - - @origin_postal_code.setter - def origin_postal_code(self, origin_postal_code): - """Sets the origin_postal_code of this CreateRailShippingEstimateRequest. - - - :param origin_postal_code: The origin_postal_code of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_postal_code = origin_postal_code - - @property - def fuel_type(self): - """Gets the fuel_type of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The fuel_type of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._fuel_type - - @fuel_type.setter - def fuel_type(self, fuel_type): - """Sets the fuel_type of this CreateRailShippingEstimateRequest. - - - :param fuel_type: The fuel_type of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "default", "diesel", "elec"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and fuel_type not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `fuel_type` ({0}), must be one of {1}".format( # noqa: E501 - fuel_type, allowed_values - ) - ) - - self._fuel_type = fuel_type - - @property - def freight_mass_g(self): - """Gets the freight_mass_g of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The freight_mass_g of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._freight_mass_g - - @freight_mass_g.setter - def freight_mass_g(self, freight_mass_g): - """Sets the freight_mass_g of this CreateRailShippingEstimateRequest. - - - :param freight_mass_g: The freight_mass_g of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g > 2000000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value less than or equal to `2000000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._freight_mass_g = freight_mass_g - - @property - def emissions_scope(self): - """Gets the emissions_scope of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The emissions_scope of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._emissions_scope - - @emissions_scope.setter - def emissions_scope(self, emissions_scope): - """Sets the emissions_scope of this CreateRailShippingEstimateRequest. - - - :param emissions_scope: The emissions_scope of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "wtt", "ttw", "wtw"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and emissions_scope not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `emissions_scope` ({0}), must be one of {1}".format( # noqa: E501 - emissions_scope, allowed_values - ) - ) - - self._emissions_scope = emissions_scope - - @property - def project_id(self): - """Gets the project_id of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateRailShippingEstimateRequest. - - - :param project_id: The project_id of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateRailShippingEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateRailShippingEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateRailShippingEstimateRequest. - - - :param create_order: The create_order of this CreateRailShippingEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateRailShippingEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateRailShippingEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_road_shipping_estimate_request.py b/patch_api/models/create_road_shipping_estimate_request.py deleted file mode 100644 index 783acf0..0000000 --- a/patch_api/models/create_road_shipping_estimate_request.py +++ /dev/null @@ -1,601 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateRoadShippingEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "destination_country_code": "str", - "destination_locode": "str", - "destination_postal_code": "str", - "origin_country_code": "str", - "origin_locode": "str", - "origin_postal_code": "str", - "cargo_type": "str", - "container_size_code": "str", - "emissions_scope": "str", - "freight_mass_g": "int", - "fuel_type": "str", - "number_of_containers": "int", - "truck_weight_t": "int", - "carrier_scac": "str", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "destination_country_code": "destination_country_code", - "destination_locode": "destination_locode", - "destination_postal_code": "destination_postal_code", - "origin_country_code": "origin_country_code", - "origin_locode": "origin_locode", - "origin_postal_code": "origin_postal_code", - "cargo_type": "cargo_type", - "container_size_code": "container_size_code", - "emissions_scope": "emissions_scope", - "freight_mass_g": "freight_mass_g", - "fuel_type": "fuel_type", - "number_of_containers": "number_of_containers", - "truck_weight_t": "truck_weight_t", - "carrier_scac": "carrier_scac", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - destination_country_code=None, - destination_locode=None, - destination_postal_code=None, - origin_country_code=None, - origin_locode=None, - origin_postal_code=None, - cargo_type="average_mixed", - container_size_code=None, - emissions_scope="ttw", - freight_mass_g=None, - fuel_type="diesel", - number_of_containers=None, - truck_weight_t=None, - carrier_scac=None, - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateRoadShippingEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._destination_country_code = None - self._destination_locode = None - self._destination_postal_code = None - self._origin_country_code = None - self._origin_locode = None - self._origin_postal_code = None - self._cargo_type = None - self._container_size_code = None - self._emissions_scope = None - self._freight_mass_g = None - self._fuel_type = None - self._number_of_containers = None - self._truck_weight_t = None - self._carrier_scac = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.destination_country_code = destination_country_code - self.destination_locode = destination_locode - self.destination_postal_code = destination_postal_code - self.origin_country_code = origin_country_code - self.origin_locode = origin_locode - self.origin_postal_code = origin_postal_code - if cargo_type is not None: - self.cargo_type = cargo_type - if container_size_code is not None: - self.container_size_code = container_size_code - self.emissions_scope = emissions_scope - if freight_mass_g is not None: - self.freight_mass_g = freight_mass_g - self.fuel_type = fuel_type - self.number_of_containers = number_of_containers - self.truck_weight_t = truck_weight_t - self.carrier_scac = carrier_scac - self.project_id = project_id - self.create_order = create_order - - @property - def destination_country_code(self): - """Gets the destination_country_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The destination_country_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_country_code - - @destination_country_code.setter - def destination_country_code(self, destination_country_code): - """Sets the destination_country_code of this CreateRoadShippingEstimateRequest. - - - :param destination_country_code: The destination_country_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_country_code = destination_country_code - - @property - def destination_locode(self): - """Gets the destination_locode of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The destination_locode of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_locode - - @destination_locode.setter - def destination_locode(self, destination_locode): - """Sets the destination_locode of this CreateRoadShippingEstimateRequest. - - - :param destination_locode: The destination_locode of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_locode = destination_locode - - @property - def destination_postal_code(self): - """Gets the destination_postal_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The destination_postal_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_postal_code - - @destination_postal_code.setter - def destination_postal_code(self, destination_postal_code): - """Sets the destination_postal_code of this CreateRoadShippingEstimateRequest. - - - :param destination_postal_code: The destination_postal_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_postal_code = destination_postal_code - - @property - def origin_country_code(self): - """Gets the origin_country_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The origin_country_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_country_code - - @origin_country_code.setter - def origin_country_code(self, origin_country_code): - """Sets the origin_country_code of this CreateRoadShippingEstimateRequest. - - - :param origin_country_code: The origin_country_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_country_code = origin_country_code - - @property - def origin_locode(self): - """Gets the origin_locode of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The origin_locode of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_locode - - @origin_locode.setter - def origin_locode(self, origin_locode): - """Sets the origin_locode of this CreateRoadShippingEstimateRequest. - - - :param origin_locode: The origin_locode of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_locode = origin_locode - - @property - def origin_postal_code(self): - """Gets the origin_postal_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The origin_postal_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_postal_code - - @origin_postal_code.setter - def origin_postal_code(self, origin_postal_code): - """Sets the origin_postal_code of this CreateRoadShippingEstimateRequest. - - - :param origin_postal_code: The origin_postal_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_postal_code = origin_postal_code - - @property - def cargo_type(self): - """Gets the cargo_type of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The cargo_type of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._cargo_type - - @cargo_type.setter - def cargo_type(self, cargo_type): - """Sets the cargo_type of this CreateRoadShippingEstimateRequest. - - - :param cargo_type: The cargo_type of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = ["average_mixed", "container"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and cargo_type not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `cargo_type` ({0}), must be one of {1}".format( # noqa: E501 - cargo_type, allowed_values - ) - ) - - self._cargo_type = cargo_type - - @property - def container_size_code(self): - """Gets the container_size_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The container_size_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._container_size_code - - @container_size_code.setter - def container_size_code(self, container_size_code): - """Sets the container_size_code of this CreateRoadShippingEstimateRequest. - - - :param container_size_code: The container_size_code of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = ["20GP", "40GP", "22G1", "42G1", "40HC", "45G1"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and container_size_code not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `container_size_code` ({0}), must be one of {1}".format( # noqa: E501 - container_size_code, allowed_values - ) - ) - - self._container_size_code = container_size_code - - @property - def emissions_scope(self): - """Gets the emissions_scope of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The emissions_scope of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._emissions_scope - - @emissions_scope.setter - def emissions_scope(self, emissions_scope): - """Sets the emissions_scope of this CreateRoadShippingEstimateRequest. - - - :param emissions_scope: The emissions_scope of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "wtt", "ttw", "wtw"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and emissions_scope not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `emissions_scope` ({0}), must be one of {1}".format( # noqa: E501 - emissions_scope, allowed_values - ) - ) - - self._emissions_scope = emissions_scope - - @property - def freight_mass_g(self): - """Gets the freight_mass_g of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The freight_mass_g of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._freight_mass_g - - @freight_mass_g.setter - def freight_mass_g(self, freight_mass_g): - """Sets the freight_mass_g of this CreateRoadShippingEstimateRequest. - - - :param freight_mass_g: The freight_mass_g of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g > 2000000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value less than or equal to `2000000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._freight_mass_g = freight_mass_g - - @property - def fuel_type(self): - """Gets the fuel_type of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The fuel_type of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._fuel_type - - @fuel_type.setter - def fuel_type(self, fuel_type): - """Sets the fuel_type of this CreateRoadShippingEstimateRequest. - - - :param fuel_type: The fuel_type of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "cng", "diesel", "lng", "petrol"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and fuel_type not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `fuel_type` ({0}), must be one of {1}".format( # noqa: E501 - fuel_type, allowed_values - ) - ) - - self._fuel_type = fuel_type - - @property - def number_of_containers(self): - """Gets the number_of_containers of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The number_of_containers of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._number_of_containers - - @number_of_containers.setter - def number_of_containers(self, number_of_containers): - """Sets the number_of_containers of this CreateRoadShippingEstimateRequest. - - - :param number_of_containers: The number_of_containers of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and number_of_containers is not None - and number_of_containers < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `number_of_containers`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._number_of_containers = number_of_containers - - @property - def truck_weight_t(self): - """Gets the truck_weight_t of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The truck_weight_t of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._truck_weight_t - - @truck_weight_t.setter - def truck_weight_t(self, truck_weight_t): - """Sets the truck_weight_t of this CreateRoadShippingEstimateRequest. - - - :param truck_weight_t: The truck_weight_t of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and truck_weight_t is not None - and truck_weight_t > 60 - ): # noqa: E501 - raise ValueError( - "Invalid value for `truck_weight_t`, must be a value less than or equal to `60`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and truck_weight_t is not None - and truck_weight_t < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `truck_weight_t`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._truck_weight_t = truck_weight_t - - @property - def carrier_scac(self): - """Gets the carrier_scac of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The carrier_scac of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._carrier_scac - - @carrier_scac.setter - def carrier_scac(self, carrier_scac): - """Sets the carrier_scac of this CreateRoadShippingEstimateRequest. - - - :param carrier_scac: The carrier_scac of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._carrier_scac = carrier_scac - - @property - def project_id(self): - """Gets the project_id of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateRoadShippingEstimateRequest. - - - :param project_id: The project_id of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateRoadShippingEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateRoadShippingEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateRoadShippingEstimateRequest. - - - :param create_order: The create_order of this CreateRoadShippingEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateRoadShippingEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateRoadShippingEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/create_sea_shipping_estimate_request.py b/patch_api/models/create_sea_shipping_estimate_request.py deleted file mode 100644 index cfa586f..0000000 --- a/patch_api/models/create_sea_shipping_estimate_request.py +++ /dev/null @@ -1,520 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class CreateSeaShippingEstimateRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "destination_country_code": "str", - "destination_locode": "str", - "destination_postal_code": "str", - "origin_country_code": "str", - "origin_locode": "str", - "origin_postal_code": "str", - "container_size_code": "str", - "emissions_scope": "str", - "freight_mass_g": "int", - "freight_volume_cubic_m": "int", - "number_of_containers": "int", - "vessel_imo": "int", - "project_id": "str", - "create_order": "bool", - } - - attribute_map = { - "destination_country_code": "destination_country_code", - "destination_locode": "destination_locode", - "destination_postal_code": "destination_postal_code", - "origin_country_code": "origin_country_code", - "origin_locode": "origin_locode", - "origin_postal_code": "origin_postal_code", - "container_size_code": "container_size_code", - "emissions_scope": "emissions_scope", - "freight_mass_g": "freight_mass_g", - "freight_volume_cubic_m": "freight_volume_cubic_m", - "number_of_containers": "number_of_containers", - "vessel_imo": "vessel_imo", - "project_id": "project_id", - "create_order": "create_order", - } - - def __init__( - self, - destination_country_code=None, - destination_locode=None, - destination_postal_code=None, - origin_country_code=None, - origin_locode=None, - origin_postal_code=None, - container_size_code=None, - emissions_scope="ttw", - freight_mass_g=None, - freight_volume_cubic_m=None, - number_of_containers=None, - vessel_imo=None, - project_id=None, - create_order=False, - local_vars_configuration=None, - ): # noqa: E501 - """CreateSeaShippingEstimateRequest - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._destination_country_code = None - self._destination_locode = None - self._destination_postal_code = None - self._origin_country_code = None - self._origin_locode = None - self._origin_postal_code = None - self._container_size_code = None - self._emissions_scope = None - self._freight_mass_g = None - self._freight_volume_cubic_m = None - self._number_of_containers = None - self._vessel_imo = None - self._project_id = None - self._create_order = None - self.discriminator = None - - self.destination_country_code = destination_country_code - self.destination_locode = destination_locode - self.destination_postal_code = destination_postal_code - self.origin_country_code = origin_country_code - self.origin_locode = origin_locode - self.origin_postal_code = origin_postal_code - if container_size_code is not None: - self.container_size_code = container_size_code - self.emissions_scope = emissions_scope - if freight_mass_g is not None: - self.freight_mass_g = freight_mass_g - self.freight_volume_cubic_m = freight_volume_cubic_m - self.number_of_containers = number_of_containers - self.vessel_imo = vessel_imo - self.project_id = project_id - self.create_order = create_order - - @property - def destination_country_code(self): - """Gets the destination_country_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The destination_country_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_country_code - - @destination_country_code.setter - def destination_country_code(self, destination_country_code): - """Sets the destination_country_code of this CreateSeaShippingEstimateRequest. - - - :param destination_country_code: The destination_country_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_country_code = destination_country_code - - @property - def destination_locode(self): - """Gets the destination_locode of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The destination_locode of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_locode - - @destination_locode.setter - def destination_locode(self, destination_locode): - """Sets the destination_locode of this CreateSeaShippingEstimateRequest. - - - :param destination_locode: The destination_locode of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_locode = destination_locode - - @property - def destination_postal_code(self): - """Gets the destination_postal_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The destination_postal_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._destination_postal_code - - @destination_postal_code.setter - def destination_postal_code(self, destination_postal_code): - """Sets the destination_postal_code of this CreateSeaShippingEstimateRequest. - - - :param destination_postal_code: The destination_postal_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._destination_postal_code = destination_postal_code - - @property - def origin_country_code(self): - """Gets the origin_country_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The origin_country_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_country_code - - @origin_country_code.setter - def origin_country_code(self, origin_country_code): - """Sets the origin_country_code of this CreateSeaShippingEstimateRequest. - - - :param origin_country_code: The origin_country_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_country_code = origin_country_code - - @property - def origin_locode(self): - """Gets the origin_locode of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The origin_locode of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_locode - - @origin_locode.setter - def origin_locode(self, origin_locode): - """Sets the origin_locode of this CreateSeaShippingEstimateRequest. - - - :param origin_locode: The origin_locode of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_locode = origin_locode - - @property - def origin_postal_code(self): - """Gets the origin_postal_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The origin_postal_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._origin_postal_code - - @origin_postal_code.setter - def origin_postal_code(self, origin_postal_code): - """Sets the origin_postal_code of this CreateSeaShippingEstimateRequest. - - - :param origin_postal_code: The origin_postal_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._origin_postal_code = origin_postal_code - - @property - def container_size_code(self): - """Gets the container_size_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The container_size_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._container_size_code - - @container_size_code.setter - def container_size_code(self, container_size_code): - """Sets the container_size_code of this CreateSeaShippingEstimateRequest. - - - :param container_size_code: The container_size_code of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = ["20GP", "40GP", "22G1", "42G1", "40HC", "45G1"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and container_size_code not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `container_size_code` ({0}), must be one of {1}".format( # noqa: E501 - container_size_code, allowed_values - ) - ) - - self._container_size_code = container_size_code - - @property - def emissions_scope(self): - """Gets the emissions_scope of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The emissions_scope of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._emissions_scope - - @emissions_scope.setter - def emissions_scope(self, emissions_scope): - """Sets the emissions_scope of this CreateSeaShippingEstimateRequest. - - - :param emissions_scope: The emissions_scope of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - allowed_values = [None, "wtt", "ttw", "wtw"] # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and emissions_scope not in allowed_values - ): # noqa: E501 - raise ValueError( - "Invalid value for `emissions_scope` ({0}), must be one of {1}".format( # noqa: E501 - emissions_scope, allowed_values - ) - ) - - self._emissions_scope = emissions_scope - - @property - def freight_mass_g(self): - """Gets the freight_mass_g of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The freight_mass_g of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._freight_mass_g - - @freight_mass_g.setter - def freight_mass_g(self, freight_mass_g): - """Sets the freight_mass_g of this CreateSeaShippingEstimateRequest. - - - :param freight_mass_g: The freight_mass_g of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g > 2000000000 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value less than or equal to `2000000000`" - ) # noqa: E501 - if ( - self.local_vars_configuration.client_side_validation - and freight_mass_g is not None - and freight_mass_g < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_mass_g`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._freight_mass_g = freight_mass_g - - @property - def freight_volume_cubic_m(self): - """Gets the freight_volume_cubic_m of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The freight_volume_cubic_m of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._freight_volume_cubic_m - - @freight_volume_cubic_m.setter - def freight_volume_cubic_m(self, freight_volume_cubic_m): - """Sets the freight_volume_cubic_m of this CreateSeaShippingEstimateRequest. - - - :param freight_volume_cubic_m: The freight_volume_cubic_m of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and freight_volume_cubic_m is not None - and freight_volume_cubic_m < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `freight_volume_cubic_m`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._freight_volume_cubic_m = freight_volume_cubic_m - - @property - def number_of_containers(self): - """Gets the number_of_containers of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The number_of_containers of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._number_of_containers - - @number_of_containers.setter - def number_of_containers(self, number_of_containers): - """Sets the number_of_containers of this CreateSeaShippingEstimateRequest. - - - :param number_of_containers: The number_of_containers of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: int - """ - if ( - self.local_vars_configuration.client_side_validation - and number_of_containers is not None - and number_of_containers < 0 - ): # noqa: E501 - raise ValueError( - "Invalid value for `number_of_containers`, must be a value greater than or equal to `0`" - ) # noqa: E501 - - self._number_of_containers = number_of_containers - - @property - def vessel_imo(self): - """Gets the vessel_imo of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The vessel_imo of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: int - """ - return self._vessel_imo - - @vessel_imo.setter - def vessel_imo(self, vessel_imo): - """Sets the vessel_imo of this CreateSeaShippingEstimateRequest. - - - :param vessel_imo: The vessel_imo of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: int - """ - - self._vessel_imo = vessel_imo - - @property - def project_id(self): - """Gets the project_id of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The project_id of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: str - """ - return self._project_id - - @project_id.setter - def project_id(self, project_id): - """Sets the project_id of this CreateSeaShippingEstimateRequest. - - - :param project_id: The project_id of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: str - """ - - self._project_id = project_id - - @property - def create_order(self): - """Gets the create_order of this CreateSeaShippingEstimateRequest. # noqa: E501 - - - :return: The create_order of this CreateSeaShippingEstimateRequest. # noqa: E501 - :rtype: bool - """ - return self._create_order - - @create_order.setter - def create_order(self, create_order): - """Sets the create_order of this CreateSeaShippingEstimateRequest. - - - :param create_order: The create_order of this CreateSeaShippingEstimateRequest. # noqa: E501 - :type: bool - """ - - self._create_order = create_order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSeaShippingEstimateRequest): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, CreateSeaShippingEstimateRequest): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/estimate.py b/patch_api/models/estimate.py deleted file mode 100644 index 7f7f301..0000000 --- a/patch_api/models/estimate.py +++ /dev/null @@ -1,259 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class Estimate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "id": "str", - "production": "bool", - "type": "str", - "mass_g": "int", - "order": "Order", - } - - attribute_map = { - "id": "id", - "production": "production", - "type": "type", - "mass_g": "mass_g", - "order": "order", - } - - def __init__( - self, - id=None, - production=None, - type=None, - mass_g=None, - order=None, - local_vars_configuration=None, - ): # noqa: E501 - """Estimate - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._id = None - self._production = None - self._type = None - self._mass_g = None - self._order = None - self.discriminator = None - - self.id = id - self.production = production - self.type = type - if mass_g is not None: - self.mass_g = mass_g - self.order = order - - @property - def id(self): - """Gets the id of this Estimate. # noqa: E501 - - A unique uid for the record. UIDs will be prepended by est_prod or est_test depending on the mode it was created in. # noqa: E501 - - :return: The id of this Estimate. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Estimate. - - A unique uid for the record. UIDs will be prepended by est_prod or est_test depending on the mode it was created in. # noqa: E501 - - :param id: The id of this Estimate. # noqa: E501 - :type: str - """ - if ( - self.local_vars_configuration.client_side_validation and id is None - ): # noqa: E501 - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def production(self): - """Gets the production of this Estimate. # noqa: E501 - - A boolean indicating if this estimate is a production or demo mode estimate. # noqa: E501 - - :return: The production of this Estimate. # noqa: E501 - :rtype: bool - """ - return self._production - - @production.setter - def production(self, production): - """Sets the production of this Estimate. - - A boolean indicating if this estimate is a production or demo mode estimate. # noqa: E501 - - :param production: The production of this Estimate. # noqa: E501 - :type: bool - """ - if ( - self.local_vars_configuration.client_side_validation and production is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `production`, must not be `None`" - ) # noqa: E501 - - self._production = production - - @property - def type(self): - """Gets the type of this Estimate. # noqa: E501 - - The type of estimate. Available types are mass, flight, shipping, and crypto. # noqa: E501 - - :return: The type of this Estimate. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Estimate. - - The type of estimate. Available types are mass, flight, shipping, and crypto. # noqa: E501 - - :param type: The type of this Estimate. # noqa: E501 - :type: str - """ - if ( - self.local_vars_configuration.client_side_validation and type is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `type`, must not be `None`" - ) # noqa: E501 - - self._type = type - - @property - def mass_g(self): - """Gets the mass_g of this Estimate. # noqa: E501 - - The estimated mass in grams for this estimate. # noqa: E501 - - :return: The mass_g of this Estimate. # noqa: E501 - :rtype: int - """ - return self._mass_g - - @mass_g.setter - def mass_g(self, mass_g): - """Sets the mass_g of this Estimate. - - The estimated mass in grams for this estimate. # noqa: E501 - - :param mass_g: The mass_g of this Estimate. # noqa: E501 - :type: int - """ - - self._mass_g = mass_g - - @property - def order(self): - """Gets the order of this Estimate. # noqa: E501 - - An object returning the order associated with this estimate. See the [Order section](/?id=orders) for the full schema. # noqa: E501 - - :return: The order of this Estimate. # noqa: E501 - :rtype: Order - """ - return self._order - - @order.setter - def order(self, order): - """Sets the order of this Estimate. - - An object returning the order associated with this estimate. See the [Order section](/?id=orders) for the full schema. # noqa: E501 - - :param order: The order of this Estimate. # noqa: E501 - :type: Order - """ - - self._order = order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Estimate): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, Estimate): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/estimate_list_response.py b/patch_api/models/estimate_list_response.py deleted file mode 100644 index 563e00b..0000000 --- a/patch_api/models/estimate_list_response.py +++ /dev/null @@ -1,224 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class EstimateListResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - "success": "bool", - "error": "object", - "data": "list[Estimate]", - "meta": "MetaIndexObject", - } - - attribute_map = { - "success": "success", - "error": "error", - "data": "data", - "meta": "meta", - } - - def __init__( - self, - success=None, - error=None, - data=None, - meta=None, - local_vars_configuration=None, - ): # noqa: E501 - """EstimateListResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._success = None - self._error = None - self._data = None - self._meta = None - self.discriminator = None - - self.success = success - self.error = error - self.data = data - self.meta = meta - - @property - def success(self): - """Gets the success of this EstimateListResponse. # noqa: E501 - - - :return: The success of this EstimateListResponse. # noqa: E501 - :rtype: bool - """ - return self._success - - @success.setter - def success(self, success): - """Sets the success of this EstimateListResponse. - - - :param success: The success of this EstimateListResponse. # noqa: E501 - :type: bool - """ - if ( - self.local_vars_configuration.client_side_validation and success is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `success`, must not be `None`" - ) # noqa: E501 - - self._success = success - - @property - def error(self): - """Gets the error of this EstimateListResponse. # noqa: E501 - - - :return: The error of this EstimateListResponse. # noqa: E501 - :rtype: object - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this EstimateListResponse. - - - :param error: The error of this EstimateListResponse. # noqa: E501 - :type: object - """ - - self._error = error - - @property - def data(self): - """Gets the data of this EstimateListResponse. # noqa: E501 - - - :return: The data of this EstimateListResponse. # noqa: E501 - :rtype: list[Estimate] - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this EstimateListResponse. - - - :param data: The data of this EstimateListResponse. # noqa: E501 - :type: list[Estimate] - """ - if ( - self.local_vars_configuration.client_side_validation and data is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `data`, must not be `None`" - ) # noqa: E501 - - self._data = data - - @property - def meta(self): - """Gets the meta of this EstimateListResponse. # noqa: E501 - - - :return: The meta of this EstimateListResponse. # noqa: E501 - :rtype: MetaIndexObject - """ - return self._meta - - @meta.setter - def meta(self, meta): - """Sets the meta of this EstimateListResponse. - - - :param meta: The meta of this EstimateListResponse. # noqa: E501 - :type: MetaIndexObject - """ - if ( - self.local_vars_configuration.client_side_validation and meta is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `meta`, must not be `None`" - ) # noqa: E501 - - self._meta = meta - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, EstimateListResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EstimateListResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/patch_api/models/estimate_response.py b/patch_api/models/estimate_response.py deleted file mode 100644 index cef6bbe..0000000 --- a/patch_api/models/estimate_response.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" - Patch API V2 - - The core API used to integrate with Patch's service # noqa: E501 - - The version of the OpenAPI document: 2 - Contact: engineering@usepatch.com - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - -from patch_api.configuration import Configuration - - -class EstimateResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = {"success": "bool", "error": "object", "data": "Estimate"} - - attribute_map = {"success": "success", "error": "error", "data": "data"} - - def __init__( - self, success=None, error=None, data=None, local_vars_configuration=None - ): # noqa: E501 - """EstimateResponse - a model defined in OpenAPI""" # noqa: E501 - if local_vars_configuration is None: - local_vars_configuration = Configuration() - self.local_vars_configuration = local_vars_configuration - - self._success = None - self._error = None - self._data = None - self.discriminator = None - - self.success = success - self.error = error - self.data = data - - @property - def success(self): - """Gets the success of this EstimateResponse. # noqa: E501 - - - :return: The success of this EstimateResponse. # noqa: E501 - :rtype: bool - """ - return self._success - - @success.setter - def success(self, success): - """Sets the success of this EstimateResponse. - - - :param success: The success of this EstimateResponse. # noqa: E501 - :type: bool - """ - if ( - self.local_vars_configuration.client_side_validation and success is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `success`, must not be `None`" - ) # noqa: E501 - - self._success = success - - @property - def error(self): - """Gets the error of this EstimateResponse. # noqa: E501 - - - :return: The error of this EstimateResponse. # noqa: E501 - :rtype: object - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this EstimateResponse. - - - :param error: The error of this EstimateResponse. # noqa: E501 - :type: object - """ - - self._error = error - - @property - def data(self): - """Gets the data of this EstimateResponse. # noqa: E501 - - - :return: The data of this EstimateResponse. # noqa: E501 - :rtype: Estimate - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this EstimateResponse. - - - :param data: The data of this EstimateResponse. # noqa: E501 - :type: Estimate - """ - if ( - self.local_vars_configuration.client_side_validation and data is None - ): # noqa: E501 - raise ValueError( - "Invalid value for `data`, must not be `None`" - ) # noqa: E501 - - self._data = data - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, EstimateResponse): - return False - - return self.to_dict() == other.to_dict() - - def __ne__(self, other): - """Returns true if both objects are not equal""" - if not isinstance(other, EstimateResponse): - return True - - return self.to_dict() != other.to_dict() diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py index 1850ce0..47cb181 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "patch-api" -VERSION = "2.4.0" +VERSION = "2.6.0" # To install the library, run the following # # python setup.py install diff --git a/test/test_estimates_api.py b/test/test_estimates_api.py deleted file mode 100644 index b38cac3..0000000 --- a/test/test_estimates_api.py +++ /dev/null @@ -1,284 +0,0 @@ -# coding: utf-8 - -""" -Patch API V1 - -The core API used to integrate with Patch's service # noqa: E501 - -The version of the OpenAPI document: v1 -Contact: developers@usepatch.com -Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import os - -from patch_api.api_client import ApiClient - - -class TestEstimatesApi(unittest.TestCase): - """EstimatesApi unit test stubs""" - - def setUp(self): - api_client = ApiClient(api_key=os.environ.get("SANDBOX_API_KEY")) - self.api = api_client.estimates # noqa: E501 - - def tearDown(self): - self.api = None - - def test_create_and_retrieve_mass_estimate(self): - """Test case for create_mass_estimate - - Create an estimate based on mass of CO2 # noqa: E501 - """ - mass_g = 100 - project_id = "pro_test_2b67b11a030b66e0a6dd61a56b49079a" - estimate = self.api.create_mass_estimate( - mass_g=mass_g, project_id=project_id, create_order=True - ) - self.assertTrue(estimate) - self.assertEqual(estimate.data.order.amount, mass_g) - - retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) - self.assertTrue(retrieved_estimate) - - def test_create_and_retrieve_flight_estimate(self): - """Test case for create_flight_estimate - - Create an estimate based on the distance in meters flown by an airplane # noqa: E501 - """ - distance_m = 1000000 - estimate = self.api.create_flight_estimate( - distance_m=distance_m, create_order=True - ) - self.assertEqual(estimate.data.type, "flight") - self.assertGreater(estimate.data.order.amount, 50000) - self.assertGreater(estimate.data.mass_g, 50000) - - retrieved_estimate = self.api.retrieve_estimate(id=estimate.data.id) - self.assertTrue(retrieved_estimate) - - def test_create_and_retrieve_flight_estimate_with_airports(self): - """Test case for create_flight_estimate - - Create an estimate based on the distance in meters flown by an airplane # noqa: E501 - """ - estimate_short = self.api.create_flight_estimate( - origin_airport="SFO", destination_airport="LAX" - ) - estimate_long = self.api.create_flight_estimate( - origin_airport="SFO", destination_airport="JFK" - ) - self.assertGreater(estimate_long.data.mass_g, estimate_short.data.mass_g) - - def test_create_bitcoin_estimate_no_params(self): - """Test case for create_bitcoin_estimate - - Create an estimate based on a transaction amount # noqa: E501 - """ - - estimate = self.api.create_bitcoin_estimate() - self.assertEqual(estimate.data.type, "bitcoin") - self.assertGreater( - estimate.data.mass_g, 200 - ) # not setting an exact value since this is changing daily - - def test_create_bitcoin_estimate_transaction_value(self): - """Test case for create_bitcoin_estimate - - Create an estimate based on a transaction amount # noqa: E501 - """ - transaction_value_btc_sats = 100000 - - estimate = self.api.create_bitcoin_estimate( - transaction_value_btc_sats=transaction_value_btc_sats - ) - self.assertEqual(estimate.data.type, "bitcoin") - self.assertGreater( - estimate.data.mass_g, 200 - ) # not setting an exact value since this is changing daily - - def test_create_air_shipping_estimate_airport_iatas(self): - """Test case for create_air_shipping_estimate - - Create an estimate based on airport iata values # noqa: E501 - """ - estimate = self.api.create_air_shipping_estimate( - destination_airport="JFK", freight_mass_g=19_158, origin_airport="ATL" - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_air") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_air_shipping_estimate_create_order(self): - """Test case for create_air_shipping_estimate - - Create an estimate and an order # noqa: E501 - """ - estimate = self.api.create_air_shipping_estimate( - create_order=True, - destination_airport="JFK", - freight_mass_g=18_092, - origin_airport="ATL", - ) - self.assertGreater(estimate.data.order.amount, 2_000) - self.assertEqual(estimate.data.type, "shipping_air") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_rail_shipping_estimate_addresses(self): - """Test case for create_rail_shipping_estimate - - Create an estimate based on locode values # noqa: E501 - """ - estimate = self.api.create_rail_shipping_estimate( - destination_country_code="US", - destination_postal_code="90210", - freight_mass_g=18092, - origin_country_code="US", - origin_postal_code="97209", - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_rail") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_rail_shipping_estimate_locodes(self): - """Test case for create_rail_shipping_estimate - - Create an estimate based on locode values # noqa: E501 - """ - estimate = self.api.create_rail_shipping_estimate( - destination_locode="USSD2", freight_mass_g=18092, origin_locode="USSEA" - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_rail") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_rail_shipping_estimate_create_order(self): - """Test case for create_rail_shipping_estimate - - Create an estimate and an order # noqa: E501 - """ - estimate = self.api.create_rail_shipping_estimate( - create_order=True, - destination_locode="USSD2", - freight_mass_g=19_217, - origin_locode="USSEA", - ) - self.assertGreater(estimate.data.order.amount, 0) - self.assertEqual(estimate.data.type, "shipping_rail") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_road_shipping_estimate_addresses(self): - """Test case for create_road_shipping_estimate - - Create an estimate based on locode values # noqa: E501 - """ - estimate = self.api.create_road_shipping_estimate( - destination_country_code="US", - destination_postal_code="90210", - freight_mass_g=19_166, - origin_country_code="US", - origin_postal_code="97209", - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_road") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_road_shipping_estimate_locodes(self): - """Test case for create_road_shipping_estimate - - Create an estimate based on locode values # noqa: E501 - """ - estimate = self.api.create_road_shipping_estimate( - destination_locode="USSD2", freight_mass_g=16_907, origin_locode="USSEA" - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_road") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_road_shipping_estimate_create_order(self): - """Test case for create_road_shipping_estimate - - Create an estimate and an order # noqa: E501 - """ - estimate = self.api.create_road_shipping_estimate( - create_order=True, - destination_locode="USSD2", - freight_mass_g=21_933, - origin_locode="USSEA", - ) - self.assertGreater(estimate.data.order.amount, 0) - self.assertEqual(estimate.data.type, "shipping_road") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_sea_shipping_estimate_addresses(self): - """Test case for create_sea_shipping_estimate - - Create an estimate based on address values # noqa: E501 - """ - estimate = self.api.create_sea_shipping_estimate( - destination_country_code="US", - destination_postal_code="90210", - freight_mass_g=26_906, - origin_country_code="US", - origin_postal_code="97209", - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_sea") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_sea_shipping_estimate_locodes(self): - """Test case for create_sea_shipping_estimate - - Create an estimate based on locode values # noqa: E501 - """ - estimate = self.api.create_sea_shipping_estimate( - destination_locode="USSD2", freight_mass_g=17_311, origin_locode="USSEA" - ) - self.assertEqual(estimate.data.order, None) - self.assertEqual(estimate.data.type, "shipping_sea") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - def test_create_sea_shipping_estimate_create_order(self): - """Test case for create_sea_shipping_estimate - - Create an estimate and an order # noqa: E501 - """ - estimate = self.api.create_sea_shipping_estimate( - create_order=True, - destination_locode="USSD2", - freight_mass_g=22_210, - origin_locode="USSEA", - ) - self.assertGreater(estimate.data.order.amount, 0) - self.assertEqual(estimate.data.type, "shipping_sea") - self.assertGreater( - estimate.data.mass_g, 0 - ) # not setting an exact value since the mock values returned are randomized - - -if __name__ == "__main__": - unittest.main()