lockss-pyclient 0.1.0.dev1__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.
Files changed (148) hide show
  1. lockss/pyclient/__init__.py +67 -0
  2. lockss/pyclient/config/__init__.py +42 -0
  3. lockss/pyclient/config/api/__init__.py +12 -0
  4. lockss/pyclient/config/api/aus_api.py +2195 -0
  5. lockss/pyclient/config/api/config_api.py +718 -0
  6. lockss/pyclient/config/api/plugins_api.py +128 -0
  7. lockss/pyclient/config/api/status_api.py +120 -0
  8. lockss/pyclient/config/api/tdb_api.py +318 -0
  9. lockss/pyclient/config/api/users_api.py +516 -0
  10. lockss/pyclient/config/api/utils_api.py +128 -0
  11. lockss/pyclient/config/api_client.py +632 -0
  12. lockss/pyclient/config/configuration.py +254 -0
  13. lockss/pyclient/config/models/__init__.py +30 -0
  14. lockss/pyclient/config/models/api_status.py +344 -0
  15. lockss/pyclient/config/models/au_configuration.py +142 -0
  16. lockss/pyclient/config/models/au_status.py +113 -0
  17. lockss/pyclient/config/models/au_ws_result.py +113 -0
  18. lockss/pyclient/config/models/auids_body.py +168 -0
  19. lockss/pyclient/config/models/check_substance_result.py +212 -0
  20. lockss/pyclient/config/models/content_configuration_result.py +200 -0
  21. lockss/pyclient/config/models/file_section_name_body.py +113 -0
  22. lockss/pyclient/config/models/platform_configuration_ws_result.py +113 -0
  23. lockss/pyclient/config/models/plugin_ws_result.py +345 -0
  24. lockss/pyclient/config/models/request_au_control_result.py +171 -0
  25. lockss/pyclient/config/models/tdb_au_ws_result.py +360 -0
  26. lockss/pyclient/config/models/tdb_publisher_ws_result.py +113 -0
  27. lockss/pyclient/config/models/tdb_title_ws_result.py +390 -0
  28. lockss/pyclient/config/rest.py +317 -0
  29. lockss/pyclient/crawler/__init__.py +45 -0
  30. lockss/pyclient/crawler/api/__init__.py +10 -0
  31. lockss/pyclient/crawler/api/crawlers_api.py +215 -0
  32. lockss/pyclient/crawler/api/crawls_api.py +952 -0
  33. lockss/pyclient/crawler/api/jobs_api.py +504 -0
  34. lockss/pyclient/crawler/api/status_api.py +120 -0
  35. lockss/pyclient/crawler/api/ws_api.py +128 -0
  36. lockss/pyclient/crawler/api_client.py +632 -0
  37. lockss/pyclient/crawler/configuration.py +254 -0
  38. lockss/pyclient/crawler/models/__init__.py +35 -0
  39. lockss/pyclient/crawler/models/api_status.py +344 -0
  40. lockss/pyclient/crawler/models/counter.py +142 -0
  41. lockss/pyclient/crawler/models/crawl_desc.py +344 -0
  42. lockss/pyclient/crawler/models/crawl_job.py +280 -0
  43. lockss/pyclient/crawler/models/crawl_pager.py +140 -0
  44. lockss/pyclient/crawler/models/crawl_status.py +780 -0
  45. lockss/pyclient/crawler/models/crawl_ws_result.py +814 -0
  46. lockss/pyclient/crawler/models/crawl_ws_result_pages_with_errors.py +162 -0
  47. lockss/pyclient/crawler/models/crawler_config.py +142 -0
  48. lockss/pyclient/crawler/models/crawler_status.py +279 -0
  49. lockss/pyclient/crawler/models/crawler_statuses.py +112 -0
  50. lockss/pyclient/crawler/models/error_result.py +164 -0
  51. lockss/pyclient/crawler/models/job_pager.py +140 -0
  52. lockss/pyclient/crawler/models/job_status.py +147 -0
  53. lockss/pyclient/crawler/models/mime_counter.py +169 -0
  54. lockss/pyclient/crawler/models/page_info.py +228 -0
  55. lockss/pyclient/crawler/models/url_error.py +148 -0
  56. lockss/pyclient/crawler/models/url_info.py +167 -0
  57. lockss/pyclient/crawler/models/url_pager.py +140 -0
  58. lockss/pyclient/crawler/rest.py +317 -0
  59. lockss/pyclient/md/__init__.py +36 -0
  60. lockss/pyclient/md/api/__init__.py +9 -0
  61. lockss/pyclient/md/api/mdupdates_api.py +508 -0
  62. lockss/pyclient/md/api/metadata_api.py +136 -0
  63. lockss/pyclient/md/api/status_api.py +120 -0
  64. lockss/pyclient/md/api/urls_api.py +224 -0
  65. lockss/pyclient/md/api_client.py +632 -0
  66. lockss/pyclient/md/configuration.py +254 -0
  67. lockss/pyclient/md/models/__init__.py +27 -0
  68. lockss/pyclient/md/models/api_status.py +344 -0
  69. lockss/pyclient/md/models/au.py +169 -0
  70. lockss/pyclient/md/models/au_metadata_page_info.py +140 -0
  71. lockss/pyclient/md/models/error_result.py +164 -0
  72. lockss/pyclient/md/models/item_metadata.py +196 -0
  73. lockss/pyclient/md/models/job.py +280 -0
  74. lockss/pyclient/md/models/job_page_info.py +140 -0
  75. lockss/pyclient/md/models/metadata_update_spec.py +142 -0
  76. lockss/pyclient/md/models/page_info.py +228 -0
  77. lockss/pyclient/md/models/status.py +142 -0
  78. lockss/pyclient/md/models/url_info.py +142 -0
  79. lockss/pyclient/md/rest.py +317 -0
  80. lockss/pyclient/poller/__init__.py +54 -0
  81. lockss/pyclient/poller/api/__init__.py +13 -0
  82. lockss/pyclient/poller/api/export_api.py +156 -0
  83. lockss/pyclient/poller/api/hash_api.py +413 -0
  84. lockss/pyclient/poller/api/import_api.py +157 -0
  85. lockss/pyclient/poller/api/poll_detail_api.py +374 -0
  86. lockss/pyclient/poller/api/poller_polls_api.py +223 -0
  87. lockss/pyclient/poller/api/repo_api.py +223 -0
  88. lockss/pyclient/poller/api/service_api.py +694 -0
  89. lockss/pyclient/poller/api/voter_polls_api.py +223 -0
  90. lockss/pyclient/poller/api_client.py +632 -0
  91. lockss/pyclient/poller/configuration.py +254 -0
  92. lockss/pyclient/poller/models/__init__.py +41 -0
  93. lockss/pyclient/poller/models/api_status.py +344 -0
  94. lockss/pyclient/poller/models/aus_import_body.py +199 -0
  95. lockss/pyclient/poller/models/cached_uri_set_spec.py +169 -0
  96. lockss/pyclient/poller/models/error_result.py +164 -0
  97. lockss/pyclient/poller/models/hasher_ws_params.py +432 -0
  98. lockss/pyclient/poller/models/link_desc.py +141 -0
  99. lockss/pyclient/poller/models/page_desc.py +227 -0
  100. lockss/pyclient/poller/models/peer_data.py +638 -0
  101. lockss/pyclient/poller/models/peer_ws_result.py +113 -0
  102. lockss/pyclient/poller/models/poll_desc.py +285 -0
  103. lockss/pyclient/poller/models/poll_ws_result.py +142 -0
  104. lockss/pyclient/poller/models/poller_detail.py +613 -0
  105. lockss/pyclient/poller/models/poller_pager.py +139 -0
  106. lockss/pyclient/poller/models/poller_summary.py +452 -0
  107. lockss/pyclient/poller/models/repair_data.py +176 -0
  108. lockss/pyclient/poller/models/repair_pager.py +139 -0
  109. lockss/pyclient/poller/models/repair_queue.py +249 -0
  110. lockss/pyclient/poller/models/repository_space_ws_result.py +113 -0
  111. lockss/pyclient/poller/models/repository_ws_result.py +113 -0
  112. lockss/pyclient/poller/models/tally_data.py +471 -0
  113. lockss/pyclient/poller/models/url_pager.py +139 -0
  114. lockss/pyclient/poller/models/vote_ws_result.py +142 -0
  115. lockss/pyclient/poller/models/voter_detail.py +701 -0
  116. lockss/pyclient/poller/models/voter_pager.py +139 -0
  117. lockss/pyclient/poller/models/voter_summary.py +284 -0
  118. lockss/pyclient/poller/rest.py +317 -0
  119. lockss/pyclient/rs/__init__.py +41 -0
  120. lockss/pyclient/rs/api/__init__.py +10 -0
  121. lockss/pyclient/rs/api/artifacts_api.py +988 -0
  122. lockss/pyclient/rs/api/aus_api.py +334 -0
  123. lockss/pyclient/rs/api/repo_api.py +379 -0
  124. lockss/pyclient/rs/api/status_api.py +120 -0
  125. lockss/pyclient/rs/api/wayback_api.py +386 -0
  126. lockss/pyclient/rs/api_client.py +632 -0
  127. lockss/pyclient/rs/configuration.py +247 -0
  128. lockss/pyclient/rs/models/__init__.py +31 -0
  129. lockss/pyclient/rs/models/api_status.py +344 -0
  130. lockss/pyclient/rs/models/archives_body.py +142 -0
  131. lockss/pyclient/rs/models/artifact.py +344 -0
  132. lockss/pyclient/rs/models/artifact_page_info.py +140 -0
  133. lockss/pyclient/rs/models/artifact_properties.py +344 -0
  134. lockss/pyclient/rs/models/artifacts_body.py +170 -0
  135. lockss/pyclient/rs/models/au_size.py +162 -0
  136. lockss/pyclient/rs/models/auid_page_info.py +140 -0
  137. lockss/pyclient/rs/models/error_result.py +164 -0
  138. lockss/pyclient/rs/models/import_status.py +298 -0
  139. lockss/pyclient/rs/models/page_info.py +229 -0
  140. lockss/pyclient/rs/models/repository_info.py +164 -0
  141. lockss/pyclient/rs/models/repository_statistics.py +112 -0
  142. lockss/pyclient/rs/models/storage_info.py +287 -0
  143. lockss/pyclient/rs/models/streaming_response_body.py +84 -0
  144. lockss/pyclient/rs/rest.py +317 -0
  145. lockss_pyclient-0.1.0.dev1.dist-info/LICENSE +27 -0
  146. lockss_pyclient-0.1.0.dev1.dist-info/METADATA +29 -0
  147. lockss_pyclient-0.1.0.dev1.dist-info/RECORD +148 -0
  148. lockss_pyclient-0.1.0.dev1.dist-info/WHEEL +4 -0
