<filename>app/hackney_law_data_client/apis/potential_answer_api.py
# coding: utf-8

"""
PotentialAnswerApi.py
Copyright 2016 SmartBear Software

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
"""

from __future__ import absolute_import

import sys
import os

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient


class PotentialAnswerApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def add_related_link_to_potential_answer(self, id, document, **kwargs):
        """
        Link RelatedLink(s).
        Link RelatedLink(s).

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.add_related_link_to_potential_answer(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param list[str] document: Array of relatedLink Ids to be linked. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'document']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method add_related_link_to_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `add_related_link_to_potential_answer`")
        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `add_related_link_to_potential_answer`")

        resource_path = '/potentialAnswers/{id}/relatedLink'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def add_required_document_to_potential_answer(self, id, document, **kwargs):
        """
        Link RequiredDocument(s).
        Link RequiredDocument(s).

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.add_required_document_to_potential_answer(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param list[str] document: Array of requiredDocument Ids to be linked. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'document']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method add_required_document_to_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `add_required_document_to_potential_answer`")
        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `add_required_document_to_potential_answer`")

        resource_path = '/potentialAnswers/{id}/requiredDocument'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def create_potential_answer(self, document, **kwargs):
        """
        Create some potentialAnswers
        Create one or more potentialAnswers.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.create_potential_answer(document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param PotentialAnswer document: Create a document by sending the paths to be added in the request body. (required)
        :param str select: Select which paths will be returned by the query. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#select)
        :param str populate: Specify which paths to populate. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#populate)
        :param str sort: Set the fields by which to sort. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#sort)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['document', 'select', 'populate', 'sort']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `create_potential_answer`")

        resource_path = '/potentialAnswers'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'select' in params:
            query_params['select'] = params['select']
        if 'populate' in params:
            query_params['populate'] = params['populate']
        if 'sort' in params:
            query_params['sort'] = params['sort']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def delete_by_ids(self, document, **kwargs):
        """
        Delete all the objects matching the ids provided.
        Delete a set of object in one shot.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_by_ids(document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param list[str] document: Array of Ids to delete. (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['document']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_by_ids" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `delete_by_ids`")

        resource_path = '/potentialAnswers/deleteByIds'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type=None,
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def delete_potential_answer_by_id(self, id, **kwargs):
        """
        Delete a potentialAnswer by its unique ID
        Deletes an existing potentialAnswer by its ID.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_potential_answer_by_id(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The identifier of the resource. (required)
        :param str select: Select which paths will be returned by the query. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#select)
        :param str populate: Specify which paths to populate. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#populate)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'select', 'populate']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_potential_answer_by_id" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `delete_potential_answer_by_id`")

        resource_path = '/potentialAnswers/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'select' in params:
            query_params['select'] = params['select']
        if 'populate' in params:
            query_params['populate'] = params['populate']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def delete_potential_answer_by_query(self, **kwargs):
        """
        Delete some potentialAnswers by query
        Delete all potentialAnswers matching the specified query.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.delete_potential_answer_by_query(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str select: Select which paths will be returned by the query. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#select)
        :param str populate: Specify which paths to populate. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#populate)
        :param str sort: Set the fields by which to sort. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#sort)
        :param int skip: How many documents to skip. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#skip)
        :param int limit: The maximum number of documents to send. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#limit)
        :param str conditions: Set the conditions used to find or remove the document(s). [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#conditions)
        :param str distinct: Set to a path name to retrieve an array of distinct values. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#distinct)
        :param str hint: Add an index hint to the query (must be enabled per controller). [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#hint)
        :param str comment: Add a comment to a query (must be enabled per controller). [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#comment)
        :return: list[PotentialAnswer]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['select', 'populate', 'sort', 'skip', 'limit', 'conditions', 'distinct', 'hint', 'comment']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_potential_answer_by_query" % key
                )
            params[key] = val
        del params['kwargs']


        resource_path = '/potentialAnswers'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'select' in params:
            query_params['select'] = params['select']
        if 'populate' in params:
            query_params['populate'] = params['populate']
        if 'sort' in params:
            query_params['sort'] = params['sort']
        if 'skip' in params:
            query_params['skip'] = params['skip']
        if 'limit' in params:
            query_params['limit'] = params['limit']
        if 'conditions' in params:
            query_params['conditions'] = params['conditions']
        if 'distinct' in params:
            query_params['distinct'] = params['distinct']
        if 'hint' in params:
            query_params['hint'] = params['hint']
        if 'comment' in params:
            query_params['comment'] = params['comment']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='list[PotentialAnswer]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_potential_answer_by_id(self, id, **kwargs):
        """
        Get a potentialAnswer by its unique ID
        Retrieve a potentialAnswer by its ID.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_potential_answer_by_id(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The identifier of the resource. (required)
        :param str select: Select which paths will be returned by the query. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#select)
        :param str populate: Specify which paths to populate. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#populate)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'select', 'populate']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_potential_answer_by_id" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `get_potential_answer_by_id`")

        resource_path = '/potentialAnswers/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'select' in params:
            query_params['select'] = params['select']
        if 'populate' in params:
            query_params['populate'] = params['populate']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_potential_answer_question(self, id, **kwargs):
        """
        Retrieves the linked question.
        Retrieves the linked question.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_potential_answer_question(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :return: GenericQuestion
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_potential_answer_question" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `get_potential_answer_question`")

        resource_path = '/potentialAnswers/{id}/question'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='GenericQuestion',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_potential_answer_related_link(self, id, **kwargs):
        """
        Retrieves the linked relatedLink.
        Retrieves the linked relatedLink.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_potential_answer_related_link(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :return: list[RelatedLink]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_potential_answer_related_link" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `get_potential_answer_related_link`")

        resource_path = '/potentialAnswers/{id}/relatedLink'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='list[RelatedLink]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_potential_answer_required_document(self, id, **kwargs):
        """
        Retrieves the linked requiredDocument.
        Retrieves the linked requiredDocument.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_potential_answer_required_document(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :return: list[RequiredDocument]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_potential_answer_required_document" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `get_potential_answer_required_document`")

        resource_path = '/potentialAnswers/{id}/requiredDocument'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='list[RequiredDocument]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def query_potential_answer(self, **kwargs):
        """
        Query some potentialAnswers
        Query over potentialAnswers.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.query_potential_answer(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str select: Select which paths will be returned by the query. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#select)
        :param str populate: Specify which paths to populate. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#populate)
        :param str sort: Set the fields by which to sort. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#sort)
        :param bool count: Set to true to return count instead of documents. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#count)
        :param int skip: How many documents to skip. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#skip)
        :param int limit: The maximum number of documents to send. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#limit)
        :param str conditions: Set the conditions used to find or remove the document(s). [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#conditions)
        :param str distinct: Set to a path name to retrieve an array of distinct values. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#distinct)
        :param str hint: Add an index hint to the query (must be enabled per controller). [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#hint)
        :param str comment: Add a comment to a query (must be enabled per controller). [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#comment)
        :return: list[PotentialAnswer]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['select', 'populate', 'sort', 'count', 'skip', 'limit', 'conditions', 'distinct', 'hint', 'comment']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method query_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']


        resource_path = '/potentialAnswers'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'select' in params:
            query_params['select'] = params['select']
        if 'populate' in params:
            query_params['populate'] = params['populate']
        if 'sort' in params:
            query_params['sort'] = params['sort']
        if 'count' in params:
            query_params['count'] = params['count']
        if 'skip' in params:
            query_params['skip'] = params['skip']
        if 'limit' in params:
            query_params['limit'] = params['limit']
        if 'conditions' in params:
            query_params['conditions'] = params['conditions']
        if 'distinct' in params:
            query_params['distinct'] = params['distinct']
        if 'hint' in params:
            query_params['hint'] = params['hint']
        if 'comment' in params:
            query_params['comment'] = params['comment']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'GET',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='list[PotentialAnswer]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def set_potential_answer_question(self, id, document, **kwargs):
        """
        Link GenericQuestion.
        Link GenericQuestion.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.set_potential_answer_question(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param BodyIdParameter document: The ID of a genericQuestion. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'document']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method set_potential_answer_question" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `set_potential_answer_question`")
        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `set_potential_answer_question`")

        resource_path = '/potentialAnswers/{id}/question'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'POST',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def set_potential_answer_related_link(self, id, document, **kwargs):
        """
        Set the linked relatedLink.
        Set the linked relatedLink.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.set_potential_answer_related_link(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param list[str] document: Array of relatedLink Ids to be linked. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'document']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method set_potential_answer_related_link" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `set_potential_answer_related_link`")
        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `set_potential_answer_related_link`")

        resource_path = '/potentialAnswers/{id}/relatedLink'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'PUT',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def set_potential_answer_required_document(self, id, document, **kwargs):
        """
        Set the linked requiredDocument.
        Set the linked requiredDocument.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.set_potential_answer_required_document(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param list[str] document: Array of requiredDocument Ids to be linked. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'document']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method set_potential_answer_required_document" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `set_potential_answer_required_document`")
        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `set_potential_answer_required_document`")

        resource_path = '/potentialAnswers/{id}/requiredDocument'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'PUT',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def unlink_question_from_potential_answer(self, id, generic_question_id, **kwargs):
        """
        Unlink the specified GenericQuestion.
        Unlink the specified GenericQuestion.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unlink_question_from_potential_answer(id, generic_question_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param str generic_question_id: The ID of a GenericQuestion. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'generic_question_id']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method unlink_question_from_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `unlink_question_from_potential_answer`")
        # verify the required parameter 'generic_question_id' is set
        if ('generic_question_id' not in params) or (params['generic_question_id'] is None):
            raise ValueError("Missing the required parameter `generic_question_id` when calling `unlink_question_from_potential_answer`")

        resource_path = '/potentialAnswers/{id}/question/{genericQuestionId}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'generic_question_id' in params:
            path_params['genericQuestionId'] = params['generic_question_id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def unlink_related_link_from_potential_answer(self, id, related_link_id, **kwargs):
        """
        Unlink the specified RelatedLink.
        Unlink the specified RelatedLink.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unlink_related_link_from_potential_answer(id, related_link_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param str related_link_id: The ID of a RelatedLink. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'related_link_id']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method unlink_related_link_from_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `unlink_related_link_from_potential_answer`")
        # verify the required parameter 'related_link_id' is set
        if ('related_link_id' not in params) or (params['related_link_id'] is None):
            raise ValueError("Missing the required parameter `related_link_id` when calling `unlink_related_link_from_potential_answer`")

        resource_path = '/potentialAnswers/{id}/relatedLink/{relatedLinkId}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'related_link_id' in params:
            path_params['relatedLinkId'] = params['related_link_id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def unlink_required_document_from_potential_answer(self, id, required_document_id, **kwargs):
        """
        Unlink the specified RequiredDocument.
        Unlink the specified RequiredDocument.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.unlink_required_document_from_potential_answer(id, required_document_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a PotentialAnswer. (required)
        :param str required_document_id: The ID of a RequiredDocument. (required)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'required_document_id']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method unlink_required_document_from_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `unlink_required_document_from_potential_answer`")
        # verify the required parameter 'required_document_id' is set
        if ('required_document_id' not in params) or (params['required_document_id'] is None):
            raise ValueError("Missing the required parameter `required_document_id` when calling `unlink_required_document_from_potential_answer`")

        resource_path = '/potentialAnswers/{id}/requiredDocument/{requiredDocumentId}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'required_document_id' in params:
            path_params['requiredDocumentId'] = params['required_document_id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'DELETE',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def update_potential_answer(self, id, document, **kwargs):
        """
        Modify a potentialAnswer by its unique ID
        Update an existing potentialAnswer by its ID.

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.update_potential_answer(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The identifier of the resource. (required)
        :param PotentialAnswer document: Update a document by sending the paths to be updated in the request body. (required)
        :param str select: Select which paths will be returned by the query. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#select)
        :param str populate: Specify which paths to populate. [doc](https://github.com/wprl/baucis/wiki/Query-String-Parameters#populate)
        :param str x_baucis_update_operator: **BYPASSES VALIDATION** May be used with PUT to update the document using $push, $pull, or $set. [doc](https://github.com/wprl/baucis/wiki/HTTP-Headers)
        :return: PotentialAnswer
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'document', 'select', 'populate', 'x_baucis_update_operator']
        all_params.append('callback')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_potential_answer" % key
                )
            params[key] = val
        del params['kwargs']

        # verify the required parameter 'id' is set
        if ('id' not in params) or (params['id'] is None):
            raise ValueError("Missing the required parameter `id` when calling `update_potential_answer`")
        # verify the required parameter 'document' is set
        if ('document' not in params) or (params['document'] is None):
            raise ValueError("Missing the required parameter `document` when calling `update_potential_answer`")

        resource_path = '/potentialAnswers/{id}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']

        query_params = {}
        if 'select' in params:
            query_params['select'] = params['select']
        if 'populate' in params:
            query_params['populate'] = params['populate']

        header_params = {}
        if 'x_baucis_update_operator' in params:
            header_params['X-Baucis-Update-Operator'] = params['x_baucis_update_operator']

        form_params = []
        local_var_files = {}

        body_params = None
        if 'document' in params:
            body_params = params['document']

        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json', 'text/html'])
        if not header_params['Accept']:
            del header_params['Accept']

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.\
            select_header_content_type(['application/json'])

        # Authentication setting
        auth_settings = ['apikey', 'basic']

        response = self.api_client.call_api(resource_path, 'PUT',
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=local_var_files,
                                            response_type='PotentialAnswer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response
