Skip to content

Commit 4643125

Browse files
committed
Remove create_flight_estimate
1 parent a646d8d commit 4643125

11 files changed

+17
-825
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ 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.5.0] - 2025-08-19
9+
10+
### Removed
11+
12+
- Removes `Patch::Estimate.create_flight_estimate` method
13+
814
## [2.4.0] - 2025-05-16
915

1016
### Removed

patch_api/__init__.py

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

3+
# flake8: noqa
4+
35
"""
46
Patch API V2
57
@@ -13,7 +15,7 @@
1315

1416
from __future__ import absolute_import
1517

16-
__version__ = "2.4.0"
18+
__version__ = "2.5.0"
1719

1820
# import ApiClient
1921
from patch_api.api_client import ApiClient

patch_api/api/__init__.py

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

3+
# flake8: noqa
4+
35
# import apis into api package
46
from patch_api.api.estimates_api import EstimatesApi
57
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
@@ -485,204 +485,6 @@ def create_bitcoin_estimate_with_http_info(
485485
collection_formats=collection_formats,
486486
)
487487

488-
def create_flight_estimate(
489-
self, create_flight_estimate_request={}, **kwargs
490-
): # noqa: E501
491-
"""Create a flight estimate given the distance traveled in meters # noqa: E501
492-
493-
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
494-
This method makes a synchronous HTTP request by default. To make an
495-
asynchronous HTTP request, please pass async_req=True
496-
>>> thread = api.create_flight_estimate(create_flight_estimate_request, async_req=True)
497-
>>> result = thread.get()
498-
499-
:param async_req bool: execute request asynchronously
500-
:param CreateFlightEstimateRequest create_flight_estimate_request: (required)
501-
:param int patch_version:
502-
:param _preload_content: if False, the urllib3.HTTPResponse object will
503-
be returned without reading/decoding response
504-
data. Default is True.
505-
:param _request_timeout: timeout setting for this request. If one
506-
number provided, it will be total request
507-
timeout. It can also be a pair (tuple) of
508-
(connection, read) timeouts.
509-
:return: EstimateResponse
510-
If the method is called asynchronously,
511-
returns the request thread.
512-
"""
513-
kwargs["_return_http_data_only"] = True
514-
return self.create_flight_estimate_with_http_info(
515-
create_flight_estimate_request, **kwargs
516-
) # noqa: E501
517-
518-
def create_flight_estimate_with_http_info(
519-
self, create_flight_estimate_request, **kwargs
520-
): # noqa: E501
521-
"""Create a flight estimate given the distance traveled in meters # noqa: E501
522-
523-
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
524-
This method makes a synchronous HTTP request by default. To make an
525-
asynchronous HTTP request, please pass async_req=True
526-
>>> thread = api.create_flight_estimate_with_http_info(create_flight_estimate_request, async_req=True)
527-
>>> result = thread.get()
528-
529-
:param async_req bool: execute request asynchronously
530-
:param CreateFlightEstimateRequest create_flight_estimate_request: (required)
531-
:param int patch_version:
532-
:param _return_http_data_only: response data without head status code
533-
and headers
534-
:param _preload_content: if False, the urllib3.HTTPResponse object will
535-
be returned without reading/decoding response
536-
data. Default is True.
537-
:param _request_timeout: timeout setting for this request. If one
538-
number provided, it will be total request
539-
timeout. It can also be a pair (tuple) of
540-
(connection, read) timeouts.
541-
:return: tuple(EstimateResponse, status_code(int), headers(HTTPHeaderDict))
542-
If the method is called asynchronously,
543-
returns the request thread.
544-
"""
545-
546-
local_var_params = locals()
547-
548-
all_params = ["create_flight_estimate_request", "patch_version"] # noqa: E501
549-
all_params.append("async_req")
550-
all_params.append("_return_http_data_only")
551-
all_params.append("_preload_content")
552-
all_params.append("_request_timeout")
553-
all_params.append("mass_g")
554-
all_params.append("total_price_cents_usd")
555-
all_params.append("project_id")
556-
all_params.append("metadata")
557-
all_params.append("distance_m")
558-
all_params.append("transportation_method")
559-
all_params.append("package_mass_g")
560-
all_params.append("create_order")
561-
all_params.append("make")
562-
all_params.append("model")
563-
all_params.append("year")
564-
all_params.append("transaction_value_btc_sats")
565-
all_params.append("transaction_value_eth_gwei")
566-
all_params.append("gas_used")
567-
all_params.append("transaction_value_btc_sats")
568-
all_params.append("average_daily_balance_btc_sats")
569-
all_params.append("average_daily_balance_eth_gwei")
570-
all_params.append("timestamp")
571-
all_params.append("origin_airport")
572-
all_params.append("destination_airport")
573-
all_params.append("aircraft_code")
574-
all_params.append("cabin_class")
575-
all_params.append("passenger_count")
576-
all_params.append("state")
577-
all_params.append("country_code")
578-
all_params.append("city")
579-
all_params.append("region")
580-
all_params.append("star_rating")
581-
all_params.append("number_of_nights")
582-
all_params.append("number_of_rooms")
583-
all_params.append("vintage_year")
584-
all_params.append("total_price")
585-
all_params.append("currency")
586-
all_params.append("amount")
587-
all_params.append("unit")
588-
all_params.append("issued_to")
589-
all_params.append("cargo_type")
590-
all_params.append("container_size_code")
591-
all_params.append("destination_country_code")
592-
all_params.append("destination_locode")
593-
all_params.append("destination_postal_code")
594-
all_params.append("emissions_scope")
595-
all_params.append("freight_mass_g")
596-
all_params.append("freight_volume_cubic_m")
597-
all_params.append("fuel_type")
598-
all_params.append("number_of_containers")
599-
all_params.append("origin_country_code")
600-
all_params.append("origin_locode")
601-
all_params.append("origin_postal_code")
602-
all_params.append("truck_weight_t")
603-
all_params.append("vessel_imo")
604-
all_params.append("vintage_start_year")
605-
all_params.append("vintage_end_year")
606-
607-
for key, val in six.iteritems(local_var_params["kwargs"]):
608-
if key not in all_params:
609-
raise ApiTypeError(
610-
"Got an unexpected keyword argument '%s'"
611-
" to method create_flight_estimate" % key
612-
)
613-
local_var_params[key] = val
614-
del local_var_params["kwargs"]
615-
# verify the required parameter 'create_flight_estimate_request' is set
616-
if (
617-
"create_flight_estimate_request" not in local_var_params
618-
or local_var_params["create_flight_estimate_request"] is None
619-
):
620-
raise ApiValueError(
621-
"Missing the required parameter `create_flight_estimate_request` when calling `create_flight_estimate`"
622-
) # noqa: E501
623-
624-
collection_formats = {}
625-
626-
path_params = {}
627-
628-
query_params = []
629-
630-
# do not add duplicate keys to query_params list
631-
existing_keys = []
632-
for param in query_params:
633-
existing_keys.append(param[0])
634-
635-
for key in kwargs:
636-
if key not in existing_keys:
637-
query_params.append([key, kwargs.get(key)])
638-
639-
header_params = {}
640-
if "patch_version" in local_var_params:
641-
header_params["Patch-Version"] = local_var_params[
642-
"patch_version"
643-
] # noqa: E501
644-
645-
form_params = []
646-
local_var_files = {}
647-
648-
body_params = None
649-
if "create_flight_estimate_request" in local_var_params:
650-
body_params = local_var_params["create_flight_estimate_request"]
651-
# HTTP header `Accept`
652-
header_params["Accept"] = self.api_client.select_header_accept(
653-
["application/json"]
654-
) # noqa: E501
655-
656-
# HTTP header `Content-Type`
657-
header_params["Content-Type"] = (
658-
self.api_client.select_header_content_type( # noqa: E501
659-
["application/json"]
660-
)
661-
) # noqa: E501
662-
663-
# Authentication setting
664-
auth_settings = ["bearer_auth"] # noqa: E501
665-
666-
return self.api_client.call_api(
667-
"/v1/estimates/flight",
668-
"POST",
669-
path_params,
670-
query_params,
671-
header_params,
672-
body=body_params,
673-
post_params=form_params,
674-
files=local_var_files,
675-
response_type="EstimateResponse", # noqa: E501
676-
auth_settings=auth_settings,
677-
async_req=local_var_params.get("async_req"),
678-
_return_http_data_only=local_var_params.get(
679-
"_return_http_data_only"
680-
), # noqa: E501
681-
_preload_content=local_var_params.get("_preload_content", True),
682-
_request_timeout=local_var_params.get("_request_timeout"),
683-
collection_formats=collection_formats,
684-
)
685-
686488
def create_mass_estimate(
687489
self, create_mass_estimate_request={}, **kwargs
688490
): # noqa: E501

patch_api/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.4.0"
95+
self.user_agent = "patch-python/2.5.0"
9696
# Set default Patch-Version
9797
self.patch_version = 2
9898

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.4.0".format(env=sys.platform, pyversion=sys.version)
344+
"SDK Package Version: 2.5.0".format(env=sys.platform, pyversion=sys.version)
345345
)
346346

347347
def get_host_settings(self):

patch_api/models/__init__.py

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

3+
# flake8: noqa
34
"""
45
Patch API V2
56
@@ -20,7 +21,6 @@
2021
from patch_api.models.create_bitcoin_estimate_request import (
2122
CreateBitcoinEstimateRequest,
2223
)
23-
from patch_api.models.create_flight_estimate_request import CreateFlightEstimateRequest
2424
from patch_api.models.create_mass_estimate_request import CreateMassEstimateRequest
2525
from patch_api.models.create_order_line_item_request import CreateOrderLineItemRequest
2626
from patch_api.models.create_order_request import CreateOrderRequest

0 commit comments

Comments
 (0)