@@ -0,0 +1,516 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LOCKSS Configuration Service REST API
5
+
6
+ REST API of the LOCKSS Configuration Service # noqa: E501
7
+
8
+ OpenAPI spec version: 2.0.0
9
+ Contact: lockss-support@lockss.org
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+ from __future__ import absolute_import
14
+
15
+ import re # noqa: F401
16
+
17
+ # python 2 and python 3 compatibility library
18
+ import six
19
+
20
+ from lockss.pyclient.config.api_client import ApiClient
21
+
22
+
23
+ class UsersApi(object):
24
+ """NOTE: This class is auto generated by the swagger code generator program.
25
+
26
+ Do not edit the class manually.
27
+ Ref: https://github.com/swagger-api/swagger-codegen
28
+ """
29
+
30
+ def __init__(self, api_client=None):
31
+ if api_client is None:
32
+ api_client = ApiClient()
33
+ self.api_client = api_client
34
+
35
+ def add_user_accounts(self, body, **kwargs): # noqa: E501
36
+ """Adds user accounts to the system # noqa: E501
37
+
38
+ Adds user accounts to the system # 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.add_user_accounts(body, async_req=True)
42
+ >>> result = thread.get()
43
+
44
+ :param async_req bool
45
+ :param str body: An array of user accounts to be stored (required)
46
+ :return: str
47
+ If the method is called asynchronously,
48
+ returns the request thread.
49
+ """
50
+ kwargs['_return_http_data_only'] = True
51
+ if kwargs.get('async_req'):
52
+ return self.add_user_accounts_with_http_info(body, **kwargs) # noqa: E501
53
+ else:
54
+ (data) = self.add_user_accounts_with_http_info(body, **kwargs) # noqa: E501
55
+ return data
56
+
57
+ def add_user_accounts_with_http_info(self, body, **kwargs): # noqa: E501
58
+ """Adds user accounts to the system # noqa: E501
59
+
60
+ Adds user accounts to the system # noqa: E501
61
+ This method makes a synchronous HTTP request by default. To make an
62
+ asynchronous HTTP request, please pass async_req=True
63
+ >>> thread = api.add_user_accounts_with_http_info(body, async_req=True)
64
+ >>> result = thread.get()
65
+
66
+ :param async_req bool
67
+ :param str body: An array of user accounts to be stored (required)
68
+ :return: str
69
+ If the method is called asynchronously,
70
+ returns the request thread.
71
+ """
72
+
73
+ all_params = ['body'] # noqa: E501
74
+ all_params.append('async_req')
75
+ all_params.append('_return_http_data_only')
76
+ all_params.append('_preload_content')
77
+ all_params.append('_request_timeout')
78
+
79
+ params = locals()
80
+ for key, val in six.iteritems(params['kwargs']):
81
+ if key not in all_params:
82
+ raise TypeError(
83
+ "Got an unexpected keyword argument '%s'"
84
+ " to method add_user_accounts" % key
85
+ )
86
+ params[key] = val
87
+ del params['kwargs']
88
+ # verify the required parameter 'body' is set
89
+ if ('body' not in params or
90
+ params['body'] is None):
91
+ raise ValueError("Missing the required parameter `body` when calling `add_user_accounts`") # noqa: E501
92
+
93
+ collection_formats = {}
94
+
95
+ path_params = {}
96
+
97
+ query_params = []
98
+
99
+ header_params = {}
100
+
101
+ form_params = []
102
+ local_var_files = {}
103
+
104
+ body_params = None
105
+ if 'body' in params:
106
+ body_params = params['body']
107
+ # HTTP header `Accept`
108
+ header_params['Accept'] = self.api_client.select_header_accept(
109
+ ['application/json']) # noqa: E501
110
+
111
+ # HTTP header `Content-Type`
112
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
113
+ ['application/json']) # noqa: E501
114
+
115
+ # Authentication setting
116
+ auth_settings = ['basicAuth'] # noqa: E501
117
+
118
+ return self.api_client.call_api(
119
+ '/users', 'POST',
120
+ path_params,
121
+ query_params,
122
+ header_params,
123
+ body=body_params,
124
+ post_params=form_params,
125
+ files=local_var_files,
126
+ response_type='str', # noqa: E501
127
+ auth_settings=auth_settings,
128
+ async_req=params.get('async_req'),
129
+ _return_http_data_only=params.get('_return_http_data_only'),
130
+ _preload_content=params.get('_preload_content', True),
131
+ _request_timeout=params.get('_request_timeout'),
132
+ collection_formats=collection_formats)
133
+
134
+ def get_user_account(self, username, **kwargs): # noqa: E501
135
+ """Get user account details # noqa: E501
136
+
137
+ Get user account details # noqa: E501
138
+ This method makes a synchronous HTTP request by default. To make an
139
+ asynchronous HTTP request, please pass async_req=True
140
+ >>> thread = api.get_user_account(username, async_req=True)
141
+ >>> result = thread.get()
142
+
143
+ :param async_req bool
144
+ :param str username: Username (required)
145
+ :return: str
146
+ If the method is called asynchronously,
147
+ returns the request thread.
148
+ """
149
+ kwargs['_return_http_data_only'] = True
150
+ if kwargs.get('async_req'):
151
+ return self.get_user_account_with_http_info(username, **kwargs) # noqa: E501
152
+ else:
153
+ (data) = self.get_user_account_with_http_info(username, **kwargs) # noqa: E501
154
+ return data
155
+
156
+ def get_user_account_with_http_info(self, username, **kwargs): # noqa: E501
157
+ """Get user account details # noqa: E501
158
+
159
+ Get user account details # noqa: E501
160
+ This method makes a synchronous HTTP request by default. To make an
161
+ asynchronous HTTP request, please pass async_req=True
162
+ >>> thread = api.get_user_account_with_http_info(username, async_req=True)
163
+ >>> result = thread.get()
164
+
165
+ :param async_req bool
166
+ :param str username: Username (required)
167
+ :return: str
168
+ If the method is called asynchronously,
169
+ returns the request thread.
170
+ """
171
+
172
+ all_params = ['username'] # noqa: E501
173
+ all_params.append('async_req')
174
+ all_params.append('_return_http_data_only')
175
+ all_params.append('_preload_content')
176
+ all_params.append('_request_timeout')
177
+
178
+ params = locals()
179
+ for key, val in six.iteritems(params['kwargs']):
180
+ if key not in all_params:
181
+ raise TypeError(
182
+ "Got an unexpected keyword argument '%s'"
183
+ " to method get_user_account" % key
184
+ )
185
+ params[key] = val
186
+ del params['kwargs']
187
+ # verify the required parameter 'username' is set
188
+ if ('username' not in params or
189
+ params['username'] is None):
190
+ raise ValueError("Missing the required parameter `username` when calling `get_user_account`") # noqa: E501
191
+
192
+ collection_formats = {}
193
+
194
+ path_params = {}
195
+ if 'username' in params:
196
+ path_params['username'] = params['username'] # noqa: E501
197
+
198
+ query_params = []
199
+
200
+ header_params = {}
201
+
202
+ form_params = []
203
+ local_var_files = {}
204
+
205
+ body_params = None
206
+ # HTTP header `Accept`
207
+ header_params['Accept'] = self.api_client.select_header_accept(
208
+ ['application/json']) # noqa: E501
209
+
210
+ # Authentication setting
211
+ auth_settings = ['basicAuth'] # noqa: E501
212
+
213
+ return self.api_client.call_api(
214
+ '/users/{username}', 'GET',
215
+ path_params,
216
+ query_params,
217
+ header_params,
218
+ body=body_params,
219
+ post_params=form_params,
220
+ files=local_var_files,
221
+ response_type='str', # noqa: E501
222
+ auth_settings=auth_settings,
223
+ async_req=params.get('async_req'),
224
+ _return_http_data_only=params.get('_return_http_data_only'),
225
+ _preload_content=params.get('_preload_content', True),
226
+ _request_timeout=params.get('_request_timeout'),
227
+ collection_formats=collection_formats)
228
+
229
+ def get_user_account_names(self, **kwargs): # noqa: E501
230
+ """Get the usernames configured in the system # noqa: E501
231
+
232
+ Get the usernames configured in the system # noqa: E501
233
+ This method makes a synchronous HTTP request by default. To make an
234
+ asynchronous HTTP request, please pass async_req=True
235
+ >>> thread = api.get_user_account_names(async_req=True)
236
+ >>> result = thread.get()
237
+
238
+ :param async_req bool
239
+ :return: list[str]
240
+ If the method is called asynchronously,
241
+ returns the request thread.
242
+ """
243
+ kwargs['_return_http_data_only'] = True
244
+ if kwargs.get('async_req'):
245
+ return self.get_user_account_names_with_http_info(**kwargs) # noqa: E501
246
+ else:
247
+ (data) = self.get_user_account_names_with_http_info(**kwargs) # noqa: E501
248
+ return data
249
+
250
+ def get_user_account_names_with_http_info(self, **kwargs): # noqa: E501
251
+ """Get the usernames configured in the system # noqa: E501
252
+
253
+ Get the usernames configured in the system # noqa: E501
254
+ This method makes a synchronous HTTP request by default. To make an
255
+ asynchronous HTTP request, please pass async_req=True
256
+ >>> thread = api.get_user_account_names_with_http_info(async_req=True)
257
+ >>> result = thread.get()
258
+
259
+ :param async_req bool
260
+ :return: list[str]
261
+ If the method is called asynchronously,
262
+ returns the request thread.
263
+ """
264
+
265
+ all_params = [] # noqa: E501
266
+ all_params.append('async_req')
267
+ all_params.append('_return_http_data_only')
268
+ all_params.append('_preload_content')
269
+ all_params.append('_request_timeout')
270
+
271
+ params = locals()
272
+ for key, val in six.iteritems(params['kwargs']):
273
+ if key not in all_params:
274
+ raise TypeError(
275
+ "Got an unexpected keyword argument '%s'"
276
+ " to method get_user_account_names" % key
277
+ )
278
+ params[key] = val
279
+ del params['kwargs']
280
+
281
+ collection_formats = {}
282
+
283
+ path_params = {}
284
+
285
+ query_params = []
286
+
287
+ header_params = {}
288
+
289
+ form_params = []
290
+ local_var_files = {}
291
+
292
+ body_params = None
293
+ # HTTP header `Accept`
294
+ header_params['Accept'] = self.api_client.select_header_accept(
295
+ ['application/json']) # noqa: E501
296
+
297
+ # Authentication setting
298
+ auth_settings = ['basicAuth'] # noqa: E501
299
+
300
+ return self.api_client.call_api(
301
+ '/usernames', 'GET',
302
+ path_params,
303
+ query_params,
304
+ header_params,
305
+ body=body_params,
306
+ post_params=form_params,
307
+ files=local_var_files,
308
+ response_type='list[str]', # noqa: E501
309
+ auth_settings=auth_settings,
310
+ async_req=params.get('async_req'),
311
+ _return_http_data_only=params.get('_return_http_data_only'),
312
+ _preload_content=params.get('_preload_content', True),
313
+ _request_timeout=params.get('_request_timeout'),
314
+ collection_formats=collection_formats)
315
+
316
+ def remove_user_account(self, username, **kwargs): # noqa: E501
317
+ """Remove a user account from the system # noqa: E501
318
+
319
+ Remove a user account from the system # noqa: E501
320
+ This method makes a synchronous HTTP request by default. To make an
321
+ asynchronous HTTP request, please pass async_req=True
322
+ >>> thread = api.remove_user_account(username, async_req=True)
323
+ >>> result = thread.get()
324
+
325
+ :param async_req bool
326
+ :param str username: Username (required)
327
+ :return: None
328
+ If the method is called asynchronously,
329
+ returns the request thread.
330
+ """
331
+ kwargs['_return_http_data_only'] = True
332
+ if kwargs.get('async_req'):
333
+ return self.remove_user_account_with_http_info(username, **kwargs) # noqa: E501
334
+ else:
335
+ (data) = self.remove_user_account_with_http_info(username, **kwargs) # noqa: E501
336
+ return data
337
+
338
+ def remove_user_account_with_http_info(self, username, **kwargs): # noqa: E501
339
+ """Remove a user account from the system # noqa: E501
340
+
341
+ Remove a user account from the system # noqa: E501
342
+ This method makes a synchronous HTTP request by default. To make an
343
+ asynchronous HTTP request, please pass async_req=True
344
+ >>> thread = api.remove_user_account_with_http_info(username, async_req=True)
345
+ >>> result = thread.get()
346
+
347
+ :param async_req bool
348
+ :param str username: Username (required)
349
+ :return: None
350
+ If the method is called asynchronously,
351
+ returns the request thread.
352
+ """
353
+
354
+ all_params = ['username'] # noqa: E501
355
+ all_params.append('async_req')
356
+ all_params.append('_return_http_data_only')
357
+ all_params.append('_preload_content')
358
+ all_params.append('_request_timeout')
359
+
360
+ params = locals()
361
+ for key, val in six.iteritems(params['kwargs']):
362
+ if key not in all_params:
363
+ raise TypeError(
364
+ "Got an unexpected keyword argument '%s'"
365
+ " to method remove_user_account" % key
366
+ )
367
+ params[key] = val
368
+ del params['kwargs']
369
+ # verify the required parameter 'username' is set
370
+ if ('username' not in params or
371
+ params['username'] is None):
372
+ raise ValueError("Missing the required parameter `username` when calling `remove_user_account`") # noqa: E501
373
+
374
+ collection_formats = {}
375
+
376
+ path_params = {}
377
+ if 'username' in params:
378
+ path_params['username'] = params['username'] # noqa: E501
379
+
380
+ query_params = []
381
+
382
+ header_params = {}
383
+
384
+ form_params = []
385
+ local_var_files = {}
386
+
387
+ body_params = None
388
+ # Authentication setting
389
+ auth_settings = ['basicAuth'] # noqa: E501
390
+
391
+ return self.api_client.call_api(
392
+ '/users/{username}', 'DELETE',
393
+ path_params,
394
+ query_params,
395
+ header_params,
396
+ body=body_params,
397
+ post_params=form_params,
398
+ files=local_var_files,
399
+ response_type=None, # noqa: E501
400
+ auth_settings=auth_settings,
401
+ async_req=params.get('async_req'),
402
+ _return_http_data_only=params.get('_return_http_data_only'),
403
+ _preload_content=params.get('_preload_content', True),
404
+ _request_timeout=params.get('_request_timeout'),
405
+ collection_formats=collection_formats)
406
+
407
+ def update_user_account(self, body, username, **kwargs): # noqa: E501
408
+ """Update properties of an existing user account # noqa: E501
409
+
410
+ Update properties of an existing user account # noqa: E501
411
+ This method makes a synchronous HTTP request by default. To make an
412
+ asynchronous HTTP request, please pass async_req=True
413
+ >>> thread = api.update_user_account(body, username, async_req=True)
414
+ >>> result = thread.get()
415
+
416
+ :param async_req bool
417
+ :param str body: The user account details to be updated (required)
418
+ :param str username: Username (required)
419
+ :param str x_lockss_request_cookie: The LOCKSS-specific request cookie header
420
+ :return: str
421
+ If the method is called asynchronously,
422
+ returns the request thread.
423
+ """
424
+ kwargs['_return_http_data_only'] = True
425
+ if kwargs.get('async_req'):
426
+ return self.update_user_account_with_http_info(body, username, **kwargs) # noqa: E501
427
+ else:
428
+ (data) = self.update_user_account_with_http_info(body, username, **kwargs) # noqa: E501
429
+ return data
430
+
431
+ def update_user_account_with_http_info(self, body, username, **kwargs): # noqa: E501
432
+ """Update properties of an existing user account # noqa: E501
433
+
434
+ Update properties of an existing user account # noqa: E501
435
+ This method makes a synchronous HTTP request by default. To make an
436
+ asynchronous HTTP request, please pass async_req=True
437
+ >>> thread = api.update_user_account_with_http_info(body, username, async_req=True)
438
+ >>> result = thread.get()
439
+
440
+ :param async_req bool
441
+ :param str body: The user account details to be updated (required)
442
+ :param str username: Username (required)
443
+ :param str x_lockss_request_cookie: The LOCKSS-specific request cookie header
444
+ :return: str
445
+ If the method is called asynchronously,
446
+ returns the request thread.
447
+ """
448
+
449
+ all_params = ['body', 'username', 'x_lockss_request_cookie'] # noqa: E501
450
+ all_params.append('async_req')
451
+ all_params.append('_return_http_data_only')
452
+ all_params.append('_preload_content')
453
+ all_params.append('_request_timeout')
454
+
455
+ params = locals()
456
+ for key, val in six.iteritems(params['kwargs']):
457
+ if key not in all_params:
458
+ raise TypeError(
459
+ "Got an unexpected keyword argument '%s'"
460
+ " to method update_user_account" % key
461
+ )
462
+ params[key] = val
463
+ del params['kwargs']
464
+ # verify the required parameter 'body' is set
465
+ if ('body' not in params or
466
+ params['body'] is None):
467
+ raise ValueError("Missing the required parameter `body` when calling `update_user_account`") # noqa: E501
468
+ # verify the required parameter 'username' is set
469
+ if ('username' not in params or
470
+ params['username'] is None):
471
+ raise ValueError("Missing the required parameter `username` when calling `update_user_account`") # noqa: E501
472
+
473
+ collection_formats = {}
474
+
475
+ path_params = {}
476
+ if 'username' in params:
477
+ path_params['username'] = params['username'] # noqa: E501
478
+
479
+ query_params = []
480
+
481
+ header_params = {}
482
+ if 'x_lockss_request_cookie' in params:
483
+ header_params['X-Lockss-Request-Cookie'] = params['x_lockss_request_cookie'] # noqa: E501
484
+
485
+ form_params = []
486
+ local_var_files = {}
487
+
488
+ body_params = None
489
+ if 'body' in params:
490
+ body_params = params['body']
491
+ # HTTP header `Accept`
492
+ header_params['Accept'] = self.api_client.select_header_accept(
493
+ ['application/json']) # noqa: E501
494
+
495
+ # HTTP header `Content-Type`
496
+ header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
497
+ ['application/json']) # noqa: E501
498
+
499
+ # Authentication setting
500
+ auth_settings = ['basicAuth'] # noqa: E501
501
+
502
+ return self.api_client.call_api(
503
+ '/users/{username}', 'PATCH',
504
+ path_params,
505
+ query_params,
506
+ header_params,
507
+ body=body_params,
508
+ post_params=form_params,
509
+ files=local_var_files,
510
+ response_type='str', # noqa: E501
511
+ auth_settings=auth_settings,
512
+ async_req=params.get('async_req'),
513
+ _return_http_data_only=params.get('_return_http_data_only'),
514
+ _preload_content=params.get('_preload_content', True),
515
+ _request_timeout=params.get('_request_timeout'),
516
+ collection_formats=collection_formats)
@@ -0,0 +1,128 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ LOCKSS Configuration Service REST API
5
+
6
+ REST API of the LOCKSS Configuration Service # noqa: E501
7
+
8
+ OpenAPI spec version: 2.0.0
9
+ Contact: lockss-support@lockss.org
10
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
11
+ """
12
+
13
+ from __future__ import absolute_import
14
+
15
+ import re # noqa: F401
16
+
17
+ # python 2 and python 3 compatibility library
18
+ import six
19
+
20
+ from lockss.pyclient.config.api_client import ApiClient
21
+
22
+
23
+ class UtilsApi(object):
24
+ """NOTE: This class is auto generated by the swagger code generator program.
25
+
26
+ Do not edit the class manually.
27
+ Ref: https://github.com/swagger-api/swagger-codegen
28
+ """
29
+
30
+ def __init__(self, api_client=None):
31
+ if api_client is None:
32
+ api_client = ApiClient()
33
+ self.api_client = api_client
34
+
35
+ def normalize_url(self, url, **kwargs): # noqa: E501
36
+ """Normalize URL # noqa: E501
37
+
38
+ Performs a LOCKSS URL normalization # 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.normalize_url(url, async_req=True)
42
+ >>> result = thread.get()
43
+
44
+ :param async_req bool
45
+ :param str url: URL to normalize (required)
46
+ :return: list[str]
47
+ If the method is called asynchronously,
48
+ returns the request thread.
49
+ """
50
+ kwargs['_return_http_data_only'] = True
51
+ if kwargs.get('async_req'):
52
+ return self.normalize_url_with_http_info(url, **kwargs) # noqa: E501
53
+ else:
54
+ (data) = self.normalize_url_with_http_info(url, **kwargs) # noqa: E501
55
+ return data
56
+
57
+ def normalize_url_with_http_info(self, url, **kwargs): # noqa: E501
58
+ """Normalize URL # noqa: E501
59
+
60
+ Performs a LOCKSS URL normalization # noqa: E501
61
+ This method makes a synchronous HTTP request by default. To make an
62
+ asynchronous HTTP request, please pass async_req=True
63
+ >>> thread = api.normalize_url_with_http_info(url, async_req=True)
64
+ >>> result = thread.get()
65
+
66
+ :param async_req bool
67
+ :param str url: URL to normalize (required)
68
+ :return: list[str]
69
+ If the method is called asynchronously,
70
+ returns the request thread.
71
+ """
72
+
73
+ all_params = ['url'] # noqa: E501
74
+ all_params.append('async_req')
75
+ all_params.append('_return_http_data_only')
76
+ all_params.append('_preload_content')
77
+ all_params.append('_request_timeout')
78
+
79
+ params = locals()
80
+ for key, val in six.iteritems(params['kwargs']):
81
+ if key not in all_params:
82
+ raise TypeError(
83
+ "Got an unexpected keyword argument '%s'"
84
+ " to method normalize_url" % key
85
+ )
86
+ params[key] = val
87
+ del params['kwargs']
88
+ # verify the required parameter 'url' is set
89
+ if ('url' not in params or
90
+ params['url'] is None):
91
+ raise ValueError("Missing the required parameter `url` when calling `normalize_url`") # noqa: E501
92
+
93
+ collection_formats = {}
94
+
95
+ path_params = {}
96
+
97
+ query_params = []
98
+ if 'url' in params:
99
+ query_params.append(('url', params['url'])) # noqa: E501
100
+
101
+ header_params = {}
102
+
103
+ form_params = []
104
+ local_var_files = {}
105
+
106
+ body_params = None
107
+ # HTTP header `Accept`
108
+ header_params['Accept'] = self.api_client.select_header_accept(
109
+ ['application/json', 'text/plain']) # noqa: E501
110
+
111
+ # Authentication setting
112
+ auth_settings = ['basicAuth'] # noqa: E501
113
+
114
+ return self.api_client.call_api(
115
+ '/utils/normalizeUrl', 'GET',
116
+ path_params,
117
+ query_params,
118
+ header_params,
119
+ body=body_params,
120
+ post_params=form_params,
121
+ files=local_var_files,
122
+ response_type='list[str]', # noqa: E501
123
+ auth_settings=auth_settings,
124
+ async_req=params.get('async_req'),
125
+ _return_http_data_only=params.get('_return_http_data_only'),
126
+ _preload_content=params.get('_preload_content', True),
127
+ _request_timeout=params.get('_request_timeout'),
128
+ collection_formats=collection_formats)