# coding: utf-8

"""
LawyerApi.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 LawyerApi(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_referrals_to_lawyer(self, id, document, **kwargs):
        """
        Link Referral(s).
        Link Referral(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_referrals_to_lawyer(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a Lawyer. (required)
        :param list[str] document: Array of referral Ids to be linked. (required)
        :return: Lawyer
                 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_referrals_to_lawyer" % 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_referrals_to_lawyer`")
        # 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_referrals_to_lawyer`")

        resource_path = '/lawyers/{id}/referrals'.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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def add_specialisms_to_lawyer(self, id, document, **kwargs):
        """
        Link Classification(s).
        Link Classification(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_specialisms_to_lawyer(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a Lawyer. (required)
        :param list[str] document: Array of classification Ids to be linked. (required)
        :return: Lawyer
                 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_specialisms_to_lawyer" % 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_specialisms_to_lawyer`")
        # 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_specialisms_to_lawyer`")

        resource_path = '/lawyers/{id}/specialisms'.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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

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

        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_lawyer(document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param Lawyer 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: Lawyer
                 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_lawyer" % 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_lawyer`")

        resource_path = '/lawyers'.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='Lawyer',
                                            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 = '/lawyers/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_lawyer_by_id(self, id, **kwargs):
        """
        Delete a lawyer by its unique ID
        Deletes an existing lawyer 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_lawyer_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: Lawyer
                 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_lawyer_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_lawyer_by_id`")

        resource_path = '/lawyers/{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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def delete_lawyer_by_query(self, **kwargs):
        """
        Delete some lawyers by query
        Delete all lawyers 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_lawyer_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[Lawyer]
                 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_lawyer_by_query" % key
                )
            params[key] = val
        del params['kwargs']


        resource_path = '/lawyers'.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[Lawyer]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_lawyer_by_id(self, id, **kwargs):
        """
        Get a lawyer by its unique ID
        Retrieve a lawyer 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_lawyer_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: Lawyer
                 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_lawyer_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_lawyer_by_id`")

        resource_path = '/lawyers/{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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_lawyer_referrals(self, id, **kwargs):
        """
        Retrieves the linked referrals.
        Retrieves the linked referrals.

        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_lawyer_referrals(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a Lawyer. (required)
        :return: list[Referral]
                 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_lawyer_referrals" % 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_lawyer_referrals`")

        resource_path = '/lawyers/{id}/referrals'.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[Referral]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def get_lawyer_specialisms(self, id, **kwargs):
        """
        Retrieves the linked specialisms.
        Retrieves the linked specialisms.

        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_lawyer_specialisms(id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a Lawyer. (required)
        :return: list[Classification]
                 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_lawyer_specialisms" % 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_lawyer_specialisms`")

        resource_path = '/lawyers/{id}/specialisms'.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[Classification]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def query_lawyer(self, **kwargs):
        """
        Query some lawyers
        Query over lawyers.

        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_lawyer(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[Lawyer]
                 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_lawyer" % key
                )
            params[key] = val
        del params['kwargs']


        resource_path = '/lawyers'.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[Lawyer]',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def set_lawyer_specialisms(self, id, document, **kwargs):
        """
        Set the linked specialisms.
        Set the linked specialisms.

        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_lawyer_specialisms(id, document, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str id: The ID of a Lawyer. (required)
        :param list[str] document: Array of classification Ids to be linked. (required)
        :return: Lawyer
                 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_lawyer_specialisms" % 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_lawyer_specialisms`")
        # 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_lawyer_specialisms`")

        resource_path = '/lawyers/{id}/specialisms'.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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def unlink_specialisms_from_lawyer(self, id, classification_id, **kwargs):
        """
        Unlink the specified Classification.
        Unlink the specified Classification.

        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_specialisms_from_lawyer(id, classification_id, callback=callback_function)

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

        all_params = ['id', 'classification_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_specialisms_from_lawyer" % 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_specialisms_from_lawyer`")
        # verify the required parameter 'classification_id' is set
        if ('classification_id' not in params) or (params['classification_id'] is None):
            raise ValueError("Missing the required parameter `classification_id` when calling `unlink_specialisms_from_lawyer`")

        resource_path = '/lawyers/{id}/specialisms/{classificationId}'.replace('{format}', 'json')
        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']
        if 'classification_id' in params:
            path_params['classificationId'] = params['classification_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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response

    def update_lawyer(self, id, document, **kwargs):
        """
        Modify a lawyer by its unique ID
        Update an existing lawyer 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_lawyer(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 Lawyer 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: Lawyer
                 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_lawyer" % 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_lawyer`")
        # 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_lawyer`")

        resource_path = '/lawyers/{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='Lawyer',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response
