|
| 1 | +# coding: utf-8 |
| 2 | + |
| 3 | +""" |
| 4 | + Patch API V1 |
| 5 | +
|
| 6 | + The core API used to integrate with Patch's service # noqa: E501 |
| 7 | +
|
| 8 | + The version of the OpenAPI document: v1 |
| 9 | + |
| 10 | + Generated by: https://openapi-generator.tech |
| 11 | +""" |
| 12 | + |
| 13 | + |
| 14 | +from __future__ import absolute_import |
| 15 | + |
| 16 | +import re # noqa: F401 |
| 17 | + |
| 18 | +# python 2 and python 3 compatibility library |
| 19 | +import six |
| 20 | + |
| 21 | +from patch_api.exceptions import ApiTypeError, ApiValueError |
| 22 | + |
| 23 | + |
| 24 | +class TechnologyTypesApi(object): |
| 25 | + """NOTE: This class is auto generated by OpenAPI Generator |
| 26 | + Ref: https://openapi-generator.tech |
| 27 | +
|
| 28 | + Do not edit the class manually. |
| 29 | + """ |
| 30 | + |
| 31 | + ALLOWED_QUERY_PARAMS = [ |
| 32 | + "mass_g", |
| 33 | + "total_price_cents_usd", |
| 34 | + "project_id", |
| 35 | + "page", |
| 36 | + "distance_m", |
| 37 | + "transportation_method", |
| 38 | + "package_mass_g", |
| 39 | + "create_order", |
| 40 | + "model", |
| 41 | + "make", |
| 42 | + "year", |
| 43 | + "transaction_value_btc_sats", |
| 44 | + "transaction_value_eth_gwei", |
| 45 | + "gas_used", |
| 46 | + "average_daily_balance_btc_sats", |
| 47 | + "average_daily_balance_eth_gwei", |
| 48 | + "timestamp", |
| 49 | + "origin_aiport", |
| 50 | + "destination_aiport", |
| 51 | + "aircraft_code", |
| 52 | + "cabin_class", |
| 53 | + "passenger_count", |
| 54 | + ] |
| 55 | + |
| 56 | + def __init__(self, api_client=None): |
| 57 | + self.api_client = api_client |
| 58 | + |
| 59 | + def retrieve_technology_types(self, **kwargs): # noqa: E501 |
| 60 | + """Retrieves the list of technology_types # noqa: E501 |
| 61 | +
|
| 62 | + Retrieves a list of all technology_types. # noqa: E501 |
| 63 | + This method makes a synchronous HTTP request by default. To make an |
| 64 | + asynchronous HTTP request, please pass async_req=True |
| 65 | + >>> thread = api.retrieve_technology_types(async_req=True) |
| 66 | + >>> result = thread.get() |
| 67 | +
|
| 68 | + :param async_req bool: execute request asynchronously |
| 69 | + :param _preload_content: if False, the urllib3.HTTPResponse object will |
| 70 | + be returned without reading/decoding response |
| 71 | + data. Default is True. |
| 72 | + :param _request_timeout: timeout setting for this request. If one |
| 73 | + number provided, it will be total request |
| 74 | + timeout. It can also be a pair (tuple) of |
| 75 | + (connection, read) timeouts. |
| 76 | + :return: TechnologyTypeListResponse |
| 77 | + If the method is called asynchronously, |
| 78 | + returns the request thread. |
| 79 | + """ |
| 80 | + kwargs["_return_http_data_only"] = True |
| 81 | + return self.retrieve_technology_types_with_http_info(**kwargs) # noqa: E501 |
| 82 | + |
| 83 | + def retrieve_technology_types_with_http_info(self, **kwargs): # noqa: E501 |
| 84 | + """Retrieves the list of technology_types # noqa: E501 |
| 85 | +
|
| 86 | + Retrieves a list of all technology_types. # noqa: E501 |
| 87 | + This method makes a synchronous HTTP request by default. To make an |
| 88 | + asynchronous HTTP request, please pass async_req=True |
| 89 | + >>> thread = api.retrieve_technology_types_with_http_info(async_req=True) |
| 90 | + >>> result = thread.get() |
| 91 | +
|
| 92 | + :param async_req bool: execute request asynchronously |
| 93 | + :param _return_http_data_only: response data without head status code |
| 94 | + and headers |
| 95 | + :param _preload_content: if False, the urllib3.HTTPResponse object will |
| 96 | + be returned without reading/decoding response |
| 97 | + data. Default is True. |
| 98 | + :param _request_timeout: timeout setting for this request. If one |
| 99 | + number provided, it will be total request |
| 100 | + timeout. It can also be a pair (tuple) of |
| 101 | + (connection, read) timeouts. |
| 102 | + :return: tuple(TechnologyTypeListResponse, status_code(int), headers(HTTPHeaderDict)) |
| 103 | + If the method is called asynchronously, |
| 104 | + returns the request thread. |
| 105 | + """ |
| 106 | + |
| 107 | + local_var_params = locals() |
| 108 | + |
| 109 | + all_params = [] # noqa: E501 |
| 110 | + all_params.append("async_req") |
| 111 | + all_params.append("_return_http_data_only") |
| 112 | + all_params.append("_preload_content") |
| 113 | + all_params.append("_request_timeout") |
| 114 | + all_params.append("mass_g") |
| 115 | + all_params.append("total_price_cents_usd") |
| 116 | + all_params.append("project_id") |
| 117 | + all_params.append("metadata") |
| 118 | + all_params.append("distance_m") |
| 119 | + all_params.append("transportation_method") |
| 120 | + all_params.append("package_mass_g") |
| 121 | + all_params.append("create_order") |
| 122 | + all_params.append("make") |
| 123 | + all_params.append("model") |
| 124 | + all_params.append("year") |
| 125 | + all_params.append("transaction_value_btc_sats") |
| 126 | + all_params.append("transaction_value_eth_gwei") |
| 127 | + all_params.append("gas_used") |
| 128 | + all_params.append("transaction_value_btc_sats") |
| 129 | + all_params.append("average_daily_balance_btc_sats") |
| 130 | + all_params.append("average_daily_balance_eth_gwei") |
| 131 | + all_params.append("timestamp") |
| 132 | + all_params.append("origin_airport") |
| 133 | + all_params.append("destination_airport") |
| 134 | + all_params.append("aircraft_code") |
| 135 | + all_params.append("cabin_class") |
| 136 | + all_params.append("passenger_count") |
| 137 | + |
| 138 | + for key, val in six.iteritems(local_var_params["kwargs"]): |
| 139 | + if key not in all_params: |
| 140 | + raise ApiTypeError( |
| 141 | + "Got an unexpected keyword argument '%s'" |
| 142 | + " to method retrieve_technology_types" % key |
| 143 | + ) |
| 144 | + local_var_params[key] = val |
| 145 | + del local_var_params["kwargs"] |
| 146 | + |
| 147 | + collection_formats = {} |
| 148 | + |
| 149 | + path_params = {} |
| 150 | + |
| 151 | + query_params = [] |
| 152 | + |
| 153 | + # do not add duplicate keys to query_params list |
| 154 | + existing_keys = [] |
| 155 | + for param in query_params: |
| 156 | + existing_keys.append(param[0]) |
| 157 | + |
| 158 | + for key in kwargs: |
| 159 | + if key not in existing_keys: |
| 160 | + query_params.append([key, kwargs.get(key)]) |
| 161 | + |
| 162 | + header_params = {} |
| 163 | + |
| 164 | + form_params = [] |
| 165 | + local_var_files = {} |
| 166 | + |
| 167 | + body_params = None |
| 168 | + # HTTP header `Accept` |
| 169 | + header_params["Accept"] = self.api_client.select_header_accept( |
| 170 | + ["application/json"] |
| 171 | + ) # noqa: E501 |
| 172 | + |
| 173 | + # Authentication setting |
| 174 | + auth_settings = ["bearer_auth"] # noqa: E501 |
| 175 | + |
| 176 | + return self.api_client.call_api( |
| 177 | + "/v1/projects/technology_types", |
| 178 | + "GET", |
| 179 | + path_params, |
| 180 | + query_params, |
| 181 | + header_params, |
| 182 | + body=body_params, |
| 183 | + post_params=form_params, |
| 184 | + files=local_var_files, |
| 185 | + response_type="TechnologyTypeListResponse", # noqa: E501 |
| 186 | + auth_settings=auth_settings, |
| 187 | + async_req=local_var_params.get("async_req"), |
| 188 | + _return_http_data_only=local_var_params.get( |
| 189 | + "_return_http_data_only" |
| 190 | + ), # noqa: E501 |
| 191 | + _preload_content=local_var_params.get("_preload_content", True), |
| 192 | + _request_timeout=local_var_params.get("_request_timeout"), |
| 193 | + collection_formats=collection_formats, |
| 194 | + ) |
0 commit comments