Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ 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).

## [1.15.0] - 2021-10-04

### Added

- Added the ability to fetch project technology types via `api_client.technology_types.retrieve_technology_types()`

## [1.14.0] - 2021-09-27

### Added
Expand Down
2 changes: 1 addition & 1 deletion patch_api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from __future__ import absolute_import

__version__ = "1.14.0"
__version__ = "1.15.0"

# import ApiClient
from patch_api.api_client import ApiClient
Expand Down
1 change: 1 addition & 0 deletions patch_api/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from patch_api.api.orders_api import OrdersApi
from patch_api.api.preferences_api import PreferencesApi
from patch_api.api.projects_api import ProjectsApi
from patch_api.api.technology_types_api import TechnologyTypesApi
194 changes: 194 additions & 0 deletions patch_api/api/technology_types_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
# 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 re # noqa: F401

# python 2 and python 3 compatibility library
import six

from patch_api.exceptions import ApiTypeError, ApiValueError


class TechnologyTypesApi(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_aiport",
"destination_aiport",
"aircraft_code",
"cabin_class",
"passenger_count",
]

def __init__(self, api_client=None):
self.api_client = api_client

def retrieve_technology_types(self, **kwargs): # noqa: E501
"""Retrieves the list of technology_types # noqa: E501

Retrieves a list of all technology_types. # 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_technology_types(async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously
: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: TechnologyTypeListResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
return self.retrieve_technology_types_with_http_info(**kwargs) # noqa: E501

def retrieve_technology_types_with_http_info(self, **kwargs): # noqa: E501
"""Retrieves the list of technology_types # noqa: E501

Retrieves a list of all technology_types. # 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_technology_types_with_http_info(async_req=True)
>>> result = thread.get()

:param async_req bool: execute request asynchronously
: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(TechnologyTypeListResponse, status_code(int), headers(HTTPHeaderDict))
If the method is called asynchronously,
returns the request thread.
"""

local_var_params = locals()

all_params = [] # 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")

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_technology_types" % key
)
local_var_params[key] = val
del local_var_params["kwargs"]

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 = {}

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/projects/technology_types",
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="TechnologyTypeListResponse", # 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,
)
4 changes: 3 additions & 1 deletion patch_api/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
from patch_api.api.orders_api import OrdersApi
from patch_api.api.preferences_api import PreferencesApi
from patch_api.api.projects_api import ProjectsApi
from patch_api.api.technology_types_api import TechnologyTypesApi

from patch_api import rest
from patch_api.exceptions import ApiValueError
Expand Down Expand Up @@ -91,7 +92,7 @@ def __init__(
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "patch-python/1.14.0"
self.user_agent = "patch-python/1.15.0"

def __del__(self):
if self._pool:
Expand All @@ -105,6 +106,7 @@ def __getattr__(self, method):
"orders": OrdersApi,
"preferences": PreferencesApi,
"estimates": EstimatesApi,
"technology_types": TechnologyTypesApi,
}[method]
return resource(api_client=self)

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: v1\n"
"SDK Package Version: 1.14.0".format(
"SDK Package Version: 1.15.0".format(
env=sys.platform, pyversion=sys.version
)
)
Expand Down
1 change: 1 addition & 0 deletions patch_api/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,4 @@
from patch_api.models.sdg import Sdg
from patch_api.models.standard import Standard
from patch_api.models.technology_type import TechnologyType
from patch_api.models.technology_type_list_response import TechnologyTypeListResponse
Loading