From 5fd2622e4c008d628696154b58e2bbb485d67d9e Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 29 Sep 2020 15:11:57 +0000 Subject: [PATCH 01/46] #145: Basic implementation of `/count` - Currently breaks when you add a distinct filter so that needs fixing --- common/icat/backend.py | 5 ++++- common/icat/helpers.py | 48 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index a9cacf44..8d66eb01 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -14,6 +14,7 @@ update_entity_by_id, delete_entity_by_id, get_entity_with_filters, + get_count_with_filters, ) from common.config import config @@ -74,6 +75,7 @@ def logout(self, session_id): @requires_session_id @queries_records def get_with_filters(self, session_id, table, filters): + self.client.sessionId = session_id return get_entity_with_filters(self.client, table.__name__, filters) @requires_session_id @@ -94,7 +96,8 @@ def get_one_with_filters(self, session_id, table, filters): @requires_session_id @queries_records def count_with_filters(self, session_id, table, filters): - pass + self.client.sessionId = session_id + return get_count_with_filters(self.client, table.__name__, filters) @requires_session_id @queries_records diff --git a/common/icat/helpers.py b/common/icat/helpers.py index d7183ac8..6d4c34da 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -180,10 +180,16 @@ def execute_query(self, client, return_json_formattable=False): data = [] for result in query_result: - dict_result = self.entity_to_dict( - result, flat_query_includes, mapped_distinct_fields - ) - data.append(dict_result) + log.debug(f"Aggregate: {self.query.aggregate}") + # TODO - How to deal with distinct and count as aggregate + if self.query.aggregate != "COUNT": + + dict_result = self.entity_to_dict( + result, flat_query_includes, mapped_distinct_fields + ) + data.append(dict_result) + else: + data.append(result) return data else: log.info("Query results will be returned as ICAT entities") @@ -677,3 +683,37 @@ def clear_order_filters(filters): if any(isinstance(filter, PythonICATOrderFilter) for filter in filters): PythonICATOrderFilter.result_order = [] + + +def get_count_with_filters(client, table_name, filters): + """ + Get the number of results of a given entity, based on the filters provided in the + request. This acts very much like `get_entity_with_filters()` but returns the number + of results, as opposed to a JSON object of data. + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param table_name: Table name to extract which entity to use + :type table_name: :class:`str` + :param filters: The list of filters to be applied to the request + :type filters: List of specific implementations :class:`QueryFilter` + :return: The number of records of the given entity (of type integer), using the + filters to restrict the result of the query + """ + + selected_entity_name = get_python_icat_entity_name(client, table_name) + query = icat_query(client, selected_entity_name, aggregate="COUNT") + + filter_handler = FilterOrderHandler() + filter_handler.add_filters(filters) + merge_limit_skip_filters(filter_handler) + clear_order_filters(filter_handler.filters) + filter_handler.apply_filters(query.query) + + data = query.execute_query(client, True) + + if not data: + raise MissingRecordError("No results found") + else: + # Only ever 1 element in a count query result + return data[0] From 86c6f27075f89620548efc8aa0f48b737391ac0c Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 29 Sep 2020 16:23:44 +0000 Subject: [PATCH 02/46] #145: Allow /count to work with distinct filters --- common/icat/filters.py | 10 +++++++++- common/icat/helpers.py | 9 ++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/common/icat/filters.py b/common/icat/filters.py index 0b4e9273..4c66046f 100644 --- a/common/icat/filters.py +++ b/common/icat/filters.py @@ -87,7 +87,15 @@ def __init__(self, fields): def apply_filter(self, query): try: log.info("Adding ICAT distinct filter to ICAT query") - query.setAggregate("DISTINCT") + if ( + query.aggregate == "COUNT" + or query.aggregate == "AVG" + or query.aggregate == "SUM" + ): + # Distinct can be combined with other aggregate functions + query.setAggregate(f"{query.aggregate}:DISTINCT") + else: + query.setAggregate("DISTINCT") # Using where filters to identify which fields to apply distinct too for field in self.fields: diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 6d4c34da..13c7f3b8 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -161,8 +161,12 @@ def execute_query(self, client, return_json_formattable=False): flat_query_includes = self.flatten_query_included_fields(self.query.includes) mapped_distinct_fields = None + + # If the query has a COUNT function applied to it, some of these steps can be + # skipped + count_query = True if "COUNT" in self.query.aggregate else False - if self.query.aggregate == "DISTINCT": + if self.query.aggregate == "DISTINCT" and not count_query: log.info("Extracting the distinct fields from query's conditions") # Check query's conditions for the ones created by the distinct filter distinct_attributes = self.iterate_query_conditions_for_distinctiveness() @@ -182,8 +186,7 @@ def execute_query(self, client, return_json_formattable=False): for result in query_result: log.debug(f"Aggregate: {self.query.aggregate}") # TODO - How to deal with distinct and count as aggregate - if self.query.aggregate != "COUNT": - + if not count_query: dict_result = self.entity_to_dict( result, flat_query_includes, mapped_distinct_fields ) From 692ac0f4c0013dba60263634d1b7598924f227e5 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 30 Sep 2020 13:59:52 +0000 Subject: [PATCH 03/46] #145: Fix bug on non-count queries --- common/icat/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 13c7f3b8..35ac65b5 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -164,7 +164,10 @@ def execute_query(self, client, return_json_formattable=False): # If the query has a COUNT function applied to it, some of these steps can be # skipped - count_query = True if "COUNT" in self.query.aggregate else False + count_query = False + if self.query.aggregate is not None: + if "COUNT" in self.query.aggregate: + count_query = True if self.query.aggregate == "DISTINCT" and not count_query: log.info("Extracting the distinct fields from query's conditions") From 0747c5b35a0adb93665d0135b76ff0ea36c23889 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 30 Sep 2020 14:45:48 +0000 Subject: [PATCH 04/46] #145: Implement /findone for all entities --- common/icat/backend.py | 4 ++- common/icat/helpers.py | 59 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index 8d66eb01..122f7d9f 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -15,6 +15,7 @@ delete_entity_by_id, get_entity_with_filters, get_count_with_filters, + get_first_result_with_filters, ) from common.config import config @@ -91,7 +92,8 @@ def update(self, session_id, table, data): @requires_session_id @queries_records def get_one_with_filters(self, session_id, table, filters): - pass + self.client.sessionId = session_id + return get_first_result_with_filters(self.client, table.__name__, filters) @requires_session_id @queries_records diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 35ac65b5..732344aa 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -136,10 +136,12 @@ def __init__( " suggesting an invalid argument" ) - def execute_query(self, client, return_json_formattable=False): + def execute_query( + self, client, return_json_formattable=False, return_first_value_only=False + ): """ - Execute a previously created ICAT Query object and return in the format - specified by the return_json_formattable flag + Execute the ICAT Query object and return in the format specified by the + return_json_formattable flag :param client: ICAT client containing an authenticated user :type client: :class:`icat.client.Client` @@ -149,6 +151,11 @@ def execute_query(self, client, return_json_formattable=False): whether to leave the data in a Python ICAT format (i.e. if it's going to be manipulated at some point) :type return_json_formattable_data: :class:`bool` + :param return_first_value_only: Flag to determine whether the query should only + return the first result in the result set. This is used for /findone + endpoints so the first result is dealt with before breaking the processing + of results and returning the first result only + :type return_first_value_only: :class:`bool` :return: Data (of type list) from the executed query :raises PythonICATError: If an error occurs during query execution """ @@ -161,7 +168,7 @@ def execute_query(self, client, return_json_formattable=False): flat_query_includes = self.flatten_query_included_fields(self.query.includes) mapped_distinct_fields = None - + # If the query has a COUNT function applied to it, some of these steps can be # skipped count_query = False @@ -187,8 +194,6 @@ def execute_query(self, client, return_json_formattable=False): data = [] for result in query_result: - log.debug(f"Aggregate: {self.query.aggregate}") - # TODO - How to deal with distinct and count as aggregate if not count_query: dict_result = self.entity_to_dict( result, flat_query_includes, mapped_distinct_fields @@ -196,6 +201,12 @@ def execute_query(self, client, return_json_formattable=False): data.append(dict_result) else: data.append(result) + + # For /findone endpoints - only need to process the first result as the + # rest won't be sent in the response + if return_first_value_only: + break + return data else: log.info("Query results will be returned as ICAT entities") @@ -613,7 +624,7 @@ def update_entity_by_id(client, table_name, id_, new_data): return get_entity_by_id(client, table_name, id_, True) -def get_entity_with_filters(client, table_name, filters): +def get_entity_with_filters(client, table_name, filters, return_first_value_only=False): """ Gets all the records of a given entity, based on the filters provided in the request @@ -623,9 +634,15 @@ def get_entity_with_filters(client, table_name, filters): :type table_name: :class:`str` :param filters: The list of filters to be applied to the request :type filters: List of specific implementations :class:`QueryFilter` + :param return_first_value_only: Flag to determine whether the query should only + return the first result in the result set. This is used for /findone + endpoints so the first result is dealt with before breaking the processing + of results and returning the first result only + :type return_first_value_only: :class:`bool` :return: The list of records of the given entity, using the filters to restrict the result of the query """ + log.info("Getting entity using request's filters") selected_entity_name = get_python_icat_entity_name(client, table_name) query = icat_query(client, selected_entity_name) @@ -636,7 +653,7 @@ def get_entity_with_filters(client, table_name, filters): clear_order_filters(filter_handler.filters) filter_handler.apply_filters(query.query) - data = query.execute_query(client, True) + data = query.execute_query(client, True, return_first_value_only) if not data: raise MissingRecordError("No results found") @@ -723,3 +740,29 @@ def get_count_with_filters(client, table_name, filters): else: # Only ever 1 element in a count query result return data[0] + + +def get_first_result_with_filters(client, table_name, filters): + """ + Using filters in the request, get results of the given entity, but only show the + first one to the user + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param table_name: Table name to extract which entity to use + :type table_name: :class:`str` + :param filters: The list of filters to be applied to the request + :type filters: List of specific implementations :class:`QueryFilter` + :return: The first record of the given entity, using the filters to restrict the + result of the query + """ + log.info("Getting only first result of an entity, making use of filters in request") + + entity_data = get_entity_with_filters( + client, table_name, filters, return_first_value_only=True + ) + + if not entity_data: + raise MissingRecordError("No results found") + else: + return entity_data From a4baba30c16f3310f763732f221903b5191c2a39 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 1 Oct 2020 15:37:29 +0000 Subject: [PATCH 05/46] #145: Remove to_dict() conversion on PATCH entity endpoints - Python ICAT backend doesn't need this conversion, so this has been moved into the relevant DB backend helper function --- common/database/helpers.py | 4 ++-- src/resources/entities/entity_endpoint.py | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/common/database/helpers.py b/common/database/helpers.py index f4e0d217..7d87b412 100644 --- a/common/database/helpers.py +++ b/common/database/helpers.py @@ -426,14 +426,14 @@ def patch_entities(table, json_list): if key.upper() == "ID": update_row_from_id(table, json_list[key], json_list) result = get_row_by_id(table, json_list[key]) - results.append(result) + results.append(result.to_dict()) else: for entity in json_list: for key in entity: if key.upper() == "ID": update_row_from_id(table, entity[key], entity) result = get_row_by_id(table, entity[key]) - results.append(result) + results.append(result.to_dict()) if len(results) == 0: raise BadRequestError(f" Bad request made, request: {json_list}") diff --git a/src/resources/entities/entity_endpoint.py b/src/resources/entities/entity_endpoint.py index cd742d49..9777ba48 100644 --- a/src/resources/entities/entity_endpoint.py +++ b/src/resources/entities/entity_endpoint.py @@ -108,13 +108,8 @@ def post(self): def patch(self): return ( - list( - map( - lambda x: x.to_dict(), - backend.update( - get_session_id_from_auth_header(), table, request.json - ), - ) + backend.update( + get_session_id_from_auth_header(), table, request.json ), 200, ) From d3a0f0bebbb9f135643fd628e2b56efe6959b876 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 1 Oct 2020 16:33:48 +0000 Subject: [PATCH 06/46] #145: Fix bug where GET requests without distinct filter sometimes return a 400 --- common/icat/helpers.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 732344aa..44037b77 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -293,9 +293,13 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): " cause an issue further on in the request" ) if isinstance(target, Entity): - distinct_fields_copy = self.prepare_distinct_fields_for_recursion( - key, distinct_fields - ) + if distinct_fields is not None: + distinct_fields_copy = self.prepare_distinct_fields_for_recursion( + key, distinct_fields + ) + else: + distinct_fields_copy = None + d[key] = self.entity_to_dict( target, includes_copy, distinct_fields_copy ) @@ -304,9 +308,13 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): elif isinstance(target, EntityList): d[key] = [] for e in target: - distinct_fields_copy = self.prepare_distinct_fields_for_recursion( - key, distinct_fields - ) + if distinct_fields is not None: + distinct_fields_copy = self.prepare_distinct_fields_for_recursion( + key, distinct_fields + ) + else: + distinct_fields_copy = None + d[key].append( self.entity_to_dict(e, includes_copy, distinct_fields_copy) ) From 4f549bce1c8977831abb883c85b0cd80791794d8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 1 Oct 2020 16:39:59 +0000 Subject: [PATCH 07/46] #145: Add basic implementation of updating multiple entities in one request - This works some of the time, but not all as of this commit --- common/icat/backend.py | 4 +++- common/icat/helpers.py | 33 +++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index 122f7d9f..f9153d19 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -16,6 +16,7 @@ get_entity_with_filters, get_count_with_filters, get_first_result_with_filters, + update_entities, ) from common.config import config @@ -87,7 +88,8 @@ def create(self, session_id, table, data): @requires_session_id @queries_records def update(self, session_id, table, data): - pass + self.client.sessionId = session_id + return update_entities(self.client, table.__name__, data) @requires_session_id @queries_records diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 44037b77..f6ad810c 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -4,7 +4,7 @@ from icat.entity import Entity, EntityList from icat.query import Query -from icat.exception import ICATSessionError, ICATValidationError +from icat.exception import ICATSessionError, ICATValidationError, ICATInternalError from common.exceptions import ( AuthenticationError, BadRequestError, @@ -163,7 +163,7 @@ def execute_query( try: log.debug("Executing ICAT query") query_result = client.search(self.query) - except ICATValidationError as e: + except (ICATValidationError, ICATInternalError) as e: raise PythonICATError(e) flat_query_includes = self.flatten_query_included_fields(self.query.includes) @@ -538,7 +538,7 @@ def update_attributes(old_entity, new_entity): except AttributeError: raise BadRequestError( f"Bad request made, cannot find attribute '{key}' within the" - f"{old_entity.BeanName} entity" + f" {old_entity.BeanName} entity" ) try: @@ -551,7 +551,7 @@ def update_attributes(old_entity, new_entity): try: old_entity.update() - except ICATValidationError as e: + except (ICATValidationError, ICATInternalError) as e: raise PythonICATError(e) @@ -774,3 +774,28 @@ def get_first_result_with_filters(client, table_name, filters): raise MissingRecordError("No results found") else: return entity_data + + +def update_entities(client, table_name, data_to_update): + """ + TODO - Add docstring + """ + + updated_data = [] + + if not isinstance(data_to_update, list): + data_to_update = [data_to_update] + + for entity in data_to_update: + try: + updated_result = update_entity_by_id( + client, table_name, entity["id"], entity + ) + updated_data.append(updated_result) + except KeyError: + raise BadRequestError( + "The new data in the request body must contain the ID (using the key:" + " 'id') of the entity you wish to update" + ) + + return updated_data From 2970dde9478bdf9f5ab334a638a3f9f11c2cb03f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 1 Oct 2020 16:55:36 +0000 Subject: [PATCH 08/46] #145: Prevent related entities from displaying in response of a PATCH request - Related entities (i.e. includes="1") must be retrieved when updating data to avoid an IcatException which highlights that a related entity field is trying to be set to null which is invalid --- common/icat/helpers.py | 18 ++++++++++++++---- src/resources/entities/entity_endpoint.py | 4 +--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index f6ad810c..43b733d3 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -555,7 +555,9 @@ def update_attributes(old_entity, new_entity): raise PythonICATError(e) -def get_entity_by_id(client, table_name, id_, return_json_formattable_data): +def get_entity_by_id( + client, table_name, id_, return_json_formattable_data, return_related_entities=False +): """ Gets a record of a given ID from the specified entity @@ -570,6 +572,11 @@ def get_entity_by_id(client, table_name, id_, return_json_formattable_data): data will be used as a response for an API call) or whether to leave the data in a Python ICAT format :type return_json_formattable_data: :class:`bool` + :param return_related_entities: Flag to determine whether related entities should + automatically be returned or not. Returning related entities used as a bug fix + for an `IcatException` where ICAT attempts to set a field to null because said + field hasn't been included in the updated data + :type return_related_entities: :class:`bool` :return: The record of the specified ID from the given entity :raises: MissingRecordError: If Python ICAT cannot find a record of the specified ID """ @@ -578,8 +585,9 @@ def get_entity_by_id(client, table_name, id_, return_json_formattable_data): # Set query condition for the selected ID id_condition = PythonICATWhereFilter.create_condition("id", "=", id_) + includes_value = "1" if return_related_entities == True else None id_query = icat_query( - client, selected_entity_name, conditions=id_condition, includes="1" + client, selected_entity_name, conditions=id_condition, includes=includes_value ) entity_by_id_data = id_query.execute_query(client, return_json_formattable_data) @@ -621,7 +629,9 @@ def update_entity_by_id(client, table_name, id_, new_data): :return: The updated record of the specified ID from the given entity """ - entity_id_data = get_entity_by_id(client, table_name, id_, False) + entity_id_data = get_entity_by_id( + client, table_name, id_, False, return_related_entities=True + ) # There will only ever be one record associated with a single ID - if a record with # the specified ID cannot be found, it'll be picked up by the MissingRecordError in # get_entity_by_id() @@ -797,5 +807,5 @@ def update_entities(client, table_name, data_to_update): "The new data in the request body must contain the ID (using the key:" " 'id') of the entity you wish to update" ) - + return updated_data diff --git a/src/resources/entities/entity_endpoint.py b/src/resources/entities/entity_endpoint.py index 9777ba48..0addd080 100644 --- a/src/resources/entities/entity_endpoint.py +++ b/src/resources/entities/entity_endpoint.py @@ -108,9 +108,7 @@ def post(self): def patch(self): return ( - backend.update( - get_session_id_from_auth_header(), table, request.json - ), + backend.update(get_session_id_from_auth_header(), table, request.json), 200, ) From b33de8a8834436d405c97496fa1f208e7dd46709 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 5 Oct 2020 15:35:46 +0000 Subject: [PATCH 09/46] #145: Add docstring for ICAT PATCH helper function --- common/icat/helpers.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 43b733d3..a9b3ec6f 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -788,7 +788,16 @@ def get_first_result_with_filters(client, table_name, filters): def update_entities(client, table_name, data_to_update): """ - TODO - Add docstring + Update one or more results for the given entity using the JSON provided in + `data_to_update` + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param table_name: Table name to extract which entity to use + :type table_name: :class:`str` + :param data_to_update: The list of filters to be applied to the request + :type data_to_update: :class:`list` or :class:`dict` + :return: The updated record(s) of the given entity """ updated_data = [] From 944b877e6d6263a1e260e40f9c7d551c7201d33c Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 7 Oct 2020 08:19:43 +0000 Subject: [PATCH 10/46] #145: Add first implementation of POST request (create) for entities - This has only been tested on /investigations so far, so further changes may be needed when I test on the rest of the entities --- common/icat/backend.py | 4 ++- common/icat/helpers.py | 73 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index f9153d19..0bc6f1a2 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -17,6 +17,7 @@ get_count_with_filters, get_first_result_with_filters, update_entities, + create_entities, ) from common.config import config @@ -83,7 +84,8 @@ def get_with_filters(self, session_id, table, filters): @requires_session_id @queries_records def create(self, session_id, table, data): - pass + self.client.sessionId = session_id + return create_entities(self.client, table.__name__, data) @requires_session_id @queries_records diff --git a/common/icat/helpers.py b/common/icat/helpers.py index a9b3ec6f..214ecaad 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -1,10 +1,16 @@ from functools import wraps import logging from datetime import datetime, timedelta +from dateutil.parser import parse from icat.entity import Entity, EntityList from icat.query import Query -from icat.exception import ICATSessionError, ICATValidationError, ICATInternalError +from icat.exception import ( + ICATSessionError, + ICATValidationError, + ICATInternalError, + ICATObjectExistsError, +) from common.exceptions import ( AuthenticationError, BadRequestError, @@ -795,7 +801,7 @@ def update_entities(client, table_name, data_to_update): :type client: :class:`icat.client.Client` :param table_name: Table name to extract which entity to use :type table_name: :class:`str` - :param data_to_update: The list of filters to be applied to the request + :param data_to_update: The data that to be updated in ICAT :type data_to_update: :class:`list` or :class:`dict` :return: The updated record(s) of the given entity """ @@ -818,3 +824,66 @@ def update_entities(client, table_name, data_to_update): ) return updated_data + + +def create_entities(client, table_name, data): + """ + Add one or more results for the given entity using the JSON provided in `data` + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param table_name: Table name to extract which entity to use + :type table_name: :class:`str` + :param data: The data that needs to be created in ICAT + :type data_to_update: :class:`list` or :class:`dict` + :return: The created record(s) of the given entity + """ + + created_data = [] + + if not isinstance(data, list): + data = [data] + + for result in data: + new_entity = client.new(table_name.lower()) + + for attribute_name, value in result.items(): + try: + entity_info = new_entity.getAttrInfo(client, attribute_name) + if entity_info.relType.lower() == "attribute": + if is_str_a_date(value): + value = str_to_datetime_object(None, value) + + setattr(new_entity, attribute_name, value) + + else: + # This means the attribute has a relationship with another object + related_object = client.get(entity_info.type, value) + setattr(new_entity, attribute_name, related_object) + + except ValueError as e: + raise BadRequestError(e) + + try: + new_entity.create() + except (ICATValidationError, ICATInternalError) as e: + raise PythonICATError(e) + except ICATObjectExistsError as e: + raise BadRequestError(e) + + created_data.append(get_entity_by_id(client, table_name, new_entity.id, True)) + + return created_data + + +def is_str_a_date(potential_date): + """ + TODO - Add docstring + """ + + try: + # Disabled fuzzy to avoid picking up dates in things like descriptions etc. + parse(potential_date, fuzzy=False) + return True + except ValueError: + return False From 5cb5068c30a282ccf1cf1d92c01758a3239899d4 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 08:18:43 +0000 Subject: [PATCH 11/46] #145: Allow Python ICAT names to be fetched as camelCase - This is required for created ICAT objects in Python ICAT --- common/icat/helpers.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 214ecaad..a29c3e66 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -4,6 +4,7 @@ from dateutil.parser import parse from icat.entity import Entity, EntityList +from icat.entities import getTypeMap from icat.query import Query from icat.exception import ( ICATSessionError, @@ -451,7 +452,7 @@ def flatten_query_included_fields(self, includes): return [m for n in (field.split(".") for field in includes) for m in n] -def get_python_icat_entity_name(client, database_table_name): +def get_python_icat_entity_name(client, database_table_name, camel_case_output=False): """ From the database table name, this function returns the correctly cased entity name relating to the table name @@ -464,14 +465,23 @@ def get_python_icat_entity_name(client, database_table_name): :type client: :class:`icat.client.Client` :param database_table_name: Table name (from icatdb) to be interacted with :type database_table_name: :class:`str` + :param camel_case_output: Flag to signify if the entity name should be returned in + camel case format. Enabling this flag gets the entity names from a different + place in Python ICAT. + :type camel_case_output: :class:`bool` :return: Entity name (of type string) in the correct casing ready to be passed into Python ICAT :raises BadRequestError: If the entity cannot be found """ + if camel_case_output: + entity_names = getTypeMap(client).keys() + else: + entity_names = client.getEntityNames() + lowercase_table_name = database_table_name.lower() - entity_names = client.getEntityNames() python_icat_entity_name = None + for entity_name in entity_names: lowercase_name = entity_name.lower() @@ -845,7 +855,9 @@ def create_entities(client, table_name, data): data = [data] for result in data: - new_entity = client.new(table_name.lower()) + new_entity = client.new( + get_python_icat_entity_name(client, table_name, camel_case_output=True) + ) for attribute_name, value in result.items(): try: From 5eed66ea64da1b3f7496f382d74c85fdb1a4bb00 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 08:37:07 +0000 Subject: [PATCH 12/46] #145: Remove parameter from str_to_datetime_object() - I've also made use of this in create_entities() which made me notice that said parameter wasn't used --- common/icat/helpers.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index a29c3e66..4fe825e5 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -498,7 +498,7 @@ def get_python_icat_entity_name(client, database_table_name, camel_case_output=F return python_icat_entity_name -def str_to_datetime_object(icat_attribute, data): +def str_to_datetime_object(data): """ Where data is stored as dates in ICAT (which this function determines), convert strings (i.e. user data from PATCH/POST requests) into datetime objects so they can @@ -510,8 +510,6 @@ def str_to_datetime_object(icat_attribute, data): Python 3.6, and it doesn't seem of enough value to mandate 3.7 for a single line of code - :param icat_attribute: Attribute that will be updated with new data - :type icat_attribute: Any valid data type that can be stored in Python ICAT :param data: Single data value from the request body :type data: Data type of the data as per user's request body :return: Date converted into a :class:`datetime` object @@ -548,9 +546,7 @@ def update_attributes(old_entity, new_entity): try: original_data_attribute = getattr(old_entity, key) if isinstance(original_data_attribute, datetime): - new_entity[key] = str_to_datetime_object( - original_data_attribute, new_entity[key] - ) + new_entity[key] = str_to_datetime_object(new_entity[key]) except AttributeError: raise BadRequestError( f"Bad request made, cannot find attribute '{key}' within the" @@ -863,8 +859,9 @@ def create_entities(client, table_name, data): try: entity_info = new_entity.getAttrInfo(client, attribute_name) if entity_info.relType.lower() == "attribute": - if is_str_a_date(value): - value = str_to_datetime_object(None, value) + if isinstance(value, str): + if is_str_a_date(value): + value = str_to_datetime_object(value) setattr(new_entity, attribute_name, value) From 85860ff112b19190819556d4a80ed343a9fc19a8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 08:39:46 +0000 Subject: [PATCH 13/46] #145: Deal with attributes that have MANY relationships - This code needs to be recursed over, since multiple 'levels' of mandatory MANY relationships don't happen currently and this results in a database related error --- common/icat/helpers.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 4fe825e5..df449cb0 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -11,6 +11,7 @@ ICATValidationError, ICATInternalError, ICATObjectExistsError, + ICATNoObjectError, ) from common.exceptions import ( AuthenticationError, @@ -867,7 +868,15 @@ def create_entities(client, table_name, data): else: # This means the attribute has a relationship with another object - related_object = client.get(entity_info.type, value) + log.debug(f"Entity Info: {entity_info}") + try: + related_object = client.get(entity_info.type, value) + except ICATNoObjectError as e: + raise BadRequestError(e) + # TODO - Recurse over related_object and get included entities from + # them + if entity_info.relType.lower() == "many": + related_object = [related_object] setattr(new_entity, attribute_name, related_object) except ValueError as e: From be3c7978fda17fe0abf501b331a0924aca5eb704 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 13:17:29 +0000 Subject: [PATCH 14/46] #145: Remove unused code - Recursing through related objects is no longer required --- common/icat/helpers.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index df449cb0..1e033818 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -865,7 +865,6 @@ def create_entities(client, table_name, data): value = str_to_datetime_object(value) setattr(new_entity, attribute_name, value) - else: # This means the attribute has a relationship with another object log.debug(f"Entity Info: {entity_info}") @@ -873,8 +872,6 @@ def create_entities(client, table_name, data): related_object = client.get(entity_info.type, value) except ICATNoObjectError as e: raise BadRequestError(e) - # TODO - Recurse over related_object and get included entities from - # them if entity_info.relType.lower() == "many": related_object = [related_object] setattr(new_entity, attribute_name, related_object) From d7741f74f390b92f7a95a634976af085050295ad Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 13:18:08 +0000 Subject: [PATCH 15/46] #145: Add exception to be caught when creating ICAT data --- common/icat/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 1e033818..d1864196 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -12,6 +12,7 @@ ICATInternalError, ICATObjectExistsError, ICATNoObjectError, + ICATParameterError, ) from common.exceptions import ( AuthenticationError, @@ -883,7 +884,7 @@ def create_entities(client, table_name, data): new_entity.create() except (ICATValidationError, ICATInternalError) as e: raise PythonICATError(e) - except ICATObjectExistsError as e: + except (ICATObjectExistsError, ICATParameterError) as e: raise BadRequestError(e) created_data.append(get_entity_by_id(client, table_name, new_entity.id, True)) From 2a88aaedc78e68931972064ba389dbeced9a6266 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 13:50:10 +0000 Subject: [PATCH 16/46] #145: Move date-related functions to a separate class - In the future, these could be used by other backends so I've moved these 3 functions into their own utility class. This change helps clean up common.icat.helpers a bit which is another reason this change has been made --- common/date_handler.py | 74 ++++++++++++++++++++++++++++++++++++++++++ common/icat/helpers.py | 69 ++++----------------------------------- 2 files changed, 81 insertions(+), 62 deletions(-) create mode 100644 common/date_handler.py diff --git a/common/date_handler.py b/common/date_handler.py new file mode 100644 index 00000000..5a8d8fe0 --- /dev/null +++ b/common/date_handler.py @@ -0,0 +1,74 @@ +from datetime import datetime +from dateutil.parser import parse + +from common.exceptions import BadRequestError +from common.constants import Constants + + +class DateHandler: + """ + Utility class to deal with dates. Currently, this class converts dates between + strings and `datetime.datetime` objects as well as detecting whether a string is + likely to be a date. + """ + + @staticmethod + def is_str_a_date(potential_date): + """ + This function identifies if a string contains a date. This function doesn't + detect which format the date is, just if there's a date or not. + + :param potential_date: String data that could contain a date of any format + :type potential_date: :class:`str` + :return: Boolean to signify whether `potential_date` is a date or not + """ + + try: + # Disabled fuzzy to avoid picking up dates in things like descriptions etc. + parse(potential_date, fuzzy=False) + return True + except ValueError: + return False + + def str_to_datetime_object(data): + """ + Convert a string to a `datetime.datetime` object. This is commonly used when + storing user input in ICAT (using the Python ICAT backend). + + Python 3.7+ has support for `datetime.fromisoformat()` which would be a more + elegant solution to this conversion operation since dates are converted into ISO + format within this file, however, the production instance of this API is + typically built on Python 3.6, and it doesn't seem of enough value to mandate + 3.7 for a single line of code + + :param data: Single data value from the request body + :type data: Data type of the data as per user's request body + :return: Date converted into a :class:`datetime` object + :raises BadRequestError: If the date is entered in the incorrect format, as per + `Constants.ACCEPTED_DATE_FORMAT` + """ + + try: + data = datetime.strptime(data, Constants.ACCEPTED_DATE_FORMAT) + except ValueError: + raise BadRequestError( + "Bad request made, the date entered is not in the correct format. Use" + f" the {Constants.ACCEPTED_DATE_FORMAT} format to submit dates to the" + " API" + ) + + return data + + @staticmethod + def datetime_object_to_str(date_obj): + """ + Convert a datetime object to a string so it can be outputted in JSON + + There's currently no reason to make this function static, but it could be useful + in the future if a use case required this functionality. + + :param date_obj: Datetime object from data from an ICAT entity + :type date_obj: :class:`datetime.datetime` + :return: Datetime (of type string) in the agreed format + """ + return date_obj.replace(tzinfo=None).strftime(Constants.ACCEPTED_DATE_FORMAT) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index d1864196..d8759302 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -1,7 +1,7 @@ from functools import wraps import logging from datetime import datetime, timedelta -from dateutil.parser import parse + from icat.entity import Entity, EntityList from icat.entities import getTypeMap @@ -22,6 +22,7 @@ PythonICATError, ) from common.filter_order_handler import FilterOrderHandler +from common.date_handler import DateHandler from common.constants import Constants from common.icat.filters import ( PythonICATLimitFilter, @@ -251,19 +252,6 @@ def check_attribute_name_for_distinct(self, attribute_list, key, value): if value == Constants.PYTHON_ICAT_DISTNCT_CONDITION: attribute_list.append(key) - def datetime_object_to_str(self, date_obj): - """ - Convert a datetime object to a string so it can be outputted in JSON - - There's currently no reason to make this function static, but it could be useful - in the future if a use case required this functionality. - - :param date_obj: Datetime object from data from an ICAT entity - :type date_obj: :class:`datetime.datetime` - :return: Datetime (of type string) in the agreed format - """ - return date_obj.replace(tzinfo=None).strftime(Constants.ACCEPTED_DATE_FORMAT) - def entity_to_dict(self, entity, includes, distinct_fields=None): """ This expands on Python ICAT's implementation of `icat.entity.Entity.as_dict()` @@ -336,7 +324,7 @@ def entity_to_dict(self, entity, includes, distinct_fields=None): # Convert datetime objects to strings ready to be outputted as JSON if isinstance(entity_data, datetime): # Remove timezone data which isn't utilised in ICAT - entity_data = self.datetime_object_to_str(entity_data) + entity_data = DateHandler.datetime_object_to_str(entity_data) d[key] = entity_data return d @@ -500,36 +488,6 @@ def get_python_icat_entity_name(client, database_table_name, camel_case_output=F return python_icat_entity_name -def str_to_datetime_object(data): - """ - Where data is stored as dates in ICAT (which this function determines), convert - strings (i.e. user data from PATCH/POST requests) into datetime objects so they can - be stored in ICAT - - Python 3.7+ has support for `datetime.fromisoformat()` which would be a more elegant - solution to this conversion operation since dates are converted into ISO format - within this file, however, the production instance of this API is typically built on - Python 3.6, and it doesn't seem of enough value to mandate 3.7 for a single line of - code - - :param data: Single data value from the request body - :type data: Data type of the data as per user's request body - :return: Date converted into a :class:`datetime` object - :raises BadRequestError: If the date is entered in the incorrect format, as per - `Constants.ACCEPTED_DATE_FORMAT` - """ - - try: - data = datetime.strptime(data, Constants.ACCEPTED_DATE_FORMAT) - except ValueError: - raise BadRequestError( - "Bad request made, the date entered is not in the correct format. Use the" - f" {Constants.ACCEPTED_DATE_FORMAT} format to submit dates to the API" - ) - - return data - - def update_attributes(old_entity, new_entity): """ Updates the attribute(s) of a given object which is a record of an entity from @@ -548,7 +506,7 @@ def update_attributes(old_entity, new_entity): try: original_data_attribute = getattr(old_entity, key) if isinstance(original_data_attribute, datetime): - new_entity[key] = str_to_datetime_object(new_entity[key]) + new_entity[key] = DateHandler.str_to_datetime_object(new_entity[key]) except AttributeError: raise BadRequestError( f"Bad request made, cannot find attribute '{key}' within the" @@ -862,8 +820,8 @@ def create_entities(client, table_name, data): entity_info = new_entity.getAttrInfo(client, attribute_name) if entity_info.relType.lower() == "attribute": if isinstance(value, str): - if is_str_a_date(value): - value = str_to_datetime_object(value) + if DateHandler.is_str_a_date(value): + value = DateHandler.str_to_datetime_object(value) setattr(new_entity, attribute_name, value) else: @@ -886,20 +844,7 @@ def create_entities(client, table_name, data): raise PythonICATError(e) except (ICATObjectExistsError, ICATParameterError) as e: raise BadRequestError(e) - + created_data.append(get_entity_by_id(client, table_name, new_entity.id, True)) return created_data - - -def is_str_a_date(potential_date): - """ - TODO - Add docstring - """ - - try: - # Disabled fuzzy to avoid picking up dates in things like descriptions etc. - parse(potential_date, fuzzy=False) - return True - except ValueError: - return False From 1f866f16a7ead87ea96c50101ad50f2fa21ce0bc Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 8 Oct 2020 13:54:31 +0000 Subject: [PATCH 17/46] #145: Add logging --- common/icat/helpers.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index d8759302..fb5b83d4 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -713,6 +713,10 @@ def get_count_with_filters(client, table_name, filters): :return: The number of records of the given entity (of type integer), using the filters to restrict the result of the query """ + log.info( + "Getting the number of results of %s, also using the request's filters", + table_name, + ) selected_entity_name = get_python_icat_entity_name(client, table_name) query = icat_query(client, selected_entity_name, aggregate="COUNT") @@ -746,7 +750,9 @@ def get_first_result_with_filters(client, table_name, filters): :return: The first record of the given entity, using the filters to restrict the result of the query """ - log.info("Getting only first result of an entity, making use of filters in request") + log.info( + "Getting only first result of %s, making use of filters in request", table_name + ) entity_data = get_entity_with_filters( client, table_name, filters, return_first_value_only=True @@ -771,6 +777,7 @@ def update_entities(client, table_name, data_to_update): :type data_to_update: :class:`list` or :class:`dict` :return: The updated record(s) of the given entity """ + log.info("Updating certain results in %s", table_name) updated_data = [] @@ -804,6 +811,7 @@ def create_entities(client, table_name, data): :type data_to_update: :class:`list` or :class:`dict` :return: The created record(s) of the given entity """ + log.info("Creating ICAT data for %s", table_name) created_data = [] From b8534e437f8ed26d18d1f1f52b1e4edc18987019 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 08:32:47 +0000 Subject: [PATCH 18/46] #145: Make small changes to date handler --- common/date_handler.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/date_handler.py b/common/date_handler.py index 5a8d8fe0..e6e0d00a 100644 --- a/common/date_handler.py +++ b/common/date_handler.py @@ -30,6 +30,7 @@ def is_str_a_date(potential_date): except ValueError: return False + @staticmethod def str_to_datetime_object(data): """ Convert a string to a `datetime.datetime` object. This is commonly used when @@ -64,9 +65,6 @@ def datetime_object_to_str(date_obj): """ Convert a datetime object to a string so it can be outputted in JSON - There's currently no reason to make this function static, but it could be useful - in the future if a use case required this functionality. - :param date_obj: Datetime object from data from an ICAT entity :type date_obj: :class:`datetime.datetime` :return: Datetime (of type string) in the agreed format From 264c130e97a431df53954ad7eebbcc32aa228312 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 08:49:40 +0000 Subject: [PATCH 19/46] #145: Add LIMIT filter into /findone endpoints - This helps to make these types of requests more snappy, without impacting the output --- common/icat/helpers.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index fb5b83d4..28f05268 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -741,6 +741,11 @@ def get_first_result_with_filters(client, table_name, filters): Using filters in the request, get results of the given entity, but only show the first one to the user + Since only one result will be outputted, inserting a `PythonICATLimitFilter` in the + query will make Python ICAT's data fetching more snappy and prevent a 500 being + caused by trying to fetch over the number of records limited by ICAT (currently + 10000). + :param client: ICAT client containing an authenticated user :type client: :class:`icat.client.Client` :param table_name: Table name to extract which entity to use @@ -754,6 +759,9 @@ def get_first_result_with_filters(client, table_name, filters): "Getting only first result of %s, making use of filters in request", table_name ) + limit_filter = PythonICATLimitFilter(1) + filters.append(limit_filter) + entity_data = get_entity_with_filters( client, table_name, filters, return_first_value_only=True ) @@ -761,7 +769,7 @@ def get_first_result_with_filters(client, table_name, filters): if not entity_data: raise MissingRecordError("No results found") else: - return entity_data + return entity_data[0] def update_entities(client, table_name, data_to_update): From 2d2f4f1da70f5103d2ee461e805f00ae5e854fc8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 09:03:56 +0000 Subject: [PATCH 20/46] #145: Remove return_first_value_only flag - This functionality has been replaced with a limit filter as per the previous commit --- common/icat/helpers.py | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 28f05268..826546c0 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -146,9 +146,7 @@ def __init__( " suggesting an invalid argument" ) - def execute_query( - self, client, return_json_formattable=False, return_first_value_only=False - ): + def execute_query(self, client, return_json_formattable=False): """ Execute the ICAT Query object and return in the format specified by the return_json_formattable flag @@ -161,11 +159,6 @@ def execute_query( whether to leave the data in a Python ICAT format (i.e. if it's going to be manipulated at some point) :type return_json_formattable_data: :class:`bool` - :param return_first_value_only: Flag to determine whether the query should only - return the first result in the result set. This is used for /findone - endpoints so the first result is dealt with before breaking the processing - of results and returning the first result only - :type return_first_value_only: :class:`bool` :return: Data (of type list) from the executed query :raises PythonICATError: If an error occurs during query execution """ @@ -212,11 +205,6 @@ def execute_query( else: data.append(result) - # For /findone endpoints - only need to process the first result as the - # rest won't be sent in the response - if return_first_value_only: - break - return data else: log.info("Query results will be returned as ICAT entities") @@ -614,7 +602,7 @@ def update_entity_by_id(client, table_name, id_, new_data): return get_entity_by_id(client, table_name, id_, True) -def get_entity_with_filters(client, table_name, filters, return_first_value_only=False): +def get_entity_with_filters(client, table_name, filters): """ Gets all the records of a given entity, based on the filters provided in the request @@ -624,11 +612,6 @@ def get_entity_with_filters(client, table_name, filters, return_first_value_only :type table_name: :class:`str` :param filters: The list of filters to be applied to the request :type filters: List of specific implementations :class:`QueryFilter` - :param return_first_value_only: Flag to determine whether the query should only - return the first result in the result set. This is used for /findone - endpoints so the first result is dealt with before breaking the processing - of results and returning the first result only - :type return_first_value_only: :class:`bool` :return: The list of records of the given entity, using the filters to restrict the result of the query """ @@ -643,7 +626,7 @@ def get_entity_with_filters(client, table_name, filters, return_first_value_only clear_order_filters(filter_handler.filters) filter_handler.apply_filters(query.query) - data = query.execute_query(client, True, return_first_value_only) + data = query.execute_query(client, True) if not data: raise MissingRecordError("No results found") @@ -762,9 +745,7 @@ def get_first_result_with_filters(client, table_name, filters): limit_filter = PythonICATLimitFilter(1) filters.append(limit_filter) - entity_data = get_entity_with_filters( - client, table_name, filters, return_first_value_only=True - ) + entity_data = get_entity_with_filters(client, table_name, filters) if not entity_data: raise MissingRecordError("No results found") From 8c8a2419b3356ff5900bbff72342c3e7779cb8c8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 09:32:12 +0000 Subject: [PATCH 21/46] #145: Move filter-specific functions to FilterOrderHandler - This will help clean up common.icat.helpers and move filter-specific functions to the relevant file - This commit also adds a function that calls other functions in its class to reduce code duplication - This is a 'leave the code in a better state than you found it' kind of commit --- common/filter_order_handler.py | 69 ++++++++++++++++++++++++++++++++++ common/icat/helpers.py | 65 ++------------------------------ 2 files changed, 72 insertions(+), 62 deletions(-) diff --git a/common/filter_order_handler.py b/common/filter_order_handler.py index c190e314..dac99a2c 100644 --- a/common/filter_order_handler.py +++ b/common/filter_order_handler.py @@ -1,3 +1,10 @@ +from common.icat.filters import ( + PythonICATLimitFilter, + PythonICATSkipFilter, + PythonICATOrderFilter, +) + + class FilterOrderHandler(object): """ The FilterOrderHandler takes in filters, sorts them according to the order of @@ -32,3 +39,65 @@ def apply_filters(self, query): for filter in self.filters: filter.apply_filter(query) + + def merge_python_icat_limit_skip_filters(self): + """ + When there are both limit and skip filters in a request, merge them into the + limit filter and remove the skip filter from the instance + """ + + if any( + isinstance(icat_filter, PythonICATSkipFilter) + for icat_filter in self.filters + ) and any( + isinstance(icat_filter, PythonICATLimitFilter) + for icat_filter in self.filters + ): + # Merge skip and limit filter into a single limit filter + for icat_filter in self.filters: + if isinstance(icat_filter, PythonICATSkipFilter): + skip_filter = icat_filter + request_skip_value = icat_filter.skip_value + + if isinstance(icat_filter, PythonICATLimitFilter): + limit_filter = icat_filter + + if skip_filter and limit_filter: + log.info("Merging skip filter with limit filter") + limit_filter.skip_value = skip_filter.skip_value + log.info("Removing skip filter from list of filters") + self.remove_filter(skip_filter) + log.debug("Filters: %s", self.filters) + + def clear_python_icat_order_filters(self): + """ + Checks if any order filters have been added to the request and resets the + variable used to manage which attribute(s) to use for sorting results. + + A reset is required because Python ICAT overwrites (as opposed to appending to + it) the query's order list every time one is added to the query. + """ + + if any( + isinstance(icat_filter, PythonICATOrderFilter) + for icat_filter in self.filters + ): + PythonICATOrderFilter.result_order = [] + + def manage_icat_filters(self, filters, query): + """ + Utility function to call other functions in this class, used to manage filters + when using the Python ICAT backend. These steps are the same with the different + types of requests that utilise filters, therefore this function helps to reduce + code duplication + + :param filters: The list of filters that will be applied to the query + :type filters: List of specific implementations :class:`QueryFilter` + :param query: ICAT query which will fetch the data at a later stage + :type query: :class:`icat.query.Query` + """ + + self.add_filters(filters) + self.merge_python_icat_limit_skip_filters() + self.clear_python_icat_order_filters() + self.apply_filters(query) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 826546c0..1c5c7cb0 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -24,13 +24,7 @@ from common.filter_order_handler import FilterOrderHandler from common.date_handler import DateHandler from common.constants import Constants -from common.icat.filters import ( - PythonICATLimitFilter, - PythonICATWhereFilter, - PythonICATSkipFilter, - PythonICATOrderFilter, -) - +from common.icat.filters import PythonICATLimitFilter, PythonICATWhereFilter log = logging.getLogger() @@ -621,10 +615,7 @@ def get_entity_with_filters(client, table_name, filters): query = icat_query(client, selected_entity_name) filter_handler = FilterOrderHandler() - filter_handler.add_filters(filters) - merge_limit_skip_filters(filter_handler) - clear_order_filters(filter_handler.filters) - filter_handler.apply_filters(query.query) + filter_handler.manage_icat_filters(filters, query.query) data = query.execute_query(client, True) @@ -634,53 +625,6 @@ def get_entity_with_filters(client, table_name, filters): return data -def merge_limit_skip_filters(filter_handler): - """ - When there are both limit and skip filters in a request, merge them into the limit - filter and remove the skip filter from `filter_handler` - - :param filter_handler: The filter handler to apply the filters - :param filters: The filters to be applied - """ - - if any( - isinstance(filter, PythonICATSkipFilter) for filter in filter_handler.filters - ) and any( - isinstance(filter, PythonICATLimitFilter) for filter in filter_handler.filters - ): - # Merge skip and limit filter into a single limit filter - for filter in filter_handler.filters: - if isinstance(filter, PythonICATSkipFilter): - skip_filter = filter - request_skip_value = filter.skip_value - - if isinstance(filter, PythonICATLimitFilter): - limit_filter = filter - - if skip_filter and limit_filter: - log.info("Merging skip filter with limit filter") - limit_filter.skip_value = skip_filter.skip_value - log.info("Removing skip filter from list of filters") - filter_handler.remove_filter(skip_filter) - log.debug("Filters: %s", filter_handler.filters) - - -def clear_order_filters(filters): - """ - Checks if any order filters have been added to the request and resets the variable - used to manage which attribute(s) to use for sorting results. - - A reset is required because Python ICAT overwrites (as opposed to appending to it) - the query's order list every time one is added to the query. - - :param filters: The list of filters to be applied to the request - :type filters: List of specific implementations :class:`QueryFilter` - """ - - if any(isinstance(filter, PythonICATOrderFilter) for filter in filters): - PythonICATOrderFilter.result_order = [] - - def get_count_with_filters(client, table_name, filters): """ Get the number of results of a given entity, based on the filters provided in the @@ -705,10 +649,7 @@ def get_count_with_filters(client, table_name, filters): query = icat_query(client, selected_entity_name, aggregate="COUNT") filter_handler = FilterOrderHandler() - filter_handler.add_filters(filters) - merge_limit_skip_filters(filter_handler) - clear_order_filters(filter_handler.filters) - filter_handler.apply_filters(query.query) + filter_handler.manage_icat_filters(filters, query.query) data = query.execute_query(client, True) From 8e046f65ba72da282c8f117fa690ae8741e5df05 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 09:42:34 +0000 Subject: [PATCH 22/46] #145: Remove logging statement from development work --- common/icat/helpers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 1c5c7cb0..c2b08425 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -764,7 +764,6 @@ def create_entities(client, table_name, data): setattr(new_entity, attribute_name, value) else: # This means the attribute has a relationship with another object - log.debug(f"Entity Info: {entity_info}") try: related_object = client.get(entity_info.type, value) except ICATNoObjectError as e: From 90a2e28c59ce673b5fe52399a5ed6ce6707b2adb Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 16:35:17 +0000 Subject: [PATCH 23/46] #146: Fix ISIS endpoints for DB backends - The function calls were to functions that didn't exist in the backend files, so I've corrected them so they do exist and also slightly renamed them during this change --- common/backend.py | 8 ++++---- common/database/backend.py | 8 ++++---- common/icat/backend.py | 8 ++++---- src/resources/table_endpoints/table_endpoints.py | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/common/backend.py b/common/backend.py index 89fe0bd1..84b8e8e8 100644 --- a/common/backend.py +++ b/common/backend.py @@ -142,7 +142,7 @@ def update_with_id(self, session_id, entity_type, id_, data): pass @abstractmethod - def get_instrument_facilitycycles_with_filters( + def get_facility_cycles_for_instrument_with_filters( self, session_id, instrument_id, filters ): """ @@ -157,7 +157,7 @@ def get_instrument_facilitycycles_with_filters( pass @abstractmethod - def count_instrument_facilitycycles_with_filters( + def get_facility_cycles_for_instrument_count_with_filters( self, session_id, instrument_id, filters ): """ @@ -172,7 +172,7 @@ def count_instrument_facilitycycles_with_filters( pass @abstractmethod - def get_instrument_facilitycycle_investigations_with_filters( + def get_investigations_for_instrument_in_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): """ @@ -188,7 +188,7 @@ def get_instrument_facilitycycle_investigations_with_filters( pass @abstractmethod - def count_instrument_facilitycycles_investigations_with_filters( + def get_investigations_for_instrument_in_facility_cycle_count_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): """ diff --git a/common/database/backend.py b/common/database/backend.py index 60e52eb8..7fdaa699 100644 --- a/common/database/backend.py +++ b/common/database/backend.py @@ -101,21 +101,21 @@ def update_with_id(self, session_id, table, id_, data): @requires_session_id @queries_records - def get_instrument_facilitycycles_with_filters( + def get_facility_cycles_for_instrument_with_filters( self, session_id, instrument_id, filters ): return get_facility_cycles_for_instrument(instrument_id, filters) @requires_session_id @queries_records - def count_instrument_facilitycycles_with_filters( + def get_facility_cycles_for_instrument_count_with_filters( self, session_id, instrument_id, filters ): return get_facility_cycles_for_instrument_count(instrument_id, filters) @requires_session_id @queries_records - def get_instrument_facilitycycle_investigations_with_filters( + def get_investigations_for_instrument_in_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): return get_investigations_for_instrument_in_facility_cycle( @@ -124,7 +124,7 @@ def get_instrument_facilitycycle_investigations_with_filters( @requires_session_id @queries_records - def count_instrument_facilitycycles_investigations_with_filters( + def get_investigations_for_instrument_in_facility_cycle_count_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): return get_investigations_for_instrument_in_facility_cycle_count( diff --git a/common/icat/backend.py b/common/icat/backend.py index 0bc6f1a2..7c34a1a7 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -122,14 +122,14 @@ def update_with_id(self, session_id, table, id_, data): @requires_session_id @queries_records - def get_instrument_facilitycycles_with_filters( + def get_facility_cycles_for_instrument_with_filters( self, session_id, instrument_id, filters ): pass @requires_session_id @queries_records - def count_instrument_facilitycycles_with_filters( + def get_facility_cycles_for_instrument_count_with_filters( self, session_id, instrument_id, filters ): pass @@ -137,7 +137,7 @@ def count_instrument_facilitycycles_with_filters( @requires_session_id @queries_records - def get_instrument_facilitycycle_investigations_with_filters( + def get_investigations_for_instrument_in_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): pass @@ -145,7 +145,7 @@ def get_instrument_facilitycycle_investigations_with_filters( @requires_session_id @queries_records - def count_instrument_facilitycycles_investigations_with_filters( + def get_investigations_for_instrument_in_facility_cycle_count_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): pass diff --git a/src/resources/table_endpoints/table_endpoints.py b/src/resources/table_endpoints/table_endpoints.py index 4de8a945..d2584c89 100644 --- a/src/resources/table_endpoints/table_endpoints.py +++ b/src/resources/table_endpoints/table_endpoints.py @@ -53,7 +53,7 @@ def get(self, id_): description: No such record - Unable to find a record in the database """ return ( - backend.get_facility_cycles_for_instrument( + backend.get_facility_cycles_for_instrument_with_filters( get_session_id_from_auth_header(), id_, get_filters_from_query_string() ), 200, @@ -94,7 +94,7 @@ def get(self, id_): description: No such record - Unable to find a record in the database """ return ( - backend.get_facility_cycles_for_instrument_count( + backend.get_facility_cycles_for_instrument_count_with_filters( get_session_id_from_auth_header(), id_, get_filters_from_query_string() ), 200, @@ -147,7 +147,7 @@ def get(self, instrument_id, cycle_id): description: No such record - Unable to find a record in the database """ return ( - backend.get_investigations_for_instrument_in_facility_cycle( + backend.get_investigations_for_instrument_in_facility_cycle_with_filters( get_session_id_from_auth_header(), instrument_id, cycle_id, @@ -197,7 +197,7 @@ def get(self, instrument_id, cycle_id): description: No such record - Unable to find a record in the database """ return ( - backend.get_investigations_for_instrument_in_facility_cycle_count( + backend.get_investigations_for_instrument_in_facility_cycle_count_with_filters( get_session_id_from_auth_header(), instrument_id, cycle_id, From 1ee4f0ef50cad340b3f3aebad7fd6ab27b72771d Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 16:45:02 +0000 Subject: [PATCH 24/46] #146: Create skeleton functions for ISIS endpoints for ICAT backend --- common/icat/backend.py | 25 ++++++++++++++++++------- common/icat/helpers.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index 7c34a1a7..925354b6 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -18,6 +18,10 @@ get_first_result_with_filters, update_entities, create_entities, + get_facility_cycles_for_instrument, + get_facility_cycles_for_instrument_count, + get_investigations_for_instrument_in_facility_cycle, + get_investigations_for_instrument_in_facility_cycle_count, ) from common.config import config @@ -125,28 +129,35 @@ def update_with_id(self, session_id, table, id_, data): def get_facility_cycles_for_instrument_with_filters( self, session_id, instrument_id, filters ): - pass + self.client.sessionId = session_id + return get_facility_cycles_for_instrument(self.client, instrument_id, filters) @requires_session_id @queries_records def get_facility_cycles_for_instrument_count_with_filters( self, session_id, instrument_id, filters ): - pass - # return get_facility_cycles_for_instrument_count(instrument_id, filters) + self.client.sessionId = session_id + return get_facility_cycles_for_instrument_count( + self.client, instrument_id, filters + ) @requires_session_id @queries_records def get_investigations_for_instrument_in_facility_cycle_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): - pass - # return get_investigations_for_instrument_in_facility_cycle(instrument_id, facilitycycle_id, filters) + self.client.sessionId = session_id + return get_investigations_for_instrument_in_facility_cycle( + self.client, instrument_id, facilitycycle_id, filters + ) @requires_session_id @queries_records def get_investigations_for_instrument_in_facility_cycle_count_with_filters( self, session_id, instrument_id, facilitycycle_id, filters ): - pass - # return get_investigations_for_instrument_in_facility_cycle_count(instrument_id, facilitycycle_id, filters) + self.client.sessionId = session_id + return get_investigations_for_instrument_in_facility_cycle_count( + self.client, instrument_id, facilitycycle_id, filters + ) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 8b521efb..a01c762c 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -459,3 +459,35 @@ def create_entities(client, table_name, data): created_data.append(get_entity_by_id(client, table_name, new_entity.id, True)) return created_data + + +def get_facility_cycles_for_instrument(client, instrument_id, filters): + """ + TODO - Add docstring + """ + pass + + +def get_facility_cycles_for_instrument_count(client, instrument_id, filters): + """ + TODO - Add docstring + """ + pass + + +def get_investigations_for_instrument_in_facility_cycle( + client, instrument_id, facilitycycle_id, filters +): + """ + TODO - Add docstring + """ + pass + + +def get_investigations_for_instrument_in_facility_cycle_count( + client, instrument_id, facilitycycle_id, filters +): + """ + TODO - Add docstring + """ + pass From 2c8842ca4493d663bcab086090fc7dddb021438e Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 9 Oct 2020 17:18:35 +0000 Subject: [PATCH 25/46] #146: Add docstrings to each of the ISIS endpoint helper functions --- common/icat/helpers.py | 48 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index a01c762c..2360a1be 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -463,14 +463,32 @@ def create_entities(client, table_name, data): def get_facility_cycles_for_instrument(client, instrument_id, filters): """ - TODO - Add docstring + Given an Instrument ID, get the Facility Cycles where there are Instruments that + have investigations occurring within that cycle + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param instrument_id: ID of the instrument from the request + :type instrument_id: :class:`int` + :param filters: The list of filters to be applied to the request + :type filters: List of specific implementations :class:`QueryFilter` + :return: A list of Facility Cycles that match the query """ pass def get_facility_cycles_for_instrument_count(client, instrument_id, filters): """ - TODO - Add docstring + Given an Instrument ID, get the number of Facility Cycles where there's Instruments + that have investigations occurring within that cycle + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param instrument_id: ID of the instrument from the request + :type instrument_id: :class:`int` + :param filters: The list of filters to be applied to the request + :type filters: List of specific implementations :class:`QueryFilter` + :return: The number of Facility Cycles that match the query """ pass @@ -479,7 +497,18 @@ def get_investigations_for_instrument_in_facility_cycle( client, instrument_id, facilitycycle_id, filters ): """ - TODO - Add docstring + Given Instrument and Facility Cycle IDs, get investigations that use the given + instrument in the given cycle + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param instrument_id: ID of the instrument from the request + :type instrument_id: :class:`int` + :param facilitycycle_id: ID of the facilityCycle from the request + :type facilitycycle_id: :class:`int` + :param filters: The list of filters to be applied to the request + :type filters: List of specific implementations :class:`QueryFilter` + :return: A list of Investigations that match the query """ pass @@ -488,6 +517,17 @@ def get_investigations_for_instrument_in_facility_cycle_count( client, instrument_id, facilitycycle_id, filters ): """ - TODO - Add docstring + Given Instrument and Facility Cycle IDs, get the number of investigations that use + the given instrument in the given cycle + + :param client: ICAT client containing an authenticated user + :type client: :class:`icat.client.Client` + :param instrument_id: ID of the instrument from the request + :type instrument_id: :class:`int` + :param facilitycycle_id: ID of the facilityCycle from the request + :type facilitycycle_id: :class:`int` + :param filters: The list of filters to be applied to the request + :type filters: List of specific implementations :class:`QueryFilter` + :return: The number of Investigations that match the query """ pass From a089db4f148c6838596263b1927177eeb55134f8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 12 Oct 2020 09:32:17 +0000 Subject: [PATCH 26/46] #146: Change where include filter data is referenced --- common/database/helpers.py | 2 +- common/filters.py | 2 +- common/icat/filters.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/database/helpers.py b/common/database/helpers.py index 7d87b412..e5a5aae6 100644 --- a/common/database/helpers.py +++ b/common/database/helpers.py @@ -233,7 +233,7 @@ def get_query_filter(filter): elif filter_name == "limit": return LimitFilter(filter["limit"]) elif filter_name == "include": - return IncludeFilter(filter) + return IncludeFilter(filter["include"]) elif filter_name == "distinct": return DistinctFieldFilter(filter["distinct"]) else: diff --git a/common/filters.py b/common/filters.py index 50732e4c..07de77fa 100644 --- a/common/filters.py +++ b/common/filters.py @@ -69,4 +69,4 @@ class IncludeFilter(QueryFilter): precedence = 5 def __init__(self, included_filters): - self.included_filters = included_filters["include"] + self.included_filters = included_filters diff --git a/common/icat/filters.py b/common/icat/filters.py index 6a396cab..bd6a11bc 100644 --- a/common/icat/filters.py +++ b/common/icat/filters.py @@ -171,7 +171,7 @@ class PythonICATIncludeFilter(IncludeFilter): def __init__(self, included_filters): self.included_filters = [] log.info("Extracting fields for include filter") - self._extract_filter_fields(included_filters["include"]) + self._extract_filter_fields(included_filters) def _extract_filter_fields(self, field): """ From b6333e9f8917e6a49bfc87ddaa5f519e5d4afbb8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 13 Oct 2020 10:13:17 +0000 Subject: [PATCH 27/46] #146: Add skeleton to an ISIS endpoint - This endpoint does not work currently, there are issues with speech marks in WHERE filter of the startDate conditions and a DISTINCT aggregate needs to be added (with a flag in ICATQuery to mark an ISIS endpoint so the aggregate doesn't behave like a distinct filter - these are two different things) --- common/icat/helpers.py | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 30c1163a..e637a53e 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -474,7 +474,41 @@ def get_facility_cycles_for_instrument(client, instrument_id, filters): :type filters: List of specific implementations :class:`QueryFilter` :return: A list of Facility Cycles that match the query """ - pass + # TODO - Add logging + + query = ICATQuery(client, "FacilityCycle") + + instrument_id_check = PythonICATWhereFilter( + "facility.instruments.id", instrument_id, "eq" + ) + investigation_instrument_id_check = PythonICATWhereFilter( + "facility.instruments.investigationInstruments.instrument.id", + instrument_id, + "eq", + ) + investigation_start_date_check = PythonICATWhereFilter( + "facility.investigations.startDate", "o.startDate", "gte" + ) + investigation_end_date_check = PythonICATWhereFilter( + "facility.investigations.startDate", "o.endDate", "lte" + ) + + facility_cycle_filters = [ + instrument_id_check, + investigation_instrument_id_check, + investigation_start_date_check, + investigation_end_date_check, + ] + filters.extend(facility_cycle_filters) + filter_handler = FilterOrderHandler() + filter_handler.manage_icat_filters(filters, query.query) + + data = query.execute_query(client, True) + + if not data: + raise MissingRecordError("No results found") + else: + return data def get_facility_cycles_for_instrument_count(client, instrument_id, filters): From 10679bb999615cc590531882122d54b1f98a2e3e Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 13 Oct 2020 12:15:11 +0000 Subject: [PATCH 28/46] #146: Add flag for ISIS endpoints in ICATQuery - ISIS endpoints require use of the DISTINCT aggregate, which is different to the DISTINCT filter in this API --- common/icat/helpers.py | 2 +- common/icat/query.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index e637a53e..f7e134a9 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -476,7 +476,7 @@ def get_facility_cycles_for_instrument(client, instrument_id, filters): """ # TODO - Add logging - query = ICATQuery(client, "FacilityCycle") + query = ICATQuery(client, "FacilityCycle", aggregate="DISTINCT", isis_endpoint=True) instrument_id_check = PythonICATWhereFilter( "facility.instruments.id", instrument_id, "eq" diff --git a/common/icat/query.py b/common/icat/query.py index b71994a8..1f24d986 100644 --- a/common/icat/query.py +++ b/common/icat/query.py @@ -15,7 +15,13 @@ class ICATQuery: def __init__( - self, client, entity_name, conditions=None, aggregate=None, includes=None + self, + client, + entity_name, + conditions=None, + aggregate=None, + includes=None, + isis_endpoint=False, ): """ Create a Query object within Python ICAT @@ -53,6 +59,8 @@ def __init__( " suggesting an invalid argument" ) + self.isis_endpoint = isis_endpoint + def execute_query(self, client, return_json_formattable=False): """ Execute the ICAT Query object and return in the format specified by the @@ -71,7 +79,7 @@ def execute_query(self, client, return_json_formattable=False): """ try: - log.debug("Executing ICAT query") + log.debug("Executing ICAT query: %s", self.query) query_result = client.search(self.query) except (ICATValidationError, ICATInternalError) as e: raise PythonICATError(e) @@ -86,7 +94,11 @@ def execute_query(self, client, return_json_formattable=False): if "COUNT" in self.query.aggregate: count_query = True - if self.query.aggregate == "DISTINCT" and not count_query: + if ( + self.query.aggregate == "DISTINCT" + and not count_query + and not self.isis_endpoint + ): log.info("Extracting the distinct fields from query's conditions") # Check query's conditions for the ones created by the distinct filter distinct_attributes = self.iterate_query_conditions_for_distinctiveness() @@ -334,4 +346,4 @@ def flatten_query_included_fields(self, includes): ICAT query """ - return [m for n in (field.split(".") for field in includes) for m in n] \ No newline at end of file + return [m for n in (field.split(".") for field in includes) for m in n] From 397602dc395444556604833e5f6ee9a0be1b35ec Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 14 Oct 2020 10:05:34 +0000 Subject: [PATCH 29/46] #146: Fix issue with RHS of where filters being a reference - This fixed is used for the ISIS endpoints --- common/icat/filters.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/icat/filters.py b/common/icat/filters.py index bd6a11bc..e2037c86 100644 --- a/common/icat/filters.py +++ b/common/icat/filters.py @@ -74,8 +74,11 @@ def create_condition(attribute_name, operator, value): # Removing quote marks when doing conditions with IN expressions or when a # distinct filter is used in a request jpql_value = ( - f"{value}" if operator == "in" or operator == "!=" else f"'{value}'" + f"{value}" + if operator == "in" or operator == "!=" or "o." in str(value) + else f"'{value}'" ) + conditions[attribute_name] = f"{operator} {jpql_value}" log.debug("Conditions in ICAT where filter, %s", conditions) return conditions From be35d4b8fc27e899274540c1bac05814cba0a5ab Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 14 Oct 2020 10:06:38 +0000 Subject: [PATCH 30/46] #146: Correct facility cycle ISIS endpoint - This ensures the correct DB tables are joined together, to match the output of the request in the DB backend. This has been compared with a query from TopCat and also gives an identical output for my test data --- common/icat/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index f7e134a9..93fc5b32 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -482,7 +482,7 @@ def get_facility_cycles_for_instrument(client, instrument_id, filters): "facility.instruments.id", instrument_id, "eq" ) investigation_instrument_id_check = PythonICATWhereFilter( - "facility.instruments.investigationInstruments.instrument.id", + "facility.investigations.investigationInstruments.instrument.id", instrument_id, "eq", ) From 5944932f6a90f9ba8b9ce48d51e8a6b727def95d Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 14 Oct 2020 10:20:13 +0000 Subject: [PATCH 31/46] #146: Fix missing logging import --- common/filter_order_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/filter_order_handler.py b/common/filter_order_handler.py index dac99a2c..857fce91 100644 --- a/common/filter_order_handler.py +++ b/common/filter_order_handler.py @@ -1,9 +1,13 @@ +import logging + from common.icat.filters import ( PythonICATLimitFilter, PythonICATSkipFilter, PythonICATOrderFilter, ) +log = logging.getLogger() + class FilterOrderHandler(object): """ From 68bd282312ad4f81bcd8d8d9fa4d5d19674f719f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 14 Oct 2020 10:33:09 +0000 Subject: [PATCH 32/46] #146: Add count functionality for 1st ISIS endpoint - Makes use of the existing function but adds a flag to detect whether the function should be used as a count query or not --- common/icat/helpers.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 93fc5b32..8d44841a 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -461,7 +461,9 @@ def create_entities(client, table_name, data): return created_data -def get_facility_cycles_for_instrument(client, instrument_id, filters): +def get_facility_cycles_for_instrument( + client, instrument_id, filters, count_query=False +): """ Given an Instrument ID, get the Facility Cycles where there are Instruments that have investigations occurring within that cycle @@ -472,11 +474,17 @@ def get_facility_cycles_for_instrument(client, instrument_id, filters): :type instrument_id: :class:`int` :param filters: The list of filters to be applied to the request :type filters: List of specific implementations :class:`QueryFilter` + :param count_query: Flag to determine if the query in this function should be used + as a count query. Used for `get_facility_cycles_for_instrument_count()` + :type count_query: :class:`bool` :return: A list of Facility Cycles that match the query """ # TODO - Add logging - query = ICATQuery(client, "FacilityCycle", aggregate="DISTINCT", isis_endpoint=True) + query_aggregate = "COUNT" if count_query else None + query = ICATQuery( + client, "FacilityCycle", aggregate=query_aggregate, isis_endpoint=True + ) instrument_id_check = PythonICATWhereFilter( "facility.instruments.id", instrument_id, "eq" @@ -524,7 +532,9 @@ def get_facility_cycles_for_instrument_count(client, instrument_id, filters): :type filters: List of specific implementations :class:`QueryFilter` :return: The number of Facility Cycles that match the query """ - pass + return get_facility_cycles_for_instrument( + client, instrument_id, filters, count_query=True + )[0] def get_investigations_for_instrument_in_facility_cycle( From 8d1dba20c01b1f7669f6427775e1448bdfdf7fec Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 14 Oct 2020 10:40:01 +0000 Subject: [PATCH 33/46] #146: Apply count query flag logic to second ISIS endpoint - It should be noted that the affected endpoint doesn't currently do anything --- common/icat/helpers.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 8d44841a..e6fb5edb 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -538,7 +538,7 @@ def get_facility_cycles_for_instrument_count(client, instrument_id, filters): def get_investigations_for_instrument_in_facility_cycle( - client, instrument_id, facilitycycle_id, filters + client, instrument_id, facilitycycle_id, filters, count_query=False ): """ Given Instrument and Facility Cycle IDs, get investigations that use the given @@ -552,9 +552,16 @@ def get_investigations_for_instrument_in_facility_cycle( :type facilitycycle_id: :class:`int` :param filters: The list of filters to be applied to the request :type filters: List of specific implementations :class:`QueryFilter` + :param count_query: Flag to determine if the query in this function should be used + as a count query. Used for + `get_investigations_for_instrument_in_facility_cycle_count()` + :type count_query: :class:`bool` :return: A list of Investigations that match the query """ - pass + query_aggregate = "COUNT" if count_query else None + query = ICATQuery( + client, "Investigation", aggregate=query_aggregate, isis_endpoint=True + ) def get_investigations_for_instrument_in_facility_cycle_count( @@ -574,4 +581,6 @@ def get_investigations_for_instrument_in_facility_cycle_count( :type filters: List of specific implementations :class:`QueryFilter` :return: The number of Investigations that match the query """ - pass + return get_investigations_for_instrument_in_facility_cycle( + client, instrument_id, facilitycycle_id, filters, count_query=True + )[0] From e28c39b61ce6d2bbc02834e510b70290b7605659 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 14 Oct 2020 13:09:44 +0000 Subject: [PATCH 34/46] #146: Implement second ISIS specific endpoint --- common/icat/helpers.py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index e6fb5edb..76e32ee3 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -563,6 +563,40 @@ def get_investigations_for_instrument_in_facility_cycle( client, "Investigation", aggregate=query_aggregate, isis_endpoint=True ) + instrument_id_check = PythonICATWhereFilter( + "facility.instruments.id", instrument_id, "eq" + ) + investigation_instrument_id_check = PythonICATWhereFilter( + "investigationInstruments.instrument.id", instrument_id, "eq", + ) + facility_cycle_id_check = PythonICATWhereFilter( + "facility.facilityCycles.id", facilitycycle_id, "eq" + ) + facility_cycle_start_date_check = PythonICATWhereFilter( + "facility.facilityCycles.startDate", "o.startDate", "lte" + ) + facility_cycle_end_date_check = PythonICATWhereFilter( + "facility.facilityCycles.endDate", "o.startDate", "gte" + ) + + required_filters = [ + instrument_id_check, + investigation_instrument_id_check, + facility_cycle_id_check, + facility_cycle_start_date_check, + facility_cycle_end_date_check, + ] + filters.extend(required_filters) + filter_handler = FilterOrderHandler() + filter_handler.manage_icat_filters(filters, query.query) + + data = query.execute_query(client, True) + + if not data: + raise MissingRecordError("No results found") + else: + return data + def get_investigations_for_instrument_in_facility_cycle_count( client, instrument_id, facilitycycle_id, filters From b52634aed38be8a7c9ad5df1181c8ba9e351197c Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 15 Oct 2020 11:07:31 +0000 Subject: [PATCH 35/46] #146: Add DISTINCT aggregate to all ISIS specific queries - Testing on dev ISIS ICAT determined this was needed --- common/icat/helpers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 76e32ee3..f4b6eb59 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -481,7 +481,7 @@ def get_facility_cycles_for_instrument( """ # TODO - Add logging - query_aggregate = "COUNT" if count_query else None + query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT" query = ICATQuery( client, "FacilityCycle", aggregate=query_aggregate, isis_endpoint=True ) @@ -558,7 +558,7 @@ def get_investigations_for_instrument_in_facility_cycle( :type count_query: :class:`bool` :return: A list of Investigations that match the query """ - query_aggregate = "COUNT" if count_query else None + query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT" query = ICATQuery( client, "Investigation", aggregate=query_aggregate, isis_endpoint=True ) From 16520486550a9a4051c1297c99106f22c7a159ab Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 15 Oct 2020 11:11:58 +0000 Subject: [PATCH 36/46] #146: Add logging for ISIS endpoints --- common/icat/helpers.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index f4b6eb59..4a017005 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -479,7 +479,7 @@ def get_facility_cycles_for_instrument( :type count_query: :class:`bool` :return: A list of Facility Cycles that match the query """ - # TODO - Add logging + log.info("Getting a list of facility cycles from the specified instrument for ISIS") query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT" query = ICATQuery( @@ -532,6 +532,9 @@ def get_facility_cycles_for_instrument_count(client, instrument_id, filters): :type filters: List of specific implementations :class:`QueryFilter` :return: The number of Facility Cycles that match the query """ + log.info( + "Getting the number of facility cycles from the specified instrument for ISIS" + ) return get_facility_cycles_for_instrument( client, instrument_id, filters, count_query=True )[0] @@ -558,6 +561,11 @@ def get_investigations_for_instrument_in_facility_cycle( :type count_query: :class:`bool` :return: A list of Investigations that match the query """ + log.info( + "Getting a list of investigations from the specified instrument and facility" + " cycle, for ISIS" + ) + query_aggregate = "COUNT:DISTINCT" if count_query else "DISTINCT" query = ICATQuery( client, "Investigation", aggregate=query_aggregate, isis_endpoint=True @@ -615,6 +623,10 @@ def get_investigations_for_instrument_in_facility_cycle_count( :type filters: List of specific implementations :class:`QueryFilter` :return: The number of Investigations that match the query """ + log.info( + "Getting the number of investigations from the specified instrument and" + " facility cycle, for ISIS" + ) return get_investigations_for_instrument_in_facility_cycle( client, instrument_id, facilitycycle_id, filters, count_query=True )[0] From adcb7a6d3ed9e3414eba22efc4b55591a5ec38c6 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 15 Oct 2020 12:11:21 +0000 Subject: [PATCH 37/46] #146: Add to ICATQuery docstring --- common/icat/query.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/icat/query.py b/common/icat/query.py index 1f24d986..aa3598e5 100644 --- a/common/icat/query.py +++ b/common/icat/query.py @@ -39,6 +39,12 @@ def __init__( :param includes: List of related entity names to add to the query so related entities (and their data) can be returned with the query result :type includes: :class:`str` or iterable of :class:`str` + :param isis_endpoint: Flag to determine if the instance will be used for an ISIS + specific endpoint. These endpoints require the use of the DISTINCT aggregate + which is different to the distinct field filter implemented in this API, so + this flag prevents code related to the filter from executing (because it + doesn't need to be on a DISTINCT aggregate) + :type isis_endpoint: :class:`bool` :return: Query object from Python ICAT :raises PythonICATError: If a ValueError is raised when creating a Query(), 500 will be returned as a response From 88c623a1c507694b2d6b7f34025df933687759bf Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 15 Oct 2020 13:43:40 +0000 Subject: [PATCH 38/46] #173: Order OpenAPI YAML request types alphabetically - Things like get, patch, post, delete etc. weren't alphabetically ordered as changing the order of the YAML file on startup --- src/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.py b/src/main.py index a19c2b94..e3939582 100644 --- a/src/main.py +++ b/src/main.py @@ -102,6 +102,12 @@ def handle_error(e): ) spec.path(resource=InstrumentsFacilityCyclesInvestigationsCount, api=api) +# Reorder paths (e.g. get, patch, post) so openapi.yaml only changes when there's a +# change to the Swagger docs, rather than changing on each startup +for entity_data in spec._paths.values(): + for endpoint_name in sorted(entity_data.keys()): + entity_data.move_to_end(endpoint_name) + openapi_spec_path = Path(__file__).parent / "swagger/openapi.yaml" with open(openapi_spec_path, "w") as f: f.write(spec.to_yaml()) From 537cafc3a7650e41a9ca954fabb18ccaf677c4ed Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Thu, 15 Oct 2020 13:45:45 +0000 Subject: [PATCH 39/46] #173: Add OpenAPI YAML file ordered alphabetically --- src/swagger/openapi.yaml | 4144 +++++++++++++++++++------------------- 1 file changed, 2072 insertions(+), 2072 deletions(-) diff --git a/src/swagger/openapi.yaml b/src/swagger/openapi.yaml index 3a187654..db6fbe18 100644 --- a/src/swagger/openapi.yaml +++ b/src/swagger/openapi.yaml @@ -1760,31 +1760,24 @@ info: openapi: 3.0.3 paths: /applications: - post: - description: Creates new APPLICATION object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/APPLICATION' - - items: - $ref: '#/components/schemas/APPLICATION' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of APPLICATION objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/APPLICATION' - - items: - $ref: '#/components/schemas/APPLICATION' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/APPLICATION' + type: array + description: Success - returns APPLICATION that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -1794,7 +1787,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Applications + summary: Get Applications tags: - Applications patch: @@ -1834,24 +1827,31 @@ paths: summary: Update Applications tags: - Applications - get: - description: Retrieves a list of APPLICATION objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new APPLICATION object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/APPLICATION' + - items: + $ref: '#/components/schemas/APPLICATION' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/APPLICATION' - type: array - description: Success - returns APPLICATION that satisfy the filters + oneOf: + - $ref: '#/components/schemas/APPLICATION' + - items: + $ref: '#/components/schemas/APPLICATION' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -1861,7 +1861,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Applications + summary: Create new Applications tags: - Applications /applications/{id_}: @@ -1890,30 +1890,22 @@ paths: summary: Delete Applications by id tags: - Applications - patch: - description: Updates APPLICATION with the specified ID with details provided - in the request body + get: + description: Retrieves a list of APPLICATION objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/APPLICATION' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/APPLICATION' - description: Success - returns the updated object + description: Success - the matching APPLICATION '400': description: Bad request - Something was wrong with the request '401': @@ -1923,25 +1915,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Applications by id + summary: Find the APPLICATION matching the given ID tags: - Applications - get: - description: Retrieves a list of APPLICATION objects + patch: + description: Updates APPLICATION with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/APPLICATION' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/APPLICATION' - description: Success - the matching APPLICATION + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -1951,7 +1951,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the APPLICATION matching the given ID + summary: Update Applications by id tags: - Applications /applications/count: @@ -2011,31 +2011,24 @@ paths: tags: - Applications /datacollectiondatafiles: - post: - description: Creates new DATACOLLECTIONDATAFILE object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - - items: - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATACOLLECTIONDATAFILE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - - items: - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' + type: array + description: Success - returns DATACOLLECTIONDATAFILE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -2045,7 +2038,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DataCollectionDatafiles + summary: Get DataCollectionDatafiles tags: - DataCollectionDatafiles patch: @@ -2085,24 +2078,31 @@ paths: summary: Update DataCollectionDatafiles tags: - DataCollectionDatafiles - get: - description: Retrieves a list of DATACOLLECTIONDATAFILE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATACOLLECTIONDATAFILE object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' + - items: + $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - type: array - description: Success - returns DATACOLLECTIONDATAFILE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' + - items: + $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -2112,7 +2112,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DataCollectionDatafiles + summary: Create new DataCollectionDatafiles tags: - DataCollectionDatafiles /datacollectiondatafiles/{id_}: @@ -2141,30 +2141,22 @@ paths: summary: Delete DataCollectionDatafiles by id tags: - DataCollectionDatafiles - patch: - description: Updates DATACOLLECTIONDATAFILE with the specified ID with details - provided in the request body + get: + description: Retrieves a list of DATACOLLECTIONDATAFILE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - description: Success - returns the updated object + description: Success - the matching DATACOLLECTIONDATAFILE '400': description: Bad request - Something was wrong with the request '401': @@ -2174,25 +2166,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DataCollectionDatafiles by id + summary: Find the DATACOLLECTIONDATAFILE matching the given ID tags: - DataCollectionDatafiles - get: - description: Retrieves a list of DATACOLLECTIONDATAFILE objects + patch: + description: Updates DATACOLLECTIONDATAFILE with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTIONDATAFILE' - description: Success - the matching DATACOLLECTIONDATAFILE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -2202,7 +2202,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATACOLLECTIONDATAFILE matching the given ID + summary: Update DataCollectionDatafiles by id tags: - DataCollectionDatafiles /datacollectiondatafiles/count: @@ -2264,31 +2264,24 @@ paths: tags: - DataCollectionDatafiles /datacollectiondatasets: - post: - description: Creates new DATACOLLECTIONDATASET object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTIONDATASET' - - items: - $ref: '#/components/schemas/DATACOLLECTIONDATASET' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATACOLLECTIONDATASET objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTIONDATASET' - - items: - $ref: '#/components/schemas/DATACOLLECTIONDATASET' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATACOLLECTIONDATASET' + type: array + description: Success - returns DATACOLLECTIONDATASET that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -2298,7 +2291,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DataCollectionDatasets + summary: Get DataCollectionDatasets tags: - DataCollectionDatasets patch: @@ -2338,24 +2331,31 @@ paths: summary: Update DataCollectionDatasets tags: - DataCollectionDatasets - get: - description: Retrieves a list of DATACOLLECTIONDATASET objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATACOLLECTIONDATASET object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATACOLLECTIONDATASET' + - items: + $ref: '#/components/schemas/DATACOLLECTIONDATASET' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATACOLLECTIONDATASET' - type: array - description: Success - returns DATACOLLECTIONDATASET that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATACOLLECTIONDATASET' + - items: + $ref: '#/components/schemas/DATACOLLECTIONDATASET' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -2365,7 +2365,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DataCollectionDatasets + summary: Create new DataCollectionDatasets tags: - DataCollectionDatasets /datacollectiondatasets/{id_}: @@ -2394,30 +2394,22 @@ paths: summary: Delete DataCollectionDatasets by id tags: - DataCollectionDatasets - patch: - description: Updates DATACOLLECTIONDATASET with the specified ID with details - provided in the request body + get: + description: Retrieves a list of DATACOLLECTIONDATASET objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATACOLLECTIONDATASET' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTIONDATASET' - description: Success - returns the updated object + description: Success - the matching DATACOLLECTIONDATASET '400': description: Bad request - Something was wrong with the request '401': @@ -2427,25 +2419,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DataCollectionDatasets by id + summary: Find the DATACOLLECTIONDATASET matching the given ID tags: - DataCollectionDatasets - get: - description: Retrieves a list of DATACOLLECTIONDATASET objects + patch: + description: Updates DATACOLLECTIONDATASET with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATACOLLECTIONDATASET' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTIONDATASET' - description: Success - the matching DATACOLLECTIONDATASET + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -2455,7 +2455,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATACOLLECTIONDATASET matching the given ID + summary: Update DataCollectionDatasets by id tags: - DataCollectionDatasets /datacollectiondatasets/count: @@ -2517,31 +2517,25 @@ paths: tags: - DataCollectionDatasets /datacollectionparameters: - post: - description: Creates new DATACOLLECTIONPARAMETER object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - - items: - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATACOLLECTIONPARAMETER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - - items: - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' + type: array + description: Success - returns DATACOLLECTIONPARAMETER that satisfy the + filters '400': description: Bad request - Something was wrong with the request '401': @@ -2551,7 +2545,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DataCollectionParameters + summary: Get DataCollectionParameters tags: - DataCollectionParameters patch: @@ -2591,25 +2585,31 @@ paths: summary: Update DataCollectionParameters tags: - DataCollectionParameters - get: - description: Retrieves a list of DATACOLLECTIONPARAMETER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATACOLLECTIONPARAMETER object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' + - items: + $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - type: array - description: Success - returns DATACOLLECTIONPARAMETER that satisfy the - filters + oneOf: + - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' + - items: + $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -2619,7 +2619,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DataCollectionParameters + summary: Create new DataCollectionParameters tags: - DataCollectionParameters /datacollectionparameters/{id_}: @@ -2648,30 +2648,22 @@ paths: summary: Delete DataCollectionParameters by id tags: - DataCollectionParameters - patch: - description: Updates DATACOLLECTIONPARAMETER with the specified ID with details - provided in the request body + get: + description: Retrieves a list of DATACOLLECTIONPARAMETER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - description: Success - returns the updated object + description: Success - the matching DATACOLLECTIONPARAMETER '400': description: Bad request - Something was wrong with the request '401': @@ -2681,25 +2673,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DataCollectionParameters by id + summary: Find the DATACOLLECTIONPARAMETER matching the given ID tags: - DataCollectionParameters - get: - description: Retrieves a list of DATACOLLECTIONPARAMETER objects + patch: + description: Updates DATACOLLECTIONPARAMETER with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTIONPARAMETER' - description: Success - the matching DATACOLLECTIONPARAMETER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -2709,7 +2709,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATACOLLECTIONPARAMETER matching the given ID + summary: Update DataCollectionParameters by id tags: - DataCollectionParameters /datacollectionparameters/count: @@ -2771,31 +2771,24 @@ paths: tags: - DataCollectionParameters /datacollections: - post: - description: Creates new DATACOLLECTION object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTION' - - items: - $ref: '#/components/schemas/DATACOLLECTION' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATACOLLECTION objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATACOLLECTION' - - items: - $ref: '#/components/schemas/DATACOLLECTION' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATACOLLECTION' + type: array + description: Success - returns DATACOLLECTION that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -2805,7 +2798,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DataCollections + summary: Get DataCollections tags: - DataCollections patch: @@ -2845,24 +2838,31 @@ paths: summary: Update DataCollections tags: - DataCollections - get: - description: Retrieves a list of DATACOLLECTION objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATACOLLECTION object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATACOLLECTION' + - items: + $ref: '#/components/schemas/DATACOLLECTION' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATACOLLECTION' - type: array - description: Success - returns DATACOLLECTION that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATACOLLECTION' + - items: + $ref: '#/components/schemas/DATACOLLECTION' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -2872,7 +2872,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DataCollections + summary: Create new DataCollections tags: - DataCollections /datacollections/{id_}: @@ -2901,30 +2901,22 @@ paths: summary: Delete DataCollections by id tags: - DataCollections - patch: - description: Updates DATACOLLECTION with the specified ID with details provided - in the request body + get: + description: Retrieves a list of DATACOLLECTION objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATACOLLECTION' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTION' - description: Success - returns the updated object + description: Success - the matching DATACOLLECTION '400': description: Bad request - Something was wrong with the request '401': @@ -2934,25 +2926,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DataCollections by id + summary: Find the DATACOLLECTION matching the given ID tags: - DataCollections - get: - description: Retrieves a list of DATACOLLECTION objects + patch: + description: Updates DATACOLLECTION with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATACOLLECTION' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATACOLLECTION' - description: Success - the matching DATACOLLECTION + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -2962,7 +2962,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATACOLLECTION matching the given ID + summary: Update DataCollections by id tags: - DataCollections /datacollections/count: @@ -3022,31 +3022,24 @@ paths: tags: - DataCollections /datafileformats: - post: - description: Creates new DATAFILEFORMAT object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATAFILEFORMAT' - - items: - $ref: '#/components/schemas/DATAFILEFORMAT' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATAFILEFORMAT objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATAFILEFORMAT' - - items: - $ref: '#/components/schemas/DATAFILEFORMAT' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATAFILEFORMAT' + type: array + description: Success - returns DATAFILEFORMAT that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -3056,7 +3049,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DatafileFormats + summary: Get DatafileFormats tags: - DatafileFormats patch: @@ -3096,24 +3089,31 @@ paths: summary: Update DatafileFormats tags: - DatafileFormats - get: - description: Retrieves a list of DATAFILEFORMAT objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATAFILEFORMAT object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATAFILEFORMAT' + - items: + $ref: '#/components/schemas/DATAFILEFORMAT' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATAFILEFORMAT' - type: array - description: Success - returns DATAFILEFORMAT that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATAFILEFORMAT' + - items: + $ref: '#/components/schemas/DATAFILEFORMAT' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -3123,7 +3123,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DatafileFormats + summary: Create new DatafileFormats tags: - DatafileFormats /datafileformats/{id_}: @@ -3152,30 +3152,22 @@ paths: summary: Delete DatafileFormats by id tags: - DatafileFormats - patch: - description: Updates DATAFILEFORMAT with the specified ID with details provided - in the request body + get: + description: Retrieves a list of DATAFILEFORMAT objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATAFILEFORMAT' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATAFILEFORMAT' - description: Success - returns the updated object + description: Success - the matching DATAFILEFORMAT '400': description: Bad request - Something was wrong with the request '401': @@ -3185,25 +3177,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DatafileFormats by id + summary: Find the DATAFILEFORMAT matching the given ID tags: - DatafileFormats - get: - description: Retrieves a list of DATAFILEFORMAT objects + patch: + description: Updates DATAFILEFORMAT with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATAFILEFORMAT' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATAFILEFORMAT' - description: Success - the matching DATAFILEFORMAT + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -3213,7 +3213,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATAFILEFORMAT matching the given ID + summary: Update DatafileFormats by id tags: - DatafileFormats /datafileformats/count: @@ -3273,31 +3273,24 @@ paths: tags: - DatafileFormats /datafileparameters: - post: - description: Creates new DATAFILEPARAMETER object(s) with details provided in - the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATAFILEPARAMETER' - - items: - $ref: '#/components/schemas/DATAFILEPARAMETER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATAFILEPARAMETER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATAFILEPARAMETER' - - items: - $ref: '#/components/schemas/DATAFILEPARAMETER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATAFILEPARAMETER' + type: array + description: Success - returns DATAFILEPARAMETER that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -3307,7 +3300,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DatafileParameters + summary: Get DatafileParameters tags: - DatafileParameters patch: @@ -3347,24 +3340,31 @@ paths: summary: Update DatafileParameters tags: - DatafileParameters - get: - description: Retrieves a list of DATAFILEPARAMETER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATAFILEPARAMETER object(s) with details provided in + the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATAFILEPARAMETER' + - items: + $ref: '#/components/schemas/DATAFILEPARAMETER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATAFILEPARAMETER' - type: array - description: Success - returns DATAFILEPARAMETER that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATAFILEPARAMETER' + - items: + $ref: '#/components/schemas/DATAFILEPARAMETER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -3374,7 +3374,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DatafileParameters + summary: Create new DatafileParameters tags: - DatafileParameters /datafileparameters/{id_}: @@ -3403,30 +3403,22 @@ paths: summary: Delete DatafileParameters by id tags: - DatafileParameters - patch: - description: Updates DATAFILEPARAMETER with the specified ID with details provided - in the request body + get: + description: Retrieves a list of DATAFILEPARAMETER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATAFILEPARAMETER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATAFILEPARAMETER' - description: Success - returns the updated object + description: Success - the matching DATAFILEPARAMETER '400': description: Bad request - Something was wrong with the request '401': @@ -3436,25 +3428,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DatafileParameters by id + summary: Find the DATAFILEPARAMETER matching the given ID tags: - DatafileParameters - get: - description: Retrieves a list of DATAFILEPARAMETER objects + patch: + description: Updates DATAFILEPARAMETER with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATAFILEPARAMETER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATAFILEPARAMETER' - description: Success - the matching DATAFILEPARAMETER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -3464,7 +3464,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATAFILEPARAMETER matching the given ID + summary: Update DatafileParameters by id tags: - DatafileParameters /datafileparameters/count: @@ -3525,31 +3525,24 @@ paths: tags: - DatafileParameters /datafiles: - post: - description: Creates new DATAFILE object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATAFILE' - - items: - $ref: '#/components/schemas/DATAFILE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATAFILE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATAFILE' - - items: - $ref: '#/components/schemas/DATAFILE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATAFILE' + type: array + description: Success - returns DATAFILE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -3559,7 +3552,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Datafiles + summary: Get Datafiles tags: - Datafiles patch: @@ -3599,24 +3592,31 @@ paths: summary: Update Datafiles tags: - Datafiles - get: - description: Retrieves a list of DATAFILE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATAFILE object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATAFILE' + - items: + $ref: '#/components/schemas/DATAFILE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATAFILE' - type: array - description: Success - returns DATAFILE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATAFILE' + - items: + $ref: '#/components/schemas/DATAFILE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -3626,7 +3626,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Datafiles + summary: Create new Datafiles tags: - Datafiles /datafiles/{id_}: @@ -3655,30 +3655,22 @@ paths: summary: Delete Datafiles by id tags: - Datafiles - patch: - description: Updates DATAFILE with the specified ID with details provided in - the request body + get: + description: Retrieves a list of DATAFILE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATAFILE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATAFILE' - description: Success - returns the updated object + description: Success - the matching DATAFILE '400': description: Bad request - Something was wrong with the request '401': @@ -3688,25 +3680,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Datafiles by id + summary: Find the DATAFILE matching the given ID tags: - Datafiles - get: - description: Retrieves a list of DATAFILE objects + patch: + description: Updates DATAFILE with the specified ID with details provided in + the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATAFILE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATAFILE' - description: Success - the matching DATAFILE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -3716,7 +3716,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATAFILE matching the given ID + summary: Update Datafiles by id tags: - Datafiles /datafiles/count: @@ -3776,31 +3776,24 @@ paths: tags: - Datafiles /datasetparameters: - post: - description: Creates new DATASETPARAMETER object(s) with details provided in - the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATASETPARAMETER' - - items: - $ref: '#/components/schemas/DATASETPARAMETER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATASETPARAMETER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATASETPARAMETER' - - items: - $ref: '#/components/schemas/DATASETPARAMETER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATASETPARAMETER' + type: array + description: Success - returns DATASETPARAMETER that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -3810,7 +3803,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DatasetParameters + summary: Get DatasetParameters tags: - DatasetParameters patch: @@ -3850,24 +3843,31 @@ paths: summary: Update DatasetParameters tags: - DatasetParameters - get: - description: Retrieves a list of DATASETPARAMETER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATASETPARAMETER object(s) with details provided in + the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATASETPARAMETER' + - items: + $ref: '#/components/schemas/DATASETPARAMETER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATASETPARAMETER' - type: array - description: Success - returns DATASETPARAMETER that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATASETPARAMETER' + - items: + $ref: '#/components/schemas/DATASETPARAMETER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -3877,7 +3877,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DatasetParameters + summary: Create new DatasetParameters tags: - DatasetParameters /datasetparameters/{id_}: @@ -3906,30 +3906,22 @@ paths: summary: Delete DatasetParameters by id tags: - DatasetParameters - patch: - description: Updates DATASETPARAMETER with the specified ID with details provided - in the request body + get: + description: Retrieves a list of DATASETPARAMETER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATASETPARAMETER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATASETPARAMETER' - description: Success - returns the updated object + description: Success - the matching DATASETPARAMETER '400': description: Bad request - Something was wrong with the request '401': @@ -3939,25 +3931,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DatasetParameters by id + summary: Find the DATASETPARAMETER matching the given ID tags: - DatasetParameters - get: - description: Retrieves a list of DATASETPARAMETER objects + patch: + description: Updates DATASETPARAMETER with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATASETPARAMETER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATASETPARAMETER' - description: Success - the matching DATASETPARAMETER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -3967,7 +3967,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATASETPARAMETER matching the given ID + summary: Update DatasetParameters by id tags: - DatasetParameters /datasetparameters/count: @@ -4028,31 +4028,24 @@ paths: tags: - DatasetParameters /datasettypes: - post: - description: Creates new DATASETTYPE object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATASETTYPE' - - items: - $ref: '#/components/schemas/DATASETTYPE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATASETTYPE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATASETTYPE' - - items: - $ref: '#/components/schemas/DATASETTYPE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATASETTYPE' + type: array + description: Success - returns DATASETTYPE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -4062,7 +4055,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new DatasetTypes + summary: Get DatasetTypes tags: - DatasetTypes patch: @@ -4102,24 +4095,31 @@ paths: summary: Update DatasetTypes tags: - DatasetTypes - get: - description: Retrieves a list of DATASETTYPE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATASETTYPE object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATASETTYPE' + - items: + $ref: '#/components/schemas/DATASETTYPE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATASETTYPE' - type: array - description: Success - returns DATASETTYPE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATASETTYPE' + - items: + $ref: '#/components/schemas/DATASETTYPE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -4129,7 +4129,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get DatasetTypes + summary: Create new DatasetTypes tags: - DatasetTypes /datasettypes/{id_}: @@ -4158,30 +4158,22 @@ paths: summary: Delete DatasetTypes by id tags: - DatasetTypes - patch: - description: Updates DATASETTYPE with the specified ID with details provided - in the request body + get: + description: Retrieves a list of DATASETTYPE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATASETTYPE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATASETTYPE' - description: Success - returns the updated object + description: Success - the matching DATASETTYPE '400': description: Bad request - Something was wrong with the request '401': @@ -4191,25 +4183,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update DatasetTypes by id + summary: Find the DATASETTYPE matching the given ID tags: - DatasetTypes - get: - description: Retrieves a list of DATASETTYPE objects + patch: + description: Updates DATASETTYPE with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATASETTYPE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATASETTYPE' - description: Success - the matching DATASETTYPE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -4219,7 +4219,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATASETTYPE matching the given ID + summary: Update DatasetTypes by id tags: - DatasetTypes /datasettypes/count: @@ -4279,31 +4279,24 @@ paths: tags: - DatasetTypes /datasets: - post: - description: Creates new DATASET object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/DATASET' - - items: - $ref: '#/components/schemas/DATASET' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of DATASET objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/DATASET' - - items: - $ref: '#/components/schemas/DATASET' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/DATASET' + type: array + description: Success - returns DATASET that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -4313,7 +4306,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Datasets + summary: Get Datasets tags: - Datasets patch: @@ -4353,24 +4346,31 @@ paths: summary: Update Datasets tags: - Datasets - get: - description: Retrieves a list of DATASET objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new DATASET object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DATASET' + - items: + $ref: '#/components/schemas/DATASET' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/DATASET' - type: array - description: Success - returns DATASET that satisfy the filters + oneOf: + - $ref: '#/components/schemas/DATASET' + - items: + $ref: '#/components/schemas/DATASET' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -4380,7 +4380,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Datasets + summary: Create new Datasets tags: - Datasets /datasets/{id_}: @@ -4409,30 +4409,22 @@ paths: summary: Delete Datasets by id tags: - Datasets - patch: - description: Updates DATASET with the specified ID with details provided in - the request body + get: + description: Retrieves a list of DATASET objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DATASET' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATASET' - description: Success - returns the updated object + description: Success - the matching DATASET '400': description: Bad request - Something was wrong with the request '401': @@ -4442,25 +4434,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Datasets by id + summary: Find the DATASET matching the given ID tags: - Datasets - get: - description: Retrieves a list of DATASET objects + patch: + description: Updates DATASET with the specified ID with details provided in + the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DATASET' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/DATASET' - description: Success - the matching DATASET + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -4470,7 +4470,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the DATASET matching the given ID + summary: Update Datasets by id tags: - Datasets /datasets/count: @@ -4530,31 +4530,24 @@ paths: tags: - Datasets /facilities: - post: - description: Creates new FACILITY object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/FACILITY' - - items: - $ref: '#/components/schemas/FACILITY' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of FACILITY objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/FACILITY' - - items: - $ref: '#/components/schemas/FACILITY' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/FACILITY' + type: array + description: Success - returns FACILITY that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -4564,7 +4557,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Facilities + summary: Get Facilities tags: - Facilities patch: @@ -4604,24 +4597,31 @@ paths: summary: Update Facilities tags: - Facilities - get: - description: Retrieves a list of FACILITY objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new FACILITY object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/FACILITY' + - items: + $ref: '#/components/schemas/FACILITY' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/FACILITY' - type: array - description: Success - returns FACILITY that satisfy the filters + oneOf: + - $ref: '#/components/schemas/FACILITY' + - items: + $ref: '#/components/schemas/FACILITY' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -4631,7 +4631,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Facilities + summary: Create new Facilities tags: - Facilities /facilities/{id_}: @@ -4660,30 +4660,22 @@ paths: summary: Delete Facilities by id tags: - Facilities - patch: - description: Updates FACILITY with the specified ID with details provided in - the request body + get: + description: Retrieves a list of FACILITY objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FACILITY' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/FACILITY' - description: Success - returns the updated object + description: Success - the matching FACILITY '400': description: Bad request - Something was wrong with the request '401': @@ -4693,25 +4685,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Facilities by id + summary: Find the FACILITY matching the given ID tags: - Facilities - get: - description: Retrieves a list of FACILITY objects + patch: + description: Updates FACILITY with the specified ID with details provided in + the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FACILITY' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/FACILITY' - description: Success - the matching FACILITY + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -4721,7 +4721,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the FACILITY matching the given ID + summary: Update Facilities by id tags: - Facilities /facilities/count: @@ -4781,31 +4781,24 @@ paths: tags: - Facilities /facilitycycles: - post: - description: Creates new FACILITYCYCLE object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/FACILITYCYCLE' - - items: - $ref: '#/components/schemas/FACILITYCYCLE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of FACILITYCYCLE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/FACILITYCYCLE' - - items: - $ref: '#/components/schemas/FACILITYCYCLE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/FACILITYCYCLE' + type: array + description: Success - returns FACILITYCYCLE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -4815,7 +4808,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new FacilityCycles + summary: Get FacilityCycles tags: - FacilityCycles patch: @@ -4855,24 +4848,31 @@ paths: summary: Update FacilityCycles tags: - FacilityCycles - get: - description: Retrieves a list of FACILITYCYCLE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new FACILITYCYCLE object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/FACILITYCYCLE' + - items: + $ref: '#/components/schemas/FACILITYCYCLE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/FACILITYCYCLE' - type: array - description: Success - returns FACILITYCYCLE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/FACILITYCYCLE' + - items: + $ref: '#/components/schemas/FACILITYCYCLE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -4882,7 +4882,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get FacilityCycles + summary: Create new FacilityCycles tags: - FacilityCycles /facilitycycles/{id_}: @@ -4911,30 +4911,22 @@ paths: summary: Delete FacilityCycles by id tags: - FacilityCycles - patch: - description: Updates FACILITYCYCLE with the specified ID with details provided - in the request body + get: + description: Retrieves a list of FACILITYCYCLE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FACILITYCYCLE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/FACILITYCYCLE' - description: Success - returns the updated object + description: Success - the matching FACILITYCYCLE '400': description: Bad request - Something was wrong with the request '401': @@ -4944,25 +4936,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update FacilityCycles by id + summary: Find the FACILITYCYCLE matching the given ID tags: - FacilityCycles - get: - description: Retrieves a list of FACILITYCYCLE objects + patch: + description: Updates FACILITYCYCLE with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FACILITYCYCLE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/FACILITYCYCLE' - description: Success - the matching FACILITYCYCLE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -4972,7 +4972,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the FACILITYCYCLE matching the given ID + summary: Update FacilityCycles by id tags: - FacilityCycles /facilitycycles/count: @@ -5032,31 +5032,24 @@ paths: tags: - FacilityCycles /groupings: - post: - description: Creates new GROUPING object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/GROUPING' - - items: - $ref: '#/components/schemas/GROUPING' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of GROUPING objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/GROUPING' - - items: - $ref: '#/components/schemas/GROUPING' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/GROUPING' + type: array + description: Success - returns GROUPING that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -5066,7 +5059,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Groupings + summary: Get Groupings tags: - Groupings patch: @@ -5106,24 +5099,31 @@ paths: summary: Update Groupings tags: - Groupings - get: - description: Retrieves a list of GROUPING objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new GROUPING object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/GROUPING' + - items: + $ref: '#/components/schemas/GROUPING' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/GROUPING' - type: array - description: Success - returns GROUPING that satisfy the filters + oneOf: + - $ref: '#/components/schemas/GROUPING' + - items: + $ref: '#/components/schemas/GROUPING' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -5133,7 +5133,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Groupings + summary: Create new Groupings tags: - Groupings /groupings/{id_}: @@ -5162,30 +5162,22 @@ paths: summary: Delete Groupings by id tags: - Groupings - patch: - description: Updates GROUPING with the specified ID with details provided in - the request body + get: + description: Retrieves a list of GROUPING objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GROUPING' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/GROUPING' - description: Success - returns the updated object + description: Success - the matching GROUPING '400': description: Bad request - Something was wrong with the request '401': @@ -5195,25 +5187,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Groupings by id + summary: Find the GROUPING matching the given ID tags: - Groupings - get: - description: Retrieves a list of GROUPING objects + patch: + description: Updates GROUPING with the specified ID with details provided in + the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GROUPING' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/GROUPING' - description: Success - the matching GROUPING + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -5223,7 +5223,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the GROUPING matching the given ID + summary: Update Groupings by id tags: - Groupings /groupings/count: @@ -5283,31 +5283,24 @@ paths: tags: - Groupings /instrumentscientists: - post: - description: Creates new INSTRUMENTSCIENTIST object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - - items: - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INSTRUMENTSCIENTIST objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - - items: - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INSTRUMENTSCIENTIST' + type: array + description: Success - returns INSTRUMENTSCIENTIST that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -5317,7 +5310,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new InstrumentScientists + summary: Get InstrumentScientists tags: - InstrumentScientists patch: @@ -5357,24 +5350,31 @@ paths: summary: Update InstrumentScientists tags: - InstrumentScientists - get: - description: Retrieves a list of INSTRUMENTSCIENTIST objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' - responses: - '200': - content: - application/json: - schema: - items: + post: + description: Creates new INSTRUMENTSCIENTIST object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' + - items: $ref: '#/components/schemas/INSTRUMENTSCIENTIST' type: array - description: Success - returns INSTRUMENTSCIENTIST that satisfy the filters + description: The values to use to create the new object(s) with + required: true + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' + - items: + $ref: '#/components/schemas/INSTRUMENTSCIENTIST' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -5384,7 +5384,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get InstrumentScientists + summary: Create new InstrumentScientists tags: - InstrumentScientists /instrumentscientists/{id_}: @@ -5413,30 +5413,22 @@ paths: summary: Delete InstrumentScientists by id tags: - InstrumentScientists - patch: - description: Updates INSTRUMENTSCIENTIST with the specified ID with details - provided in the request body + get: + description: Retrieves a list of INSTRUMENTSCIENTIST objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - description: Success - returns the updated object + description: Success - the matching INSTRUMENTSCIENTIST '400': description: Bad request - Something was wrong with the request '401': @@ -5446,25 +5438,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update InstrumentScientists by id + summary: Find the INSTRUMENTSCIENTIST matching the given ID tags: - InstrumentScientists - get: - description: Retrieves a list of INSTRUMENTSCIENTIST objects + patch: + description: Updates INSTRUMENTSCIENTIST with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INSTRUMENTSCIENTIST' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INSTRUMENTSCIENTIST' - description: Success - the matching INSTRUMENTSCIENTIST + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -5474,7 +5474,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INSTRUMENTSCIENTIST matching the given ID + summary: Update InstrumentScientists by id tags: - InstrumentScientists /instrumentscientists/count: @@ -5535,31 +5535,24 @@ paths: tags: - InstrumentScientists /instruments: - post: - description: Creates new INSTRUMENT object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INSTRUMENT' - - items: - $ref: '#/components/schemas/INSTRUMENT' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INSTRUMENT objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INSTRUMENT' - - items: - $ref: '#/components/schemas/INSTRUMENT' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INSTRUMENT' + type: array + description: Success - returns INSTRUMENT that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -5569,7 +5562,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Instruments + summary: Get Instruments tags: - Instruments patch: @@ -5609,24 +5602,31 @@ paths: summary: Update Instruments tags: - Instruments - get: - description: Retrieves a list of INSTRUMENT objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INSTRUMENT object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INSTRUMENT' + - items: + $ref: '#/components/schemas/INSTRUMENT' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INSTRUMENT' - type: array - description: Success - returns INSTRUMENT that satisfy the filters + oneOf: + - $ref: '#/components/schemas/INSTRUMENT' + - items: + $ref: '#/components/schemas/INSTRUMENT' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -5636,7 +5636,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Instruments + summary: Create new Instruments tags: - Instruments /instruments/{id_}: @@ -5665,30 +5665,22 @@ paths: summary: Delete Instruments by id tags: - Instruments - patch: - description: Updates INSTRUMENT with the specified ID with details provided - in the request body + get: + description: Retrieves a list of INSTRUMENT objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INSTRUMENT' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INSTRUMENT' - description: Success - returns the updated object + description: Success - the matching INSTRUMENT '400': description: Bad request - Something was wrong with the request '401': @@ -5698,25 +5690,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Instruments by id + summary: Find the INSTRUMENT matching the given ID tags: - Instruments - get: - description: Retrieves a list of INSTRUMENT objects + patch: + description: Updates INSTRUMENT with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INSTRUMENT' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INSTRUMENT' - description: Success - the matching INSTRUMENT + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -5726,7 +5726,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INSTRUMENT matching the given ID + summary: Update Instruments by id tags: - Instruments /instruments/count: @@ -5786,31 +5786,24 @@ paths: tags: - Instruments /investigationgroups: - post: - description: Creates new INVESTIGATIONGROUP object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONGROUP' - - items: - $ref: '#/components/schemas/INVESTIGATIONGROUP' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INVESTIGATIONGROUP objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONGROUP' - - items: - $ref: '#/components/schemas/INVESTIGATIONGROUP' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INVESTIGATIONGROUP' + type: array + description: Success - returns INVESTIGATIONGROUP that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -5820,7 +5813,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new InvestigationGroups + summary: Get InvestigationGroups tags: - InvestigationGroups patch: @@ -5860,24 +5853,31 @@ paths: summary: Update InvestigationGroups tags: - InvestigationGroups - get: - description: Retrieves a list of INVESTIGATIONGROUP objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INVESTIGATIONGROUP object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONGROUP' + - items: + $ref: '#/components/schemas/INVESTIGATIONGROUP' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INVESTIGATIONGROUP' - type: array - description: Success - returns INVESTIGATIONGROUP that satisfy the filters + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONGROUP' + - items: + $ref: '#/components/schemas/INVESTIGATIONGROUP' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -5887,7 +5887,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get InvestigationGroups + summary: Create new InvestigationGroups tags: - InvestigationGroups /investigationgroups/{id_}: @@ -5916,30 +5916,22 @@ paths: summary: Delete InvestigationGroups by id tags: - InvestigationGroups - patch: - description: Updates INVESTIGATIONGROUP with the specified ID with details provided - in the request body + get: + description: Retrieves a list of INVESTIGATIONGROUP objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INVESTIGATIONGROUP' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONGROUP' - description: Success - returns the updated object + description: Success - the matching INVESTIGATIONGROUP '400': description: Bad request - Something was wrong with the request '401': @@ -5949,25 +5941,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update InvestigationGroups by id + summary: Find the INVESTIGATIONGROUP matching the given ID tags: - InvestigationGroups - get: - description: Retrieves a list of INVESTIGATIONGROUP objects + patch: + description: Updates INVESTIGATIONGROUP with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INVESTIGATIONGROUP' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONGROUP' - description: Success - the matching INVESTIGATIONGROUP + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -5977,7 +5977,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INVESTIGATIONGROUP matching the given ID + summary: Update InvestigationGroups by id tags: - InvestigationGroups /investigationgroups/count: @@ -6038,31 +6038,25 @@ paths: tags: - InvestigationGroups /investigationinstruments: - post: - description: Creates new INVESTIGATIONINSTRUMENT object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - - items: - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INVESTIGATIONINSTRUMENT objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - - items: - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' + type: array + description: Success - returns INVESTIGATIONINSTRUMENT that satisfy the + filters '400': description: Bad request - Something was wrong with the request '401': @@ -6072,7 +6066,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new InvestigationInstruments + summary: Get InvestigationInstruments tags: - InvestigationInstruments patch: @@ -6112,25 +6106,31 @@ paths: summary: Update InvestigationInstruments tags: - InvestigationInstruments - get: - description: Retrieves a list of INVESTIGATIONINSTRUMENT objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INVESTIGATIONINSTRUMENT object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' + - items: + $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - type: array - description: Success - returns INVESTIGATIONINSTRUMENT that satisfy the - filters + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' + - items: + $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -6140,7 +6140,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get InvestigationInstruments + summary: Create new InvestigationInstruments tags: - InvestigationInstruments /investigationinstruments/{id_}: @@ -6169,30 +6169,22 @@ paths: summary: Delete InvestigationInstruments by id tags: - InvestigationInstruments - patch: - description: Updates INVESTIGATIONINSTRUMENT with the specified ID with details - provided in the request body + get: + description: Retrieves a list of INVESTIGATIONINSTRUMENT objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - description: Success - returns the updated object + description: Success - the matching INVESTIGATIONINSTRUMENT '400': description: Bad request - Something was wrong with the request '401': @@ -6202,25 +6194,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update InvestigationInstruments by id + summary: Find the INVESTIGATIONINSTRUMENT matching the given ID tags: - InvestigationInstruments - get: - description: Retrieves a list of INVESTIGATIONINSTRUMENT objects + patch: + description: Updates INVESTIGATIONINSTRUMENT with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONINSTRUMENT' - description: Success - the matching INVESTIGATIONINSTRUMENT + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -6230,7 +6230,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INVESTIGATIONINSTRUMENT matching the given ID + summary: Update InvestigationInstruments by id tags: - InvestigationInstruments /investigationinstruments/count: @@ -6292,31 +6292,24 @@ paths: tags: - InvestigationInstruments /investigationparameters: - post: - description: Creates new INVESTIGATIONPARAMETER object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - - items: - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INVESTIGATIONPARAMETER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - - items: - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INVESTIGATIONPARAMETER' + type: array + description: Success - returns INVESTIGATIONPARAMETER that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -6326,7 +6319,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new InvestigationParameters + summary: Get InvestigationParameters tags: - InvestigationParameters patch: @@ -6366,24 +6359,31 @@ paths: summary: Update InvestigationParameters tags: - InvestigationParameters - get: - description: Retrieves a list of INVESTIGATIONPARAMETER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INVESTIGATIONPARAMETER object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' + - items: + $ref: '#/components/schemas/INVESTIGATIONPARAMETER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - type: array - description: Success - returns INVESTIGATIONPARAMETER that satisfy the filters + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' + - items: + $ref: '#/components/schemas/INVESTIGATIONPARAMETER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -6393,7 +6393,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get InvestigationParameters + summary: Create new InvestigationParameters tags: - InvestigationParameters /investigationparameters/{id_}: @@ -6422,30 +6422,22 @@ paths: summary: Delete InvestigationParameters by id tags: - InvestigationParameters - patch: - description: Updates INVESTIGATIONPARAMETER with the specified ID with details - provided in the request body + get: + description: Retrieves a list of INVESTIGATIONPARAMETER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - description: Success - returns the updated object + description: Success - the matching INVESTIGATIONPARAMETER '400': description: Bad request - Something was wrong with the request '401': @@ -6455,25 +6447,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update InvestigationParameters by id + summary: Find the INVESTIGATIONPARAMETER matching the given ID tags: - InvestigationParameters - get: - description: Retrieves a list of INVESTIGATIONPARAMETER objects + patch: + description: Updates INVESTIGATIONPARAMETER with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INVESTIGATIONPARAMETER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONPARAMETER' - description: Success - the matching INVESTIGATIONPARAMETER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -6483,7 +6483,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INVESTIGATIONPARAMETER matching the given ID + summary: Update InvestigationParameters by id tags: - InvestigationParameters /investigationparameters/count: @@ -6545,31 +6545,24 @@ paths: tags: - InvestigationParameters /investigationtypes: - post: - description: Creates new INVESTIGATIONTYPE object(s) with details provided in - the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONTYPE' - - items: - $ref: '#/components/schemas/INVESTIGATIONTYPE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INVESTIGATIONTYPE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONTYPE' - - items: - $ref: '#/components/schemas/INVESTIGATIONTYPE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INVESTIGATIONTYPE' + type: array + description: Success - returns INVESTIGATIONTYPE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -6579,7 +6572,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new InvestigationTypes + summary: Get InvestigationTypes tags: - InvestigationTypes patch: @@ -6619,24 +6612,31 @@ paths: summary: Update InvestigationTypes tags: - InvestigationTypes - get: - description: Retrieves a list of INVESTIGATIONTYPE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INVESTIGATIONTYPE object(s) with details provided in + the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONTYPE' + - items: + $ref: '#/components/schemas/INVESTIGATIONTYPE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INVESTIGATIONTYPE' - type: array - description: Success - returns INVESTIGATIONTYPE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONTYPE' + - items: + $ref: '#/components/schemas/INVESTIGATIONTYPE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -6646,7 +6646,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get InvestigationTypes + summary: Create new InvestigationTypes tags: - InvestigationTypes /investigationtypes/{id_}: @@ -6675,30 +6675,22 @@ paths: summary: Delete InvestigationTypes by id tags: - InvestigationTypes - patch: - description: Updates INVESTIGATIONTYPE with the specified ID with details provided - in the request body + get: + description: Retrieves a list of INVESTIGATIONTYPE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INVESTIGATIONTYPE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONTYPE' - description: Success - returns the updated object + description: Success - the matching INVESTIGATIONTYPE '400': description: Bad request - Something was wrong with the request '401': @@ -6708,25 +6700,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update InvestigationTypes by id + summary: Find the INVESTIGATIONTYPE matching the given ID tags: - InvestigationTypes - get: - description: Retrieves a list of INVESTIGATIONTYPE objects + patch: + description: Updates INVESTIGATIONTYPE with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INVESTIGATIONTYPE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONTYPE' - description: Success - the matching INVESTIGATIONTYPE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -6736,7 +6736,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INVESTIGATIONTYPE matching the given ID + summary: Update InvestigationTypes by id tags: - InvestigationTypes /investigationtypes/count: @@ -6797,31 +6797,24 @@ paths: tags: - InvestigationTypes /investigationusers: - post: - description: Creates new INVESTIGATIONUSER object(s) with details provided in - the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONUSER' - - items: - $ref: '#/components/schemas/INVESTIGATIONUSER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INVESTIGATIONUSER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATIONUSER' - - items: - $ref: '#/components/schemas/INVESTIGATIONUSER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INVESTIGATIONUSER' + type: array + description: Success - returns INVESTIGATIONUSER that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -6831,7 +6824,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new InvestigationUsers + summary: Get InvestigationUsers tags: - InvestigationUsers patch: @@ -6871,24 +6864,31 @@ paths: summary: Update InvestigationUsers tags: - InvestigationUsers - get: - description: Retrieves a list of INVESTIGATIONUSER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INVESTIGATIONUSER object(s) with details provided in + the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONUSER' + - items: + $ref: '#/components/schemas/INVESTIGATIONUSER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INVESTIGATIONUSER' - type: array - description: Success - returns INVESTIGATIONUSER that satisfy the filters + oneOf: + - $ref: '#/components/schemas/INVESTIGATIONUSER' + - items: + $ref: '#/components/schemas/INVESTIGATIONUSER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -6898,7 +6898,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get InvestigationUsers + summary: Create new InvestigationUsers tags: - InvestigationUsers /investigationusers/{id_}: @@ -6927,30 +6927,22 @@ paths: summary: Delete InvestigationUsers by id tags: - InvestigationUsers - patch: - description: Updates INVESTIGATIONUSER with the specified ID with details provided - in the request body + get: + description: Retrieves a list of INVESTIGATIONUSER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INVESTIGATIONUSER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONUSER' - description: Success - returns the updated object + description: Success - the matching INVESTIGATIONUSER '400': description: Bad request - Something was wrong with the request '401': @@ -6960,25 +6952,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update InvestigationUsers by id + summary: Find the INVESTIGATIONUSER matching the given ID tags: - InvestigationUsers - get: - description: Retrieves a list of INVESTIGATIONUSER objects + patch: + description: Updates INVESTIGATIONUSER with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INVESTIGATIONUSER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATIONUSER' - description: Success - the matching INVESTIGATIONUSER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -6988,7 +6988,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INVESTIGATIONUSER matching the given ID + summary: Update InvestigationUsers by id tags: - InvestigationUsers /investigationusers/count: @@ -7049,31 +7049,24 @@ paths: tags: - InvestigationUsers /investigations: - post: - description: Creates new INVESTIGATION object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATION' - - items: - $ref: '#/components/schemas/INVESTIGATION' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of INVESTIGATION objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/INVESTIGATION' - - items: - $ref: '#/components/schemas/INVESTIGATION' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/INVESTIGATION' + type: array + description: Success - returns INVESTIGATION that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -7083,7 +7076,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Investigations + summary: Get Investigations tags: - Investigations patch: @@ -7123,24 +7116,31 @@ paths: summary: Update Investigations tags: - Investigations - get: - description: Retrieves a list of INVESTIGATION objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new INVESTIGATION object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/INVESTIGATION' + - items: + $ref: '#/components/schemas/INVESTIGATION' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/INVESTIGATION' - type: array - description: Success - returns INVESTIGATION that satisfy the filters + oneOf: + - $ref: '#/components/schemas/INVESTIGATION' + - items: + $ref: '#/components/schemas/INVESTIGATION' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -7150,7 +7150,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Investigations + summary: Create new Investigations tags: - Investigations /investigations/{id_}: @@ -7179,30 +7179,22 @@ paths: summary: Delete Investigations by id tags: - Investigations - patch: - description: Updates INVESTIGATION with the specified ID with details provided - in the request body + get: + description: Retrieves a list of INVESTIGATION objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/INVESTIGATION' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATION' - description: Success - returns the updated object + description: Success - the matching INVESTIGATION '400': description: Bad request - Something was wrong with the request '401': @@ -7212,25 +7204,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Investigations by id + summary: Find the INVESTIGATION matching the given ID tags: - Investigations - get: - description: Retrieves a list of INVESTIGATION objects + patch: + description: Updates INVESTIGATION with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/INVESTIGATION' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/INVESTIGATION' - description: Success - the matching INVESTIGATION + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -7240,7 +7240,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the INVESTIGATION matching the given ID + summary: Update Investigations by id tags: - Investigations /investigations/count: @@ -7300,31 +7300,24 @@ paths: tags: - Investigations /jobs: - post: - description: Creates new JOB object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/JOB' - - items: - $ref: '#/components/schemas/JOB' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of JOB objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/JOB' - - items: - $ref: '#/components/schemas/JOB' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/JOB' + type: array + description: Success - returns JOB that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -7334,7 +7327,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Jobs + summary: Get Jobs tags: - Jobs patch: @@ -7373,24 +7366,31 @@ paths: summary: Update Jobs tags: - Jobs - get: - description: Retrieves a list of JOB objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new JOB object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/JOB' + - items: + $ref: '#/components/schemas/JOB' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/JOB' - type: array - description: Success - returns JOB that satisfy the filters + oneOf: + - $ref: '#/components/schemas/JOB' + - items: + $ref: '#/components/schemas/JOB' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -7400,7 +7400,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Jobs + summary: Create new Jobs tags: - Jobs /jobs/{id_}: @@ -7429,30 +7429,22 @@ paths: summary: Delete Jobs by id tags: - Jobs - patch: - description: Updates JOB with the specified ID with details provided in the - request body + get: + description: Retrieves a list of JOB objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/JOB' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/JOB' - description: Success - returns the updated object + description: Success - the matching JOB '400': description: Bad request - Something was wrong with the request '401': @@ -7462,25 +7454,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Jobs by id + summary: Find the JOB matching the given ID tags: - Jobs - get: - description: Retrieves a list of JOB objects + patch: + description: Updates JOB with the specified ID with details provided in the + request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JOB' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/JOB' - description: Success - the matching JOB + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -7490,7 +7490,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the JOB matching the given ID + summary: Update Jobs by id tags: - Jobs /jobs/count: @@ -7550,31 +7550,24 @@ paths: tags: - Jobs /keywords: - post: - description: Creates new KEYWORD object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/KEYWORD' - - items: - $ref: '#/components/schemas/KEYWORD' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of KEYWORD objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/KEYWORD' - - items: - $ref: '#/components/schemas/KEYWORD' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/KEYWORD' + type: array + description: Success - returns KEYWORD that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -7584,7 +7577,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Keywords + summary: Get Keywords tags: - Keywords patch: @@ -7624,24 +7617,31 @@ paths: summary: Update Keywords tags: - Keywords - get: - description: Retrieves a list of KEYWORD objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new KEYWORD object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/KEYWORD' + - items: + $ref: '#/components/schemas/KEYWORD' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/KEYWORD' - type: array - description: Success - returns KEYWORD that satisfy the filters + oneOf: + - $ref: '#/components/schemas/KEYWORD' + - items: + $ref: '#/components/schemas/KEYWORD' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -7651,7 +7651,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Keywords + summary: Create new Keywords tags: - Keywords /keywords/{id_}: @@ -7680,30 +7680,22 @@ paths: summary: Delete Keywords by id tags: - Keywords - patch: - description: Updates KEYWORD with the specified ID with details provided in - the request body + get: + description: Retrieves a list of KEYWORD objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/KEYWORD' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/KEYWORD' - description: Success - returns the updated object + description: Success - the matching KEYWORD '400': description: Bad request - Something was wrong with the request '401': @@ -7713,25 +7705,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Keywords by id + summary: Find the KEYWORD matching the given ID tags: - Keywords - get: - description: Retrieves a list of KEYWORD objects + patch: + description: Updates KEYWORD with the specified ID with details provided in + the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/KEYWORD' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/KEYWORD' - description: Success - the matching KEYWORD + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -7741,7 +7741,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the KEYWORD matching the given ID + summary: Update Keywords by id tags: - Keywords /keywords/count: @@ -7801,31 +7801,24 @@ paths: tags: - Keywords /parametertypes: - post: - description: Creates new PARAMETERTYPE object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/PARAMETERTYPE' - - items: - $ref: '#/components/schemas/PARAMETERTYPE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of PARAMETERTYPE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/PARAMETERTYPE' - - items: - $ref: '#/components/schemas/PARAMETERTYPE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/PARAMETERTYPE' + type: array + description: Success - returns PARAMETERTYPE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -7835,7 +7828,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new ParameterTypes + summary: Get ParameterTypes tags: - ParameterTypes patch: @@ -7875,24 +7868,31 @@ paths: summary: Update ParameterTypes tags: - ParameterTypes - get: - description: Retrieves a list of PARAMETERTYPE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new PARAMETERTYPE object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/PARAMETERTYPE' + - items: + $ref: '#/components/schemas/PARAMETERTYPE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/PARAMETERTYPE' - type: array - description: Success - returns PARAMETERTYPE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/PARAMETERTYPE' + - items: + $ref: '#/components/schemas/PARAMETERTYPE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -7902,7 +7902,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get ParameterTypes + summary: Create new ParameterTypes tags: - ParameterTypes /parametertypes/{id_}: @@ -7931,30 +7931,22 @@ paths: summary: Delete ParameterTypes by id tags: - ParameterTypes - patch: - description: Updates PARAMETERTYPE with the specified ID with details provided - in the request body + get: + description: Retrieves a list of PARAMETERTYPE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PARAMETERTYPE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PARAMETERTYPE' - description: Success - returns the updated object + description: Success - the matching PARAMETERTYPE '400': description: Bad request - Something was wrong with the request '401': @@ -7964,25 +7956,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update ParameterTypes by id + summary: Find the PARAMETERTYPE matching the given ID tags: - ParameterTypes - get: - description: Retrieves a list of PARAMETERTYPE objects + patch: + description: Updates PARAMETERTYPE with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PARAMETERTYPE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PARAMETERTYPE' - description: Success - the matching PARAMETERTYPE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -7992,7 +7992,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the PARAMETERTYPE matching the given ID + summary: Update ParameterTypes by id tags: - ParameterTypes /parametertypes/count: @@ -8052,31 +8052,24 @@ paths: tags: - ParameterTypes /permissiblestringvalues: - post: - description: Creates new PERMISSIBLESTRINGVALUE object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - - items: - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of PERMISSIBLESTRINGVALUE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - - items: - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' + type: array + description: Success - returns PERMISSIBLESTRINGVALUE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -8086,7 +8079,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new PermissibleStringValues + summary: Get PermissibleStringValues tags: - PermissibleStringValues patch: @@ -8126,24 +8119,31 @@ paths: summary: Update PermissibleStringValues tags: - PermissibleStringValues - get: - description: Retrieves a list of PERMISSIBLESTRINGVALUE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new PERMISSIBLESTRINGVALUE object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' + - items: + $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - type: array - description: Success - returns PERMISSIBLESTRINGVALUE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' + - items: + $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -8153,7 +8153,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get PermissibleStringValues + summary: Create new PermissibleStringValues tags: - PermissibleStringValues /permissiblestringvalues/{id_}: @@ -8182,30 +8182,22 @@ paths: summary: Delete PermissibleStringValues by id tags: - PermissibleStringValues - patch: - description: Updates PERMISSIBLESTRINGVALUE with the specified ID with details - provided in the request body + get: + description: Retrieves a list of PERMISSIBLESTRINGVALUE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - description: Success - returns the updated object + description: Success - the matching PERMISSIBLESTRINGVALUE '400': description: Bad request - Something was wrong with the request '401': @@ -8215,25 +8207,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update PermissibleStringValues by id + summary: Find the PERMISSIBLESTRINGVALUE matching the given ID tags: - PermissibleStringValues - get: - description: Retrieves a list of PERMISSIBLESTRINGVALUE objects + patch: + description: Updates PERMISSIBLESTRINGVALUE with the specified ID with details + provided in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PERMISSIBLESTRINGVALUE' - description: Success - the matching PERMISSIBLESTRINGVALUE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -8243,7 +8243,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the PERMISSIBLESTRINGVALUE matching the given ID + summary: Update PermissibleStringValues by id tags: - PermissibleStringValues /permissiblestringvalues/count: @@ -8305,8 +8305,38 @@ paths: tags: - PermissibleStringValues /publicsteps: - post: - description: Creates new PUBLICSTEP object(s) with details provided in the request + get: + description: Retrieves a list of PUBLICSTEP objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/PUBLICSTEP' + type: array + description: Success - returns PUBLICSTEP that satisfy the filters + '400': + description: Bad request - Something was wrong with the request + '401': + description: Unauthorized - No session ID was found in the HTTP Authorization + header + '403': + description: Forbidden - The session ID provided is invalid + '404': + description: No such record - Unable to find a record in the database + summary: Get PublicSteps + tags: + - PublicSteps + patch: + description: Updates PUBLICSTEP object(s) with details provided in the request body requestBody: content: @@ -8317,7 +8347,7 @@ paths: - items: $ref: '#/components/schemas/PUBLICSTEP' type: array - description: The values to use to create the new object(s) with + description: The values to use to update the object(s) with required: true responses: '200': @@ -8329,7 +8359,7 @@ paths: - items: $ref: '#/components/schemas/PUBLICSTEP' type: array - description: Success - returns the created object + description: Success - returns the updated object(s) '400': description: Bad request - Something was wrong with the request '401': @@ -8339,11 +8369,11 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new PublicSteps + summary: Update PublicSteps tags: - PublicSteps - patch: - description: Updates PUBLICSTEP object(s) with details provided in the request + post: + description: Creates new PUBLICSTEP object(s) with details provided in the request body requestBody: content: @@ -8354,7 +8384,7 @@ paths: - items: $ref: '#/components/schemas/PUBLICSTEP' type: array - description: The values to use to update the object(s) with + description: The values to use to create the new object(s) with required: true responses: '200': @@ -8366,7 +8396,7 @@ paths: - items: $ref: '#/components/schemas/PUBLICSTEP' type: array - description: Success - returns the updated object(s) + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -8376,37 +8406,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update PublicSteps - tags: - - PublicSteps - get: - description: Retrieves a list of PUBLICSTEP objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' - responses: - '200': - content: - application/json: - schema: - items: - $ref: '#/components/schemas/PUBLICSTEP' - type: array - description: Success - returns PUBLICSTEP that satisfy the filters - '400': - description: Bad request - Something was wrong with the request - '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header - '403': - description: Forbidden - The session ID provided is invalid - '404': - description: No such record - Unable to find a record in the database - summary: Get PublicSteps + summary: Create new PublicSteps tags: - PublicSteps /publicsteps/{id_}: @@ -8435,30 +8435,22 @@ paths: summary: Delete PublicSteps by id tags: - PublicSteps - patch: - description: Updates PUBLICSTEP with the specified ID with details provided - in the request body + get: + description: Retrieves a list of PUBLICSTEP objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PUBLICSTEP' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PUBLICSTEP' - description: Success - returns the updated object + description: Success - the matching PUBLICSTEP '400': description: Bad request - Something was wrong with the request '401': @@ -8468,25 +8460,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update PublicSteps by id + summary: Find the PUBLICSTEP matching the given ID tags: - PublicSteps - get: - description: Retrieves a list of PUBLICSTEP objects + patch: + description: Updates PUBLICSTEP with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PUBLICSTEP' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PUBLICSTEP' - description: Success - the matching PUBLICSTEP + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -8496,7 +8496,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the PUBLICSTEP matching the given ID + summary: Update PublicSteps by id tags: - PublicSteps /publicsteps/count: @@ -8556,31 +8556,24 @@ paths: tags: - PublicSteps /publications: - post: - description: Creates new PUBLICATION object(s) with details provided in the - request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/PUBLICATION' - - items: - $ref: '#/components/schemas/PUBLICATION' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of PUBLICATION objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/PUBLICATION' - - items: - $ref: '#/components/schemas/PUBLICATION' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/PUBLICATION' + type: array + description: Success - returns PUBLICATION that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -8590,7 +8583,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Publications + summary: Get Publications tags: - Publications patch: @@ -8630,24 +8623,31 @@ paths: summary: Update Publications tags: - Publications - get: - description: Retrieves a list of PUBLICATION objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new PUBLICATION object(s) with details provided in the + request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/PUBLICATION' + - items: + $ref: '#/components/schemas/PUBLICATION' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/PUBLICATION' - type: array - description: Success - returns PUBLICATION that satisfy the filters + oneOf: + - $ref: '#/components/schemas/PUBLICATION' + - items: + $ref: '#/components/schemas/PUBLICATION' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -8657,7 +8657,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Publications + summary: Create new Publications tags: - Publications /publications/{id_}: @@ -8686,30 +8686,22 @@ paths: summary: Delete Publications by id tags: - Publications - patch: - description: Updates PUBLICATION with the specified ID with details provided - in the request body + get: + description: Retrieves a list of PUBLICATION objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PUBLICATION' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PUBLICATION' - description: Success - returns the updated object + description: Success - the matching PUBLICATION '400': description: Bad request - Something was wrong with the request '401': @@ -8719,25 +8711,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Publications by id + summary: Find the PUBLICATION matching the given ID tags: - Publications - get: - description: Retrieves a list of PUBLICATION objects + patch: + description: Updates PUBLICATION with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PUBLICATION' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/PUBLICATION' - description: Success - the matching PUBLICATION + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -8747,7 +8747,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the PUBLICATION matching the given ID + summary: Update Publications by id tags: - Publications /publications/count: @@ -8807,31 +8807,24 @@ paths: tags: - Publications /relateddatafiles: - post: - description: Creates new RELATEDDATAFILE object(s) with details provided in - the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/RELATEDDATAFILE' - - items: - $ref: '#/components/schemas/RELATEDDATAFILE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of RELATEDDATAFILE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/RELATEDDATAFILE' - - items: - $ref: '#/components/schemas/RELATEDDATAFILE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/RELATEDDATAFILE' + type: array + description: Success - returns RELATEDDATAFILE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -8841,7 +8834,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new RelatedDatafiles + summary: Get RelatedDatafiles tags: - RelatedDatafiles patch: @@ -8881,24 +8874,31 @@ paths: summary: Update RelatedDatafiles tags: - RelatedDatafiles - get: - description: Retrieves a list of RELATEDDATAFILE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new RELATEDDATAFILE object(s) with details provided in + the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/RELATEDDATAFILE' + - items: + $ref: '#/components/schemas/RELATEDDATAFILE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/RELATEDDATAFILE' - type: array - description: Success - returns RELATEDDATAFILE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/RELATEDDATAFILE' + - items: + $ref: '#/components/schemas/RELATEDDATAFILE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -8908,7 +8908,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get RelatedDatafiles + summary: Create new RelatedDatafiles tags: - RelatedDatafiles /relateddatafiles/{id_}: @@ -8937,6 +8937,34 @@ paths: summary: Delete RelatedDatafiles by id tags: - RelatedDatafiles + get: + description: Retrieves a list of RELATEDDATAFILE objects + parameters: + - description: The id of the entity to retrieve + in: path + name: id + required: true + schema: + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RELATEDDATAFILE' + description: Success - the matching RELATEDDATAFILE + '400': + description: Bad request - Something was wrong with the request + '401': + description: Unauthorized - No session ID was found in the HTTP Authorization + header + '403': + description: Forbidden - The session ID provided is invalid + '404': + description: No such record - Unable to find a record in the database + summary: Find the RELATEDDATAFILE matching the given ID + tags: + - RelatedDatafiles patch: description: Updates RELATEDDATAFILE with the specified ID with details provided in the request body @@ -8973,22 +9001,21 @@ paths: summary: Update RelatedDatafiles by id tags: - RelatedDatafiles + /relateddatafiles/count: get: - description: Retrieves a list of RELATEDDATAFILE objects + description: Return the count of the RELATEDDATAFILE objects that would be retrieved + given the filters provided parameters: - - description: The id of the entity to retrieve - in: path - name: id - required: true - schema: - type: integer + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/RELATEDDATAFILE' - description: Success - the matching RELATEDDATAFILE + type: integer + description: Success - The count of the RELATEDDATAFILE objects '400': description: Bad request - Something was wrong with the request '401': @@ -8998,15 +9025,18 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the RELATEDDATAFILE matching the given ID + summary: Count RelatedDatafiles tags: - RelatedDatafiles - /relateddatafiles/count: + /relateddatafiles/findone: get: - description: Return the count of the RELATEDDATAFILE objects that would be retrieved - given the filters provided + description: Retrieves the first RELATEDDATAFILE objects that satisfies the + filters. parameters: - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' - $ref: '#/components/parameters/DISTINCT_FILTER' - $ref: '#/components/parameters/INCLUDE_FILTER' responses: @@ -9014,8 +9044,8 @@ paths: content: application/json: schema: - type: integer - description: Success - The count of the RELATEDDATAFILE objects + $ref: '#/components/schemas/RELATEDDATAFILE' + description: Success - a RELATEDDATAFILE object that satisfies the filters '400': description: Bad request - Something was wrong with the request '401': @@ -9025,13 +9055,12 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Count RelatedDatafiles + summary: Get single RELATEDDATAFILE tags: - RelatedDatafiles - /relateddatafiles/findone: + /rules: get: - description: Retrieves the first RELATEDDATAFILE objects that satisfies the - filters. + description: Retrieves a list of RULE objects parameters: - $ref: '#/components/parameters/WHERE_FILTER' - $ref: '#/components/parameters/ORDER_FILTER' @@ -9044,8 +9073,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/RELATEDDATAFILE' - description: Success - a RELATEDDATAFILE object that satisfies the filters + items: + $ref: '#/components/schemas/RULE' + type: array + description: Success - returns RULE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -9055,13 +9086,11 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get single RELATEDDATAFILE + summary: Get Rules tags: - - RelatedDatafiles - /rules: - post: - description: Creates new RULE object(s) with details provided in the request - body + - Rules + patch: + description: Updates RULE object(s) with details provided in the request body requestBody: content: application/json: @@ -9071,7 +9100,7 @@ paths: - items: $ref: '#/components/schemas/RULE' type: array - description: The values to use to create the new object(s) with + description: The values to use to update the object(s) with required: true responses: '200': @@ -9083,7 +9112,7 @@ paths: - items: $ref: '#/components/schemas/RULE' type: array - description: Success - returns the created object + description: Success - returns the updated object(s) '400': description: Bad request - Something was wrong with the request '401': @@ -9093,11 +9122,12 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Rules + summary: Update Rules tags: - Rules - patch: - description: Updates RULE object(s) with details provided in the request body + post: + description: Creates new RULE object(s) with details provided in the request + body requestBody: content: application/json: @@ -9107,7 +9137,7 @@ paths: - items: $ref: '#/components/schemas/RULE' type: array - description: The values to use to update the object(s) with + description: The values to use to create the new object(s) with required: true responses: '200': @@ -9119,37 +9149,7 @@ paths: - items: $ref: '#/components/schemas/RULE' type: array - description: Success - returns the updated object(s) - '400': - description: Bad request - Something was wrong with the request - '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header - '403': - description: Forbidden - The session ID provided is invalid - '404': - description: No such record - Unable to find a record in the database - summary: Update Rules - tags: - - Rules - get: - description: Retrieves a list of RULE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' - responses: - '200': - content: - application/json: - schema: - items: - $ref: '#/components/schemas/RULE' - type: array - description: Success - returns RULE that satisfy the filters + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -9159,7 +9159,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Rules + summary: Create new Rules tags: - Rules /rules/{id_}: @@ -9188,30 +9188,22 @@ paths: summary: Delete Rules by id tags: - Rules - patch: - description: Updates RULE with the specified ID with details provided in the - request body + get: + description: Retrieves a list of RULE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RULE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/RULE' - description: Success - returns the updated object + description: Success - the matching RULE '400': description: Bad request - Something was wrong with the request '401': @@ -9221,25 +9213,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Rules by id + summary: Find the RULE matching the given ID tags: - Rules - get: - description: Retrieves a list of RULE objects + patch: + description: Updates RULE with the specified ID with details provided in the + request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RULE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/RULE' - description: Success - the matching RULE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -9249,7 +9249,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the RULE matching the given ID + summary: Update Rules by id tags: - Rules /rules/count: @@ -9309,31 +9309,24 @@ paths: tags: - Rules /sampleparameters: - post: - description: Creates new SAMPLEPARAMETER object(s) with details provided in - the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/SAMPLEPARAMETER' - - items: - $ref: '#/components/schemas/SAMPLEPARAMETER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of SAMPLEPARAMETER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/SAMPLEPARAMETER' - - items: - $ref: '#/components/schemas/SAMPLEPARAMETER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/SAMPLEPARAMETER' + type: array + description: Success - returns SAMPLEPARAMETER that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -9343,7 +9336,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new SampleParameters + summary: Get SampleParameters tags: - SampleParameters patch: @@ -9383,24 +9376,31 @@ paths: summary: Update SampleParameters tags: - SampleParameters - get: - description: Retrieves a list of SAMPLEPARAMETER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new SAMPLEPARAMETER object(s) with details provided in + the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SAMPLEPARAMETER' + - items: + $ref: '#/components/schemas/SAMPLEPARAMETER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/SAMPLEPARAMETER' - type: array - description: Success - returns SAMPLEPARAMETER that satisfy the filters + oneOf: + - $ref: '#/components/schemas/SAMPLEPARAMETER' + - items: + $ref: '#/components/schemas/SAMPLEPARAMETER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -9410,7 +9410,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get SampleParameters + summary: Create new SampleParameters tags: - SampleParameters /sampleparameters/{id_}: @@ -9439,30 +9439,22 @@ paths: summary: Delete SampleParameters by id tags: - SampleParameters - patch: - description: Updates SAMPLEPARAMETER with the specified ID with details provided - in the request body + get: + description: Retrieves a list of SAMPLEPARAMETER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SAMPLEPARAMETER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SAMPLEPARAMETER' - description: Success - returns the updated object + description: Success - the matching SAMPLEPARAMETER '400': description: Bad request - Something was wrong with the request '401': @@ -9472,25 +9464,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update SampleParameters by id + summary: Find the SAMPLEPARAMETER matching the given ID tags: - SampleParameters - get: - description: Retrieves a list of SAMPLEPARAMETER objects + patch: + description: Updates SAMPLEPARAMETER with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SAMPLEPARAMETER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SAMPLEPARAMETER' - description: Success - the matching SAMPLEPARAMETER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -9500,7 +9500,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the SAMPLEPARAMETER matching the given ID + summary: Update SampleParameters by id tags: - SampleParameters /sampleparameters/count: @@ -9561,31 +9561,24 @@ paths: tags: - SampleParameters /sampletypes: - post: - description: Creates new SAMPLETYPE object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/SAMPLETYPE' - - items: - $ref: '#/components/schemas/SAMPLETYPE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of SAMPLETYPE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/SAMPLETYPE' - - items: - $ref: '#/components/schemas/SAMPLETYPE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/SAMPLETYPE' + type: array + description: Success - returns SAMPLETYPE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -9595,7 +9588,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new SampleTypes + summary: Get SampleTypes tags: - SampleTypes patch: @@ -9635,24 +9628,31 @@ paths: summary: Update SampleTypes tags: - SampleTypes - get: - description: Retrieves a list of SAMPLETYPE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new SAMPLETYPE object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SAMPLETYPE' + - items: + $ref: '#/components/schemas/SAMPLETYPE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/SAMPLETYPE' - type: array - description: Success - returns SAMPLETYPE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/SAMPLETYPE' + - items: + $ref: '#/components/schemas/SAMPLETYPE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -9662,7 +9662,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get SampleTypes + summary: Create new SampleTypes tags: - SampleTypes /sampletypes/{id_}: @@ -9691,30 +9691,22 @@ paths: summary: Delete SampleTypes by id tags: - SampleTypes - patch: - description: Updates SAMPLETYPE with the specified ID with details provided - in the request body + get: + description: Retrieves a list of SAMPLETYPE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SAMPLETYPE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SAMPLETYPE' - description: Success - returns the updated object + description: Success - the matching SAMPLETYPE '400': description: Bad request - Something was wrong with the request '401': @@ -9724,25 +9716,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update SampleTypes by id + summary: Find the SAMPLETYPE matching the given ID tags: - SampleTypes - get: - description: Retrieves a list of SAMPLETYPE objects + patch: + description: Updates SAMPLETYPE with the specified ID with details provided + in the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SAMPLETYPE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SAMPLETYPE' - description: Success - the matching SAMPLETYPE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -9752,7 +9752,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the SAMPLETYPE matching the given ID + summary: Update SampleTypes by id tags: - SampleTypes /sampletypes/count: @@ -9812,31 +9812,24 @@ paths: tags: - SampleTypes /samples: - post: - description: Creates new SAMPLE object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/SAMPLE' - - items: - $ref: '#/components/schemas/SAMPLE' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of SAMPLE objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/SAMPLE' - - items: - $ref: '#/components/schemas/SAMPLE' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/SAMPLE' + type: array + description: Success - returns SAMPLE that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -9846,7 +9839,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Samples + summary: Get Samples tags: - Samples patch: @@ -9885,24 +9878,31 @@ paths: summary: Update Samples tags: - Samples - get: - description: Retrieves a list of SAMPLE objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new SAMPLE object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SAMPLE' + - items: + $ref: '#/components/schemas/SAMPLE' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/SAMPLE' - type: array - description: Success - returns SAMPLE that satisfy the filters + oneOf: + - $ref: '#/components/schemas/SAMPLE' + - items: + $ref: '#/components/schemas/SAMPLE' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -9912,7 +9912,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Samples + summary: Create new Samples tags: - Samples /samples/{id_}: @@ -9941,30 +9941,22 @@ paths: summary: Delete Samples by id tags: - Samples - patch: - description: Updates SAMPLE with the specified ID with details provided in the - request body + get: + description: Retrieves a list of SAMPLE objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SAMPLE' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SAMPLE' - description: Success - returns the updated object + description: Success - the matching SAMPLE '400': description: Bad request - Something was wrong with the request '401': @@ -9974,25 +9966,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Samples by id + summary: Find the SAMPLE matching the given ID tags: - Samples - get: - description: Retrieves a list of SAMPLE objects + patch: + description: Updates SAMPLE with the specified ID with details provided in the + request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SAMPLE' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SAMPLE' - description: Success - the matching SAMPLE + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -10002,7 +10002,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the SAMPLE matching the given ID + summary: Update Samples by id tags: - Samples /samples/count: @@ -10062,31 +10062,24 @@ paths: tags: - Samples /shifts: - post: - description: Creates new SHIFT object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/SHIFT' - - items: - $ref: '#/components/schemas/SHIFT' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of SHIFT objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/SHIFT' - - items: - $ref: '#/components/schemas/SHIFT' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/SHIFT' + type: array + description: Success - returns SHIFT that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -10096,7 +10089,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Shifts + summary: Get Shifts tags: - Shifts patch: @@ -10135,24 +10128,31 @@ paths: summary: Update Shifts tags: - Shifts - get: - description: Retrieves a list of SHIFT objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new SHIFT object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/SHIFT' + - items: + $ref: '#/components/schemas/SHIFT' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/SHIFT' - type: array - description: Success - returns SHIFT that satisfy the filters + oneOf: + - $ref: '#/components/schemas/SHIFT' + - items: + $ref: '#/components/schemas/SHIFT' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -10162,7 +10162,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Shifts + summary: Create new Shifts tags: - Shifts /shifts/{id_}: @@ -10191,30 +10191,22 @@ paths: summary: Delete Shifts by id tags: - Shifts - patch: - description: Updates SHIFT with the specified ID with details provided in the - request body + get: + description: Retrieves a list of SHIFT objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SHIFT' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SHIFT' - description: Success - returns the updated object + description: Success - the matching SHIFT '400': description: Bad request - Something was wrong with the request '401': @@ -10224,25 +10216,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Shifts by id + summary: Find the SHIFT matching the given ID tags: - Shifts - get: - description: Retrieves a list of SHIFT objects + patch: + description: Updates SHIFT with the specified ID with details provided in the + request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SHIFT' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/SHIFT' - description: Success - the matching SHIFT + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -10252,7 +10252,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the SHIFT matching the given ID + summary: Update Shifts by id tags: - Shifts /shifts/count: @@ -10312,31 +10312,24 @@ paths: tags: - Shifts /studies: - post: - description: Creates new STUDY object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/STUDY' - - items: - $ref: '#/components/schemas/STUDY' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of STUDY objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/STUDY' - - items: - $ref: '#/components/schemas/STUDY' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/STUDY' + type: array + description: Success - returns STUDY that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -10346,7 +10339,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Studies + summary: Get Studies tags: - Studies patch: @@ -10385,24 +10378,31 @@ paths: summary: Update Studies tags: - Studies - get: - description: Retrieves a list of STUDY objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new STUDY object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/STUDY' + - items: + $ref: '#/components/schemas/STUDY' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/STUDY' - type: array - description: Success - returns STUDY that satisfy the filters + oneOf: + - $ref: '#/components/schemas/STUDY' + - items: + $ref: '#/components/schemas/STUDY' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -10412,7 +10412,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Studies + summary: Create new Studies tags: - Studies /studies/{id_}: @@ -10441,30 +10441,22 @@ paths: summary: Delete Studies by id tags: - Studies - patch: - description: Updates STUDY with the specified ID with details provided in the - request body + get: + description: Retrieves a list of STUDY objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/STUDY' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/STUDY' - description: Success - returns the updated object + description: Success - the matching STUDY '400': description: Bad request - Something was wrong with the request '401': @@ -10474,25 +10466,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Studies by id + summary: Find the STUDY matching the given ID tags: - Studies - get: - description: Retrieves a list of STUDY objects + patch: + description: Updates STUDY with the specified ID with details provided in the + request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/STUDY' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/STUDY' - description: Success - the matching STUDY + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -10502,7 +10502,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the STUDY matching the given ID + summary: Update Studies by id tags: - Studies /studies/count: @@ -10562,31 +10562,24 @@ paths: tags: - Studies /studyinvestigations: - post: - description: Creates new STUDYINVESTIGATION object(s) with details provided - in the request body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/STUDYINVESTIGATION' - - items: - $ref: '#/components/schemas/STUDYINVESTIGATION' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of STUDYINVESTIGATION objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/STUDYINVESTIGATION' - - items: - $ref: '#/components/schemas/STUDYINVESTIGATION' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/STUDYINVESTIGATION' + type: array + description: Success - returns STUDYINVESTIGATION that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -10596,7 +10589,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new StudyInvestigations + summary: Get StudyInvestigations tags: - StudyInvestigations patch: @@ -10636,24 +10629,31 @@ paths: summary: Update StudyInvestigations tags: - StudyInvestigations - get: - description: Retrieves a list of STUDYINVESTIGATION objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new STUDYINVESTIGATION object(s) with details provided + in the request body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/STUDYINVESTIGATION' + - items: + $ref: '#/components/schemas/STUDYINVESTIGATION' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/STUDYINVESTIGATION' - type: array - description: Success - returns STUDYINVESTIGATION that satisfy the filters + oneOf: + - $ref: '#/components/schemas/STUDYINVESTIGATION' + - items: + $ref: '#/components/schemas/STUDYINVESTIGATION' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -10663,7 +10663,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get StudyInvestigations + summary: Create new StudyInvestigations tags: - StudyInvestigations /studyinvestigations/{id_}: @@ -10692,6 +10692,34 @@ paths: summary: Delete StudyInvestigations by id tags: - StudyInvestigations + get: + description: Retrieves a list of STUDYINVESTIGATION objects + parameters: + - description: The id of the entity to retrieve + in: path + name: id + required: true + schema: + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/STUDYINVESTIGATION' + description: Success - the matching STUDYINVESTIGATION + '400': + description: Bad request - Something was wrong with the request + '401': + description: Unauthorized - No session ID was found in the HTTP Authorization + header + '403': + description: Forbidden - The session ID provided is invalid + '404': + description: No such record - Unable to find a record in the database + summary: Find the STUDYINVESTIGATION matching the given ID + tags: + - StudyInvestigations patch: description: Updates STUDYINVESTIGATION with the specified ID with details provided in the request body @@ -10728,22 +10756,21 @@ paths: summary: Update StudyInvestigations by id tags: - StudyInvestigations + /studyinvestigations/count: get: - description: Retrieves a list of STUDYINVESTIGATION objects + description: Return the count of the STUDYINVESTIGATION objects that would be + retrieved given the filters provided parameters: - - description: The id of the entity to retrieve - in: path - name: id - required: true - schema: - type: integer + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - $ref: '#/components/schemas/STUDYINVESTIGATION' - description: Success - the matching STUDYINVESTIGATION + type: integer + description: Success - The count of the STUDYINVESTIGATION objects '400': description: Bad request - Something was wrong with the request '401': @@ -10753,15 +10780,18 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the STUDYINVESTIGATION matching the given ID + summary: Count StudyInvestigations tags: - StudyInvestigations - /studyinvestigations/count: + /studyinvestigations/findone: get: - description: Return the count of the STUDYINVESTIGATION objects that would be - retrieved given the filters provided + description: Retrieves the first STUDYINVESTIGATION objects that satisfies the + filters. parameters: - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' - $ref: '#/components/parameters/DISTINCT_FILTER' - $ref: '#/components/parameters/INCLUDE_FILTER' responses: @@ -10769,8 +10799,8 @@ paths: content: application/json: schema: - type: integer - description: Success - The count of the STUDYINVESTIGATION objects + $ref: '#/components/schemas/STUDYINVESTIGATION' + description: Success - a STUDYINVESTIGATION object that satisfies the filters '400': description: Bad request - Something was wrong with the request '401': @@ -10780,13 +10810,12 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Count StudyInvestigations + summary: Get single STUDYINVESTIGATION tags: - StudyInvestigations - /studyinvestigations/findone: + /usergroups: get: - description: Retrieves the first STUDYINVESTIGATION objects that satisfies the - filters. + description: Retrieves a list of USERGROUP objects parameters: - $ref: '#/components/parameters/WHERE_FILTER' - $ref: '#/components/parameters/ORDER_FILTER' @@ -10799,8 +10828,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/STUDYINVESTIGATION' - description: Success - a STUDYINVESTIGATION object that satisfies the filters + items: + $ref: '#/components/schemas/USERGROUP' + type: array + description: Success - returns USERGROUP that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -10810,12 +10841,11 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get single STUDYINVESTIGATION + summary: Get UserGroups tags: - - StudyInvestigations - /usergroups: - post: - description: Creates new USERGROUP object(s) with details provided in the request + - UserGroups + patch: + description: Updates USERGROUP object(s) with details provided in the request body requestBody: content: @@ -10826,7 +10856,7 @@ paths: - items: $ref: '#/components/schemas/USERGROUP' type: array - description: The values to use to create the new object(s) with + description: The values to use to update the object(s) with required: true responses: '200': @@ -10838,7 +10868,7 @@ paths: - items: $ref: '#/components/schemas/USERGROUP' type: array - description: Success - returns the created object + description: Success - returns the updated object(s) '400': description: Bad request - Something was wrong with the request '401': @@ -10848,11 +10878,11 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new UserGroups + summary: Update UserGroups tags: - UserGroups - patch: - description: Updates USERGROUP object(s) with details provided in the request + post: + description: Creates new USERGROUP object(s) with details provided in the request body requestBody: content: @@ -10863,7 +10893,7 @@ paths: - items: $ref: '#/components/schemas/USERGROUP' type: array - description: The values to use to update the object(s) with + description: The values to use to create the new object(s) with required: true responses: '200': @@ -10875,37 +10905,7 @@ paths: - items: $ref: '#/components/schemas/USERGROUP' type: array - description: Success - returns the updated object(s) - '400': - description: Bad request - Something was wrong with the request - '401': - description: Unauthorized - No session ID was found in the HTTP Authorization - header - '403': - description: Forbidden - The session ID provided is invalid - '404': - description: No such record - Unable to find a record in the database - summary: Update UserGroups - tags: - - UserGroups - get: - description: Retrieves a list of USERGROUP objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' - responses: - '200': - content: - application/json: - schema: - items: - $ref: '#/components/schemas/USERGROUP' - type: array - description: Success - returns USERGROUP that satisfy the filters + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -10915,7 +10915,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get UserGroups + summary: Create new UserGroups tags: - UserGroups /usergroups/{id_}: @@ -10944,30 +10944,22 @@ paths: summary: Delete UserGroups by id tags: - UserGroups - patch: - description: Updates USERGROUP with the specified ID with details provided in - the request body + get: + description: Retrieves a list of USERGROUP objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/USERGROUP' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/USERGROUP' - description: Success - returns the updated object + description: Success - the matching USERGROUP '400': description: Bad request - Something was wrong with the request '401': @@ -10977,25 +10969,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update UserGroups by id + summary: Find the USERGROUP matching the given ID tags: - UserGroups - get: - description: Retrieves a list of USERGROUP objects + patch: + description: Updates USERGROUP with the specified ID with details provided in + the request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/USERGROUP' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/USERGROUP' - description: Success - the matching USERGROUP + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -11005,7 +11005,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the USERGROUP matching the given ID + summary: Update UserGroups by id tags: - UserGroups /usergroups/count: @@ -11065,31 +11065,24 @@ paths: tags: - UserGroups /users: - post: - description: Creates new USER object(s) with details provided in the request - body - requestBody: - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/USER' - - items: - $ref: '#/components/schemas/USER' - type: array - description: The values to use to create the new object(s) with - required: true + get: + description: Retrieves a list of USER objects + parameters: + - $ref: '#/components/parameters/WHERE_FILTER' + - $ref: '#/components/parameters/ORDER_FILTER' + - $ref: '#/components/parameters/LIMIT_FILTER' + - $ref: '#/components/parameters/SKIP_FILTER' + - $ref: '#/components/parameters/DISTINCT_FILTER' + - $ref: '#/components/parameters/INCLUDE_FILTER' responses: '200': content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/USER' - - items: - $ref: '#/components/schemas/USER' - type: array - description: Success - returns the created object + items: + $ref: '#/components/schemas/USER' + type: array + description: Success - returns USER that satisfy the filters '400': description: Bad request - Something was wrong with the request '401': @@ -11099,7 +11092,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Create new Users + summary: Get Users tags: - Users patch: @@ -11138,24 +11131,31 @@ paths: summary: Update Users tags: - Users - get: - description: Retrieves a list of USER objects - parameters: - - $ref: '#/components/parameters/WHERE_FILTER' - - $ref: '#/components/parameters/ORDER_FILTER' - - $ref: '#/components/parameters/LIMIT_FILTER' - - $ref: '#/components/parameters/SKIP_FILTER' - - $ref: '#/components/parameters/DISTINCT_FILTER' - - $ref: '#/components/parameters/INCLUDE_FILTER' + post: + description: Creates new USER object(s) with details provided in the request + body + requestBody: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/USER' + - items: + $ref: '#/components/schemas/USER' + type: array + description: The values to use to create the new object(s) with + required: true responses: '200': content: application/json: schema: - items: - $ref: '#/components/schemas/USER' - type: array - description: Success - returns USER that satisfy the filters + oneOf: + - $ref: '#/components/schemas/USER' + - items: + $ref: '#/components/schemas/USER' + type: array + description: Success - returns the created object '400': description: Bad request - Something was wrong with the request '401': @@ -11165,7 +11165,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Get Users + summary: Create new Users tags: - Users /users/{id_}: @@ -11194,30 +11194,22 @@ paths: summary: Delete Users by id tags: - Users - patch: - description: Updates USER with the specified ID with details provided in the - request body + get: + description: Retrieves a list of USER objects parameters: - - description: The id of the entity to update + - description: The id of the entity to retrieve in: path name: id required: true schema: type: integer - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/USER' - description: The values to use to update the object(s) with - required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/USER' - description: Success - returns the updated object + description: Success - the matching USER '400': description: Bad request - Something was wrong with the request '401': @@ -11227,25 +11219,33 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Update Users by id + summary: Find the USER matching the given ID tags: - Users - get: - description: Retrieves a list of USER objects + patch: + description: Updates USER with the specified ID with details provided in the + request body parameters: - - description: The id of the entity to retrieve + - description: The id of the entity to update in: path name: id required: true schema: type: integer + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/USER' + description: The values to use to update the object(s) with + required: true responses: '200': content: application/json: schema: $ref: '#/components/schemas/USER' - description: Success - the matching USER + description: Success - returns the updated object '400': description: Bad request - Something was wrong with the request '401': @@ -11255,7 +11255,7 @@ paths: description: Forbidden - The session ID provided is invalid '404': description: No such record - Unable to find a record in the database - summary: Find the USER matching the given ID + summary: Update Users by id tags: - Users /users/count: @@ -11332,23 +11332,34 @@ paths: summary: Delete session tags: - Sessions - put: - description: Refreshes a users session + get: + description: Gives details of a user's session responses: '200': content: application/json: schema: - description: Session ID - example: xxxxxx-yyyyyyy-zzzzzz - type: string - description: Success - the user's session ID that has been refreshed + properties: + EXPIREDATETIME: + description: When this session expires + example: '2017-07-21T17:32:28Z' + format: datetime + type: string + ID: + description: The session ID + example: xxxxxx-yyyyyyy-zzzzzz + type: string + USERNAME: + description: Username associated with this session + type: string + type: object + description: Success - a user's session details '401': description: Unauthorized - No session ID was found in the HTTP Authorization header '403': description: Forbidden - The session ID provided is invalid - summary: Refresh session + summary: Get session details tags: - Sessions post: @@ -11388,34 +11399,23 @@ paths: summary: Login tags: - Sessions - get: - description: Gives details of a user's session + put: + description: Refreshes a users session responses: '200': content: application/json: schema: - properties: - EXPIREDATETIME: - description: When this session expires - example: '2017-07-21T17:32:28Z' - format: datetime - type: string - ID: - description: The session ID - example: xxxxxx-yyyyyyy-zzzzzz - type: string - USERNAME: - description: Username associated with this session - type: string - type: object - description: Success - a user's session details + description: Session ID + example: xxxxxx-yyyyyyy-zzzzzz + type: string + description: Success - the user's session ID that has been refreshed '401': description: Unauthorized - No session ID was found in the HTTP Authorization header '403': description: Forbidden - The session ID provided is invalid - summary: Get session details + summary: Refresh session tags: - Sessions /instruments/{id_}/facilitycycles: From ed562e8940c0838a26e023b1f76312466d9bf1f5 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 20 Nov 2020 15:16:21 +0000 Subject: [PATCH 40/46] #145: Ensure updated data is pushed at the end of the request - This will prevent an issue where you're updating multiple pieces of data and the request returns a 400, you don't know which pieces of data have been updated --- common/icat/helpers.py | 30 ++++++++++++++++++++++++------ common/icat/query.py | 2 +- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 3b47d216..f0ca33be 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -177,8 +177,12 @@ def update_attributes(old_entity, new_entity): f" {old_entity.BeanName} entity" ) + return old_entity + + +def push_data_updates_to_icat(entity): try: - old_entity.update() + entity.update() except (ICATValidationError, ICATInternalError) as e: raise PythonICATError(e) @@ -263,7 +267,8 @@ def update_entity_by_id(client, table_name, id_, new_data): # There will only ever be one record associated with a single ID - if a record with # the specified ID cannot be found, it'll be picked up by the MissingRecordError in # get_entity_by_id() - update_attributes(entity_id_data, new_data) + updated_icat_entity = update_attributes(entity_id_data, new_data) + push_data_updates_to_icat(updated_icat_entity) # The record is re-obtained from Python ICAT (rather than using entity_id_data) to # show to the user whether the change has actually been applied @@ -388,18 +393,31 @@ def update_entities(client, table_name, data_to_update): if not isinstance(data_to_update, list): data_to_update = [data_to_update] - for entity in data_to_update: + updated_icat_data = [] + + for entity_request in data_to_update: try: - updated_result = update_entity_by_id( - client, table_name, entity["id"], entity + entity_data = get_entity_by_id( + client, + table_name, + entity_request["id"], + False, + return_related_entities=True, ) - updated_data.append(updated_result) + + updated_entity_data = update_attributes(entity_data, entity_request) + updated_icat_data.append(updated_entity_data) except KeyError: raise BadRequestError( "The new data in the request body must contain the ID (using the key:" " 'id') of the entity you wish to update" ) + # This separates the local data updates from pushing these updates to icatdb + for entity in updated_icat_data: + push_data_updates_to_icat(entity) + updated_data.append(get_entity_by_id(client, table_name, entity.id, True)) + return updated_data diff --git a/common/icat/query.py b/common/icat/query.py index dc35c32a..4dd708a9 100644 --- a/common/icat/query.py +++ b/common/icat/query.py @@ -333,4 +333,4 @@ def flatten_query_included_fields(self, includes): ICAT query """ - return [m for n in (field.split(".") for field in includes) for m in n] \ No newline at end of file + return [m for n in (field.split(".") for field in includes) for m in n] From b6395e5b1737b126b93e8d11af14f604bf3103fb Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 20 Nov 2020 15:51:20 +0000 Subject: [PATCH 41/46] #145: Ensure the database remains in a similar state to what it started in if POST returns an error - Similar purpose to the previous commit but expanded so changes are 'rolled back' if an exception occurs on the .create() --- common/icat/helpers.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index f0ca33be..e34e60a7 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -12,6 +12,7 @@ ICATNoObjectError, ICATParameterError, ) +from icat.sslcontext import create_ssl_context from common.exceptions import ( AuthenticationError, BadRequestError, @@ -425,6 +426,13 @@ def create_entities(client, table_name, data): """ Add one or more results for the given entity using the JSON provided in `data` + `created_icat_data` is data of `icat.entity.Entity` type that is collated to be + pushed to ICAT at the end of the function - this avoids confusion over which data + has/hasn't been created if the request returns an error. When pushing the data to + ICAT, there is still risk an exception might be caught, so any entities already + pushed to ICAT will be deleted. Python ICAT doesn't support a database rollback (or + the concept of transactions) so this is a good alternative. + :param client: ICAT client containing an authenticated user :type client: :class:`icat.client.Client` :param table_name: Table name to extract which entity to use @@ -436,6 +444,7 @@ def create_entities(client, table_name, data): log.info("Creating ICAT data for %s", table_name) created_data = [] + created_icat_data = [] if not isinstance(data, list): data = [data] @@ -467,13 +476,23 @@ def create_entities(client, table_name, data): except ValueError as e: raise BadRequestError(e) + created_icat_data.append(new_entity) + + for entity in created_icat_data: try: - new_entity.create() + entity.create() except (ICATValidationError, ICATInternalError) as e: + for entity_json in created_data: + # Delete any data that has been pushed to ICAT before the exception + delete_entity_by_id(client, table_name, entity_json["id"]) + raise PythonICATError(e) except (ICATObjectExistsError, ICATParameterError) as e: + for entity_json in created_data: + delete_entity_by_id(client, table_name, entity_json["id"]) + raise BadRequestError(e) - created_data.append(get_entity_by_id(client, table_name, new_entity.id, True)) + created_data.append(get_entity_by_id(client, table_name, entity.id, True)) return created_data From 3224a277ab03e3beeda74e1afe167ae90e4e5212 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Fri, 20 Nov 2020 16:36:14 +0000 Subject: [PATCH 42/46] #145: Add attempt to restore old data if an update goes wrong - This is a solution to a comment made on the PR for this branch - This solution doesn't need to be applied to update by ID because if an error occurs there, there's no other data that could possibly be updated --- common/icat/helpers.py | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/common/icat/helpers.py b/common/icat/helpers.py index e34e60a7..af39edb2 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -379,6 +379,9 @@ def update_entities(client, table_name, data_to_update): Update one or more results for the given entity using the JSON provided in `data_to_update` + If an exception occurs while sending data to icatdb, an attempt will be made to + restore a backup of the data made before making the update. + :param client: ICAT client containing an authenticated user :type client: :class:`icat.client.Client` :param table_name: Table name to extract which entity to use @@ -394,6 +397,7 @@ def update_entities(client, table_name, data_to_update): if not isinstance(data_to_update, list): data_to_update = [data_to_update] + icat_data_backup = [] updated_icat_data = [] for entity_request in data_to_update: @@ -405,6 +409,7 @@ def update_entities(client, table_name, data_to_update): False, return_related_entities=True, ) + icat_data_backup.append(entity_data.copy()) updated_entity_data = update_attributes(entity_data, entity_request) updated_icat_data.append(updated_entity_data) @@ -415,9 +420,25 @@ def update_entities(client, table_name, data_to_update): ) # This separates the local data updates from pushing these updates to icatdb - for entity in updated_icat_data: - push_data_updates_to_icat(entity) - updated_data.append(get_entity_by_id(client, table_name, entity.id, True)) + for updated_icat_entity in updated_icat_data: + try: + updated_icat_entity.update() + except (ICATValidationError, ICATInternalError) as e: + # Use `icat_data_backup` to restore data trying to updated to the state + # before this request + for icat_entity_backup in icat_data_backup: + try: + icat_entity_backup.update() + except (ICATValidationError, ICATInternalError) as e: + # If an error occurs while trying to restore backup data, just throw + # a 500 immediately + raise PythonICATError(e) + + raise PythonICATError(e) + + updated_data.append( + get_entity_by_id(client, table_name, updated_icat_entity.id, True) + ) return updated_data From ed3fe4f29f3ffa7412a027f4c1b81d8241f6d614 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 2 Dec 2020 13:05:32 +0000 Subject: [PATCH 43/46] #145: Correct mistake made in merge conflict resolution --- common/icat/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index 9a07cb6d..fffa588a 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -82,7 +82,7 @@ def create(self, session_id, table, data, **kwargs): @queries_records def update(self, session_id, table, data, **kwargs): client = kwargs["client"] if kwargs["client"] else create_client() - return update_entities(client, table.__name__, data) + return create_entities(client, table.__name__, data) @requires_session_id @queries_records From 1a16451f79d0f247205102a7b70eb3f32e0727dd Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 2 Dec 2020 13:10:01 +0000 Subject: [PATCH 44/46] #146: Correct mistake made in merge conflict resolution --- common/icat/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index e79a447e..9699c73c 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -80,7 +80,7 @@ def get_with_filters(self, session_id, table, filters, **kwargs): @queries_records def create(self, session_id, table, data, **kwargs): client = kwargs["client"] if kwargs["client"] else create_client() - return update_entities(client, table.__name__, data) + return create_entities(client, table.__name__, data) @requires_session_id @queries_records From e8c13e9ad184fdabb231b6647e40b964fe909a6c Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 5 Jan 2021 12:15:40 +0000 Subject: [PATCH 45/46] #145: Improve datetime conversion - The 'accepted_date_format' constant is removed since it's no longer used. Datetime to string conversion will convert to ISO format and string to datetime can be converted using the same format (allowing for easy-tripping of datetimes for API users). --- common/constants.py | 1 - common/date_handler.py | 34 ++++++++++++++++------------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/common/constants.py b/common/constants.py index 8dbdb7c3..e5d5fb63 100644 --- a/common/constants.py +++ b/common/constants.py @@ -3,6 +3,5 @@ class Constants: DATABASE_URL = config.get_db_url() - ACCEPTED_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" PYTHON_ICAT_DISTNCT_CONDITION = "!= null" ICAT_PROPERTIES = config.get_icat_properties() diff --git a/common/date_handler.py b/common/date_handler.py index e6e0d00a..cf5b5710 100644 --- a/common/date_handler.py +++ b/common/date_handler.py @@ -1,8 +1,7 @@ -from datetime import datetime from dateutil.parser import parse +from icat import helper from common.exceptions import BadRequestError -from common.constants import Constants class DateHandler: @@ -40,33 +39,32 @@ def str_to_datetime_object(data): elegant solution to this conversion operation since dates are converted into ISO format within this file, however, the production instance of this API is typically built on Python 3.6, and it doesn't seem of enough value to mandate - 3.7 for a single line of code + 3.7 for a single line of code. Instead, a helper function from `python-icat` is + used which does the conversion using `suds`. This will convert inputs in the ISO + format (i.e. the format which Python ICAT, and therefore DataGateway API outputs + data) but also allows for conversion of other "sensible" formats. :param data: Single data value from the request body - :type data: Data type of the data as per user's request body + :type data: Data type of the data as per user's request body, :class:`str` is + assumed :return: Date converted into a :class:`datetime` object - :raises BadRequestError: If the date is entered in the incorrect format, as per - `Constants.ACCEPTED_DATE_FORMAT` + :raises BadRequestError: If there is an issue with the date format """ try: - data = datetime.strptime(data, Constants.ACCEPTED_DATE_FORMAT) - except ValueError: - raise BadRequestError( - "Bad request made, the date entered is not in the correct format. Use" - f" the {Constants.ACCEPTED_DATE_FORMAT} format to submit dates to the" - " API" - ) + datetime_obj = helper.parse_attr_string(data, "Date") + except ValueError as e: + raise BadRequestError(e) - return data + return datetime_obj @staticmethod - def datetime_object_to_str(date_obj): + def datetime_object_to_str(datetime_obj): """ Convert a datetime object to a string so it can be outputted in JSON - :param date_obj: Datetime object from data from an ICAT entity - :type date_obj: :class:`datetime.datetime` + :param datetime_obj: Datetime object from data from an ICAT entity + :type datetime_obj: :class:`datetime.datetime` :return: Datetime (of type string) in the agreed format """ - return date_obj.replace(tzinfo=None).strftime(Constants.ACCEPTED_DATE_FORMAT) + return datetime_obj.isoformat(" ") From d6bff57de7a0071f294d61af71579d1c1859f5d2 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 5 Jan 2021 12:20:27 +0000 Subject: [PATCH 46/46] #145: Improve the GET /sessions helper function - Remove rounding on the expireDateTime value and ensure it always returns a consistent, accurate result - Change the keys to camelCase, in line with the rest of the API --- common/icat/backend.py | 2 +- common/icat/helpers.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/icat/backend.py b/common/icat/backend.py index 6d8b807b..9699c73c 100644 --- a/common/icat/backend.py +++ b/common/icat/backend.py @@ -86,7 +86,7 @@ def create(self, session_id, table, data, **kwargs): @queries_records def update(self, session_id, table, data, **kwargs): client = kwargs["client"] if kwargs["client"] else create_client() - return create_entities(client, table.__name__, data) + return update_entities(client, table.__name__, data) @requires_session_id @queries_records diff --git a/common/icat/helpers.py b/common/icat/helpers.py index 12f4eb37..81fa68e2 100644 --- a/common/icat/helpers.py +++ b/common/icat/helpers.py @@ -86,16 +86,16 @@ def get_session_details_helper(client): :return: Details of the user's session, ready to be converted into a JSON response body """ - # Remove rounding session_time_remaining = client.getRemainingMinutes() - session_expiry_time = datetime.now() + timedelta(minutes=session_time_remaining) - + session_expiry_time = ( + datetime.now() + timedelta(minutes=session_time_remaining) + ).replace(microsecond=0) username = client.getUserName() return { - "ID": client.sessionId, - "EXPIREDATETIME": str(session_expiry_time), - "USERNAME": username, + "id": client.sessionId, + "expireDateTime": DateHandler.datetime_object_to_str(session_expiry_time), + "username": username, }