# coding: utf-8

"""
    Vero Public API's

    The VeRO API has methods that allow owners of an intellectual property to report eBay listings that infringe on their intellectual property rights. It contains methods to report a listing, retrieve supported VeRO reason codes, and retrieve the status of reported items.  # 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 ...commerce_vero.api_client import ApiClient


class VeroReasonCodeApi(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 get_vero_reason_code(self, vero_reason_code_id, **kwargs):  # noqa: E501
        """get_vero_reason_code  # noqa: E501

        <div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> You must be a member of the Verified Rights Owner (VeRO) Program to use this call.</p></div><br>This method is used to retrieve the details of a specific VeRO reason code, including a description of the code and the marketplace associated with the code.<br><br>The <b>vero_reason_code_id</b> of the VeRO reason code for which to retrieve details is required as a path parameter.  # 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_vero_reason_code(vero_reason_code_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str vero_reason_code_id: This path parameter specifies the unique identifier of the VeRO reason code that is to be retrieved.<br><br>Use the <a href=\"/api-docs/commerce/vero/resources/vero_reason_code/methods/getVeroReasonCodes\" target=\"_blank \">getVeroReasonCodes</a> method to retrieve supported VeRO reason code IDs. (required)
        :return: VeroReasonCodeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if '_return_http_data_only' not in kwargs:  # ebay_rest patch
            kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_vero_reason_code_with_http_info(vero_reason_code_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_vero_reason_code_with_http_info(vero_reason_code_id, **kwargs)  # noqa: E501
            return data

    def get_vero_reason_code_with_http_info(self, vero_reason_code_id, **kwargs):  # noqa: E501
        """get_vero_reason_code  # noqa: E501

        <div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> You must be a member of the Verified Rights Owner (VeRO) Program to use this call.</p></div><br>This method is used to retrieve the details of a specific VeRO reason code, including a description of the code and the marketplace associated with the code.<br><br>The <b>vero_reason_code_id</b> of the VeRO reason code for which to retrieve details is required as a path parameter.  # 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_vero_reason_code_with_http_info(vero_reason_code_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str vero_reason_code_id: This path parameter specifies the unique identifier of the VeRO reason code that is to be retrieved.<br><br>Use the <a href=\"/api-docs/commerce/vero/resources/vero_reason_code/methods/getVeroReasonCodes\" target=\"_blank \">getVeroReasonCodes</a> method to retrieve supported VeRO reason code IDs. (required)
        :return: VeroReasonCodeResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['vero_reason_code_id']  # 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_vero_reason_code" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'vero_reason_code_id' is set
        if ('vero_reason_code_id' not in params or
                params['vero_reason_code_id'] is None):
            raise ValueError("Missing the required parameter `vero_reason_code_id` when calling `get_vero_reason_code`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'vero_reason_code_id' in params:
            path_params['vero_reason_code_id'] = params['vero_reason_code_id']  # 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 = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/vero_reason_code/{vero_reason_code_id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VeroReasonCodeResponse',  # 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_vero_reason_codes(self, **kwargs):  # noqa: E501
        """get_vero_reason_codes  # noqa: E501

        <div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> You must be a member of the Verified Rights Owner (VeRO) Program to use this call.</p></div><br>This method is used to retrieve the details of an array of VeRO reason codes. This information includes the descriptions of each code, as well as the marketplace associated with each code.<br><br> If the <b>X-EBAY-C-MARKETPLACE-ID</b> header is present, only VeRO reason codes for that specific site will be returned. If this header is not included, all reason codes for all sites are returned.  # 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_vero_reason_codes(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str x_ebay_c_marketplace_id: This header identifies the eBay marketplace for which to retrieve VeRO reason codes. If this header is used, only VeRO reason codes for the specified marketplace will be returned in the response.<br><br>See <a href=\"/api-docs/commerce/vero/types/br:MarketplaceIdEnum\" target=\"_blank \">MarketplaceIdEnum</a> for a list of supported values.
        :return: VeroReasonCodeDetailResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        if '_return_http_data_only' not in kwargs:  # ebay_rest patch
            kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_vero_reason_codes_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.get_vero_reason_codes_with_http_info(**kwargs)  # noqa: E501
            return data

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

        <div class=\"msgbox_important\"><p class=\"msgbox_importantInDiv\" data-mc-autonum=\"&lt;b&gt;&lt;span style=&quot;color: #dd1e31;&quot; class=&quot;mcFormatColor&quot;&gt;Important! &lt;/span&gt;&lt;/b&gt;\"><span class=\"autonumber\"><span><b><span style=\"color: #dd1e31;\" class=\"mcFormatColor\">Important!</span></b></span></span> You must be a member of the Verified Rights Owner (VeRO) Program to use this call.</p></div><br>This method is used to retrieve the details of an array of VeRO reason codes. This information includes the descriptions of each code, as well as the marketplace associated with each code.<br><br> If the <b>X-EBAY-C-MARKETPLACE-ID</b> header is present, only VeRO reason codes for that specific site will be returned. If this header is not included, all reason codes for all sites are returned.  # 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_vero_reason_codes_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str x_ebay_c_marketplace_id: This header identifies the eBay marketplace for which to retrieve VeRO reason codes. If this header is used, only VeRO reason codes for the specified marketplace will be returned in the response.<br><br>See <a href=\"/api-docs/commerce/vero/types/br:MarketplaceIdEnum\" target=\"_blank \">MarketplaceIdEnum</a> for a list of supported values.
        :return: VeroReasonCodeDetailResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['x_ebay_c_marketplace_id']  # 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_vero_reason_codes" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}
        if 'x_ebay_c_marketplace_id' in params:
            header_params['X-EBAY-C-MARKETPLACE-ID'] = params['x_ebay_c_marketplace_id']  # noqa: E501

        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 = ['api_auth']  # noqa: E501

        return self.api_client.call_api(
            '/vero_reason_code', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VeroReasonCodeDetailResponse',  # 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)
