Skip to content

Commit a646d8d

Browse files
authored
Remove hotelestimates (#81)
1 parent b62bc4a commit a646d8d

15 files changed

+35
-561
lines changed

.flake8

Lines changed: 0 additions & 7 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ repos:
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- id: name-tests-test
9-
- repo: https://github.com/pycqa/flake8
10-
rev: "4.0.1"
11-
hooks:
12-
- id: flake8
13-
args: ["--config=.flake8"]
149
- repo: https://github.com/psf/black
1510
rev: 24.4.2
1611
hooks:

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.4.0] - 2025-05-16
9+
10+
### Removed
11+
12+
- Removes `Patch::Estimate.create_hotel_estimate` method
13+
14+
## [2.3.1] - 2025-04-28
15+
16+
### Removed
17+
18+
- Removes `patch.estimates.create_ecommerce_estimate` method
19+
20+
[2.3.0] 2025-01-10
21+
22+
### Removed
23+
24+
- Removes `patch.estimates.create_ethereum_estimate` method
25+
- Removes `patch.estimates.create_shipping_estimate` method
26+
- Removes `patch.estimates.create_vehicle_estimate` method
27+
828
## [2.1.1] - 2023-04-18
929

1030
### Added

patch_api/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# coding: utf-8
22

3-
# flake8: noqa
4-
53
"""
64
Patch API V2
75
@@ -15,7 +13,7 @@
1513

1614
from __future__ import absolute_import
1715

18-
__version__ = "2.3.1"
16+
__version__ = "2.4.0"
1917

2018
# import ApiClient
2119
from patch_api.api_client import ApiClient

patch_api/api/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import absolute_import
22

3-
# flake8: noqa
4-
53
# import apis into api package
64
from patch_api.api.estimates_api import EstimatesApi
75
from patch_api.api.order_line_items_api import OrderLineItemsApi

patch_api/api/estimates_api.py

Lines changed: 0 additions & 198 deletions
Original file line numberDiff line numberDiff line change
@@ -683,204 +683,6 @@ def create_flight_estimate_with_http_info(
683683
collection_formats=collection_formats,
684684
)
685685

686-
def create_hotel_estimate(
687-
self, create_hotel_estimate_request={}, **kwargs
688-
): # noqa: E501
689-
"""Create a hotel estimate. # noqa: E501
690-
691-
Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters. # noqa: E501
692-
This method makes a synchronous HTTP request by default. To make an
693-
asynchronous HTTP request, please pass async_req=True
694-
>>> thread = api.create_hotel_estimate(create_hotel_estimate_request, async_req=True)
695-
>>> result = thread.get()
696-
697-
:param async_req bool: execute request asynchronously
698-
:param CreateHotelEstimateRequest create_hotel_estimate_request: (required)
699-
:param int patch_version:
700-
:param _preload_content: if False, the urllib3.HTTPResponse object will
701-
be returned without reading/decoding response
702-
data. Default is True.
703-
:param _request_timeout: timeout setting for this request. If one
704-
number provided, it will be total request
705-
timeout. It can also be a pair (tuple) of
706-
(connection, read) timeouts.
707-
:return: EstimateResponse
708-
If the method is called asynchronously,
709-
returns the request thread.
710-
"""
711-
kwargs["_return_http_data_only"] = True
712-
return self.create_hotel_estimate_with_http_info(
713-
create_hotel_estimate_request, **kwargs
714-
) # noqa: E501
715-
716-
def create_hotel_estimate_with_http_info(
717-
self, create_hotel_estimate_request, **kwargs
718-
): # noqa: E501
719-
"""Create a hotel estimate. # noqa: E501
720-
721-
Creates a hotel estimate for the amount of CO2 to be compensated. An order in the `draft` state may be created based on the parameters. # noqa: E501
722-
This method makes a synchronous HTTP request by default. To make an
723-
asynchronous HTTP request, please pass async_req=True
724-
>>> thread = api.create_hotel_estimate_with_http_info(create_hotel_estimate_request, async_req=True)
725-
>>> result = thread.get()
726-
727-
:param async_req bool: execute request asynchronously
728-
:param CreateHotelEstimateRequest create_hotel_estimate_request: (required)
729-
:param int patch_version:
730-
:param _return_http_data_only: response data without head status code
731-
and headers
732-
:param _preload_content: if False, the urllib3.HTTPResponse object will
733-
be returned without reading/decoding response
734-
data. Default is True.
735-
:param _request_timeout: timeout setting for this request. If one
736-
number provided, it will be total request
737-
timeout. It can also be a pair (tuple) of
738-
(connection, read) timeouts.
739-
:return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict))
740-
If the method is called asynchronously,
741-
returns the request thread.
742-
"""
743-
744-
local_var_params = locals()
745-
746-
all_params = ["create_hotel_estimate_request", "patch_version"] # noqa: E501
747-
all_params.append("async_req")
748-
all_params.append("_return_http_data_only")
749-
all_params.append("_preload_content")
750-
all_params.append("_request_timeout")
751-
all_params.append("mass_g")
752-
all_params.append("total_price_cents_usd")
753-
all_params.append("project_id")
754-
all_params.append("metadata")
755-
all_params.append("distance_m")
756-
all_params.append("transportation_method")
757-
all_params.append("package_mass_g")
758-
all_params.append("create_order")
759-
all_params.append("make")
760-
all_params.append("model")
761-
all_params.append("year")
762-
all_params.append("transaction_value_btc_sats")
763-
all_params.append("transaction_value_eth_gwei")
764-
all_params.append("gas_used")
765-
all_params.append("transaction_value_btc_sats")
766-
all_params.append("average_daily_balance_btc_sats")
767-
all_params.append("average_daily_balance_eth_gwei")
768-
all_params.append("timestamp")
769-
all_params.append("origin_airport")
770-
all_params.append("destination_airport")
771-
all_params.append("aircraft_code")
772-
all_params.append("cabin_class")
773-
all_params.append("passenger_count")
774-
all_params.append("state")
775-
all_params.append("country_code")
776-
all_params.append("city")
777-
all_params.append("region")
778-
all_params.append("star_rating")
779-
all_params.append("number_of_nights")
780-
all_params.append("number_of_rooms")
781-
all_params.append("vintage_year")
782-
all_params.append("total_price")
783-
all_params.append("currency")
784-
all_params.append("amount")
785-
all_params.append("unit")
786-
all_params.append("issued_to")
787-
all_params.append("cargo_type")
788-
all_params.append("container_size_code")
789-
all_params.append("destination_country_code")
790-
all_params.append("destination_locode")
791-
all_params.append("destination_postal_code")
792-
all_params.append("emissions_scope")
793-
all_params.append("freight_mass_g")
794-
all_params.append("freight_volume_cubic_m")
795-
all_params.append("fuel_type")
796-
all_params.append("number_of_containers")
797-
all_params.append("origin_country_code")
798-
all_params.append("origin_locode")
799-
all_params.append("origin_postal_code")
800-
all_params.append("truck_weight_t")
801-
all_params.append("vessel_imo")
802-
all_params.append("vintage_start_year")
803-
all_params.append("vintage_end_year")
804-
805-
for key, val in six.iteritems(local_var_params["kwargs"]):
806-
if key not in all_params:
807-
raise ApiTypeError(
808-
"Got an unexpected keyword argument '%s'"
809-
" to method create_hotel_estimate" % key
810-
)
811-
local_var_params[key] = val
812-
del local_var_params["kwargs"]
813-
# verify the required parameter 'create_hotel_estimate_request' is set
814-
if (
815-
"create_hotel_estimate_request" not in local_var_params
816-
or local_var_params["create_hotel_estimate_request"] is None
817-
):
818-
raise ApiValueError(
819-
"Missing the required parameter `create_hotel_estimate_request` when calling `create_hotel_estimate`"
820-
) # noqa: E501
821-
822-
collection_formats = {}
823-
824-
path_params = {}
825-
826-
query_params = []
827-
828-
# do not add duplicate keys to query_params list
829-
existing_keys = []
830-
for param in query_params:
831-
existing_keys.append(param[0])
832-
833-
for key in kwargs:
834-
if key not in existing_keys:
835-
query_params.append([key, kwargs.get(key)])
836-
837-
header_params = {}
838-
if "patch_version" in local_var_params:
839-
header_params["Patch-Version"] = local_var_params[
840-
"patch_version"
841-
] # noqa: E501
842-
843-
form_params = []
844-
local_var_files = {}
845-
846-
body_params = None
847-
if "create_hotel_estimate_request" in local_var_params:
848-
body_params = local_var_params["create_hotel_estimate_request"]
849-
# HTTP header `Accept`
850-
header_params["Accept"] = self.api_client.select_header_accept(
851-
["application/json"]
852-
) # noqa: E501
853-
854-
# HTTP header `Content-Type`
855-
header_params["Content-Type"] = (
856-
self.api_client.select_header_content_type( # noqa: E501
857-
["application/json"]
858-
)
859-
) # noqa: E501
860-
861-
# Authentication setting
862-
auth_settings = ["bearer_auth"] # noqa: E501
863-
864-
return self.api_client.call_api(
865-
"/v1/estimates/hotel",
866-
"POST",
867-
path_params,
868-
query_params,
869-
header_params,
870-
body=body_params,
871-
post_params=form_params,
872-
files=local_var_files,
873-
response_type="EstimateResponse", # noqa: E501
874-
auth_settings=auth_settings,
875-
async_req=local_var_params.get("async_req"),
876-
_return_http_data_only=local_var_params.get(
877-
"_return_http_data_only"
878-
), # noqa: E501
879-
_preload_content=local_var_params.get("_preload_content", True),
880-
_request_timeout=local_var_params.get("_request_timeout"),
881-
collection_formats=collection_formats,
882-
)
883-
884686
def create_mass_estimate(
885687
self, create_mass_estimate_request={}, **kwargs
886688
): # noqa: E501

patch_api/api_client.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# coding: utf-8
22
"""
3-
Patch API V2
3+
Patch API V2
44
5-
The core API used to integrate with Patch's service # noqa: E501
5+
The core API used to integrate with Patch's service # noqa: E501
66
7-
The version of the OpenAPI document: 2
8-
9-
Generated by: https://openapi-generator.tech
7+
The version of the OpenAPI document: 2
8+
9+
Generated by: https://openapi-generator.tech
1010
"""
1111

1212
from __future__ import absolute_import
@@ -92,7 +92,7 @@ def __init__(
9292
self.default_headers[header_name] = header_value
9393
self.cookie = cookie
9494
# Set default User-Agent.
95-
self.user_agent = "patch-python/2.3.1"
95+
self.user_agent = "patch-python/2.4.0"
9696
# Set default Patch-Version
9797
self.patch_version = 2
9898

@@ -130,6 +130,9 @@ def user_agent(self):
130130
def user_agent(self, value):
131131
self.default_headers["User-Agent"] = value
132132

133+
def set_default_header(self, header_name, header_value):
134+
self.default_headers[header_name] = header_value
135+
133136
@property
134137
def patch_version(self):
135138
"""API version for this API client"""

patch_api/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def to_debug_report(self):
341341
"OS: {env}\n"
342342
"Python Version: {pyversion}\n"
343343
"Version of the API: 2\n"
344-
"SDK Package Version: 2.3.1".format(env=sys.platform, pyversion=sys.version)
344+
"SDK Package Version: 2.4.0".format(env=sys.platform, pyversion=sys.version)
345345
)
346346

347347
def get_host_settings(self):

patch_api/exceptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def __init__(self, msg, path_to_item=None):
8282

8383

8484
class ApiException(OpenApiException):
85+
8586
def __init__(self, status=None, reason=None, http_resp=None):
8687
if http_resp:
8788
self.status = http_resp.status

patch_api/models/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# coding: utf-8
22

3-
# flake8: noqa
43
"""
54
Patch API V2
65
@@ -22,7 +21,6 @@
2221
CreateBitcoinEstimateRequest,
2322
)
2423
from patch_api.models.create_flight_estimate_request import CreateFlightEstimateRequest
25-
from patch_api.models.create_hotel_estimate_request import CreateHotelEstimateRequest
2624
from patch_api.models.create_mass_estimate_request import CreateMassEstimateRequest
2725
from patch_api.models.create_order_line_item_request import CreateOrderLineItemRequest
2826
from patch_api.models.create_order_request import CreateOrderRequest

0 commit comments

Comments
 (0)