<reponame>loanzen/probe-py
# coding: utf-8

"""
SearchApi.py
Copyright 2015 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 SearchApi(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 authorized_signatories_get(self, x_api_version, filters, **kwargs):
        """
        Search Authorized Signatories
        Search Authorized Signatories by DIN or PAN

        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.authorized_signatories_get(x_api_version, filters, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str x_api_version: api version (required)
        :param str filters: Filter to apply. Filter can be of the format ={\"filter\":\"value\"} Filter can be DIN and PAN (required)
        :param float limit: Number of items to retrieve. Default is 5 maximum is 100.
        :param float offset: Offset the list of returned results by this amount. Default is zero.
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['x_api_version', 'filters', 'limit', 'offset']
        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 authorized_signatories_get" % key
                )
            params[key] = val
        del params['kwargs']

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

        resource_path = '/authorized-signatories'.replace('{format}', 'json')
        method = 'GET'

        path_params = {}

        query_params = {}
        if 'limit' in params:
            query_params['limit'] = params['limit']
        if 'offset' in params:
            query_params['offset'] = params['offset']
        if 'filters' in params:
            query_params['filters'] = params['filters']

        header_params = {}
        if 'x_api_version' in params:
            header_params['x-api-version'] = params['x_api_version']

        form_params = {}
        files = {}

        body_params = None

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

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

        # Authentication setting
        auth_settings = ['api_key']

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

    def companies_get(self, x_api_version, **kwargs):
        """
        Search Companies
        The Search Companies returns information about the companies registered in India.\nThe response includes the name and CIN and lists the companies in a proper display order.

        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.companies_get(x_api_version, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str x_api_version: api version (required)
        :param float limit: Number of items to retrieve. Default is 5 maximum is 100.
        :param float offset: Offset the list of returned results by this amount. Default is zero.
        :param str filters: Filter to apply. Filter can be of the format ={filter:value} Filter can be \"nameStartsWith\"
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['x_api_version', 'limit', 'offset', 'filters']
        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 companies_get" % key
                )
            params[key] = val
        del params['kwargs']

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

        resource_path = '/companies'.replace('{format}', 'json')
        method = 'GET'

        path_params = {}

        query_params = {}
        if 'limit' in params:
            query_params['limit'] = params['limit']
        if 'offset' in params:
            query_params['offset'] = params['offset']
        if 'filters' in params:
            query_params['filters'] = params['filters']

        header_params = {}
        if 'x_api_version' in params:
            header_params['x-api-version'] = params['x_api_version']

        form_params = {}
        files = {}

        body_params = None

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

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

        # Authentication setting
        auth_settings = ['api_key']

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

# coding: utf-8

"""
SearchApi.py
Copyright 2015 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 SearchApi(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 authorized_signatories_get(self, x_api_version, filters, **kwargs):
        """
        Search Authorized Signatories
        Search Authorized Signatories by DIN or PAN

        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.authorized_signatories_get(x_api_version, filters, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str x_api_version: api version (required)
        :param str filters: Filter to apply. Filter can be of the format ={\"filter\":\"value\"} Filter can be DIN and PAN (required)
        :param float limit: Number of items to retrieve. Default is 5 maximum is 100.
        :param float offset: Offset the list of returned results by this amount. Default is zero.
        :return: InlineResponse200
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['x_api_version', 'filters', 'limit', 'offset']
        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 authorized_signatories_get" % key
                )
            params[key] = val
        del params['kwargs']

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

        resource_path = '/authorized-signatories'.replace('{format}', 'json')
        method = 'GET'

        path_params = {}

        query_params = {}
        if 'limit' in params:
            query_params['limit'] = params['limit']
        if 'offset' in params:
            query_params['offset'] = params['offset']
        if 'filters' in params:
            query_params['filters'] = params['filters']

        header_params = {}
        if 'x_api_version' in params:
            header_params['x-api-version'] = params['x_api_version']

        form_params = {}
        files = {}

        body_params = None

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

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

        # Authentication setting
        auth_settings = ['api_key']

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

    def companies_get(self, x_api_version, **kwargs):
        """
        Search Companies
        The Search Companies returns information about the companies registered in India.\nThe response includes the name and CIN and lists the companies in a proper display order.

        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.companies_get(x_api_version, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param str x_api_version: api version (required)
        :param float limit: Number of items to retrieve. Default is 5 maximum is 100.
        :param float offset: Offset the list of returned results by this amount. Default is zero.
        :param str filters: Filter to apply. Filter can be of the format ={filter:value} Filter can be \"nameStartsWith\"
        :return: InlineResponse2001
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['x_api_version', 'limit', 'offset', 'filters']
        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 companies_get" % key
                )
            params[key] = val
        del params['kwargs']

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

        resource_path = '/companies'.replace('{format}', 'json')
        method = 'GET'

        path_params = {}

        query_params = {}
        if 'limit' in params:
            query_params['limit'] = params['limit']
        if 'offset' in params:
            query_params['offset'] = params['offset']
        if 'filters' in params:
            query_params['filters'] = params['filters']

        header_params = {}
        if 'x_api_version' in params:
            header_params['x-api-version'] = params['x_api_version']

        form_params = {}
        files = {}

        body_params = None

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

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

        # Authentication setting
        auth_settings = ['api_key']

        response = self.api_client.call_api(resource_path, method,
                                            path_params,
                                            query_params,
                                            header_params,
                                            body=body_params,
                                            post_params=form_params,
                                            files=files,
                                            response_type='InlineResponse2001',
                                            auth_settings=auth_settings,
                                            callback=params.get('callback'))
        return response
# coding: utf-8 SearchApi.py Copyright 2015 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. # python 2 and python 3 compatibility library 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 Search Authorized Signatories         Search Authorized Signatories by DIN or PAN          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.authorized_signatories_get(x_api_version, filters, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str x_api_version: api version (required)         :param str filters: Filter to apply. Filter can be of the format ={\"filter\":\"value\"} Filter can be DIN and PAN (required)         :param float limit: Number of items to retrieve. Default is 5 maximum is 100.         :param float offset: Offset the list of returned results by this amount. Default is zero.         :return: InlineResponse200                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'x_api_version' is set # verify the required parameter 'filters' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting Search Companies         The Search Companies returns information about the companies registered in India.\nThe response includes the name and CIN and lists the companies in a proper display order.          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.companies_get(x_api_version, callback=callback_function)          :param callback function: The callback function             for asynchronous request. (optional)         :param str x_api_version: api version (required)         :param float limit: Number of items to retrieve. Default is 5 maximum is 100.         :param float offset: Offset the list of returned results by this amount. Default is zero.         :param str filters: Filter to apply. Filter can be of the format ={filter:value} Filter can be \"nameStartsWith\"         :return: InlineResponse2001                  If the method is called asynchronously,                  returns the request thread. # verify the required parameter 'x_api_version' is set # HTTP header `Accept` # HTTP header `Content-Type` # Authentication setting