aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/fatcat/crossref_importer.py2
-rw-r--r--python/fatcat/importer_common.py3
-rw-r--r--python/fatcat/issn_importer.py2
-rw-r--r--python/fatcat/orcid_importer.py2
-rw-r--r--python/fatcat_client/api/default_api.py50
5 files changed, 49 insertions, 10 deletions
diff --git a/python/fatcat/crossref_importer.py b/python/fatcat/crossref_importer.py
index d3e525a4..54a3e84f 100644
--- a/python/fatcat/crossref_importer.py
+++ b/python/fatcat/crossref_importer.py
@@ -152,4 +152,4 @@ class FatcatCrossrefImporter(FatcatImporter):
re.container_id = container.ident
self._issnl_id_map[ce.issnl] = container.ident
release_batch.append(re)
- self.api.create_release_batch(release_batch)
+ self.api.create_release_batch(release_batch, autoaccept="true", editgroup=editgroup_id)
diff --git a/python/fatcat/importer_common.py b/python/fatcat/importer_common.py
index e084d8c4..0b02d175 100644
--- a/python/fatcat/importer_common.py
+++ b/python/fatcat/importer_common.py
@@ -45,8 +45,7 @@ class FatcatImporter:
for rows in grouper(source, size):
eg = self.api.create_editgroup(
fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae'))
- self.create_batch(rows, eg.id)
- self.api.accept_editgroup(eg.id)
+ self.create_batch(rows, editgroup_id=eg.id)
def process_csv_source(self, source, group_size=100, delimiter=','):
reader = csv.DictReader(source, delimiter=delimiter)
diff --git a/python/fatcat/issn_importer.py b/python/fatcat/issn_importer.py
index 181137ac..eb8a50ba 100644
--- a/python/fatcat/issn_importer.py
+++ b/python/fatcat/issn_importer.py
@@ -70,4 +70,4 @@ class FatcatIssnImporter(FatcatImporter):
objects = [o for o in objects if o != None]
for o in objects:
o.editgroup_id = editgroup_id
- self.api.create_container_batch(objects)
+ self.api.create_container_batch(objects, autoaccept="true", editgroup=editgroup_id)
diff --git a/python/fatcat/orcid_importer.py b/python/fatcat/orcid_importer.py
index e57703d5..fe76b02c 100644
--- a/python/fatcat/orcid_importer.py
+++ b/python/fatcat/orcid_importer.py
@@ -71,4 +71,4 @@ class FatcatOrcidImporter(FatcatImporter):
objects = [o for o in objects if o != None]
for o in objects:
o.editgroup_id = editgroup_id
- self.api.create_creator_batch(objects)
+ self.api.create_creator_batch(objects, autoaccept="true", editgroup=editgroup_id)
diff --git a/python/fatcat_client/api/default_api.py b/python/fatcat_client/api/default_api.py
index acd33c88..a0298750 100644
--- a/python/fatcat_client/api/default_api.py
+++ b/python/fatcat_client/api/default_api.py
@@ -245,6 +245,8 @@ class DefaultApi(object):
:param async bool
:param list[ContainerEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
@@ -266,12 +268,14 @@ class DefaultApi(object):
:param async bool
:param list[ContainerEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
"""
- all_params = ['entity_list'] # noqa: E501
+ all_params = ['entity_list', 'autoaccept', 'editgroup'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -296,6 +300,10 @@ class DefaultApi(object):
path_params = {}
query_params = []
+ if 'autoaccept' in params:
+ query_params.append(('autoaccept', params['autoaccept'])) # noqa: E501
+ if 'editgroup' in params:
+ query_params.append(('editgroup', params['editgroup'])) # noqa: E501
header_params = {}
@@ -439,6 +447,8 @@ class DefaultApi(object):
:param async bool
:param list[CreatorEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
@@ -460,12 +470,14 @@ class DefaultApi(object):
:param async bool
:param list[CreatorEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
"""
- all_params = ['entity_list'] # noqa: E501
+ all_params = ['entity_list', 'autoaccept', 'editgroup'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -490,6 +502,10 @@ class DefaultApi(object):
path_params = {}
query_params = []
+ if 'autoaccept' in params:
+ query_params.append(('autoaccept', params['autoaccept'])) # noqa: E501
+ if 'editgroup' in params:
+ query_params.append(('editgroup', params['editgroup'])) # noqa: E501
header_params = {}
@@ -730,6 +746,8 @@ class DefaultApi(object):
:param async bool
:param list[FileEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
@@ -751,12 +769,14 @@ class DefaultApi(object):
:param async bool
:param list[FileEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
"""
- all_params = ['entity_list'] # noqa: E501
+ all_params = ['entity_list', 'autoaccept', 'editgroup'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -781,6 +801,10 @@ class DefaultApi(object):
path_params = {}
query_params = []
+ if 'autoaccept' in params:
+ query_params.append(('autoaccept', params['autoaccept'])) # noqa: E501
+ if 'editgroup' in params:
+ query_params.append(('editgroup', params['editgroup'])) # noqa: E501
header_params = {}
@@ -924,6 +948,8 @@ class DefaultApi(object):
:param async bool
:param list[ReleaseEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
@@ -945,12 +971,14 @@ class DefaultApi(object):
:param async bool
:param list[ReleaseEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
"""
- all_params = ['entity_list'] # noqa: E501
+ all_params = ['entity_list', 'autoaccept', 'editgroup'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -975,6 +1003,10 @@ class DefaultApi(object):
path_params = {}
query_params = []
+ if 'autoaccept' in params:
+ query_params.append(('autoaccept', params['autoaccept'])) # noqa: E501
+ if 'editgroup' in params:
+ query_params.append(('editgroup', params['editgroup'])) # noqa: E501
header_params = {}
@@ -1118,6 +1150,8 @@ class DefaultApi(object):
:param async bool
:param list[WorkEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
@@ -1139,12 +1173,14 @@ class DefaultApi(object):
:param async bool
:param list[WorkEntity] entity_list: (required)
+ :param bool autoaccept: If true, and editor is authorized, batch is accepted all at once
+ :param str editgroup: Editgroup to auto-accept and apply to all entities (required if 'autoaccept' is True)
:return: list[EntityEdit]
If the method is called asynchronously,
returns the request thread.
"""
- all_params = ['entity_list'] # noqa: E501
+ all_params = ['entity_list', 'autoaccept', 'editgroup'] # noqa: E501
all_params.append('async')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
@@ -1169,6 +1205,10 @@ class DefaultApi(object):
path_params = {}
query_params = []
+ if 'autoaccept' in params:
+ query_params.append(('autoaccept', params['autoaccept'])) # noqa: E501
+ if 'editgroup' in params:
+ query_params.append(('editgroup', params['editgroup'])) # noqa: E501
header_params = {}