# coding: utf-8

"""
    Street Manager Sampling API

    See API specification Resource Guide > Sampling API for more information on endpoints NOTE: Swagger Editor/UI does not display all description text for enumerations and child elements, check swagger.json for full description text  # noqa: E501

    OpenAPI spec version: 1.0.0
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from ..api_client import ApiClient


class DefaultApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def create_sample_inspection_target(self, body, **kwargs):  # noqa: E501
        """create_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_sample_inspection_target(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SampleInspectionTargetCreateRequest body: (required)
        :return: SampleInspectionTargetCreateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_sample_inspection_target_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.create_sample_inspection_target_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def create_sample_inspection_target_with_http_info(self, body, **kwargs):  # noqa: E501
        """create_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_sample_inspection_target_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SampleInspectionTargetCreateRequest body: (required)
        :return: SampleInspectionTargetCreateResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method create_sample_inspection_target" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `create_sample_inspection_target`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspection-targets', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SampleInspectionTargetCreateResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def delete_sample_inspection_target(self, sample_inspection_target_reference_number, **kwargs):  # noqa: E501
        """delete_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_sample_inspection_target(sample_inspection_target_reference_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sample_inspection_target_reference_number: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.delete_sample_inspection_target_with_http_info(sample_inspection_target_reference_number, **kwargs)  # noqa: E501
        else:
            (data) = self.delete_sample_inspection_target_with_http_info(sample_inspection_target_reference_number, **kwargs)  # noqa: E501
            return data

    def delete_sample_inspection_target_with_http_info(self, sample_inspection_target_reference_number, **kwargs):  # noqa: E501
        """delete_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.delete_sample_inspection_target_with_http_info(sample_inspection_target_reference_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sample_inspection_target_reference_number: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['sample_inspection_target_reference_number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method delete_sample_inspection_target" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'sample_inspection_target_reference_number' is set
        if ('sample_inspection_target_reference_number' not in params or
                params['sample_inspection_target_reference_number'] is None):
            raise ValueError("Missing the required parameter `sample_inspection_target_reference_number` when calling `delete_sample_inspection_target`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'sample_inspection_target_reference_number' in params:
            path_params['sampleInspectionTargetReferenceNumber'] = params['sample_inspection_target_reference_number']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspection-targets/{sampleInspectionTargetReferenceNumber}', 'DELETE',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def end_quarter(self, **kwargs):  # noqa: E501
        """end_quarter  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.end_quarter(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.end_quarter_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.end_quarter_with_http_info(**kwargs)  # noqa: E501
            return data

    def end_quarter_with_http_info(self, **kwargs):  # noqa: E501
        """end_quarter  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.end_quarter_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspections/end-quarter', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def generate_sample_inspections(self, body, **kwargs):  # noqa: E501
        """generate_sample_inspections  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.generate_sample_inspections(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GenerateSampleInspectionsRequest body: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.generate_sample_inspections_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.generate_sample_inspections_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def generate_sample_inspections_with_http_info(self, body, **kwargs):  # noqa: E501
        """generate_sample_inspections  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.generate_sample_inspections_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param GenerateSampleInspectionsRequest body: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method generate_sample_inspections" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `generate_sample_inspections`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspections', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_previous_annual_inspection_units(self, promoter_org_ref, **kwargs):  # noqa: E501
        """get_previous_annual_inspection_units  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_previous_annual_inspection_units(promoter_org_ref, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str promoter_org_ref: (required)
        :param datetime financial_year_start_date:
        :return: AnnualInspectionUnitsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_previous_annual_inspection_units_with_http_info(promoter_org_ref, **kwargs)  # noqa: E501
        else:
            (data) = self.get_previous_annual_inspection_units_with_http_info(promoter_org_ref, **kwargs)  # noqa: E501
            return data

    def get_previous_annual_inspection_units_with_http_info(self, promoter_org_ref, **kwargs):  # noqa: E501
        """get_previous_annual_inspection_units  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_previous_annual_inspection_units_with_http_info(promoter_org_ref, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str promoter_org_ref: (required)
        :param datetime financial_year_start_date:
        :return: AnnualInspectionUnitsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['promoter_org_ref', 'financial_year_start_date']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_previous_annual_inspection_units" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'promoter_org_ref' is set
        if ('promoter_org_ref' not in params or
                params['promoter_org_ref'] is None):
            raise ValueError("Missing the required parameter `promoter_org_ref` when calling `get_previous_annual_inspection_units`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'promoter_org_ref' in params:
            query_params.append(('promoter_org_ref', params['promoter_org_ref']))  # noqa: E501
        if 'financial_year_start_date' in params:
            query_params.append(('financial_year_start_date', params['financial_year_start_date']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/previous-annual-inspection-units', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='AnnualInspectionUnitsResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_sample_inspection_quota(self, inspection_units, inspection_rate, **kwargs):  # noqa: E501
        """get_sample_inspection_quota  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_sample_inspection_quota(inspection_units, inspection_rate, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[float] inspection_units: (required)
        :param float inspection_rate: (required)
        :return: SampleInspectionQuotaResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_sample_inspection_quota_with_http_info(inspection_units, inspection_rate, **kwargs)  # noqa: E501
        else:
            (data) = self.get_sample_inspection_quota_with_http_info(inspection_units, inspection_rate, **kwargs)  # noqa: E501
            return data

    def get_sample_inspection_quota_with_http_info(self, inspection_units, inspection_rate, **kwargs):  # noqa: E501
        """get_sample_inspection_quota  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_sample_inspection_quota_with_http_info(inspection_units, inspection_rate, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param list[float] inspection_units: (required)
        :param float inspection_rate: (required)
        :return: SampleInspectionQuotaResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['inspection_units', 'inspection_rate']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_sample_inspection_quota" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'inspection_units' is set
        if ('inspection_units' not in params or
                params['inspection_units'] is None):
            raise ValueError("Missing the required parameter `inspection_units` when calling `get_sample_inspection_quota`")  # noqa: E501
        # verify the required parameter 'inspection_rate' is set
        if ('inspection_rate' not in params or
                params['inspection_rate'] is None):
            raise ValueError("Missing the required parameter `inspection_rate` when calling `get_sample_inspection_quota`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'inspection_units' in params:
            query_params.append(('inspection_units', params['inspection_units']))  # noqa: E501
            collection_formats['inspection_units'] = 'multi'  # noqa: E501
        if 'inspection_rate' in params:
            query_params.append(('inspection_rate', params['inspection_rate']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspection-quota', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SampleInspectionQuotaResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def get_sample_inspection_target(self, sample_inspection_target_reference_number, **kwargs):  # noqa: E501
        """get_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_sample_inspection_target(sample_inspection_target_reference_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sample_inspection_target_reference_number: (required)
        :return: SampleInspectionTargetResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_sample_inspection_target_with_http_info(sample_inspection_target_reference_number, **kwargs)  # noqa: E501
        else:
            (data) = self.get_sample_inspection_target_with_http_info(sample_inspection_target_reference_number, **kwargs)  # noqa: E501
            return data

    def get_sample_inspection_target_with_http_info(self, sample_inspection_target_reference_number, **kwargs):  # noqa: E501
        """get_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_sample_inspection_target_with_http_info(sample_inspection_target_reference_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str sample_inspection_target_reference_number: (required)
        :return: SampleInspectionTargetResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['sample_inspection_target_reference_number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_sample_inspection_target" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'sample_inspection_target_reference_number' is set
        if ('sample_inspection_target_reference_number' not in params or
                params['sample_inspection_target_reference_number'] is None):
            raise ValueError("Missing the required parameter `sample_inspection_target_reference_number` when calling `get_sample_inspection_target`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'sample_inspection_target_reference_number' in params:
            path_params['sampleInspectionTargetReferenceNumber'] = params['sample_inspection_target_reference_number']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspection-targets/{sampleInspectionTargetReferenceNumber}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SampleInspectionTargetResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def revert_end_quarter(self, **kwargs):  # noqa: E501
        """revert_end_quarter  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.revert_end_quarter(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.revert_end_quarter_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.revert_end_quarter_with_http_info(**kwargs)  # noqa: E501
            return data

    def revert_end_quarter_with_http_info(self, **kwargs):  # noqa: E501
        """revert_end_quarter  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.revert_end_quarter_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspections/revert-end-quarter', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def start_quarter(self, body, **kwargs):  # noqa: E501
        """start_quarter  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_quarter(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SampleInspectionStartQuarterRequest body: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.start_quarter_with_http_info(body, **kwargs)  # noqa: E501
        else:
            (data) = self.start_quarter_with_http_info(body, **kwargs)  # noqa: E501
            return data

    def start_quarter_with_http_info(self, body, **kwargs):  # noqa: E501
        """start_quarter  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.start_quarter_with_http_info(body, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SampleInspectionStartQuarterRequest body: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method start_quarter" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `start_quarter`")  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspections/start-quarter', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)

    def update_sample_inspection_target(self, body, sample_inspection_target_reference_number, **kwargs):  # noqa: E501
        """update_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_sample_inspection_target(body, sample_inspection_target_reference_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SampleInspectionTargetUpdateRequest body: (required)
        :param str sample_inspection_target_reference_number: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_sample_inspection_target_with_http_info(body, sample_inspection_target_reference_number, **kwargs)  # noqa: E501
        else:
            (data) = self.update_sample_inspection_target_with_http_info(body, sample_inspection_target_reference_number, **kwargs)  # noqa: E501
            return data

    def update_sample_inspection_target_with_http_info(self, body, sample_inspection_target_reference_number, **kwargs):  # noqa: E501
        """update_sample_inspection_target  # noqa: E501

        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_sample_inspection_target_with_http_info(body, sample_inspection_target_reference_number, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param SampleInspectionTargetUpdateRequest body: (required)
        :param str sample_inspection_target_reference_number: (required)
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['body', 'sample_inspection_target_reference_number']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in six.iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method update_sample_inspection_target" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'body' is set
        if ('body' not in params or
                params['body'] is None):
            raise ValueError("Missing the required parameter `body` when calling `update_sample_inspection_target`")  # noqa: E501
        # verify the required parameter 'sample_inspection_target_reference_number' is set
        if ('sample_inspection_target_reference_number' not in params or
                params['sample_inspection_target_reference_number'] is None):
            raise ValueError("Missing the required parameter `sample_inspection_target_reference_number` when calling `update_sample_inspection_target`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'sample_inspection_target_reference_number' in params:
            path_params['sampleInspectionTargetReferenceNumber'] = params['sample_inspection_target_reference_number']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in params:
            body_params = params['body']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['token']  # noqa: E501

        return self.api_client.call_api(
            '/sample-inspection-targets/{sampleInspectionTargetReferenceNumber}', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _return_http_data_only=params.get('_return_http_data_only'),
            _preload_content=params.get('_preload_content', True),
            _request_timeout=params.get('_request_timeout'),
            collection_formats=collection_formats)
