aboutsummaryrefslogtreecommitdiffstats
path: root/python_openapi_client/fatcat_openapi_client/api
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-09-18 17:49:30 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-09-18 17:49:30 -0700
commita8fec1c8d34292d0ea74690d545db519c1ee8be6 (patch)
treedf6ac208da1e856e8bf76c7fe5ad978325b7aa66 /python_openapi_client/fatcat_openapi_client/api
parentedc000220baee1f91811345aba87bdab2d259c61 (diff)
downloadfatcat-a8fec1c8d34292d0ea74690d545db519c1ee8be6.tar.gz
fatcat-a8fec1c8d34292d0ea74690d545db519c1ee8be6.zip
codegen python lib v0.3.1
Diffstat (limited to 'python_openapi_client/fatcat_openapi_client/api')
-rw-r--r--python_openapi_client/fatcat_openapi_client/api/default_api.py105
1 files changed, 104 insertions, 1 deletions
diff --git a/python_openapi_client/fatcat_openapi_client/api/default_api.py b/python_openapi_client/fatcat_openapi_client/api/default_api.py
index 188c725d..cfa485ec 100644
--- a/python_openapi_client/fatcat_openapi_client/api/default_api.py
+++ b/python_openapi_client/fatcat_openapi_client/api/default_api.py
@@ -5,7 +5,7 @@
Fatcat is a scalable, versioned, API-oriented catalog of bibliographic entities and file metadata. # noqa: E501
- OpenAPI spec version: 0.3.0
+ OpenAPI spec version: 0.3.1
Contact: webservices@archive.org
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
@@ -334,6 +334,109 @@ class DefaultApi(object):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
+ def create_auth_token(self, editor_id, **kwargs): # noqa: E501
+ """create_auth_token # noqa: E501
+
+ Generate a new auth token for a given editor (internal method). This method is used by the web interface to generate API tokens for users. It can not be called by editors (human or bot) to generate new tokens for themselves, at least at this time. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async=True
+ >>> thread = api.create_auth_token(editor_id, async=True)
+ >>> result = thread.get()
+
+ :param async bool
+ :param str editor_id: (required)
+ :param int duration_seconds: How long API token should be valid for (in seconds)
+ :return: AuthTokenResult
+ If the method is called asynchronously,
+ returns the request thread.
+ """
+ kwargs['_return_http_data_only'] = True
+ if kwargs.get('async'):
+ return self.create_auth_token_with_http_info(editor_id, **kwargs) # noqa: E501
+ else:
+ (data) = self.create_auth_token_with_http_info(editor_id, **kwargs) # noqa: E501
+ return data
+
+ def create_auth_token_with_http_info(self, editor_id, **kwargs): # noqa: E501
+ """create_auth_token # noqa: E501
+
+ Generate a new auth token for a given editor (internal method). This method is used by the web interface to generate API tokens for users. It can not be called by editors (human or bot) to generate new tokens for themselves, at least at this time. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async=True
+ >>> thread = api.create_auth_token_with_http_info(editor_id, async=True)
+ >>> result = thread.get()
+
+ :param async bool
+ :param str editor_id: (required)
+ :param int duration_seconds: How long API token should be valid for (in seconds)
+ :return: AuthTokenResult
+ If the method is called asynchronously,
+ returns the request thread.
+ """
+
+ all_params = ['editor_id', 'duration_seconds'] # noqa: E501
+ all_params.append('async')
+ 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 create_auth_token" % key
+ )
+ params[key] = val
+ del params['kwargs']
+ # verify the required parameter 'editor_id' is set
+ if ('editor_id' not in params or
+ params['editor_id'] is None):
+ raise ValueError("Missing the required parameter `editor_id` when calling `create_auth_token`") # noqa: E501
+
+ collection_formats = {}
+
+ path_params = {}
+ if 'editor_id' in params:
+ path_params['editor_id'] = params['editor_id'] # noqa: E501
+
+ query_params = []
+ if 'duration_seconds' in params:
+ query_params.append(('duration_seconds', params['duration_seconds'])) # noqa: E501
+
+ 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
+
+ # 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'] # noqa: E501
+
+ return self.api_client.call_api(
+ '/auth/token/{editor_id}', 'POST',
+ path_params,
+ query_params,
+ header_params,
+ body=body_params,
+ post_params=form_params,
+ files=local_var_files,
+ response_type='AuthTokenResult', # noqa: E501
+ auth_settings=auth_settings,
+ async=params.get('async'),
+ _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)
+
def create_container(self, editgroup_id, entity, **kwargs): # noqa: E501
"""create_container # noqa: E501