collections_api.py•76.5 kB
# coding: utf-8
"""
Alteryx Server API V3
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3
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 src.server_client.api_client import ApiClient
class CollectionsApi(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 collections_add_schedule_to_collection(self, collection_id, contract, **kwargs): # noqa: E501
"""Add a schedule to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_schedule_to_collection(collection_id, contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddScheduleContract contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_add_schedule_to_collection_with_http_info(collection_id, contract, **kwargs) # noqa: E501
else:
(data) = self.collections_add_schedule_to_collection_with_http_info(collection_id, contract, **kwargs) # noqa: E501
return data
def collections_add_schedule_to_collection_with_http_info(self, collection_id, contract, **kwargs): # noqa: E501
"""Add a schedule to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_schedule_to_collection_with_http_info(collection_id, contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddScheduleContract contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "contract"] # 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 collections_add_schedule_to_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_add_schedule_to_collection`"
) # noqa: E501
# verify the required parameter 'contract' is set
if self.api_client.client_side_validation and ("contract" not in params or params["contract"] is None): # noqa: E501
raise ValueError(
"Missing the required parameter `contract` when calling `collections_add_schedule_to_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "contract" in params:
body_params = params["contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/schedules",
"POST",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_add_user_group_to_collection(self, collection_id, add_user_groups_contract, **kwargs): # noqa: E501
"""Add a user group to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_user_group_to_collection(collection_id, add_user_groups_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddUserGroupContract add_user_groups_contract: User Group and permissions information. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_add_user_group_to_collection_with_http_info(
collection_id, add_user_groups_contract, **kwargs
) # noqa: E501
else:
(data) = self.collections_add_user_group_to_collection_with_http_info(
collection_id, add_user_groups_contract, **kwargs
) # noqa: E501
return data
def collections_add_user_group_to_collection_with_http_info(
self, collection_id, add_user_groups_contract, **kwargs
): # noqa: E501
"""Add a user group to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_user_group_to_collection_with_http_info(collection_id, add_user_groups_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddUserGroupContract add_user_groups_contract: User Group and permissions information. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "add_user_groups_contract"] # 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 collections_add_user_group_to_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_add_user_group_to_collection`"
) # noqa: E501
# verify the required parameter 'add_user_groups_contract' is set
if self.api_client.client_side_validation and (
"add_user_groups_contract" not in params or params["add_user_groups_contract"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `add_user_groups_contract` when calling `collections_add_user_group_to_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "add_user_groups_contract" in params:
body_params = params["add_user_groups_contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/userGroups",
"POST",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_add_user_to_collection(self, collection_id, add_users_contract, **kwargs): # noqa: E501
"""Add a user to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_user_to_collection(collection_id, add_users_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddUserContract add_users_contract: User and permissions information. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_add_user_to_collection_with_http_info(collection_id, add_users_contract, **kwargs) # noqa: E501
else:
(data) = self.collections_add_user_to_collection_with_http_info(collection_id, add_users_contract, **kwargs) # noqa: E501
return data
def collections_add_user_to_collection_with_http_info(self, collection_id, add_users_contract, **kwargs): # noqa: E501
"""Add a user to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_user_to_collection_with_http_info(collection_id, add_users_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddUserContract add_users_contract: User and permissions information. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "add_users_contract"] # 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 collections_add_user_to_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_add_user_to_collection`"
) # noqa: E501
# verify the required parameter 'add_users_contract' is set
if self.api_client.client_side_validation and (
"add_users_contract" not in params or params["add_users_contract"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `add_users_contract` when calling `collections_add_user_to_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "add_users_contract" in params:
body_params = params["add_users_contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/users",
"POST",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_add_workflow_to_collection(self, collection_id, contract, **kwargs): # noqa: E501
"""Add a workflow to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_workflow_to_collection(collection_id, contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddWorkflowContract contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_add_workflow_to_collection_with_http_info(collection_id, contract, **kwargs) # noqa: E501
else:
(data) = self.collections_add_workflow_to_collection_with_http_info(collection_id, contract, **kwargs) # noqa: E501
return data
def collections_add_workflow_to_collection_with_http_info(self, collection_id, contract, **kwargs): # noqa: E501
"""Add a workflow to an existing collection. # noqa: E501
Only Curators can use this API 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.collections_add_workflow_to_collection_with_http_info(collection_id, contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param AddWorkflowContract contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "contract"] # 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 collections_add_workflow_to_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_add_workflow_to_collection`"
) # noqa: E501
# verify the required parameter 'contract' is set
if self.api_client.client_side_validation and ("contract" not in params or params["contract"] is None): # noqa: E501
raise ValueError(
"Missing the required parameter `contract` when calling `collections_add_workflow_to_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "contract" in params:
body_params = params["contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/workflows",
"POST",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_create_collection(self, contract, **kwargs): # noqa: E501
"""Create a new collection. # noqa: E501
Only Curators can use this API endpoint. The authenticated API user must have the \"Create Collections\" permission to use this endpoint, else 401 Unauthorized will be returned. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.collections_create_collection(contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param CreateCollectionContract contract: (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.collections_create_collection_with_http_info(contract, **kwargs) # noqa: E501
else:
(data) = self.collections_create_collection_with_http_info(contract, **kwargs) # noqa: E501
return data
def collections_create_collection_with_http_info(self, contract, **kwargs): # noqa: E501
"""Create a new collection. # noqa: E501
Only Curators can use this API endpoint. The authenticated API user must have the \"Create Collections\" permission to use this endpoint, else 401 Unauthorized will be returned. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.collections_create_collection_with_http_info(contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param CreateCollectionContract contract: (required)
:return: str
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["contract"] # 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 collections_create_collection" % key)
params[key] = val
del params["kwargs"]
# verify the required parameter 'contract' is set
if self.api_client.client_side_validation and ("contract" not in params or params["contract"] is None): # noqa: E501
raise ValueError("Missing the required parameter `contract` when calling `collections_create_collection`") # noqa: E501
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "contract" in params:
body_params = params["contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections",
"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 collections_delete_collection(self, collection_id, **kwargs): # noqa: E501
"""Delete an existing collection. # noqa: E501
Only Curators can use this API 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.collections_delete_collection(collection_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param bool force_delete:
: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.collections_delete_collection_with_http_info(collection_id, **kwargs) # noqa: E501
else:
(data) = self.collections_delete_collection_with_http_info(collection_id, **kwargs) # noqa: E501
return data
def collections_delete_collection_with_http_info(self, collection_id, **kwargs): # noqa: E501
"""Delete an existing collection. # noqa: E501
Only Curators can use this API 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.collections_delete_collection_with_http_info(collection_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param bool force_delete:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "force_delete"] # 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 collections_delete_collection" % key)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_delete_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
query_params = []
if "force_delete" in params:
query_params.append(("forceDelete", params["force_delete"])) # 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/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}",
"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 collections_get_collection(self, collection_id, **kwargs): # noqa: E501
"""Retrieve details about an existing collection. # noqa: E501
Only Curators can use this API 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.collections_get_collection(collection_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_get_collection_with_http_info(collection_id, **kwargs) # noqa: E501
else:
(data) = self.collections_get_collection_with_http_info(collection_id, **kwargs) # noqa: E501
return data
def collections_get_collection_with_http_info(self, collection_id, **kwargs): # noqa: E501
"""Retrieve details about an existing collection. # noqa: E501
Only Curators can use this API 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.collections_get_collection_with_http_info(collection_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_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 collections_get_collection" % key)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError("Missing the required parameter `collection_id` when calling `collections_get_collection`") # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_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", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}",
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_get_collections(self, **kwargs): # noqa: E501
"""Retrieve all accessible collection records. # noqa: E501
Only Curators can use this API 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.collections_get_collections(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str view:
:return: list[ReducedCollectionView]
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_get_collections_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.collections_get_collections_with_http_info(**kwargs) # noqa: E501
return data
def collections_get_collections_with_http_info(self, **kwargs): # noqa: E501
"""Retrieve all accessible collection records. # noqa: E501
Only Curators can use this API 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.collections_get_collections_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param str view:
:return: list[ReducedCollectionView]
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["view"] # 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 collections_get_collections" % key)
params[key] = val
del params["kwargs"]
collection_formats = {}
path_params = {}
query_params = []
if "view" in params:
query_params.append(("view", params["view"])) # 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/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections",
"GET",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="list[ReducedCollectionView]", # 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 collections_remove_schedule_from_collection(self, collection_id, schedule_id, **kwargs): # noqa: E501
"""Remove a schedule from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_schedule_from_collection(collection_id, schedule_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str schedule_id: Identifier for an existing schedule. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_remove_schedule_from_collection_with_http_info(collection_id, schedule_id, **kwargs) # noqa: E501
else:
(data) = self.collections_remove_schedule_from_collection_with_http_info(
collection_id, schedule_id, **kwargs
) # noqa: E501
return data
def collections_remove_schedule_from_collection_with_http_info(self, collection_id, schedule_id, **kwargs): # noqa: E501
"""Remove a schedule from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_schedule_from_collection_with_http_info(collection_id, schedule_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str schedule_id: Identifier for an existing schedule. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "schedule_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 collections_remove_schedule_from_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_remove_schedule_from_collection`"
) # noqa: E501
# verify the required parameter 'schedule_id' is set
if self.api_client.client_side_validation and ("schedule_id" not in params or params["schedule_id"] is None): # noqa: E501
raise ValueError(
"Missing the required parameter `schedule_id` when calling `collections_remove_schedule_from_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
if "schedule_id" in params:
path_params["scheduleId"] = params["schedule_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", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/schedules/{scheduleId}",
"DELETE",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_remove_user_from_collection(self, collection_id, user_id, **kwargs): # noqa: E501
"""Remove a user from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_user_from_collection(collection_id, user_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_id: Identifier for an existing user. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_remove_user_from_collection_with_http_info(collection_id, user_id, **kwargs) # noqa: E501
else:
(data) = self.collections_remove_user_from_collection_with_http_info(collection_id, user_id, **kwargs) # noqa: E501
return data
def collections_remove_user_from_collection_with_http_info(self, collection_id, user_id, **kwargs): # noqa: E501
"""Remove a user from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_user_from_collection_with_http_info(collection_id, user_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_id: Identifier for an existing user. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "user_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 collections_remove_user_from_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_remove_user_from_collection`"
) # noqa: E501
# verify the required parameter 'user_id' is set
if self.api_client.client_side_validation and ("user_id" not in params or params["user_id"] is None): # noqa: E501
raise ValueError(
"Missing the required parameter `user_id` when calling `collections_remove_user_from_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
if "user_id" in params:
path_params["userId"] = params["user_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", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/users/{userId}",
"DELETE",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_remove_user_group_from_collection(self, collection_id, user_group_id, **kwargs): # noqa: E501
"""Remove a user group from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_user_group_from_collection(collection_id, user_group_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_group_id: Identifier for an existing user group. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_remove_user_group_from_collection_with_http_info(
collection_id, user_group_id, **kwargs
) # noqa: E501
else:
(data) = self.collections_remove_user_group_from_collection_with_http_info(
collection_id, user_group_id, **kwargs
) # noqa: E501
return data
def collections_remove_user_group_from_collection_with_http_info(self, collection_id, user_group_id, **kwargs): # noqa: E501
"""Remove a user group from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_user_group_from_collection_with_http_info(collection_id, user_group_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_group_id: Identifier for an existing user group. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "user_group_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 collections_remove_user_group_from_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_remove_user_group_from_collection`"
) # noqa: E501
# verify the required parameter 'user_group_id' is set
if self.api_client.client_side_validation and (
"user_group_id" not in params or params["user_group_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `user_group_id` when calling `collections_remove_user_group_from_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
if "user_group_id" in params:
path_params["userGroupId"] = params["user_group_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", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/userGroups/{userGroupId}",
"DELETE",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_remove_workflow_from_collection(self, collection_id, workflow_id, **kwargs): # noqa: E501
"""Remove a workflow from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_workflow_from_collection(collection_id, workflow_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str workflow_id: Identifier for an existing workflow or app. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_remove_workflow_from_collection_with_http_info(collection_id, workflow_id, **kwargs) # noqa: E501
else:
(data) = self.collections_remove_workflow_from_collection_with_http_info(
collection_id, workflow_id, **kwargs
) # noqa: E501
return data
def collections_remove_workflow_from_collection_with_http_info(self, collection_id, workflow_id, **kwargs): # noqa: E501
"""Remove a workflow from an existing collection. # noqa: E501
Only Curators can use this API 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.collections_remove_workflow_from_collection_with_http_info(collection_id, workflow_id, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str workflow_id: Identifier for an existing workflow or app. (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "workflow_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 collections_remove_workflow_from_collection" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_remove_workflow_from_collection`"
) # noqa: E501
# verify the required parameter 'workflow_id' is set
if self.api_client.client_side_validation and ("workflow_id" not in params or params["workflow_id"] is None): # noqa: E501
raise ValueError(
"Missing the required parameter `workflow_id` when calling `collections_remove_workflow_from_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
if "workflow_id" in params:
path_params["workflowId"] = params["workflow_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", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/workflows/{workflowId}",
"DELETE",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_update_collection(self, collection_id, update_collection_contract, **kwargs): # noqa: E501
"""Update the name and/or owner of an existing collection. # noqa: E501
Only Curators can use this API 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.collections_update_collection(collection_id, update_collection_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param UpdateCollectionContract update_collection_contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_update_collection_with_http_info(
collection_id, update_collection_contract, **kwargs
) # noqa: E501
else:
(data) = self.collections_update_collection_with_http_info(
collection_id, update_collection_contract, **kwargs
) # noqa: E501
return data
def collections_update_collection_with_http_info(self, collection_id, update_collection_contract, **kwargs): # noqa: E501
"""Update the name and/or owner of an existing collection. # noqa: E501
Only Curators can use this API 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.collections_update_collection_with_http_info(collection_id, update_collection_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param UpdateCollectionContract update_collection_contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "update_collection_contract"] # 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 collections_update_collection" % key)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_update_collection`"
) # noqa: E501
# verify the required parameter 'update_collection_contract' is set
if self.api_client.client_side_validation and (
"update_collection_contract" not in params or params["update_collection_contract"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `update_collection_contract` when calling `collections_update_collection`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "update_collection_contract" in params:
body_params = params["update_collection_contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}",
"PUT",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_update_collection_user_group_permissions(
self, collection_id, user_group_id, update_permissions_contract, **kwargs
): # noqa: E501
"""Update a user group's permissions within an existing collection. # noqa: E501
Only Curators can use this API 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.collections_update_collection_user_group_permissions(collection_id, user_group_id, update_permissions_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_group_id: Identifier for an existing user group. (required)
:param UpdatePermissionsContract update_permissions_contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_update_collection_user_group_permissions_with_http_info(
collection_id, user_group_id, update_permissions_contract, **kwargs
) # noqa: E501
else:
(data) = self.collections_update_collection_user_group_permissions_with_http_info(
collection_id, user_group_id, update_permissions_contract, **kwargs
) # noqa: E501
return data
def collections_update_collection_user_group_permissions_with_http_info(
self, collection_id, user_group_id, update_permissions_contract, **kwargs
): # noqa: E501
"""Update a user group's permissions within an existing collection. # noqa: E501
Only Curators can use this API 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.collections_update_collection_user_group_permissions_with_http_info(collection_id, user_group_id, update_permissions_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_group_id: Identifier for an existing user group. (required)
:param UpdatePermissionsContract update_permissions_contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "user_group_id", "update_permissions_contract"] # 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 collections_update_collection_user_group_permissions" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_update_collection_user_group_permissions`"
) # noqa: E501
# verify the required parameter 'user_group_id' is set
if self.api_client.client_side_validation and (
"user_group_id" not in params or params["user_group_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `user_group_id` when calling `collections_update_collection_user_group_permissions`"
) # noqa: E501
# verify the required parameter 'update_permissions_contract' is set
if self.api_client.client_side_validation and (
"update_permissions_contract" not in params or params["update_permissions_contract"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `update_permissions_contract` when calling `collections_update_collection_user_group_permissions`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
if "user_group_id" in params:
path_params["userGroupId"] = params["user_group_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "update_permissions_contract" in params:
body_params = params["update_permissions_contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/userGroups/{userGroupId}/permissions",
"PUT",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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 collections_update_collection_user_permissions(
self, collection_id, user_id, update_permissions_contract, **kwargs
): # noqa: E501
"""Update a user's permissions within an existing collection. # noqa: E501
Only Curators can use this API endpoint. For Windows Authentication configured Server instances, provide the Active Directory Sid for the userId parameter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.collections_update_collection_user_permissions(collection_id, user_id, update_permissions_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_id: Identifier for an existing user. For Windows Authentication-configured Server instances, the Active Directory sid should be provided instead. (required)
:param UpdatePermissionsContract update_permissions_contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
kwargs["_return_http_data_only"] = True
if kwargs.get("async_req"):
return self.collections_update_collection_user_permissions_with_http_info(
collection_id, user_id, update_permissions_contract, **kwargs
) # noqa: E501
else:
(data) = self.collections_update_collection_user_permissions_with_http_info(
collection_id, user_id, update_permissions_contract, **kwargs
) # noqa: E501
return data
def collections_update_collection_user_permissions_with_http_info(
self, collection_id, user_id, update_permissions_contract, **kwargs
): # noqa: E501
"""Update a user's permissions within an existing collection. # noqa: E501
Only Curators can use this API endpoint. For Windows Authentication configured Server instances, provide the Active Directory Sid for the userId parameter. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.collections_update_collection_user_permissions_with_http_info(collection_id, user_id, update_permissions_contract, async_req=True)
>>> result = thread.get()
:param async_req bool
:param str collection_id: Identifier for an existing collection. (required)
:param str user_id: Identifier for an existing user. For Windows Authentication-configured Server instances, the Active Directory sid should be provided instead. (required)
:param UpdatePermissionsContract update_permissions_contract: (required)
:return: CollectionView
If the method is called asynchronously,
returns the request thread.
"""
all_params = ["collection_id", "user_id", "update_permissions_contract"] # 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 collections_update_collection_user_permissions" % key
)
params[key] = val
del params["kwargs"]
# verify the required parameter 'collection_id' is set
if self.api_client.client_side_validation and (
"collection_id" not in params or params["collection_id"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `collection_id` when calling `collections_update_collection_user_permissions`"
) # noqa: E501
# verify the required parameter 'user_id' is set
if self.api_client.client_side_validation and ("user_id" not in params or params["user_id"] is None): # noqa: E501
raise ValueError(
"Missing the required parameter `user_id` when calling `collections_update_collection_user_permissions`"
) # noqa: E501
# verify the required parameter 'update_permissions_contract' is set
if self.api_client.client_side_validation and (
"update_permissions_contract" not in params or params["update_permissions_contract"] is None
): # noqa: E501
raise ValueError(
"Missing the required parameter `update_permissions_contract` when calling `collections_update_collection_user_permissions`"
) # noqa: E501
collection_formats = {}
path_params = {}
if "collection_id" in params:
path_params["collectionId"] = params["collection_id"] # noqa: E501
if "user_id" in params:
path_params["userId"] = params["user_id"] # noqa: E501
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if "update_permissions_contract" in params:
body_params = params["update_permissions_contract"]
# HTTP header `Accept`
header_params["Accept"] = self.api_client.select_header_accept(
["application/json", "text/json", "application/xml", "text/xml"]
) # noqa: E501
# HTTP header `Content-Type`
header_params["Content-Type"] = self.api_client.select_header_content_type( # noqa: E501
["application/json", "text/json", "application/xml", "text/xml", "application/x-www-form-urlencoded"]
) # noqa: E501
# Authentication setting
auth_settings = ["oauth2"] # noqa: E501
return self.api_client.call_api(
"/v3/collections/{collectionId}/users/{userId}/permissions",
"PUT",
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type="CollectionView", # 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,
)