-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3 Revert back to pipenv instead of poetry due to lack of support of…
… libraries like GDAL. Move swagger_client to the top level of the source code so that it can be used.
- Loading branch information
Showing
3 changed files
with
146 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
The Earth Observatory Natural Event Tracker ([EONET](https://eonet.sci.gsfc.nasa.gov/what-is-eonet)) | ||
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 | ||
OpenAPI spec version: 3.0.0 | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
||
from __future__ import absolute_import | ||
|
||
import re # noqa: F401 | ||
|
||
# python 2 and python 3 compatibility library | ||
import six | ||
|
||
from swagger_client.api_client import ApiClient | ||
|
||
|
||
class CategoriesApi(object): | ||
"""NOTE: This class is auto generated by the swagger code generator program. | ||
Do not edit the class manually. | ||
Ref: https://github.com/swagger-api/swagger-codegen | ||
""" | ||
|
||
def __init__(self, api_client=None): | ||
if api_client is None: | ||
api_client = ApiClient() | ||
self.api_client = api_client | ||
|
||
def get_category_by_id(self, category_id, **kwargs): # noqa: E501 | ||
"""Categories are the types of events by which individual events are cataloged # noqa: E501 | ||
Returns a single category # noqa: E501 | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.get_category_by_id(category_id, async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool | ||
:param int category_id: ID of category to return (required) | ||
:return: Category | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" | ||
kwargs['_return_http_data_only'] = True | ||
if kwargs.get('async_req'): | ||
return self.get_category_by_id_with_http_info(category_id, **kwargs) # noqa: E501 | ||
else: | ||
(data) = self.get_category_by_id_with_http_info(category_id, **kwargs) # noqa: E501 | ||
return data | ||
|
||
def get_category_by_id_with_http_info(self, category_id, **kwargs): # noqa: E501 | ||
"""Categories are the types of events by which individual events are cataloged # noqa: E501 | ||
Returns a single category # noqa: E501 | ||
This method makes a synchronous HTTP request by default. To make an | ||
asynchronous HTTP request, please pass async_req=True | ||
>>> thread = api.get_category_by_id_with_http_info(category_id, async_req=True) | ||
>>> result = thread.get() | ||
:param async_req bool | ||
:param int category_id: ID of category to return (required) | ||
:return: Category | ||
If the method is called asynchronously, | ||
returns the request thread. | ||
""" | ||
|
||
all_params = ['category_id'] # noqa: E501 | ||
all_params.append('async_req') | ||
all_params.append('_return_http_data_only') | ||
all_params.append('_preload_content') | ||
all_params.append('_request_timeout') | ||
|
||
params = locals() | ||
for key, val in six.iteritems(params['kwargs']): | ||
if key not in all_params: | ||
raise TypeError( | ||
"Got an unexpected keyword argument '%s'" | ||
" to method get_category_by_id" % key | ||
) | ||
params[key] = val | ||
del params['kwargs'] | ||
# verify the required parameter 'category_id' is set | ||
if ('category_id' not in params or | ||
params['category_id'] is None): | ||
raise ValueError("Missing the required parameter `category_id` when calling `get_category_by_id`") # noqa: E501 | ||
|
||
collection_formats = {} | ||
|
||
path_params = {} | ||
if 'category_id' in params: | ||
path_params['categoryId'] = params['category_id'] # noqa: E501 | ||
|
||
query_params = [] | ||
|
||
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 = [] # noqa: E501 | ||
|
||
return self.api_client.call_api( | ||
'/categories/{categoryId}', 'GET', | ||
path_params, | ||
query_params, | ||
header_params, | ||
body=body_params, | ||
post_params=form_params, | ||
files=local_var_files, | ||
response_type='Category', # noqa: E501 | ||
auth_settings=auth_settings, | ||
async_req=params.get('async_req'), | ||
_return_http_data_only=params.get('_return_http_data_only'), | ||
_preload_content=params.get('_preload_content', True), | ||
_request_timeout=params.get('_request_timeout'), | ||
collection_formats=collection_formats) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters