elabapi-python 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,3 +101,4 @@ from elabapi_python.models.upload import Upload
101
101
  from elabapi_python.models.uploads_subid_body import UploadsSubidBody
102
102
  from elabapi_python.models.users import Users
103
103
  from elabapi_python.models.users_body import UsersBody
104
+ from elabapi_python.models.users_id_body import UsersIdBody
@@ -137,6 +137,7 @@ class ItemsApi(object):
137
137
 
138
138
  :param async_req bool
139
139
  :param int id: ID of the item (required)
140
+ :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\".
140
141
  :return: Item
141
142
  If the method is called asynchronously,
142
143
  returns the request thread.
@@ -158,12 +159,13 @@ class ItemsApi(object):
158
159
 
159
160
  :param async_req bool
160
161
  :param int id: ID of the item (required)
162
+ :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\".
161
163
  :return: Item
162
164
  If the method is called asynchronously,
163
165
  returns the request thread.
164
166
  """
165
167
 
166
- all_params = ['id'] # noqa: E501
168
+ all_params = ['id', 'format'] # noqa: E501
167
169
  all_params.append('async_req')
168
170
  all_params.append('_return_http_data_only')
169
171
  all_params.append('_preload_content')
@@ -190,6 +192,8 @@ class ItemsApi(object):
190
192
  path_params['id'] = params['id'] # noqa: E501
191
193
 
192
194
  query_params = []
195
+ if 'format' in params:
196
+ query_params.append(('format', params['format'])) # noqa: E501
193
197
 
194
198
  header_params = {}
195
199
 
@@ -32,6 +32,109 @@ class UsersApi(object):
32
32
  api_client = ApiClient()
33
33
  self.api_client = api_client
34
34
 
35
+ def patch_user(self, id, **kwargs): # noqa: E501
36
+ """Modify a user. # noqa: E501
37
+
38
+ Note: it is possible to use \"me\" instead of the userid to access the user of the API key. # noqa: E501
39
+ This method makes a synchronous HTTP request by default. To make an
40
+ asynchronous HTTP request, please pass async_req=True
41
+ >>> thread = api.patch_user(id, async_req=True)
42
+ >>> result = thread.get()
43
+
44
+ :param async_req bool
45
+ :param Id id: ID of the user or `me`. (required)
46
+ :param UsersIdBody body: Parameters for modifying a user.
47
+ :return: Users
48
+ If the method is called asynchronously,
49
+ returns the request thread.
50
+ """
51
+ kwargs['_return_http_data_only'] = True
52
+ if kwargs.get('async_req'):
53
+ return self.patch_user_with_http_info(id, **kwargs) # noqa: E501
54
+ else:
55
+ (data) = self.patch_user_with_http_info(id, **kwargs) # noqa: E501
56
+ return data
57
+
58
+ def patch_user_with_http_info(self, id, **kwargs): # noqa: E501
59
+ """Modify a user. # noqa: E501
60
+
61
+ Note: it is possible to use \"me\" instead of the userid to access the user of the API key. # noqa: E501
62
+ This method makes a synchronous HTTP request by default. To make an
63
+ asynchronous HTTP request, please pass async_req=True
64
+ >>> thread = api.patch_user_with_http_info(id, async_req=True)
65
+ >>> result = thread.get()
66
+
67
+ :param async_req bool
68
+ :param Id id: ID of the user or `me`. (required)
69
+ :param UsersIdBody body: Parameters for modifying a user.
70
+ :return: Users
71
+ If the method is called asynchronously,
72
+ returns the request thread.
73
+ """
74
+
75
+ all_params = ['id', 'body'] # noqa: E501
76
+ all_params.append('async_req')
77
+ all_params.append('_return_http_data_only')
78
+ all_params.append('_preload_content')
79
+ all_params.append('_request_timeout')
80
+
81
+ params = locals()
82
+ for key, val in six.iteritems(params['kwargs']):
83
+ if key not in all_params:
84
+ raise TypeError(
85
+ "Got an unexpected keyword argument '%s'"
86
+ " to method patch_user" % key
87
+ )
88
+ params[key] = val
89
+ del params['kwargs']
90
+ # verify the required parameter 'id' is set
91
+ if ('id' not in params or
92
+ params['id'] is None):
93
+ raise ValueError("Missing the required parameter `id` when calling `patch_user`") # noqa: E501
94
+
95
+ collection_formats = {}
96
+
97
+ path_params = {}
98
+ if 'id' in params:
99
+ path_params['id'] = params['id'] # noqa: E501
100
+
101
+ query_params = []
102
+
103
+ header_params = {}
104
+
105
+ form_params = []
106
+ local_var_files = {}
107
+
108
+ body_params = None
109
+ if 'body' in params:
110
+ body_params = params['body']
111
+ # HTTP header `Accept`
112
+ header_params['Accept'] = self.api_client.select_header_accept(
113
+ ['application/json']) # noqa: E501
114
+
115
+ # HTTP header `Content-Type`
116
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
117
+ ['application/json']) # noqa: E501
118
+
119
+ # Authentication setting
120
+ auth_settings = ['token'] # noqa: E501
121
+
122
+ return self.api_client.call_api(
123
+ '/users/{id}', 'PATCH',
124
+ path_params,
125
+ query_params,
126
+ header_params,
127
+ body=body_params,
128
+ post_params=form_params,
129
+ files=local_var_files,
130
+ response_type='Users', # noqa: E501
131
+ auth_settings=auth_settings,
132
+ async_req=params.get('async_req'),
133
+ _return_http_data_only=params.get('_return_http_data_only'),
134
+ _preload_content=params.get('_preload_content', True),
135
+ _request_timeout=params.get('_request_timeout'),
136
+ collection_formats=collection_formats)
137
+
35
138
  def post_user(self, **kwargs): # noqa: E501
36
139
  """Create a new user. # noqa: E501
37
140
 
@@ -72,7 +72,7 @@ class ApiClient(object):
72
72
  self.default_headers[header_name] = header_value
73
73
  self.cookie = cookie
74
74
  # Set default User-Agent.
75
- self.user_agent = 'Swagger-Codegen/0.1.6/python'
75
+ self.user_agent = 'Swagger-Codegen/0.1.7/python'
76
76
 
77
77
  def __del__(self):
78
78
  self.pool.close()
@@ -247,5 +247,5 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
247
247
  "OS: {env}\n"\
248
248
  "Python Version: {pyversion}\n"\
249
249
  "Version of the API: 2.0.0\n"\
250
- "SDK Package Version: 0.1.6".\
250
+ "SDK Package Version: 0.1.7".\
251
251
  format(env=sys.platform, pyversion=sys.version)
@@ -74,3 +74,4 @@ from elabapi_python.models.upload import Upload
74
74
  from elabapi_python.models.uploads_subid_body import UploadsSubidBody
75
75
  from elabapi_python.models.users import Users
76
76
  from elabapi_python.models.users_body import UsersBody
77
+ from elabapi_python.models.users_id_body import UsersIdBody
@@ -0,0 +1,84 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ eLabFTW REST API v2 Documentation
5
+
6
+ This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
7
+
8
+ OpenAPI spec version: 2.0.0
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+ import pprint
14
+ import re # noqa: F401
15
+
16
+ import six
17
+
18
+ class UsersIdBody(object):
19
+ """NOTE: This class is auto generated by the swagger code generator program.
20
+
21
+ Do not edit the class manually.
22
+ """
23
+ """
24
+ Attributes:
25
+ swagger_types (dict): The key is attribute name
26
+ and the value is attribute type.
27
+ attribute_map (dict): The key is attribute name
28
+ and the value is json key in definition.
29
+ """
30
+ swagger_types = {
31
+ }
32
+
33
+ attribute_map = {
34
+ }
35
+
36
+ def __init__(self): # noqa: E501
37
+ """UsersIdBody - a model defined in Swagger""" # noqa: E501
38
+ self.discriminator = None
39
+
40
+ def to_dict(self):
41
+ """Returns the model properties as a dict"""
42
+ result = {}
43
+
44
+ for attr, _ in six.iteritems(self.swagger_types):
45
+ value = getattr(self, attr)
46
+ if isinstance(value, list):
47
+ result[attr] = list(map(
48
+ lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
49
+ value
50
+ ))
51
+ elif hasattr(value, "to_dict"):
52
+ result[attr] = value.to_dict()
53
+ elif isinstance(value, dict):
54
+ result[attr] = dict(map(
55
+ lambda item: (item[0], item[1].to_dict())
56
+ if hasattr(item[1], "to_dict") else item,
57
+ value.items()
58
+ ))
59
+ else:
60
+ result[attr] = value
61
+ if issubclass(UsersIdBody, dict):
62
+ for key, value in self.items():
63
+ result[key] = value
64
+
65
+ return result
66
+
67
+ def to_str(self):
68
+ """Returns the string representation of the model"""
69
+ return pprint.pformat(self.to_dict())
70
+
71
+ def __repr__(self):
72
+ """For `print` and `pprint`"""
73
+ return self.to_str()
74
+
75
+ def __eq__(self, other):
76
+ """Returns true if both objects are equal"""
77
+ if not isinstance(other, UsersIdBody):
78
+ return False
79
+
80
+ return self.__dict__ == other.__dict__
81
+
82
+ def __ne__(self, other):
83
+ """Returns true if both objects are not equal"""
84
+ return not self == other
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elabapi-python
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: eLabFTW REST API v2 Documentation
5
5
  Home-page: https://github.com/elabftw/elabapi-python
