Skip to content

Remove hotel_estimate #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .flake8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was crapping out and wasn't creating value

This file was deleted.

5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: name-tests-test
- repo: https://github.com/pycqa/flake8
rev: "4.0.1"
hooks:
- id: flake8
args: ["--config=.flake8"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👋

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ 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.4.0] - 2025-05-16

### Removed

- Removes `Patch::Estimate.create_hotel_estimate` method

## [2.3.1] - 2025-04-28

### Removed

- Removes `patch.estimates.create_ecommerce_estimate` method

[2.3.0] 2025-01-10

### Removed

- Removes `patch.estimates.create_ethereum_estimate` method
- Removes `patch.estimates.create_shipping_estimate` method
- Removes `patch.estimates.create_vehicle_estimate` method

## [2.1.1] - 2023-04-18

### Added
Expand Down
4 changes: 1 addition & 3 deletions patch_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# coding: utf-8

# flake8: noqa

"""
Patch API V2

Expand All @@ -15,7 +13,7 @@

from __future__ import absolute_import

__version__ = "2.3.1"
__version__ = "2.4.0"

# import ApiClient
from patch_api.api_client import ApiClient
Expand Down
2 changes: 0 additions & 2 deletions patch_api/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
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
Expand Down
198 changes: 0 additions & 198 deletions patch_api/api/estimates_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,204 +683,6 @@ def create_flight_estimate_with_http_info(
collection_formats=collection_formats,
)

def create_hotel_estimate(
self, create_hotel_estimate_request={}, **kwargs
): # noqa: E501
"""Create a hotel estimate. # noqa: E501

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
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_hotel_estimate(create_hotel_estimate_request, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously
:param CreateHotelEstimateRequest create_hotel_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_hotel_estimate_with_http_info(
create_hotel_estimate_request, **kwargs
) # noqa: E501

def create_hotel_estimate_with_http_info(
self, create_hotel_estimate_request, **kwargs
): # noqa: E501
"""Create a hotel estimate. # noqa: E501

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
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_hotel_estimate_with_http_info(create_hotel_estimate_request, async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously
:param CreateHotelEstimateRequest create_hotel_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_hotel_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_hotel_estimate" % key
)
local_var_params[key] = val
del local_var_params["kwargs"]
# verify the required parameter 'create_hotel_estimate_request' is set
if (
"create_hotel_estimate_request" not in local_var_params
or local_var_params["create_hotel_estimate_request"] is None
):
raise ApiValueError(
"Missing the required parameter `create_hotel_estimate_request` when calling `create_hotel_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_hotel_estimate_request" in local_var_params:
body_params = local_var_params["create_hotel_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/hotel",
"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
Expand Down
15 changes: 9 additions & 6 deletions patch_api/api_client.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# coding: utf-8
"""
Patch API V2
Patch API V2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tab spacing intentional?


The core API used to integrate with Patch's service # noqa: E501
The core API used to integrate with Patch's service # noqa: E501

The version of the OpenAPI document: 2
Contact: [email protected]
Generated by: https://openapi-generator.tech
The version of the OpenAPI document: 2
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""

from __future__ import absolute_import
Expand Down Expand Up @@ -92,7 +92,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "patch-python/2.3.1"
self.user_agent = "patch-python/2.4.0"
# Set default Patch-Version
self.patch_version = 2

Expand Down Expand Up @@ -130,6 +130,9 @@ def user_agent(self):
def user_agent(self, value):
self.default_headers["User-Agent"] = value

def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value

@property
def patch_version(self):
"""API version for this API client"""
Expand Down
2 changes: 1 addition & 1 deletion patch_api/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.1".format(env=sys.platform, pyversion=sys.version)
"SDK Package Version: 2.4.0".format(env=sys.platform, pyversion=sys.version)
)

def get_host_settings(self):
Expand Down
1 change: 1 addition & 0 deletions patch_api/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def __init__(self, msg, path_to_item=None):


class ApiException(OpenApiException):

def __init__(self, status=None, reason=None, http_resp=None):
if http_resp:
self.status = http_resp.status
Expand Down
2 changes: 0 additions & 2 deletions patch_api/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# coding: utf-8

# flake8: noqa
"""
Patch API V2

Expand All @@ -22,7 +21,6 @@
CreateBitcoinEstimateRequest,
)
from patch_api.models.create_flight_estimate_request import CreateFlightEstimateRequest
from patch_api.models.create_hotel_estimate_request import CreateHotelEstimateRequest
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
Expand Down
Loading