Initial version
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
# flake8: noqa
|
||||
|
||||
# import apis into api package
|
||||
from elabapi_python.api.api_keys_api import ApiKeysApi
|
||||
from elabapi_python.api.branding_api import BrandingApi
|
||||
from elabapi_python.api.comments_api import CommentsApi
|
||||
from elabapi_python.api.compounds_api import CompoundsApi
|
||||
from elabapi_python.api.config_api import ConfigApi
|
||||
from elabapi_python.api.containers_api import ContainersApi
|
||||
from elabapi_python.api.custom_fields_keys_api import CustomFieldsKeysApi
|
||||
from elabapi_python.api.d_space_api import DSpaceApi
|
||||
from elabapi_python.api.events_api import EventsApi
|
||||
from elabapi_python.api.experiments_api import ExperimentsApi
|
||||
from elabapi_python.api.experiments_categories_api import ExperimentsCategoriesApi
|
||||
from elabapi_python.api.experiments_status_api import ExperimentsStatusApi
|
||||
from elabapi_python.api.experiments_templates_api import ExperimentsTemplatesApi
|
||||
from elabapi_python.api.exports_api import ExportsApi
|
||||
from elabapi_python.api.favorite_tags_api import FavoriteTagsApi
|
||||
from elabapi_python.api.idps_api import IdpsApi
|
||||
from elabapi_python.api.idps_sources_api import IdpsSourcesApi
|
||||
from elabapi_python.api.import_api import ImportApi
|
||||
from elabapi_python.api.info_api import InfoApi
|
||||
from elabapi_python.api.instance_api import InstanceApi
|
||||
from elabapi_python.api.items_api import ItemsApi
|
||||
from elabapi_python.api.items_types__resources_templates_api import ItemsTypesResourcesTemplatesApi
|
||||
from elabapi_python.api.links_to_compounds_api import LinksToCompoundsApi
|
||||
from elabapi_python.api.links_to_experiments_api import LinksToExperimentsApi
|
||||
from elabapi_python.api.links_to_items_api import LinksToItemsApi
|
||||
from elabapi_python.api.notifications_api import NotificationsApi
|
||||
from elabapi_python.api.reports_api import ReportsApi
|
||||
from elabapi_python.api.resources_categories_api import ResourcesCategoriesApi
|
||||
from elabapi_python.api.resources_status_api import ResourcesStatusApi
|
||||
from elabapi_python.api.revisions_api import RevisionsApi
|
||||
from elabapi_python.api.steps_api import StepsApi
|
||||
from elabapi_python.api.storage_units_api import StorageUnitsApi
|
||||
from elabapi_python.api.tags_api import TagsApi
|
||||
from elabapi_python.api.team_tags_api import TeamTagsApi
|
||||
from elabapi_python.api.teamgroups_api import TeamgroupsApi
|
||||
from elabapi_python.api.teams_api import TeamsApi
|
||||
from elabapi_python.api.todolist_api import TodolistApi
|
||||
from elabapi_python.api.unfinished_steps_api import UnfinishedStepsApi
|
||||
from elabapi_python.api.uploads_api import UploadsApi
|
||||
from elabapi_python.api.user_uploads_api import UserUploadsApi
|
||||
from elabapi_python.api.users_api import UsersApi
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,310 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ApiKeysApi(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 delete_apikey(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an API key. # noqa: E501
|
||||
|
||||
Delete an API key # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_apikey(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the API key (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_apikey_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_apikey_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_apikey_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an API key. # noqa: E501
|
||||
|
||||
Delete an API key # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_apikey_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the API key (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_apikey" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_apikey`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/apikeys/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_apikeys(self, **kwargs): # noqa: E501
|
||||
"""Read API keys # noqa: E501
|
||||
|
||||
Get list of API keys for currently logged in user. # 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_apikeys(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Apikey]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_apikeys_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_apikeys_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_apikeys_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read API keys # noqa: E501
|
||||
|
||||
Get list of API keys for currently logged in user. # 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_apikeys_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Apikey]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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_apikeys" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/apikeys', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Apikey]', # 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)
|
||||
|
||||
def post_apikeys(self, **kwargs): # noqa: E501
|
||||
"""Create an API key # noqa: E501
|
||||
|
||||
Create an API key. The cleartext key is sent back in the location header. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_apikeys(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ApikeysBody body:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_apikeys_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_apikeys_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_apikeys_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create an API key # noqa: E501
|
||||
|
||||
Create an API key. The cleartext key is sent back in the location header. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_apikeys_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ApikeysBody body:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_apikeys" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/apikeys', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
@@ -0,0 +1,247 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class BrandingApi(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_instance_branding(self, id, format, **kwargs): # noqa: E501
|
||||
"""Read a branding asset as a binary file. # 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_instance_branding(id, format, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: Branding id. (required)
|
||||
:param str format: Use binary format to retrieve the branding asset. (required)
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_instance_branding_with_http_info(id, format, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_instance_branding_with_http_info(id, format, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_instance_branding_with_http_info(self, id, format, **kwargs): # noqa: E501
|
||||
"""Read a branding asset as a binary file. # 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_instance_branding_with_http_info(id, format, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: Branding id. (required)
|
||||
:param str format: Use binary format to retrieve the branding asset. (required)
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'format'] # 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_instance_branding" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `get_instance_branding`") # noqa: E501
|
||||
# verify the required parameter 'format' is set
|
||||
if ('format' not in params or
|
||||
params['format'] is None):
|
||||
raise ValueError("Missing the required parameter `format` when calling `get_instance_branding`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'format' in params:
|
||||
query_params.append(('format', params['format'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['image/svg+xml', 'image/png', 'image/jpeg', 'image/webp', 'image/x-icon', 'image/vnd.microsoft.icon', 'application/json']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/instance/branding/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='str', # 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)
|
||||
|
||||
def post_instance_branding(self, action, file, id, **kwargs): # noqa: E501
|
||||
"""Update a branding asset. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_instance_branding(action, file, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str action: (required)
|
||||
:param str file: (required)
|
||||
:param int id: Branding id. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_instance_branding_with_http_info(action, file, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_instance_branding_with_http_info(action, file, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_instance_branding_with_http_info(self, action, file, id, **kwargs): # noqa: E501
|
||||
"""Update a branding asset. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_instance_branding_with_http_info(action, file, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str action: (required)
|
||||
:param str file: (required)
|
||||
:param int id: Branding id. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['action', 'file', '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 post_instance_branding" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'action' is set
|
||||
if ('action' not in params or
|
||||
params['action'] is None):
|
||||
raise ValueError("Missing the required parameter `action` when calling `post_instance_branding`") # noqa: E501
|
||||
# verify the required parameter 'file' is set
|
||||
if ('file' not in params or
|
||||
params['file'] is None):
|
||||
raise ValueError("Missing the required parameter `file` when calling `post_instance_branding`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_instance_branding`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
if 'action' in params:
|
||||
form_params.append(('action', params['action'])) # noqa: E501
|
||||
if 'file' in params:
|
||||
local_var_files['file'] = params['file'] # noqa: E501
|
||||
|
||||
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
|
||||
['multipart/form-data']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/instance/branding/{id}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
@@ -0,0 +1,580 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class CommentsApi(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 delete_entity_comment(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an entity comment. # noqa: E501
|
||||
|
||||
The comment gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entity_comment(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the comment (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_entity_comment_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_entity_comment_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_entity_comment_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an entity comment. # noqa: E501
|
||||
|
||||
The comment gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entity_comment_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the comment (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_entity_comment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_entity_comment`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_entity_comment`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_entity_comment`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/comments/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_entity_comment(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify an entity comment. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_entity_comment(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the comment (required)
|
||||
:param Comment body: Parameters for patching an entity comment.
|
||||
:return: Comment
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_entity_comment_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_entity_comment_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_entity_comment_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify an entity comment. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_entity_comment_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the comment (required)
|
||||
:param Comment body: Parameters for patching an entity comment.
|
||||
:return: Comment
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 patch_entity_comment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `patch_entity_comment`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_entity_comment`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_entity_comment`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/comments/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Comment', # 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)
|
||||
|
||||
def post_entity_comments(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create a comment. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_comments(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param IdCommentsBody body: Parameters for creating a comment
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_entity_comments_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_entity_comments_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_entity_comments_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create a comment. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_comments_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param IdCommentsBody body: Parameters for creating a comment
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'body'] # 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 post_entity_comments" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_entity_comments`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_entity_comments`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/comments', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_entity_comment(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a comment of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_comment(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the comment (required)
|
||||
:return: Comment
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_comment_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_comment_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_comment_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a comment of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_comment_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the comment (required)
|
||||
:return: Comment
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 read_entity_comment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_comment`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_comment`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_entity_comment`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/comments/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Comment', # 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)
|
||||
|
||||
def read_entity_comments(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all comments of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_comments(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Comment]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_comments_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_comments_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_comments_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all comments of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_comments_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Comment]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_entity_comments" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_comments`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_comments`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/comments', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Comment]', # 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)
|
||||
@@ -0,0 +1,409 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class CompoundsApi(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 delete_compound(self, id, **kwargs): # noqa: E501
|
||||
"""Soft-delete a compound # noqa: E501
|
||||
|
||||
The compound gets marked as deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_compound(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the compound (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_compound_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_compound_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_compound_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Soft-delete a compound # noqa: E501
|
||||
|
||||
The compound gets marked as deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_compound_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the compound (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_compound" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_compound`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/compounds/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_compound(self, id, **kwargs): # noqa: E501
|
||||
"""Get a single compound # noqa: E501
|
||||
|
||||
Retrieve one compound by its ID # 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_compound(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the compound (required)
|
||||
:return: Compound
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_compound_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_compound_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_compound_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Get a single compound # noqa: E501
|
||||
|
||||
Retrieve one compound by its ID # 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_compound_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the compound (required)
|
||||
:return: Compound
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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_compound" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `get_compound`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/compounds/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Compound', # 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)
|
||||
|
||||
def get_compounds(self, **kwargs): # noqa: E501
|
||||
"""Read compounds # noqa: E501
|
||||
|
||||
Get the list of all compounds # 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_compounds(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Compound]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_compounds_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_compounds_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_compounds_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read compounds # noqa: E501
|
||||
|
||||
Get the list of all compounds # 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_compounds_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Compound]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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_compounds" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/compounds', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Compound]', # 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)
|
||||
|
||||
def post_compounds(self, body, **kwargs): # noqa: E501
|
||||
"""Create or import a compound # noqa: E501
|
||||
|
||||
- If `action=duplicate`, import (or match) a compound from PubChem using `cid` or `cas`. If both parameters are present, only the `cid` is used. - Otherwise, create a compound directly from the provided fields. - If a compound with the same unique identifier already exists (e.g `cas_number`, `pubchem_cid`), the API will return the existing compound instead of creating a new one. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_compounds(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param CompoundsBody body: (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_compounds_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_compounds_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_compounds_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""Create or import a compound # noqa: E501
|
||||
|
||||
- If `action=duplicate`, import (or match) a compound from PubChem using `cid` or `cas`. If both parameters are present, only the `cid` is used. - Otherwise, create a compound directly from the provided fields. - If a compound with the same unique identifier already exists (e.g `cas_number`, `pubchem_cid`), the API will return the existing compound instead of creating a new one. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_compounds_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param CompoundsBody body: (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_compounds" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_compounds`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/compounds', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
@@ -0,0 +1,296 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ConfigApi(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 delete_config(self, **kwargs): # noqa: E501
|
||||
"""Reset the config to default values # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_config(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_config_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_config_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_config_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Reset the config to default values # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_config_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 delete_config" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/config', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_config(self, **kwargs): # noqa: E501
|
||||
"""Read the config # 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_config(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: Config
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_config_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_config_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_config_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read the config # 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_config_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: Config
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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_config" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/config', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Config', # 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)
|
||||
|
||||
def patch_config(self, **kwargs): # noqa: E501
|
||||
"""Modify the config # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_config(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Config body: The config values to change.
|
||||
:return: Config
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_config_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_config_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_config_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Modify the config # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_config_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Config body: The config values to change.
|
||||
:return: Config
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 patch_config" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/config', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Config', # 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)
|
||||
@@ -0,0 +1,596 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ContainersApi(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 delete_container(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a container. # noqa: E501
|
||||
|
||||
Remove an entity from a storage unit. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_container(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_container_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a container. # noqa: E501
|
||||
|
||||
Remove an entity from a storage unit. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_container_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_container" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_container`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_container`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_container`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/containers/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_container(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a container. # noqa: E501
|
||||
|
||||
Update the quantity stored, the unit, or the storage location of a container. Setting `storage_id` moves the container to a different storage unit while preserving its `id` and `created_at`. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_container(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:param ContainersSubidBody1 body: Parameters for modifying a container.
|
||||
:return: Container
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_container_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a container. # noqa: E501
|
||||
|
||||
Update the quantity stored, the unit, or the storage location of a container. Setting `storage_id` moves the container to a different storage unit while preserving its `id` and `created_at`. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_container_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:param ContainersSubidBody1 body: Parameters for modifying a container.
|
||||
:return: Container
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 patch_container" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `patch_container`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_container`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_container`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/containers/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Container', # 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)
|
||||
|
||||
def post_container(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Create a container for this entity. # noqa: E501
|
||||
|
||||
Store this entity in a storage unit with a specified quantity. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_container(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:param ContainersSubidBody body: Parameters for creating a container.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_container_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Create a container for this entity. # noqa: E501
|
||||
|
||||
Store this entity in a storage unit with a specified quantity. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_container_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:param ContainersSubidBody body: Parameters for creating a container.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 post_container" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_container`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_container`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `post_container`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/containers/{subid}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_container(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a container. # noqa: E501
|
||||
|
||||
Get details of a specific container entry. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_container(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:return: Container
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_container_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_container_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a container. # noqa: E501
|
||||
|
||||
Get details of a specific container entry. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_container_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the container (required)
|
||||
:return: Container
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 read_container" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_container`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_container`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_container`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/containers/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Container', # 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)
|
||||
|
||||
def read_containers(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all containers for this entity. # noqa: E501
|
||||
|
||||
Get a list of all storage locations (containers) where this entity is stored. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_containers(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Container]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_containers_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_containers_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_containers_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all containers for this entity. # noqa: E501
|
||||
|
||||
Get a list of all storage locations (containers) where this entity is stored. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_containers_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Container]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_containers" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_containers`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_containers`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/containers', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Container]', # 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)
|
||||
@@ -0,0 +1,126 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class CustomFieldsKeysApi(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 custom_fields_keys(self, **kwargs): # noqa: E501
|
||||
"""Read custom fields keys. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.custom_fields_keys(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in the custom fields keys.
|
||||
:param int limit: Number of custom fields keys that will be returned. Value >= -1; -1: no limit, 0: users default setting from UCP.
|
||||
:return: list[ExtraFieldsKeys]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.custom_fields_keys_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.custom_fields_keys_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def custom_fields_keys_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read custom fields keys. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.custom_fields_keys_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in the custom fields keys.
|
||||
:param int limit: Number of custom fields keys that will be returned. Value >= -1; -1: no limit, 0: users default setting from UCP.
|
||||
:return: list[ExtraFieldsKeys]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['q', 'limit'] # 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 custom_fields_keys" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'q' in params:
|
||||
query_params.append(('q', params['q'])) # noqa: E501
|
||||
if 'limit' in params:
|
||||
query_params.append(('limit', params['limit'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/extra_fields_keys', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[ExtraFieldsKeys]', # 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)
|
||||
@@ -0,0 +1,320 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class DSpaceApi(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 dspace_create(self, body, **kwargs): # noqa: E501
|
||||
"""Create a new DSpace workspace item. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.dspace_create(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DspaceBody body: (required)
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.dspace_create_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.dspace_create_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def dspace_create_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""Create a new DSpace workspace item. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.dspace_create_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DspaceBody body: (required)
|
||||
:return: str
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 dspace_create" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `dspace_create`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# HTTP header `Accept`
|
||||
header_params['Accept'] = self.api_client.select_header_accept(
|
||||
['text/html', '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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/dspace', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='str', # 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)
|
||||
|
||||
def dspace_read(self, action, **kwargs): # noqa: E501
|
||||
"""Read DSpace information. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.dspace_read(action, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str action: Action to perform: - `getcollections`: list available DSpace collections. - `gettypes`: list DSpace item types (submission vocabularies). If omitted or invalid, the endpoint returns an error explaining valid usage. (required)
|
||||
:return: InlineResponse2009
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.dspace_read_with_http_info(action, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.dspace_read_with_http_info(action, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def dspace_read_with_http_info(self, action, **kwargs): # noqa: E501
|
||||
"""Read DSpace information. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.dspace_read_with_http_info(action, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str action: Action to perform: - `getcollections`: list available DSpace collections. - `gettypes`: list DSpace item types (submission vocabularies). If omitted or invalid, the endpoint returns an error explaining valid usage. (required)
|
||||
:return: InlineResponse2009
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['action'] # 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 dspace_read" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'action' is set
|
||||
if ('action' not in params or
|
||||
params['action'] is None):
|
||||
raise ValueError("Missing the required parameter `action` when calling `dspace_read`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'action' in params:
|
||||
query_params.append(('action', params['action'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/dspace', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2009', # 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)
|
||||
|
||||
def dspace_submit(self, body, **kwargs): # noqa: E501
|
||||
"""Submit an eLabFTW entry to DSpace. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.dspace_submit(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DspaceBody1 body: (required)
|
||||
:return: InlineResponse20010
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.dspace_submit_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.dspace_submit_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def dspace_submit_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""Submit an eLabFTW entry to DSpace. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.dspace_submit_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param DspaceBody1 body: (required)
|
||||
:return: InlineResponse20010
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 dspace_submit" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `dspace_submit`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/dspace', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse20010', # 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)
|
||||
@@ -0,0 +1,510 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class EventsApi(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 delete_event(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a booking slot. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_event(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the event to modify. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_event_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_event_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_event_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a booking slot. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_event_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the event to modify. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_event" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_event`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/event/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_event(self, body, id, **kwargs): # noqa: E501
|
||||
"""Modify a booking slot. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_event(body, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EventIdBody body: Parameters for modifying an event. (required)
|
||||
:param int id: ID of the event to modify. (required)
|
||||
:return: Event
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_event_with_http_info(body, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_event_with_http_info(body, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_event_with_http_info(self, body, id, **kwargs): # noqa: E501
|
||||
"""Modify a booking slot. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_event_with_http_info(body, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EventIdBody body: Parameters for modifying an event. (required)
|
||||
:param int id: ID of the event to modify. (required)
|
||||
:return: Event
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body', '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 patch_event" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `patch_event`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_event`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/event/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Event', # 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)
|
||||
|
||||
def post_events(self, id, **kwargs): # noqa: E501
|
||||
"""Create an event for the item specified as id. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_events(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the item to book. (required)
|
||||
:param EventsIdBody body: Parameters for creating an event.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_events_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_events_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_events_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create an event for the item specified as id. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_events_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the item to book. (required)
|
||||
:param EventsIdBody body: Parameters for creating an event.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_events" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_events`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/events/{id}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_event(self, id, **kwargs): # noqa: E501
|
||||
"""Read a booking slot. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_event(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the event to modify. (required)
|
||||
:return: Event
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_event_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_event_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_event_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read a booking slot. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_event_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the event to modify. (required)
|
||||
:return: Event
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_event" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_event`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/event/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Event', # 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)
|
||||
|
||||
def read_events(self, **kwargs): # noqa: E501
|
||||
"""Read all events in the team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_events(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Event]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_events_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_events_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_events_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all events in the team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_events_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Event]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 read_events" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/events', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Event]', # 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)
|
||||
@@ -0,0 +1,686 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ExperimentsApi(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 delete_experiment(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an experiment. # noqa: E501
|
||||
|
||||
The experiment gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_experiment(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_experiment_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_experiment_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_experiment_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an experiment. # noqa: E501
|
||||
|
||||
The experiment gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_experiment_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_experiment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_experiment`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_experiment(self, id, **kwargs): # noqa: E501
|
||||
"""Read an experiment # 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_experiment(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment (required)
|
||||
:param str format: Get the entity in a different format like csv, pdf, eln or zip. \"pdfa\" means archive pdf (PDF/A), same with \"zipa\".
|
||||
:param bool json: Include a full JSON export in the ZIP archive. Only applicable if format is zip(a).
|
||||
:param bool with_title: Include the title in the QR code. Only applicable if format is qrpng.
|
||||
:param int size: Specify the size of the QR code in pixels. Only applicable if format is qrpng.
|
||||
:param bool changelog: Toggles if the changelog should be included in PDF exports (pdf, pdfa, zip, zipa). Changelog is by default included if the export provides PDF/A, otherwise not.
|
||||
:return: Entity
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_experiment_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_experiment_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_experiment_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read an experiment # 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_experiment_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment (required)
|
||||
:param str format: Get the entity in a different format like csv, pdf, eln or zip. \"pdfa\" means archive pdf (PDF/A), same with \"zipa\".
|
||||
:param bool json: Include a full JSON export in the ZIP archive. Only applicable if format is zip(a).
|
||||
:param bool with_title: Include the title in the QR code. Only applicable if format is qrpng.
|
||||
:param int size: Specify the size of the QR code in pixels. Only applicable if format is qrpng.
|
||||
:param bool changelog: Toggles if the changelog should be included in PDF exports (pdf, pdfa, zip, zipa). Changelog is by default included if the export provides PDF/A, otherwise not.
|
||||
:return: Entity
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'format', 'json', 'with_title', 'size', 'changelog'] # 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_experiment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `get_experiment`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'format' in params:
|
||||
query_params.append(('format', params['format'])) # noqa: E501
|
||||
if 'json' in params:
|
||||
query_params.append(('json', params['json'])) # noqa: E501
|
||||
if 'with_title' in params:
|
||||
query_params.append(('withTitle', params['with_title'])) # noqa: E501
|
||||
if 'size' in params:
|
||||
query_params.append(('size', params['size'])) # noqa: E501
|
||||
if 'changelog' in params:
|
||||
query_params.append(('changelog', params['changelog'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Entity', # 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)
|
||||
|
||||
def patch_experiment(self, body, id, **kwargs): # noqa: E501
|
||||
"""Modify an experiment # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_experiment(body, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param object body: Parameters for patching an entity (required)
|
||||
:param int id: ID of the experiment (required)
|
||||
:return: Experiment
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_experiment_with_http_info(body, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_experiment_with_http_info(body, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_experiment_with_http_info(self, body, id, **kwargs): # noqa: E501
|
||||
"""Modify an experiment # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_experiment_with_http_info(body, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param object body: Parameters for patching an entity (required)
|
||||
:param int id: ID of the experiment (required)
|
||||
:return: Experiment
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body', '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 patch_experiment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `patch_experiment`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_experiment`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Experiment', # 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)
|
||||
|
||||
def post_experiment(self, **kwargs): # noqa: E501
|
||||
"""Create an experiment # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityEditable body: Parameters for creating an experiment
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_experiment_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_experiment_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_experiment_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create an experiment # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityEditable body: Parameters for creating an experiment
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_experiment" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_experiment_by_id(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate an experiment with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_by_id(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the experiment to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating an experiment
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_experiment_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_experiment_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_experiment_by_id_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate an experiment with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_by_id_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the experiment to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating an experiment
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_experiment_by_id" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_experiment_by_id`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments/{id}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_experiments(self, **kwargs): # noqa: E501
|
||||
"""Read all experiments that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_experiments(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[Experiment]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_experiments_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_experiments_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_experiments_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all experiments that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_experiments_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[Experiment]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['q', 'extended', 'related', 'related_origin', 'category', 'status', 'tags', 'limit', 'offset', 'owner', 'scope', 'order', 'sort', 'state', 'full'] # 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 read_experiments" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'q' in params:
|
||||
query_params.append(('q', params['q'])) # noqa: E501
|
||||
if 'extended' in params:
|
||||
query_params.append(('extended', params['extended'])) # noqa: E501
|
||||
if 'related' in params:
|
||||
query_params.append(('related', params['related'])) # noqa: E501
|
||||
if 'related_origin' in params:
|
||||
query_params.append(('related_origin', params['related_origin'])) # noqa: E501
|
||||
if 'category' in params:
|
||||
query_params.append(('category', params['category'])) # noqa: E501
|
||||
if 'status' in params:
|
||||
query_params.append(('status', params['status'])) # noqa: E501
|
||||
if 'tags' in params:
|
||||
query_params.append(('tags[]', params['tags'])) # noqa: E501
|
||||
collection_formats['tags[]'] = 'multi' # noqa: E501
|
||||
if 'limit' in params:
|
||||
query_params.append(('limit', params['limit'])) # noqa: E501
|
||||
if 'offset' in params:
|
||||
query_params.append(('offset', params['offset'])) # noqa: E501
|
||||
if 'owner' in params:
|
||||
query_params.append(('owner', params['owner'])) # noqa: E501
|
||||
if 'scope' in params:
|
||||
query_params.append(('scope', params['scope'])) # noqa: E501
|
||||
if 'order' in params:
|
||||
query_params.append(('order', params['order'])) # noqa: E501
|
||||
if 'sort' in params:
|
||||
query_params.append(('sort', params['sort'])) # noqa: E501
|
||||
if 'state' in params:
|
||||
query_params.append(('state', params['state'])) # noqa: E501
|
||||
if 'full' in params:
|
||||
query_params.append(('full', params['full'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Experiment]', # 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)
|
||||
@@ -0,0 +1,538 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ExperimentsCategoriesApi(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 delete_expcat(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a 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.delete_expcat(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_expcat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_expcat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_expcat_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a 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.delete_expcat_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 delete_expcat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_expcat`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_expcat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_categories/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_expcat(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a 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.patch_expcat(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:param Statuslike body: Parameters for modifying a category.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_expcat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_expcat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_expcat_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a 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.patch_expcat_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:param Statuslike body: Parameters for modifying a category.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_expcat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_expcat`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_expcat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_categories/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
|
||||
def post_team_one_expcat(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new category for experiments. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_expcat(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdExperimentsCategoriesBody body: Parameters for creating a category.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_team_one_expcat_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_team_one_expcat_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_team_one_expcat_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new category for experiments. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_expcat_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdExperimentsCategoriesBody body: Parameters for creating a category.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_team_one_expcat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_team_one_expcat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_categories', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team_experiments_categories(self, id, **kwargs): # noqa: E501
|
||||
"""Read experiments categories of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_experiments_categories(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_experiments_categories_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_experiments_categories_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_experiments_categories_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read experiments categories of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_experiments_categories_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team_experiments_categories" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_experiments_categories`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_categories', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Statuslike]', # 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)
|
||||
|
||||
def read_team_one_expcat(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a 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.read_team_one_expcat(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_one_expcat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_one_expcat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_one_expcat_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a 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.read_team_one_expcat_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_team_one_expcat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_one_expcat`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_team_one_expcat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_categories/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
@@ -0,0 +1,538 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ExperimentsStatusApi(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 delete_expstatus(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_expstatus(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_expstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_expstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_expstatus_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_expstatus_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 delete_expstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_expstatus`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_expstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_status/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_expstatus(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_expstatus(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:param Statuslike body: Parameters for modifying a status.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_expstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_expstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_expstatus_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_expstatus_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:param Statuslike body: Parameters for modifying a status.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_expstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_expstatus`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_expstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_status/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
|
||||
def post_team_one_expstatus(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new experiments status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_expstatus(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdExperimentsStatusBody body: Parameters for creating a status.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_team_one_expstatus_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_team_one_expstatus_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_team_one_expstatus_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new experiments status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_expstatus_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdExperimentsStatusBody body: Parameters for creating a status.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_team_one_expstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_team_one_expstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_status', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team_experiments_status(self, id, **kwargs): # noqa: E501
|
||||
"""Read experiments status of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_experiments_status(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_experiments_status_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_experiments_status_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_experiments_status_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read experiments status of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_experiments_status_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team_experiments_status" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_experiments_status`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_status', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Statuslike]', # 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)
|
||||
|
||||
def read_team_one_expstatus(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_one_expstatus(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_one_expstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_one_expstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_one_expstatus_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_one_expstatus_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_team_one_expstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_one_expstatus`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_team_one_expstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/experiments_status/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
@@ -0,0 +1,662 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ExperimentsTemplatesApi(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 delete_experiment_template(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an experiment template. # noqa: E501
|
||||
|
||||
The experiment template gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_experiment_template(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment template (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_experiment_template_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_experiment_template_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_experiment_template_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an experiment template. # noqa: E501
|
||||
|
||||
The experiment template gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_experiment_template_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment template (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_experiment_template" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_experiment_template`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments_templates/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_experiment_template(self, id, **kwargs): # noqa: E501
|
||||
"""Read an experiment template # 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_experiment_template(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment template (required)
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_experiment_template_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_experiment_template_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_experiment_template_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read an experiment template # 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_experiment_template_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment template (required)
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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_experiment_template" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `get_experiment_template`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments_templates/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='EntityTemplate', # 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)
|
||||
|
||||
def patch_experiment_template(self, id, **kwargs): # noqa: E501
|
||||
"""Modify an experiment template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_experiment_template(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment template (required)
|
||||
:param ExperimentsTemplatesIdBody body: Parameters for modifying an experiment template
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_experiment_template_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_experiment_template_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_experiment_template_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Modify an experiment template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_experiment_template_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the experiment template (required)
|
||||
:param ExperimentsTemplatesIdBody body: Parameters for modifying an experiment template
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_experiment_template" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_experiment_template`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments_templates/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='EntityTemplate', # 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)
|
||||
|
||||
def post_experiment_template(self, **kwargs): # noqa: E501
|
||||
"""Create an experiment template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_template(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityTemplateEditable body: Parameters for creating an experiment template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_experiment_template_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_experiment_template_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_experiment_template_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create an experiment template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_template_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityTemplateEditable body: Parameters for creating an experiment template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_experiment_template" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments_templates', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_experiment_template_by_id(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate an experiment template with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_template_by_id(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the experiment template to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating an experiment template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_experiment_template_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_experiment_template_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_experiment_template_by_id_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate an experiment template with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_experiment_template_by_id_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the experiment template to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating an experiment template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_experiment_template_by_id" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_experiment_template_by_id`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments_templates/{id}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_experiments_templates(self, **kwargs): # noqa: E501
|
||||
"""Read all experiments_templates that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_experiments_templates(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[EntityTemplate]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_experiments_templates_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_experiments_templates_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_experiments_templates_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all experiments_templates that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_experiments_templates_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[EntityTemplate]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['q', 'extended', 'related', 'related_origin', 'category', 'status', 'tags', 'limit', 'offset', 'owner', 'scope', 'order', 'sort', 'state', 'full'] # 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 read_experiments_templates" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'q' in params:
|
||||
query_params.append(('q', params['q'])) # noqa: E501
|
||||
if 'extended' in params:
|
||||
query_params.append(('extended', params['extended'])) # noqa: E501
|
||||
if 'related' in params:
|
||||
query_params.append(('related', params['related'])) # noqa: E501
|
||||
if 'related_origin' in params:
|
||||
query_params.append(('related_origin', params['related_origin'])) # noqa: E501
|
||||
if 'category' in params:
|
||||
query_params.append(('category', params['category'])) # noqa: E501
|
||||
if 'status' in params:
|
||||
query_params.append(('status', params['status'])) # noqa: E501
|
||||
if 'tags' in params:
|
||||
query_params.append(('tags[]', params['tags'])) # noqa: E501
|
||||
collection_formats['tags[]'] = 'multi' # noqa: E501
|
||||
if 'limit' in params:
|
||||
query_params.append(('limit', params['limit'])) # noqa: E501
|
||||
if 'offset' in params:
|
||||
query_params.append(('offset', params['offset'])) # noqa: E501
|
||||
if 'owner' in params:
|
||||
query_params.append(('owner', params['owner'])) # noqa: E501
|
||||
if 'scope' in params:
|
||||
query_params.append(('scope', params['scope'])) # noqa: E501
|
||||
if 'order' in params:
|
||||
query_params.append(('order', params['order'])) # noqa: E501
|
||||
if 'sort' in params:
|
||||
query_params.append(('sort', params['sort'])) # noqa: E501
|
||||
if 'state' in params:
|
||||
query_params.append(('state', params['state'])) # noqa: E501
|
||||
if 'full' in params:
|
||||
query_params.append(('full', params['full'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/experiments_templates', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[EntityTemplate]', # 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)
|
||||
@@ -0,0 +1,399 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ExportsApi(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 delete_export(self, id, **kwargs): # noqa: E501
|
||||
"""Remove an export request and its associated file # noqa: E501
|
||||
|
||||
This method will remove the file from the server temporary storage and clear the export request. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_export(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the export request (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_export_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_export_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_export_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Remove an export request and its associated file # noqa: E501
|
||||
|
||||
This method will remove the file from the server temporary storage and clear the export request. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_export_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the export request (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_export" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_export`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/exports/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_export(self, **kwargs): # noqa: E501
|
||||
"""Register an export request # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_export(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ExportsBody body:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_export_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_export_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_export_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Register an export request # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_export_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param ExportsBody body:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_export" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/exports', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_export(self, id, **kwargs): # noqa: E501
|
||||
"""Get export # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_export(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the export request (required)
|
||||
:return: list[Export]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_export_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_export_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_export_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Get export # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_export_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the export request (required)
|
||||
:return: list[Export]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_export" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_export`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/exports/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Export]', # 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)
|
||||
|
||||
def readall_exports(self, **kwargs): # noqa: E501
|
||||
"""List exports # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.readall_exports(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Export]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.readall_exports_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.readall_exports_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def readall_exports_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""List exports # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.readall_exports_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Export]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 readall_exports" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/exports', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Export]', # 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)
|
||||
@@ -0,0 +1,304 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class FavoriteTagsApi(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 delete_favtag(self, id, **kwargs): # noqa: E501
|
||||
"""Unfavorite a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_favtag(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the tag. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_favtag_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_favtag_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_favtag_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Unfavorite a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_favtag_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the tag. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_favtag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_favtag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/favtags/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_favtags(self, **kwargs): # noqa: E501
|
||||
"""Add a tag as favorite. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_favtags(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param FavtagsBody body: Parameters for adding a favorite tag.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_favtags_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_favtags_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_favtags_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Add a tag as favorite. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_favtags_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param FavtagsBody body: Parameters for adding a favorite tag.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_favtags" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/favtags', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_favtags(self, **kwargs): # noqa: E501
|
||||
"""Read all favorite tags for the user. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_favtags(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: InlineResponse2003
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_favtags_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_favtags_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_favtags_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all favorite tags for the user. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_favtags_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: InlineResponse2003
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 read_favtags" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/favtags', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2003', # 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)
|
||||
+1296
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,500 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class IdpsSourcesApi(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 delete_idps_source(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an idp source. # noqa: E501
|
||||
|
||||
The idp source gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_idps_source(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the idps source (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_idps_source_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_idps_source_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_idps_source_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an idp source. # noqa: E501
|
||||
|
||||
The idp source gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_idps_source_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the idps source (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_idps_source" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_idps_source`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/idps_sources/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_idps_source(self, id, **kwargs): # noqa: E501
|
||||
"""Patch an idp source. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_idps_source(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the idps source (required)
|
||||
:param IdpsSourcesIdBody body: Parameters for patching an idp source.
|
||||
:return: IdpSource
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_idps_source_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_idps_source_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_idps_source_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Patch an idp source. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_idps_source_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the idps source (required)
|
||||
:param IdpsSourcesIdBody body: Parameters for patching an idp source.
|
||||
:return: IdpSource
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_idps_source" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_idps_source`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/idps_sources/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='IdpSource', # 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)
|
||||
|
||||
def post_idp_source(self, **kwargs): # noqa: E501
|
||||
"""Create an idp source. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_idp_source(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param IdpsSourcesBody body: Parameters for creating an idp source.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_idp_source_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_idp_source_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_idp_source_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create an idp source. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_idp_source_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param IdpsSourcesBody body: Parameters for creating an idp source.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_idp_source" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/idps_sources', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_idps_source(self, id, **kwargs): # noqa: E501
|
||||
"""Read an IdPs source # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_idps_source(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the idps source (required)
|
||||
:return: IdpSource
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_idps_source_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_idps_source_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_idps_source_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read an IdPs source # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_idps_source_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the idps source (required)
|
||||
:return: IdpSource
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_idps_source" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_idps_source`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/idps_sources/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='IdpSource', # 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)
|
||||
|
||||
def read_idps_sources(self, **kwargs): # noqa: E501
|
||||
"""Read all IDPs sources # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_idps_sources(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[IdpSource]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_idps_sources_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_idps_sources_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_idps_sources_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all IDPs sources # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_idps_sources_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[IdpSource]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 read_idps_sources" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/idps_sources', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[IdpSource]', # 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)
|
||||
@@ -0,0 +1,231 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ImportApi(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 post_import(self, **kwargs): # noqa: E501
|
||||
"""Send a file to import # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_import(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str file:
|
||||
:param str entity_type:
|
||||
:param int category:
|
||||
:param float canread_base:
|
||||
:param float canwrite_base:
|
||||
:param int owner:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_import_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_import_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_import_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Send a file to import # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_import_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str file:
|
||||
:param str entity_type:
|
||||
:param int category:
|
||||
:param float canread_base:
|
||||
:param float canwrite_base:
|
||||
:param int owner:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['file', 'entity_type', 'category', 'canread_base', 'canwrite_base', 'owner'] # 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 post_import" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
if 'file' in params:
|
||||
local_var_files['file'] = params['file'] # noqa: E501
|
||||
if 'entity_type' in params:
|
||||
form_params.append(('entity_type', params['entity_type'])) # noqa: E501
|
||||
if 'category' in params:
|
||||
form_params.append(('category', params['category'])) # noqa: E501
|
||||
if 'canread_base' in params:
|
||||
form_params.append(('canread_base', params['canread_base'])) # noqa: E501
|
||||
if 'canwrite_base' in params:
|
||||
form_params.append(('canwrite_base', params['canwrite_base'])) # noqa: E501
|
||||
if 'owner' in params:
|
||||
form_params.append(('owner', params['owner'])) # noqa: E501
|
||||
|
||||
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
|
||||
['multipart/form-data']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/import', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_import(self, **kwargs): # noqa: E501
|
||||
"""Get information about this endpoint # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_import(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: InlineResponse2002
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_import_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_import_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_import_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Get information about this endpoint # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_import_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: InlineResponse2002
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 read_import" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/import', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2002', # 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)
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class InfoApi(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_info(self, **kwargs): # noqa: E501
|
||||
"""Get information about the instance. # noqa: E501
|
||||
|
||||
Get information about the instance. # 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_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param bool hist: Get usage information about the instance. If `hist` is present, returns cumulative histogram data for experiments, items (resources), and users.
|
||||
:param int columns: Number of columns (buckets) to display in histogram outputs.
|
||||
:return: InlineResponse2001
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_info_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_info_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_info_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Get information about the instance. # noqa: E501
|
||||
|
||||
Get information about the instance. # 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_info_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param bool hist: Get usage information about the instance. If `hist` is present, returns cumulative histogram data for experiments, items (resources), and users.
|
||||
:param int columns: Number of columns (buckets) to display in histogram outputs.
|
||||
:return: InlineResponse2001
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['hist', 'columns'] # 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_info" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'hist' in params:
|
||||
query_params.append(('hist', params['hist'])) # noqa: E501
|
||||
if 'columns' in params:
|
||||
query_params.append(('columns', params['columns'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/info', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2001', # 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)
|
||||
@@ -0,0 +1,130 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class InstanceApi(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 post_instance(self, body, **kwargs): # noqa: E501
|
||||
"""Run an instance level action. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_instance(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param InstanceBody body: Parameters for the instance action. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_instance_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_instance_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_instance_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""Run an instance level action. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_instance_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param InstanceBody body: Parameters for the instance action. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_instance" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_instance`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/instance', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
@@ -0,0 +1,686 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ItemsApi(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 delete_item(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an item. # noqa: E501
|
||||
|
||||
The item gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_item(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the item (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_item_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_item_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_item_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete an item. # noqa: E501
|
||||
|
||||
The item gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_item_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the item (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_item" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_item`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_item(self, id, **kwargs): # noqa: E501
|
||||
"""Read an item # 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_item(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the item (required)
|
||||
:param str format: Get the entity in a different format like csv, pdf, eln or zip. \"pdfa\" means archive pdf (PDF/A), same with \"zipa\".
|
||||
:param bool json: Include a full JSON export in the ZIP archive. Only applicable if format is zip(a).
|
||||
:param bool with_title: Include the title in the QR code. Only applicable if format is qrpng.
|
||||
:param int size: Specify the size of the QR code in pixels. Only applicable if format is qrpng.
|
||||
:param bool changelog: Toggles if the changelog should be included in PDF exports (pdf, pdfa, zip, zipa). Changelog is by default included if the export provides PDF/A, otherwise not.
|
||||
:return: Entity
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_item_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_item_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_item_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read an item # 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_item_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the item (required)
|
||||
:param str format: Get the entity in a different format like csv, pdf, eln or zip. \"pdfa\" means archive pdf (PDF/A), same with \"zipa\".
|
||||
:param bool json: Include a full JSON export in the ZIP archive. Only applicable if format is zip(a).
|
||||
:param bool with_title: Include the title in the QR code. Only applicable if format is qrpng.
|
||||
:param int size: Specify the size of the QR code in pixels. Only applicable if format is qrpng.
|
||||
:param bool changelog: Toggles if the changelog should be included in PDF exports (pdf, pdfa, zip, zipa). Changelog is by default included if the export provides PDF/A, otherwise not.
|
||||
:return: Entity
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'format', 'json', 'with_title', 'size', 'changelog'] # 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_item" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `get_item`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'format' in params:
|
||||
query_params.append(('format', params['format'])) # noqa: E501
|
||||
if 'json' in params:
|
||||
query_params.append(('json', params['json'])) # noqa: E501
|
||||
if 'with_title' in params:
|
||||
query_params.append(('withTitle', params['with_title'])) # noqa: E501
|
||||
if 'size' in params:
|
||||
query_params.append(('size', params['size'])) # noqa: E501
|
||||
if 'changelog' in params:
|
||||
query_params.append(('changelog', params['changelog'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Entity', # 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)
|
||||
|
||||
def patch_item(self, body, id, **kwargs): # noqa: E501
|
||||
"""Modify an item # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_item(body, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param object body: Parameters for patching an item (required)
|
||||
:param int id: ID of the item (required)
|
||||
:return: Item
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_item_with_http_info(body, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_item_with_http_info(body, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_item_with_http_info(self, body, id, **kwargs): # noqa: E501
|
||||
"""Modify an item # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_item_with_http_info(body, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param object body: Parameters for patching an item (required)
|
||||
:param int id: ID of the item (required)
|
||||
:return: Item
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body', '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 patch_item" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `patch_item`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_item`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Item', # 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)
|
||||
|
||||
def post_item(self, **kwargs): # noqa: E501
|
||||
"""Create an item # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_item(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityEditable body: Parameters for creating an item
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_item_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_item_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_item_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create an item # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_item_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityEditable body: Parameters for creating an item
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_item" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_item_by_id(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate an item with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_item_by_id(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the item to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating an item
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_item_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_item_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_item_by_id_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate an item with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_item_by_id_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the item to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating an item
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_item_by_id" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_item_by_id`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items/{id}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_items(self, **kwargs): # noqa: E501
|
||||
"""Read all items that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_items(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[Item]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_items_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_items_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_items_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all items that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_items_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[Item]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['q', 'extended', 'related', 'related_origin', 'category', 'status', 'tags', 'limit', 'offset', 'owner', 'scope', 'order', 'sort', 'state', 'full'] # 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 read_items" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'q' in params:
|
||||
query_params.append(('q', params['q'])) # noqa: E501
|
||||
if 'extended' in params:
|
||||
query_params.append(('extended', params['extended'])) # noqa: E501
|
||||
if 'related' in params:
|
||||
query_params.append(('related', params['related'])) # noqa: E501
|
||||
if 'related_origin' in params:
|
||||
query_params.append(('related_origin', params['related_origin'])) # noqa: E501
|
||||
if 'category' in params:
|
||||
query_params.append(('category', params['category'])) # noqa: E501
|
||||
if 'status' in params:
|
||||
query_params.append(('status', params['status'])) # noqa: E501
|
||||
if 'tags' in params:
|
||||
query_params.append(('tags[]', params['tags'])) # noqa: E501
|
||||
collection_formats['tags[]'] = 'multi' # noqa: E501
|
||||
if 'limit' in params:
|
||||
query_params.append(('limit', params['limit'])) # noqa: E501
|
||||
if 'offset' in params:
|
||||
query_params.append(('offset', params['offset'])) # noqa: E501
|
||||
if 'owner' in params:
|
||||
query_params.append(('owner', params['owner'])) # noqa: E501
|
||||
if 'scope' in params:
|
||||
query_params.append(('scope', params['scope'])) # noqa: E501
|
||||
if 'order' in params:
|
||||
query_params.append(('order', params['order'])) # noqa: E501
|
||||
if 'sort' in params:
|
||||
query_params.append(('sort', params['sort'])) # noqa: E501
|
||||
if 'state' in params:
|
||||
query_params.append(('state', params['state'])) # noqa: E501
|
||||
if 'full' in params:
|
||||
query_params.append(('full', params['full'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Item]', # 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)
|
||||
+662
@@ -0,0 +1,662 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ItemsTypesResourcesTemplatesApi(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 delete_items_type(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a resource template. # noqa: E501
|
||||
|
||||
The resource template gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_items_type(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the resource template (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_items_type_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_items_type_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_items_type_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a resource template. # noqa: E501
|
||||
|
||||
The resource template gets soft-deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_items_type_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the resource template (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_items_type" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_items_type`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items_types/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def get_items_type(self, id, **kwargs): # noqa: E501
|
||||
"""Read a resource template # 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_items_type(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the resource template (required)
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_items_type_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_items_type_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_items_type_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read a resource template # 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_items_type_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the resource template (required)
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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_items_type" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `get_items_type`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items_types/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='EntityTemplate', # 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)
|
||||
|
||||
def patch_items_type(self, id, **kwargs): # noqa: E501
|
||||
"""Modify a resource template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_items_type(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the resource template (required)
|
||||
:param ItemsTypesIdBody body: Parameters for modifying a resource template
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_items_type_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_items_type_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_items_type_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Modify a resource template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_items_type_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the resource template (required)
|
||||
:param ItemsTypesIdBody body: Parameters for modifying a resource template
|
||||
:return: EntityTemplate
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_items_type" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_items_type`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items_types/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='EntityTemplate', # 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)
|
||||
|
||||
def post_items_types(self, **kwargs): # noqa: E501
|
||||
"""Create a resource template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_items_types(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityTemplateEditable body: Parameters for creating a resource template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_items_types_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_items_types_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_items_types_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create a resource template # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_items_types_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param EntityTemplateEditable body: Parameters for creating a resource template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_items_types" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items_types', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_items_types_by_id(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate a resource template with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_items_types_by_id(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the resource template to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating a resource template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_items_types_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_items_types_by_id_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_items_types_by_id_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Duplicate a resource template with its ID # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_items_types_by_id_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: The unique identifier of the resource template to duplicate. (required)
|
||||
:param EntityDuplicate body: Parameters for duplicating a resource template
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_items_types_by_id" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_items_types_by_id`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items_types/{id}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_items_types(self, **kwargs): # noqa: E501
|
||||
"""Read all resources templates that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_items_types(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[EntityTemplate]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_items_types_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_items_types_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_items_types_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all resources templates that are accessible # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_items_types_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str q: Search for a term in title, body or elabid.
|
||||
:param str extended: Extended search (advanced query).
|
||||
:param int related: Look only for entries linked to this entry id.
|
||||
:param str related_origin: When using the \"related\" query parameter, select the type of the related ID (experiments or items)
|
||||
:param str category: Add a filter on the Category. Supports comma separated list of numbers, including \"null\".
|
||||
:param str status: Add a filter on the Status. Supports comma separated list of numbers, including \"null\".
|
||||
:param list[str] tags: An array of tags for filtering results containing all of these tags.
|
||||
:param int limit: Limit the number of results.
|
||||
:param int offset: Skip a number of results. Use with limit to work the pagination.
|
||||
:param str owner: Filter results by author (user id)
|
||||
:param int scope: Set the scope for the results. 1: self, 2: team, 3: everything. It defaults to the user value stored in preferences.
|
||||
:param str order: Change the ordering of the results.
|
||||
:param str sort: Change the sorting of results: ascending or descending.
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:param int full: Return all columns of each entry when set to 1.
|
||||
:return: list[EntityTemplate]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['q', 'extended', 'related', 'related_origin', 'category', 'status', 'tags', 'limit', 'offset', 'owner', 'scope', 'order', 'sort', 'state', 'full'] # 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 read_items_types" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'q' in params:
|
||||
query_params.append(('q', params['q'])) # noqa: E501
|
||||
if 'extended' in params:
|
||||
query_params.append(('extended', params['extended'])) # noqa: E501
|
||||
if 'related' in params:
|
||||
query_params.append(('related', params['related'])) # noqa: E501
|
||||
if 'related_origin' in params:
|
||||
query_params.append(('related_origin', params['related_origin'])) # noqa: E501
|
||||
if 'category' in params:
|
||||
query_params.append(('category', params['category'])) # noqa: E501
|
||||
if 'status' in params:
|
||||
query_params.append(('status', params['status'])) # noqa: E501
|
||||
if 'tags' in params:
|
||||
query_params.append(('tags[]', params['tags'])) # noqa: E501
|
||||
collection_formats['tags[]'] = 'multi' # noqa: E501
|
||||
if 'limit' in params:
|
||||
query_params.append(('limit', params['limit'])) # noqa: E501
|
||||
if 'offset' in params:
|
||||
query_params.append(('offset', params['offset'])) # noqa: E501
|
||||
if 'owner' in params:
|
||||
query_params.append(('owner', params['owner'])) # noqa: E501
|
||||
if 'scope' in params:
|
||||
query_params.append(('scope', params['scope'])) # noqa: E501
|
||||
if 'order' in params:
|
||||
query_params.append(('order', params['order'])) # noqa: E501
|
||||
if 'sort' in params:
|
||||
query_params.append(('sort', params['sort'])) # noqa: E501
|
||||
if 'state' in params:
|
||||
query_params.append(('state', params['state'])) # noqa: E501
|
||||
if 'full' in params:
|
||||
query_params.append(('full', params['full'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/items_types', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[EntityTemplate]', # 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)
|
||||
@@ -0,0 +1,362 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class LinksToCompoundsApi(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 delete_entity_compounds_link(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a compound link. # noqa: E501
|
||||
|
||||
The link gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entity_compounds_link(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the compound linked (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_entity_compounds_link_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_entity_compounds_link_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_entity_compounds_link_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a compound link. # noqa: E501
|
||||
|
||||
The link gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entity_compounds_link_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the compound linked (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_entity_compounds_link" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_entity_compounds_link`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_entity_compounds_link`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_entity_compounds_link`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/compounds_links/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_entity_compounds_links(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Link an entity to a compound. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_compounds_links(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the compound linked (required)
|
||||
:param CompoundsLinksSubidBody body: Parameters for creating a link.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_entity_compounds_links_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_entity_compounds_links_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_entity_compounds_links_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Link an entity to a compound. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_compounds_links_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the compound linked (required)
|
||||
:param CompoundsLinksSubidBody body: Parameters for creating a link.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 post_entity_compounds_links" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_entity_compounds_links`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_entity_compounds_links`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `post_entity_compounds_links`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/compounds_links/{subid}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_entity_compounds_links(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all compounds links of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_compounds_links(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Link]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_compounds_links_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_compounds_links_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_compounds_links_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all compounds links of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_compounds_links_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Link]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_entity_compounds_links" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_compounds_links`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_compounds_links`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/compounds_links', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Link]', # 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)
|
||||
@@ -0,0 +1,362 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class LinksToExperimentsApi(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 delete_entity_experiments_link(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an experiment link. # noqa: E501
|
||||
|
||||
The link gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entity_experiments_link(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the experiment linked (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_entity_experiments_link_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_entity_experiments_link_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_entity_experiments_link_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an experiment link. # noqa: E501
|
||||
|
||||
The link gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entity_experiments_link_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the experiment linked (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_entity_experiments_link" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_entity_experiments_link`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_entity_experiments_link`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_entity_experiments_link`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/experiments_links/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_entity_experiments_links(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Create or import a link. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_experiments_links(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the experiment linked (required)
|
||||
:param ExperimentsLinksSubidBody body: Parameters for creating or importing a link.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_entity_experiments_links_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_entity_experiments_links_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_entity_experiments_links_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Create or import a link. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_experiments_links_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the experiment linked (required)
|
||||
:param ExperimentsLinksSubidBody body: Parameters for creating or importing a link.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 post_entity_experiments_links" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_entity_experiments_links`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_entity_experiments_links`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `post_entity_experiments_links`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/experiments_links/{subid}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_entity_experiments_links(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all experiments links of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_experiments_links(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Link]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_experiments_links_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_experiments_links_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_experiments_links_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all experiments links of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_experiments_links_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Link]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_entity_experiments_links" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_experiments_links`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_experiments_links`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/experiments_links', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Link]', # 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)
|
||||
@@ -0,0 +1,362 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class LinksToItemsApi(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 delete_entitiy_items_link(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an item link. # noqa: E501
|
||||
|
||||
The link gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entitiy_items_link(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the item (link) (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_entitiy_items_link_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_entitiy_items_link_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_entitiy_items_link_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an item link. # noqa: E501
|
||||
|
||||
The link gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_entitiy_items_link_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the item (link) (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_entitiy_items_link" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_entitiy_items_link`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_entitiy_items_link`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_entitiy_items_link`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/items_links/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_entity_items_links(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Create or import a link. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_items_links(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the item (link) (required)
|
||||
:param ItemsLinksSubidBody body: Parameters for creating or importing a link.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_entity_items_links_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_entity_items_links_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_entity_items_links_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Create or import a link. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_entity_items_links_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the item (link) (required)
|
||||
:param ItemsLinksSubidBody body: Parameters for creating or importing a link.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 post_entity_items_links" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_entity_items_links`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_entity_items_links`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `post_entity_items_links`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/items_links/{subid}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_entity_items_links(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all items links of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_items_links(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Link]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_items_links_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_items_links_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_items_links_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all items links of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_items_links_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Link]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_entity_items_links" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_items_links`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_items_links`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/items_links', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Link]', # 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)
|
||||
@@ -0,0 +1,431 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class NotificationsApi(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 delete_notifications(self, id, **kwargs): # noqa: E501
|
||||
"""Delete all notifications of the user. # noqa: E501
|
||||
|
||||
All notifications for the user are deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_notifications(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id3 id: ID of the user or `me`. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_notifications_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_notifications_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_notifications_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete all notifications of the user. # noqa: E501
|
||||
|
||||
All notifications for the user are deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_notifications_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id3 id: ID of the user or `me`. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_notifications" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_notifications`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}/notifications', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_notification(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Update the acknowledgment status of a notification. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_notification(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id4 id: ID of the user or `me`. (required)
|
||||
:param int subid: ID of the notification. (required)
|
||||
:param NotificationsSubidBody body: Defines whether the notification is acknowledged.
|
||||
:return: Notification
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_notification_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_notification_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_notification_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Update the acknowledgment status of a notification. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_notification_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id4 id: ID of the user or `me`. (required)
|
||||
:param int subid: ID of the notification. (required)
|
||||
:param NotificationsSubidBody body: Defines whether the notification is acknowledged.
|
||||
:return: Notification
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_notification" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_notification`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_notification`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}/notifications/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Notification', # 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)
|
||||
|
||||
def read_notification(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a notification. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_notification(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id4 id: ID of the user or `me`. (required)
|
||||
:param int subid: ID of the notification. (required)
|
||||
:return: Notification
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_notification_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_notification_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_notification_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a notification. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_notification_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id4 id: ID of the user or `me`. (required)
|
||||
:param int subid: ID of the notification. (required)
|
||||
:return: Notification
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_notification" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_notification`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_notification`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}/notifications/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Notification', # 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)
|
||||
|
||||
def read_notifications(self, id, **kwargs): # noqa: E501
|
||||
"""Read notifications of a user. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_notifications(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id3 id: ID of the user or `me`. (required)
|
||||
:return: InlineResponse2007
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_notifications_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_notifications_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_notifications_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read notifications of a user. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_notifications_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id3 id: ID of the user or `me`. (required)
|
||||
:return: InlineResponse2007
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_notifications" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_notifications`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}/notifications', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2007', # 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)
|
||||
@@ -0,0 +1,136 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ReportsApi(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_reports(self, **kwargs): # noqa: E501
|
||||
"""Get usage reports # noqa: E501
|
||||
|
||||
Get usage reports at the instance or team level. # 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_reports(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str format: Select the output format
|
||||
:param str scope: Select the scope. Instance is for sysadmins only. Team will generate report for the current team. If scope is `compounds_history`, you can also provide `start` and `end` (format `YYYY-MM-DD`).
|
||||
:param date start: Start date (YYYY-MM-DD). Only used when scope is `compounds_history`.
|
||||
:param date end: End date (YYYY-MM-DD). Only used when scope is `compounds_history`.
|
||||
:return: InlineResponse2004
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.get_reports_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.get_reports_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def get_reports_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Get usage reports # noqa: E501
|
||||
|
||||
Get usage reports at the instance or team level. # 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_reports_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str format: Select the output format
|
||||
:param str scope: Select the scope. Instance is for sysadmins only. Team will generate report for the current team. If scope is `compounds_history`, you can also provide `start` and `end` (format `YYYY-MM-DD`).
|
||||
:param date start: Start date (YYYY-MM-DD). Only used when scope is `compounds_history`.
|
||||
:param date end: End date (YYYY-MM-DD). Only used when scope is `compounds_history`.
|
||||
:return: InlineResponse2004
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['format', 'scope', 'start', 'end'] # 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_reports" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'format' in params:
|
||||
query_params.append(('format', params['format'])) # noqa: E501
|
||||
if 'scope' in params:
|
||||
query_params.append(('scope', params['scope'])) # noqa: E501
|
||||
if 'start' in params:
|
||||
query_params.append(('start', params['start'])) # noqa: E501
|
||||
if 'end' in params:
|
||||
query_params.append(('end', params['end'])) # 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', 'text/csv']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/reports', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2004', # 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)
|
||||
@@ -0,0 +1,538 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ResourcesCategoriesApi(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 delete_rescat(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a 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.delete_rescat(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_rescat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_rescat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_rescat_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a 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.delete_rescat_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 delete_rescat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_rescat`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_rescat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/resources_categories/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_rescat(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a 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.patch_rescat(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:param Statuslike body: Parameters for modifying a resource category.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_rescat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_rescat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_rescat_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a 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.patch_rescat_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:param Statuslike body: Parameters for modifying a resource category.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_rescat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_rescat`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_rescat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/resources_categories/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
|
||||
def post_team_one_rescat(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new category for resources. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_rescat(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdResourcesCategoriesBody body: Parameters for creating a resource category.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_team_one_rescat_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_team_one_rescat_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_team_one_rescat_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new category for resources. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_rescat_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdResourcesCategoriesBody body: Parameters for creating a resource category.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_team_one_rescat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_team_one_rescat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/resources_categories', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team_one_rescat(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a 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.read_team_one_rescat(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_one_rescat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_one_rescat_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_one_rescat_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a 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.read_team_one_rescat_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the category. (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_team_one_rescat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_one_rescat`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_team_one_rescat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/resources_categories/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
|
||||
def read_team_resources_categories(self, id, **kwargs): # noqa: E501
|
||||
"""Read resources categories of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_resources_categories(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_resources_categories_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_resources_categories_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_resources_categories_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read resources categories of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_resources_categories_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team_resources_categories" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_resources_categories`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/resources_categories', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Statuslike]', # 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)
|
||||
@@ -0,0 +1,538 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class ResourcesStatusApi(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 delete_resstatus(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_resstatus(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_resstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_resstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_resstatus_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_resstatus_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 delete_resstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_resstatus`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_resstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/items_status/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_resstatus(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_resstatus(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:param Statuslike body: Parameters for modifying a status.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_resstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_resstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_resstatus_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_resstatus_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:param Statuslike body: Parameters for modifying a status.
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_resstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_resstatus`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_resstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/items_status/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
|
||||
def post_team_one_resstat(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new status for resources. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_resstat(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdItemsStatusBody body: Parameters for creating a resources status.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_team_one_resstat_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_team_one_resstat_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_team_one_resstat_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new status for resources. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_one_resstat_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdItemsStatusBody body: Parameters for creating a resources status.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_team_one_resstat" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_team_one_resstat`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/items_status', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team_items_status(self, id, **kwargs): # noqa: E501
|
||||
"""Read resources status of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_items_status(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_items_status_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_items_status_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_items_status_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read resources status of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_items_status_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Statuslike]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team_items_status" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_items_status`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/items_status', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Statuslike]', # 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)
|
||||
|
||||
def read_team_one_resstatus(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_one_resstatus(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_one_resstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_one_resstatus_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_one_resstatus_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a status. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_one_resstatus_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the status (required)
|
||||
:return: Statuslike
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_team_one_resstatus" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_one_resstatus`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_team_one_resstatus`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/items_status/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Statuslike', # 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)
|
||||
@@ -0,0 +1,360 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class RevisionsApi(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 patch_entity_revision(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Restore a revision. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_entity_revision(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the revision (required)
|
||||
:param RevisionsSubidBody body: Parameters for restoring an entity revision.
|
||||
:return: Revision
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_entity_revision_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_entity_revision_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_entity_revision_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Restore a revision. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_entity_revision_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the revision (required)
|
||||
:param RevisionsSubidBody body: Parameters for restoring an entity revision.
|
||||
:return: Revision
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 patch_entity_revision" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `patch_entity_revision`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_entity_revision`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_entity_revision`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/revisions/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Revision', # 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)
|
||||
|
||||
def read_entity_revision(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a revision of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_revision(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the revision (required)
|
||||
:return: Revision
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_revision_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_revision_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_revision_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a revision of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_revision_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the revision (required)
|
||||
:return: Revision
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 read_entity_revision" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_revision`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_revision`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_entity_revision`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/revisions/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Revision', # 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)
|
||||
|
||||
def read_entity_revisions(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all revisions of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_revisions(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[InlineResponse2008]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_entity_revisions_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_entity_revisions_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_entity_revisions_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all revisions of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_entity_revisions_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[InlineResponse2008]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_entity_revisions" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_entity_revisions`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_entity_revisions`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/revisions', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[InlineResponse2008]', # 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)
|
||||
@@ -0,0 +1,471 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class StepsApi(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 delete_step(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a step. # noqa: E501
|
||||
|
||||
The step gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_step(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the step (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_step_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_step_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_step_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a step. # noqa: E501
|
||||
|
||||
The step gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_step_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the step (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_step" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_step`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_step`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_step`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/steps/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_step(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Actions on a step. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_step(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the step (required)
|
||||
:param StepsSubidBody body: Parameters for modifying a step
|
||||
:return: Step
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_step_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_step_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_step_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Actions on a step. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_step_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the step (required)
|
||||
:param StepsSubidBody body: Parameters for modifying a step
|
||||
:return: Step
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 patch_step" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `patch_step`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_step`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_step`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/steps/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Step', # 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)
|
||||
|
||||
def post_step(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create a step. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_step(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param IdStepsBody body: Parameters for creating a step.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_step_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_step_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_step_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create a step. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_step_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param IdStepsBody body: Parameters for creating a step.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'body'] # 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 post_step" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_step`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_step`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/steps', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_steps(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all steps of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_steps(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Step]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_steps_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_steps_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_steps_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all steps of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_steps_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Step]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_steps" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_steps`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_steps`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/steps', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Step]', # 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)
|
||||
@@ -0,0 +1,516 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class StorageUnitsApi(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 delete_storage_unit(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a storage unit. # noqa: E501
|
||||
|
||||
Delete a storage unit. Requires permission to manage inventory locations. Cannot delete a storage unit that has children or containers. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_storage_unit(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the storage unit. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_storage_unit_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_storage_unit_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_storage_unit_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a storage unit. # noqa: E501
|
||||
|
||||
Delete a storage unit. Requires permission to manage inventory locations. Cannot delete a storage unit that has children or containers. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_storage_unit_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the storage unit. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_storage_unit" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_storage_unit`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/storage_units/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_storage_unit(self, id, **kwargs): # noqa: E501
|
||||
"""Modify a storage unit. # noqa: E501
|
||||
|
||||
Update the name and/or the parent of a storage unit. Setting `parent_id` reparents the unit (and everything under it) in place. Pass `parent_id: null` to move the unit to the root. Requires permission to manage inventory locations. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_storage_unit(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the storage unit. (required)
|
||||
:param StorageUnitsIdBody body: Parameters for modifying a storage unit.
|
||||
:return: StorageUnit
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_storage_unit_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_storage_unit_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_storage_unit_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Modify a storage unit. # noqa: E501
|
||||
|
||||
Update the name and/or the parent of a storage unit. Setting `parent_id` reparents the unit (and everything under it) in place. Pass `parent_id: null` to move the unit to the root. Requires permission to manage inventory locations. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_storage_unit_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the storage unit. (required)
|
||||
:param StorageUnitsIdBody body: Parameters for modifying a storage unit.
|
||||
:return: StorageUnit
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_storage_unit" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_storage_unit`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/storage_units/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='StorageUnit', # 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)
|
||||
|
||||
def post_storage_unit(self, body, **kwargs): # noqa: E501
|
||||
"""Create a new storage unit. # noqa: E501
|
||||
|
||||
Create a new storage unit. Requires permission to manage inventory locations. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_storage_unit(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param StorageUnitsBody body: Parameters for creating a storage unit. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_storage_unit_with_http_info(body, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_storage_unit_with_http_info(body, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_storage_unit_with_http_info(self, body, **kwargs): # noqa: E501
|
||||
"""Create a new storage unit. # noqa: E501
|
||||
|
||||
Create a new storage unit. Requires permission to manage inventory locations. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_storage_unit_with_http_info(body, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param StorageUnitsBody body: Parameters for creating a storage unit. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_storage_unit" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'body' is set
|
||||
if ('body' not in params or
|
||||
params['body'] is None):
|
||||
raise ValueError("Missing the required parameter `body` when calling `post_storage_unit`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/storage_units', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_storage_unit(self, id, **kwargs): # noqa: E501
|
||||
"""Read a storage unit. # noqa: E501
|
||||
|
||||
Get details of a specific storage unit including its full hierarchical path. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_storage_unit(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the storage unit. (required)
|
||||
:return: StorageUnit
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_storage_unit_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_storage_unit_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_storage_unit_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read a storage unit. # noqa: E501
|
||||
|
||||
Get details of a specific storage unit including its full hierarchical path. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_storage_unit_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the storage unit. (required)
|
||||
:return: StorageUnit
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_storage_unit" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_storage_unit`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/storage_units/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='StorageUnit', # 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)
|
||||
|
||||
def read_storage_units(self, **kwargs): # noqa: E501
|
||||
"""Read all containers, or the storage unit hierarchy when `?hierarchy=true`. # noqa: E501
|
||||
|
||||
Without parameters, returns the full list of containers (assignments of experiments or resources to storage locations) that you have access to. With `?hierarchy=true`, returns a flat list of all storage units (freezers, boxes, positions, etc.) with their hierarchy metadata (`id`, `name`, `parent_id`, `full_path`, `level_depth`, `children_count`). This allows clients to discover, traverse, or display the storage unit tree. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_storage_units(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param bool hierarchy: When true, returns a flat list of all storage units in the hierarchy (id, name, parent_id, full_path, level_depth, children_count) instead of the default container assignment list.
|
||||
:return: InlineResponse200
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_storage_units_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_storage_units_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_storage_units_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all containers, or the storage unit hierarchy when `?hierarchy=true`. # noqa: E501
|
||||
|
||||
Without parameters, returns the full list of containers (assignments of experiments or resources to storage locations) that you have access to. With `?hierarchy=true`, returns a flat list of all storage units (freezers, boxes, positions, etc.) with their hierarchy metadata (`id`, `name`, `parent_id`, `full_path`, `level_depth`, `children_count`). This allows clients to discover, traverse, or display the storage unit tree. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_storage_units_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param bool hierarchy: When true, returns a flat list of all storage units in the hierarchy (id, name, parent_id, full_path, level_depth, children_count) instead of the default container assignment list.
|
||||
:return: InlineResponse200
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['hierarchy'] # 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 read_storage_units" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'hierarchy' in params:
|
||||
query_params.append(('hierarchy', params['hierarchy'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/storage_units', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse200', # 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)
|
||||
@@ -0,0 +1,572 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class TagsApi(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 delete_tag(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Delete all tags. # noqa: E501
|
||||
|
||||
All the tags from that entity get removed. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_tag(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_tag_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_tag_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_tag_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Delete all tags. # noqa: E501
|
||||
|
||||
All the tags from that entity get removed. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_tag_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 delete_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_tag`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/tags', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_tag(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Actions on a tag (like removing it from the entity). # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_tag(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the tag (required)
|
||||
:param TagsSubidBody1 body: Parameters for modifying a tag
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_tag_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_tag_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_tag_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Actions on a tag (like removing it from the entity). # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_tag_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the tag (required)
|
||||
:param TagsSubidBody1 body: Parameters for modifying a tag
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 patch_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `patch_tag`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_tag`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/tags/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Tag', # 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)
|
||||
|
||||
def post_tag(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_tag(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param IdTagsBody1 body: Parameters for creating a tag.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_tag_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_tag_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_tag_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_tag_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param IdTagsBody1 body: Parameters for creating a tag.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'body'] # 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 post_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_tag`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/tags', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_tag(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_tag(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the tag (required)
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_tag_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_tag_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_tag_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_tag_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the tag (required)
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 read_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_tag`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_tag`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/tags/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Tag', # 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)
|
||||
|
||||
def read_tags(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all tags of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_tags(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Tag]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_tags_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_tags_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_tags_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read all tags of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_tags_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:return: list[Tag]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', '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 read_tags" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_tags`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_tags`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/tags', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Tag]', # 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)
|
||||
@@ -0,0 +1,538 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class TeamTagsApi(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 delete_team_tag(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_team_tag(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the tag. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_team_tag_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_team_tag_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_team_tag_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_team_tag_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the tag. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 delete_team_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_team_tag`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_team_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/tags/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_team_tag(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Actions on a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_team_tag(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the tag. (required)
|
||||
:param TagsSubidBody body: Parameters for modifying a tag.
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_team_tag_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_team_tag_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_team_tag_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Actions on a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_team_tag_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the tag. (required)
|
||||
:param TagsSubidBody body: Parameters for modifying a tag.
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_team_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_team_tag`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_team_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/tags/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Tag', # 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)
|
||||
|
||||
def post_team_tag(self, id, **kwargs): # noqa: E501
|
||||
"""Create a tag in the team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_tag(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdTagsBody body: Parameters for adding a tag in the team.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_team_tag_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_team_tag_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_team_tag_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create a tag in the team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_team_tag_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdTagsBody body: Parameters for adding a tag in the team.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_team_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_team_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/tags', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team_tag(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_tag(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the tag. (required)
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_tag_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_tag_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_tag_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a tag. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_tag_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the tag. (required)
|
||||
:return: Tag
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_team_tag" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_tag`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_team_tag`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/tags/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Tag', # 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)
|
||||
|
||||
def read_team_tags(self, id, **kwargs): # noqa: E501
|
||||
"""Read all tags for the team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_tags(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Tag]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_tags_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_tags_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_tags_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read all tags for the team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_tags_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: list[Tag]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team_tags" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_tags`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/tags', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Tag]', # 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)
|
||||
@@ -0,0 +1,538 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class TeamgroupsApi(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 delete_teamgroup(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_teamgroup(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the teamgroup. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_teamgroup_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_teamgroup_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_teamgroup_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete a teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_teamgroup_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the teamgroup. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 delete_teamgroup" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_teamgroup`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_teamgroup`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/teamgroups/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_teamgroup(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_teamgroup(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the teamgroup. (required)
|
||||
:param TeamgroupsSubidBody body: Parameters for modifying a teamgroup.
|
||||
:return: Teamgroup
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_teamgroup_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_teamgroup_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_teamgroup_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify a teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_teamgroup_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the teamgroup. (required)
|
||||
:param TeamgroupsSubidBody body: Parameters for modifying a teamgroup.
|
||||
:return: Teamgroup
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid', 'body'] # 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 patch_teamgroup" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_teamgroup`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_teamgroup`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/teamgroups/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Teamgroup', # 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)
|
||||
|
||||
def post_teamgroups(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_teamgroups(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdTeamgroupsBody body: Parameters for creating a teamgroup.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_teamgroups_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_teamgroups_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_teamgroups_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Create a new teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_teamgroups_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param IdTeamgroupsBody body: Parameters for creating a teamgroup.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 post_teamgroups" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_teamgroups`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/teamgroups', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team_teamgroups(self, id, **kwargs): # noqa: E501
|
||||
"""Read teamgroups of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_teamgroups(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: dict(str, Teamgroup)
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_teamgroups_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_teamgroups_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_teamgroups_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read teamgroups of a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_teamgroups_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:return: dict(str, Teamgroup)
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team_teamgroups" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team_teamgroups`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/teamgroups', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='dict(str, Teamgroup)', # 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)
|
||||
|
||||
def read_teamgroup(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_teamgroup(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the teamgroup. (required)
|
||||
:return: InlineResponse2005
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_teamgroup_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_teamgroup_with_http_info(id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_teamgroup_with_http_info(self, id, subid, **kwargs): # noqa: E501
|
||||
"""Read a teamgroup. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_teamgroup_with_http_info(id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the team. (required)
|
||||
:param int subid: ID of the teamgroup. (required)
|
||||
:return: InlineResponse2005
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'subid'] # 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 read_teamgroup" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_teamgroup`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_teamgroup`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}/teamgroups/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='InlineResponse2005', # 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)
|
||||
@@ -0,0 +1,405 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class TeamsApi(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 patch_team(self, id, **kwargs): # noqa: E501
|
||||
"""Actions on a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_team(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id id: ID of the team or `current`. (required)
|
||||
:param TeamsIdBody body: Parameters for modifying a team.
|
||||
:return: Team
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_team_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_team_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_team_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Actions on a team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_team_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id id: ID of the team or `current`. (required)
|
||||
:param TeamsIdBody body: Parameters for modifying a team.
|
||||
:return: Team
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_team" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_team`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Team', # 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)
|
||||
|
||||
def post_teams(self, **kwargs): # noqa: E501
|
||||
"""Create a new team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_teams(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TeamsBody body: Parameters for creating a new team.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_teams_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_teams_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_teams_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create a new team. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_teams_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TeamsBody body: Parameters for creating a new team.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_teams" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_team(self, id, **kwargs): # noqa: E501
|
||||
"""Read a team. Requires Admin permissions. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id id: ID of the team or `current`. (required)
|
||||
:return: Team
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_team_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_team_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_team_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read a team. Requires Admin permissions. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_team_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id id: ID of the team or `current`. (required)
|
||||
:return: Team
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_team" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_team`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Team', # 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)
|
||||
|
||||
def read_teams(self, **kwargs): # noqa: E501
|
||||
"""Read all teams. Requires Sysadmin permissions. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_teams(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Team]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_teams_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_teams_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_teams_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all teams. Requires Sysadmin permissions. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_teams_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Team]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 read_teams" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/teams', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Team]', # 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)
|
||||
@@ -0,0 +1,498 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class TodolistApi(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 delete_todoitem(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a todoitem. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_todoitem(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the todoitem. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_todoitem_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_todoitem_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_todoitem_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Delete a todoitem. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_todoitem_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the todoitem. (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 delete_todoitem" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_todoitem`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/todolist/{id}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_todoitem(self, id, **kwargs): # noqa: E501
|
||||
"""Actions on a todoitem. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_todoitem(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the todoitem. (required)
|
||||
:param TodolistIdBody body: Parameters for modifying a todoitem.
|
||||
:return: Todoitem
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_todoitem_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_todoitem_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_todoitem_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Actions on a todoitem. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_todoitem_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the todoitem. (required)
|
||||
:param TodolistIdBody body: Parameters for modifying a todoitem.
|
||||
:return: Todoitem
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_todoitem" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_todoitem`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/todolist/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Todoitem', # 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)
|
||||
|
||||
def post_todolist(self, **kwargs): # noqa: E501
|
||||
"""Create a todo item # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_todolist(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TodolistBody body: Parameters for creating a todoitem.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_todolist_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_todolist_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_todolist_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create a todo item # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_todolist_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param TodolistBody body: Parameters for creating a todoitem.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_todolist" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/todolist', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_todoitem(self, id, **kwargs): # noqa: E501
|
||||
"""Read a todo entry. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_todoitem(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the todoitem. (required)
|
||||
:return: Todoitem
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_todoitem_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_todoitem_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_todoitem_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read a todo entry. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_todoitem_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int id: ID of the todoitem. (required)
|
||||
:return: Todoitem
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_todoitem" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_todoitem`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/todolist/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Todoitem', # 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)
|
||||
|
||||
def read_todolist(self, **kwargs): # noqa: E501
|
||||
"""Read all todoitems. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_todolist(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Todoitem]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_todolist_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_todolist_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_todolist_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all todoitems. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_todolist_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:return: list[Todoitem]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
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')
|
||||
|
||||
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 read_todolist" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/todolist', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Todoitem]', # 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)
|
||||
@@ -0,0 +1,122 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class UnfinishedStepsApi(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 read_unfinished_steps(self, **kwargs): # noqa: E501
|
||||
"""Read all unfinished steps. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_unfinished_steps(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str scope: Set to \"team\" to extend the list to other members.
|
||||
:return: list[UnfinishedSteps]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_unfinished_steps_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_unfinished_steps_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_unfinished_steps_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read all unfinished steps. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_unfinished_steps_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str scope: Set to \"team\" to extend the list to other members.
|
||||
:return: list[UnfinishedSteps]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['scope'] # 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 read_unfinished_steps" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'scope' in params:
|
||||
query_params.append(('scope', params['scope'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/unfinished_steps', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[UnfinishedSteps]', # 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)
|
||||
@@ -0,0 +1,717 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class UploadsApi(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 delete_upload(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an upload. # noqa: E501
|
||||
|
||||
The upload gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_upload(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.delete_upload_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.delete_upload_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def delete_upload_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Delete an upload. # noqa: E501
|
||||
|
||||
The upload gets deleted. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.delete_upload_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid'] # 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 delete_upload" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `delete_upload`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `delete_upload`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `delete_upload`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/uploads/{subid}', 'DELETE',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def patch_upload(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify attributes such as \"real_name\", \"comment\" or \"state\" of an upload. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_upload(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:param UploadsSubidBody1 body: Parameters for modifying an upload attributes.
|
||||
:return: Upload
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_upload_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_upload_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_upload_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Modify attributes such as \"real_name\", \"comment\" or \"state\" of an upload. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_upload_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:param UploadsSubidBody1 body: Parameters for modifying an upload attributes.
|
||||
:return: Upload
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'body'] # 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 patch_upload" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `patch_upload`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_upload`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `patch_upload`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/uploads/{subid}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Upload', # 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)
|
||||
|
||||
def post_upload(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create an upload. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_upload(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param str file:
|
||||
:param str comment:
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_upload_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_upload_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_upload_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Create an upload. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_upload_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param str file:
|
||||
:param str comment:
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'file', 'comment', 'state'] # 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 post_upload" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_upload`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_upload`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'state' in params:
|
||||
query_params.append(('state', params['state'])) # noqa: E501
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
if 'file' in params:
|
||||
local_var_files['file'] = params['file'] # noqa: E501
|
||||
if 'comment' in params:
|
||||
form_params.append(('comment', params['comment'])) # noqa: E501
|
||||
|
||||
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
|
||||
['multipart/form-data']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/uploads', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def post_upload_replace(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Replace an existing uploaded file. The existing file will be archived and the new one will be added. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_upload_replace(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:param str file:
|
||||
:param str comment:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_upload_replace_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_upload_replace_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_upload_replace_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Replace an existing uploaded file. The existing file will be archived and the new one will be added. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_upload_replace_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:param str file:
|
||||
:param str comment:
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'file', 'comment'] # 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 post_upload_replace" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `post_upload_replace`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `post_upload_replace`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `post_upload_replace`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
if 'file' in params:
|
||||
local_var_files['file'] = params['file'] # noqa: E501
|
||||
if 'comment' in params:
|
||||
form_params.append(('comment', params['comment'])) # noqa: E501
|
||||
|
||||
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
|
||||
['multipart/form-data']) # noqa: E501
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/uploads/{subid}', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_upload(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read an upload. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_upload(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:param str format: To download the file itself, use `binary` format parameter. In python library, when downloading a file content, make sure to add ` _preload_content=False` into the call to `read_upload()`.
|
||||
:return: Upload
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_upload_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_upload_with_http_info(entity_type, id, subid, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_upload_with_http_info(self, entity_type, id, subid, **kwargs): # noqa: E501
|
||||
"""Read an upload. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_upload_with_http_info(entity_type, id, subid, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param int subid: ID of the upload (required)
|
||||
:param str format: To download the file itself, use `binary` format parameter. In python library, when downloading a file content, make sure to add ` _preload_content=False` into the call to `read_upload()`.
|
||||
:return: Upload
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'subid', 'format'] # 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 read_upload" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_upload`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_upload`") # noqa: E501
|
||||
# verify the required parameter 'subid' is set
|
||||
if ('subid' not in params or
|
||||
params['subid'] is None):
|
||||
raise ValueError("Missing the required parameter `subid` when calling `read_upload`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
if 'subid' in params:
|
||||
path_params['subid'] = params['subid'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'format' in params:
|
||||
query_params.append(('format', params['format'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/uploads/{subid}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Upload', # 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)
|
||||
|
||||
def read_uploads(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read attached files of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_uploads(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:return: list[Upload]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_uploads_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_uploads_with_http_info(entity_type, id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_uploads_with_http_info(self, entity_type, id, **kwargs): # noqa: E501
|
||||
"""Read attached files of that entity. # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_uploads_with_http_info(entity_type, id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param str entity_type: Entity type (required)
|
||||
:param int id: ID of the entity (required)
|
||||
:param str state: Filter results based on their state: 1 (Normal), 2 (Archived), 3 (Deleted). Supports comma separated values.
|
||||
:return: list[Upload]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['entity_type', 'id', 'state'] # 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 read_uploads" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'entity_type' is set
|
||||
if ('entity_type' not in params or
|
||||
params['entity_type'] is None):
|
||||
raise ValueError("Missing the required parameter `entity_type` when calling `read_uploads`") # noqa: E501
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_uploads`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'entity_type' in params:
|
||||
path_params['entity_type'] = params['entity_type'] # noqa: E501
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
if 'state' in params:
|
||||
query_params.append(('state', params['state'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/{entity_type}/{id}/uploads', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[Upload]', # 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)
|
||||
@@ -0,0 +1,126 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class UserUploadsApi(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 read_user_uploads(self, id, **kwargs): # noqa: E501
|
||||
"""Read attached files from a user # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_user_uploads(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id2 id: ID of the user or `me`. (required)
|
||||
:return: list[InlineResponse2006]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_user_uploads_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_user_uploads_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_user_uploads_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read attached files from a user # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_user_uploads_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id2 id: ID of the user or `me`. (required)
|
||||
:return: list[InlineResponse2006]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_user_uploads" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_user_uploads`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}/uploads', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[InlineResponse2006]', # 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)
|
||||
@@ -0,0 +1,429 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
eLabFTW REST API v2 Documentation
|
||||
|
||||
This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
|
||||
|
||||
OpenAPI spec version: 2.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 elabapi_python.api_client import ApiClient
|
||||
|
||||
|
||||
class UsersApi(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 patch_user(self, id, **kwargs): # noqa: E501
|
||||
"""Modify a user. # noqa: E501
|
||||
|
||||
Note: it is possible to use \"me\" instead of the userid to access the user of the API key. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_user(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id1 id: ID of the user or `me`. (required)
|
||||
:param UsersIdBody body: Parameters for modifying a user.
|
||||
:return: Users
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.patch_user_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.patch_user_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def patch_user_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Modify a user. # noqa: E501
|
||||
|
||||
Note: it is possible to use \"me\" instead of the userid to access the user of the API key. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.patch_user_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id1 id: ID of the user or `me`. (required)
|
||||
:param UsersIdBody body: Parameters for modifying a user.
|
||||
:return: Users
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['id', 'body'] # 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 patch_user" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `patch_user`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['id'] # noqa: E501
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}', 'PATCH',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Users', # 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)
|
||||
|
||||
def post_user(self, **kwargs): # noqa: E501
|
||||
"""Create a new user. # noqa: E501
|
||||
|
||||
An Admin can create a user in its own team only. A sysadmin can specify the team. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_user(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param UsersBody body: Parameters for creating a user.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.post_user_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.post_user_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def post_user_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Create a new user. # noqa: E501
|
||||
|
||||
An Admin can create a user in its own team only. A sysadmin can specify the team. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.post_user_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param UsersBody body: Parameters for creating a user.
|
||||
:return: None
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['body'] # 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 post_user" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
|
||||
header_params = {}
|
||||
|
||||
form_params = []
|
||||
local_var_files = {}
|
||||
|
||||
body_params = None
|
||||
if 'body' in params:
|
||||
body_params = params['body']
|
||||
# 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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users', 'POST',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type=None, # 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)
|
||||
|
||||
def read_user(self, id, **kwargs): # noqa: E501
|
||||
"""Read information of a user. # noqa: E501
|
||||
|
||||
Note: it is possible to use \"me\" instead of the userid to access the user of the API key. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_user(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id1 id: ID of the user or `me`. (required)
|
||||
:return: Users
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_user_with_http_info(id, **kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_user_with_http_info(id, **kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_user_with_http_info(self, id, **kwargs): # noqa: E501
|
||||
"""Read information of a user. # noqa: E501
|
||||
|
||||
Note: it is possible to use \"me\" instead of the userid to access the user of the API key. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_user_with_http_info(id, async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param Id1 id: ID of the user or `me`. (required)
|
||||
:return: Users
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['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 read_user" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
# verify the required parameter 'id' is set
|
||||
if ('id' not in params or
|
||||
params['id'] is None):
|
||||
raise ValueError("Missing the required parameter `id` when calling `read_user`") # noqa: E501
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
if 'id' in params:
|
||||
path_params['id'] = params['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 = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users/{id}', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='Users', # 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)
|
||||
|
||||
def read_users(self, **kwargs): # noqa: E501
|
||||
"""Read users from instance. # noqa: E501
|
||||
|
||||
Get a list of users with an active account on the instance. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_users(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int team: Add a filter on the team
|
||||
:param int current_team: If set to 1, use the requester's current team as filter.
|
||||
:param bool only_admins: Return only team admins.
|
||||
:param bool only_archived: Return only archived users.
|
||||
:return: list[object]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if kwargs.get('async_req'):
|
||||
return self.read_users_with_http_info(**kwargs) # noqa: E501
|
||||
else:
|
||||
(data) = self.read_users_with_http_info(**kwargs) # noqa: E501
|
||||
return data
|
||||
|
||||
def read_users_with_http_info(self, **kwargs): # noqa: E501
|
||||
"""Read users from instance. # noqa: E501
|
||||
|
||||
Get a list of users with an active account on the instance. # noqa: E501
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
asynchronous HTTP request, please pass async_req=True
|
||||
>>> thread = api.read_users_with_http_info(async_req=True)
|
||||
>>> result = thread.get()
|
||||
|
||||
:param async_req bool
|
||||
:param int team: Add a filter on the team
|
||||
:param int current_team: If set to 1, use the requester's current team as filter.
|
||||
:param bool only_admins: Return only team admins.
|
||||
:param bool only_archived: Return only archived users.
|
||||
:return: list[object]
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
"""
|
||||
|
||||
all_params = ['team', 'current_team', 'only_admins', 'only_archived'] # 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 read_users" % key
|
||||
)
|
||||
params[key] = val
|
||||
del params['kwargs']
|
||||
|
||||
collection_formats = {}
|
||||
|
||||
path_params = {}
|
||||
|
||||
query_params = []
|
||||
if 'team' in params:
|
||||
query_params.append(('team', params['team'])) # noqa: E501
|
||||
if 'current_team' in params:
|
||||
query_params.append(('currentTeam', params['current_team'])) # noqa: E501
|
||||
if 'only_admins' in params:
|
||||
query_params.append(('onlyAdmins', params['only_admins'])) # noqa: E501
|
||||
if 'only_archived' in params:
|
||||
query_params.append(('onlyArchived', params['only_archived'])) # 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
|
||||
|
||||
# Authentication setting
|
||||
auth_settings = ['token'] # noqa: E501
|
||||
|
||||
return self.api_client.call_api(
|
||||
'/users', 'GET',
|
||||
path_params,
|
||||
query_params,
|
||||
header_params,
|
||||
body=body_params,
|
||||
post_params=form_params,
|
||||
files=local_var_files,
|
||||
response_type='list[object]', # 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)
|
||||
Reference in New Issue
Block a user