6
6
  Author-email:
@@ -1,6 +1,6 @@
1
- elabapi_python/__init__.py,sha256=sMooG1BYiOiFE4M_OA9-zJB15LKkjESHiXc9Lc9e7og,5431
2
- elabapi_python/api_client.py,sha256=rbEojspkhJH8BOf4KwyGjTj-AeYezRWwduDu2UKiAoE,25079
3
- elabapi_python/configuration.py,sha256=mo6AGfZOGZwP6BnTQg9wb8FQ7zS7RxcIWjCcoVl3V3A,8263
1
+ elabapi_python/__init__.py,sha256=uQ1bobO4iSD5AoGpfsO8bJPjbXMGfN2UxiTnRMv1nqs,5491
2
+ elabapi_python/api_client.py,sha256=B3yBj_rLPS1awtovyQ07HGnKSybk94oDTiD8LxP3T2s,25079
3
+ elabapi_python/configuration.py,sha256=1cWiKwY9fEoB0FIeClhqxogypr-oBiLgju_-nsiEU6A,8263
4
4
  elabapi_python/rest.py,sha256=zVk_B5g308vKBtZ4jb8fpaeXXEO4GZzTGNPfZK_zkY0,13031
5
5
  elabapi_python/api/__init__.py,sha256=OOk3CfzFbxOpwq7MZZPDs12PlCZehGQFMf03d-OXSZc,1379
6
6
  elabapi_python/api/api_keys_api.py,sha256=u_SZ2stg1KsRnPY2s1dpjvHVrJeFKj-L6hLRFaitvZo,10666
@@ -10,7 +10,7 @@ elabapi_python/api/events_api.py,sha256=Mcg-3v053ocERa73uqOCv29KeNwRBfqtbSbGAtx_
10
10
  elabapi_python/api/experiments_api.py,sha256=ydAxfpiPOu5Iu6_4pR7NGpYDUaUjRnI4rdgBeSpOcKs,20487
11
11
  elabapi_python/api/experiments_templates_api.py,sha256=RzTyv0rxKqdMO_gBEqgkN1oGsKMZ9MT0-2dIuorS8kc,18664
12
12
  elabapi_python/api/favorite_tags_api.py,sha256=Riyr1S_sYjnLc460AhGehv8tuiFPXHhjWEQGndnxLcg,10417
