# coding: utf-8

"""
    Cherwell REST API

    Unofficial Python Cherwell REST API library.  # noqa: E501

    The version of the OpenAPI document: 9.3.2
    Contact: See AUTHORS.
    Generated by: https://openapi-generator.tech
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from pycherwell.api_client import ApiClient
from pycherwell.exceptions import (
    ApiTypeError,
    ApiValueError
)


class FormsApi(object):
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

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

    def forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1(self, busobid, publicid, **kwargs):  # noqa: E501
        """Get mobile form by BusObId and Public ID  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object ID and Public ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1(busobid, publicid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobid: Specify the Business Object ID. (required)
        :param str publicid: Specify the Business Object Public ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: MobileFormResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1_with_http_info(busobid, publicid, **kwargs)  # noqa: E501

    def forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1_with_http_info(self, busobid, publicid, **kwargs):  # noqa: E501
        """Get mobile form by BusObId and Public ID  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object ID and Public ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1_with_http_info(busobid, publicid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobid: Specify the Business Object ID. (required)
        :param str publicid: Specify the Business Object Public ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(MobileFormResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['busobid', 'publicid', 'foredit', 'formid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'busobid' is set
        if self.api_client.client_side_validation and ('busobid' not in local_var_params or  # noqa: E501
                                                        local_var_params['busobid'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `busobid` when calling `forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1`")  # noqa: E501
        # verify the required parameter 'publicid' is set
        if self.api_client.client_side_validation and ('publicid' not in local_var_params or  # noqa: E501
                                                        local_var_params['publicid'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `publicid` when calling `forms_get_mobile_form_for_bus_ob_by_id_and_public_id_v1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'busobid' in local_var_params:
            path_params['busobid'] = local_var_params['busobid']  # noqa: E501
        if 'publicid' in local_var_params:
            path_params['publicid'] = local_var_params['publicid']  # noqa: E501

        query_params = []
        if 'foredit' in local_var_params and local_var_params['foredit'] is not None:  # noqa: E501
            query_params.append(('foredit', local_var_params['foredit']))  # noqa: E501
        if 'formid' in local_var_params and local_var_params['formid'] is not None:  # noqa: E501
            query_params.append(('formid', local_var_params['formid']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/V1/getmobileformforbusob/busobid/{busobid}/publicid/{publicid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MobileFormResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1(self, busobid, busobrecid, **kwargs):  # noqa: E501
        """Get mobile form by Business Object ID and Business Object Record ID.  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object ID and record ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1(busobid, busobrecid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobid: Specify the Business Object ID. (required)
        :param str busobrecid: Specify the Business Object Record ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: MobileFormResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1_with_http_info(busobid, busobrecid, **kwargs)  # noqa: E501

    def forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1_with_http_info(self, busobid, busobrecid, **kwargs):  # noqa: E501
        """Get mobile form by Business Object ID and Business Object Record ID.  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object ID and record ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1_with_http_info(busobid, busobrecid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobid: Specify the Business Object ID. (required)
        :param str busobrecid: Specify the Business Object Record ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(MobileFormResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['busobid', 'busobrecid', 'foredit', 'formid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'busobid' is set
        if self.api_client.client_side_validation and ('busobid' not in local_var_params or  # noqa: E501
                                                        local_var_params['busobid'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `busobid` when calling `forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1`")  # noqa: E501
        # verify the required parameter 'busobrecid' is set
        if self.api_client.client_side_validation and ('busobrecid' not in local_var_params or  # noqa: E501
                                                        local_var_params['busobrecid'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `busobrecid` when calling `forms_get_mobile_form_for_bus_ob_by_id_and_rec_id_v1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'busobid' in local_var_params:
            path_params['busobid'] = local_var_params['busobid']  # noqa: E501
        if 'busobrecid' in local_var_params:
            path_params['busobrecid'] = local_var_params['busobrecid']  # noqa: E501

        query_params = []
        if 'foredit' in local_var_params and local_var_params['foredit'] is not None:  # noqa: E501
            query_params.append(('foredit', local_var_params['foredit']))  # noqa: E501
        if 'formid' in local_var_params and local_var_params['formid'] is not None:  # noqa: E501
            query_params.append(('formid', local_var_params['formid']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/V1/getmobileformforbusob/busobid/{busobid}/busobrecid/{busobrecid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MobileFormResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1(self, busobname, publicid, **kwargs):  # noqa: E501
        """Get mobile form by Business Object name and Public ID  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object name and public ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1(busobname, publicid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobname: Specify the Business Object name. (required)
        :param str publicid: Specify the Business Object public ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: MobileFormResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1_with_http_info(busobname, publicid, **kwargs)  # noqa: E501

    def forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1_with_http_info(self, busobname, publicid, **kwargs):  # noqa: E501
        """Get mobile form by Business Object name and Public ID  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object name and public ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1_with_http_info(busobname, publicid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobname: Specify the Business Object name. (required)
        :param str publicid: Specify the Business Object public ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(MobileFormResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['busobname', 'publicid', 'foredit', 'formid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'busobname' is set
        if self.api_client.client_side_validation and ('busobname' not in local_var_params or  # noqa: E501
                                                        local_var_params['busobname'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `busobname` when calling `forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1`")  # noqa: E501
        # verify the required parameter 'publicid' is set
        if self.api_client.client_side_validation and ('publicid' not in local_var_params or  # noqa: E501
                                                        local_var_params['publicid'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `publicid` when calling `forms_get_mobile_form_for_bus_ob_by_name_and_public_id_v1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'busobname' in local_var_params:
            path_params['busobname'] = local_var_params['busobname']  # noqa: E501
        if 'publicid' in local_var_params:
            path_params['publicid'] = local_var_params['publicid']  # noqa: E501

        query_params = []
        if 'foredit' in local_var_params and local_var_params['foredit'] is not None:  # noqa: E501
            query_params.append(('foredit', local_var_params['foredit']))  # noqa: E501
        if 'formid' in local_var_params and local_var_params['formid'] is not None:  # noqa: E501
            query_params.append(('formid', local_var_params['formid']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/V1/getmobileformforbusob/busobname/{busobname}/publicid/{publicid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MobileFormResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)

    def forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1(self, busobname, busobrecid, **kwargs):  # noqa: E501
        """Get mobile form by Business Object name and record ID.  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object name and record ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1(busobname, busobrecid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobname: Specify the Business Object name. (required)
        :param str busobrecid: Specify the Business Object record ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: MobileFormResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        return self.forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1_with_http_info(busobname, busobrecid, **kwargs)  # noqa: E501

    def forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1_with_http_info(self, busobname, busobrecid, **kwargs):  # noqa: E501
        """Get mobile form by Business Object name and record ID.  # noqa: E501

        Operation that gets a mobile form for a specific Business Object by Business Object name and record ID.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1_with_http_info(busobname, busobrecid, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str busobname: Specify the Business Object name. (required)
        :param str busobrecid: Specify the Business Object record ID. (required)
        :param bool foredit: Flag to get the edit mode version of a form.
        :param str formid: Specify the form ID if the default is not desired.
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :return: tuple(MobileFormResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['busobname', 'busobrecid', 'foredit', 'formid']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'busobname' is set
        if self.api_client.client_side_validation and ('busobname' not in local_var_params or  # noqa: E501
                                                        local_var_params['busobname'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `busobname` when calling `forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1`")  # noqa: E501
        # verify the required parameter 'busobrecid' is set
        if self.api_client.client_side_validation and ('busobrecid' not in local_var_params or  # noqa: E501
                                                        local_var_params['busobrecid'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `busobrecid` when calling `forms_get_mobile_form_for_bus_ob_by_name_and_rec_id_v1`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'busobname' in local_var_params:
            path_params['busobname'] = local_var_params['busobname']  # noqa: E501
        if 'busobrecid' in local_var_params:
            path_params['busobrecid'] = local_var_params['busobrecid']  # noqa: E501

        query_params = []
        if 'foredit' in local_var_params and local_var_params['foredit'] is not None:  # noqa: E501
            query_params.append(('foredit', local_var_params['foredit']))  # noqa: E501
        if 'formid' in local_var_params and local_var_params['formid'] is not None:  # noqa: E501
            query_params.append(('formid', local_var_params['formid']))  # 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 = []  # noqa: E501

        return self.api_client.call_api(
            '/api/V1/getmobileformforbusob/busobname/{busobname}/busobrecid/{busobrecid}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MobileFormResponse',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get('_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