13
- elabapi_python/api/items_api.py,sha256=Lvr2gOUQyLE-GFeTQxaVaj6Z8J3B2g_4rL9ii_GCEEI,19333
13
+ elabapi_python/api/items_api.py,sha256=X_D7SlAxngbZrWDKygCUx5uaOaRVw_xLb05zK8gQGNw,19746
14
14
  elabapi_python/api/items_types_api.py,sha256=ioGXuFCw5Vfly-DiwSWo4f6j_2jbIOo1ZBFtCgc2T68,17478
15
15
  elabapi_python/api/links_to_experiments_api.py,sha256=c18lWZMFEitrCS5QUlLid7mcV-pFFepqPpD5FtVE2n4,14876
16
16
  elabapi_python/api/links_to_items_api.py,sha256=GgkcghazGu2tZQCnCtgKMfzqtYnmUlyfhrvX48g3FkE,14628
@@ -24,8 +24,8 @@ elabapi_python/api/teams_api.py,sha256=crTQ6nMSgLLUzs87h2obR1wzefhNjU4IEiEntzJdJ
24
24
  elabapi_python/api/todolist_api.py,sha256=CZvN9CqRhj0DI4g1nmZ73zbHbQUk78iSF3E6Umvpv7w,17653
25
25
  elabapi_python/api/unfinished_steps_api.py,sha256=Zxp0VGbn5VwTjZjoGjD0GDh49XD2WoQV26d1Y4nGM1s,4153
26
26
  elabapi_python/api/uploads_api.py,sha256=JpUVgK7Lb2dv_nSBS8bbqdvX_tH3TARFFj5_zE0Kw-g,28747
27
- elabapi_python/api/users_api.py,sha256=HoUZlFRIU04-17MjEAiA4eHF_kdfwbkqjpKU11zDEz0,10989
28
- elabapi_python/models/__init__.py,sha256=qaPoDbUxKd3WPw9WT18MoRlyAEk3AaKk9rh3oAGt7ZM,3987
27
+ elabapi_python/api/users_api.py,sha256=dS6-7qKKl8Oj_nTaqJ11SIBMFYwTvVQga22U2LK_Xb0,14987
28
+ elabapi_python/models/__init__.py,sha256=VQXPBN0fgZjSvyZGWQZBGHZvaaBjEEhMZusJARg6ijc,4047
29
29
  elabapi_python/models/apikey.py,sha256=OlLlUZKfa_P0bKIgYAycT9yxtrbgZbk-p8E4YTW2E2M,5370
30
30
  elabapi_python/models/apikeys_body.py,sha256=8Rdoft5f80PRZaxbxncNZyGba9D8H4JDbBJOOtWI4mI,3900
31
31
  elabapi_python/models/comment.py,sha256=niUGHXr-rV07CYtYAZI1_bcsepigAq9_LYJ4NkowV4k,8659
@@ -86,6 +86,7 @@ elabapi_python/models/upload.py,sha256=p-2SW8SiDd0UIMzKe6Do9nAM-aPYV2B1XuVIshZt_
86
86
  elabapi_python/models/uploads_subid_body.py,sha256=EeSgQAtTciI0PInnm0PmoDAY0jvaHeqikJBwP5p40is,3451
87
87
  elabapi_python/models/users.py,sha256=ZCLUVIYHi9jPO7tsrbr9DILzRVfbJkt3G-VvpHdvrJo,9360
88
88
  elabapi_python/models/users_body.py,sha256=6V46vSMTtnrZlrewGVC-llyWt4VUEPkNYWsNIJyFatU,7416
89
+ elabapi_python/models/users_id_body.py,sha256=ofNLr9t6Yc3mvLGo6B4EU9M9fdteKuq9Ky1uz1w6Ezw,2447
89
90
  test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
90
91
  test/test_api_keys_api.py,sha256=7RpC-1rj3WDoZuW9fDEBYSfbqCURdAYohLIel2U9d7k,1119
91
92
  test/test_apikey.py,sha256=KmCGehf1zVp8rTN_IVf7WHe0NMAIt1V6RqO_LRqgaCw,876
@@ -167,9 +168,10 @@ test/test_upload.py,sha256=Eku9biI2tgI6pkq1IABtDFg-0mhO_wZn8Edd4z9cwzY,876
167
168
  test/test_uploads_api.py,sha256=wfujdKlHZ1Kwx4uIqfRuYof0p8pG-8P5L0wZ7IkCawE,1651
168
169
  test/test_uploads_subid_body.py,sha256=gzX7QRy2TDbwb0JmxqI_gwnL879pudViKaFwpU0bFzg,960
169
170
  test/test_users.py,sha256=ksfv3iXjBchgcvFQnbBwZYLHCr9oGj7ZJVpmafi73GE,868
170
- test/test_users_api.py,sha256=LSuIEd_5cYtzwZJAjMDEUrCpuVmYki9cCyZ6la4KEik,1114
171
+ test/test_users_api.py,sha256=kg9_Dt3yO4CgXNWI0npPCtbQHyaWMQ-qkK1F8gX2Ryk,1245
171
172
  test/test_users_body.py,sha256=fcBZe3SisFS-_Td6Voqu3GjCyIa60OWc81yFus96vIc,902
172
- elabapi_python-0.1.6.dist-info/METADATA,sha256=VxAfSXP9A9-HuOI89KomR_9p99WNb1y81FbouLFbyvw,454
173
- elabapi_python-0.1.6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
174
- elabapi_python-0.1.6.dist-info/top_level.txt,sha256=BPZOy4tB7V5mJMvvpw5nc6Ou5L4KByC5IWWyNYD3fME,20
175
- elabapi_python-0.1.6.dist-info/RECORD,,
173
+ test/test_users_id_body.py,sha256=SUH_AGVzw_8sPRBV3giq87oJhxgd7j00ZtoybuRxl-g,920
174
+ elabapi_python-0.1.7.dist-info/METADATA,sha256=pJVJ_sZUe2ZGhtI71aIj6Pa2piGRK8qDsG_fpbWh-bI,454
175
+ elabapi_python-0.1.7.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
176
+ elabapi_python-0.1.7.dist-info/top_level.txt,sha256=BPZOy4tB7V5mJMvvpw5nc6Ou5L4KByC5IWWyNYD3fME,20
177
+ elabapi_python-0.1.7.dist-info/RECORD,,
test/test_users_api.py CHANGED
@@ -28,6 +28,13 @@ class TestUsersApi(unittest.TestCase):
28
28
  def tearDown(self):
29
29
  pass
30
30
 
31
+ def test_patch_user(self):
32
+ """Test case for patch_user
33
+
34
+ Modify a user. # noqa: E501
35
+ """
36
+ pass
37
+
31
38
  def test_post_user(self):
32
39
  """Test case for post_user
33
40
 
@@ -0,0 +1,39 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ eLabFTW REST API v2 Documentation
5
+
6
+ This document describes all available endpoints and methods for eLabFTW's API version 2. # noqa: E501
7
+
8
+ OpenAPI spec version: 2.0.0
9
+
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+ from __future__ import absolute_import
14
+
15
+ import unittest
16
+
17
+ import elabapi_python
18
+ from elabapi_python.models.users_id_body import UsersIdBody # noqa: E501
19
+ from elabapi_python.rest import ApiException
20
+
21
+
22
+ class TestUsersIdBody(unittest.TestCase):
23
+ """UsersIdBody unit test stubs"""
24
+
25
+ def setUp(self):
26
+ pass
27
+
28
+ def tearDown(self):
29
+ pass
30
+
31
+ def testUsersIdBody(self):
32
+ """Test UsersIdBody"""
33
+ # FIXME: construct object with mandatory attributes with example values
34
+ # model = elabapi_python.models.users_id_body.UsersIdBody() # noqa: E501
35
+ pass
36
+
37
+
38
+ if __name__ == '__main__':
39
+ unittest.main()