# coding: utf-8

"""
    Mauve Admin API

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)  # noqa: E501

    OpenAPI spec version: 1.0.12
    
    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 mauve_client.api_client import ApiClient


class PortalCategoriesApi(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_portal_category_products_request_participantcategories_category_idproducts_get(self, accept, participant, category_id, **kwargs):  # noqa: E501
        """Retrieve products listed in a specific category of a specific portal participant.  # noqa: E501

        Retrieve products listed in a specific category of a specific portal participant.  # 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_portal_category_products_request_participantcategories_category_idproducts_get(accept, participant, category_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param int category_id: The unique identifier of a category (required)
        :param str include: Return additional data specified by a comma-separated list of values (current possible values: \"packaginginformation\", \"producer\", \"images\", \"prices\", \"prices_current\", \"pharmacy_wholesaler_availabilities\", \"categories\", \"abda_artikelstamm\", \"abdata_laiendaten\", \"abda_other_pack_sizes\", \"bundles\"\", \"translations\").
        :param int shop_id: The unique identifier of a shop which is used to determine the shop and image urls (if not specified, the first available shop will be used)
        :param int offset: The (zero-based) offset of the first item in the collection to return (default: 0)
        :param int limit: The maximum number of entries to return. If the value exceeds the maximum, then the maximum value will be used. (default: 1000, maximum: 1000)
        :return: GetPortalCategoryProductsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_portal_category_products_request_participantcategories_category_idproducts_get_with_http_info(accept, participant, category_id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_portal_category_products_request_participantcategories_category_idproducts_get_with_http_info(accept, participant, category_id, **kwargs)  # noqa: E501
            return data

    def get_portal_category_products_request_participantcategories_category_idproducts_get_with_http_info(self, accept, participant, category_id, **kwargs):  # noqa: E501
        """Retrieve products listed in a specific category of a specific portal participant.  # noqa: E501

        Retrieve products listed in a specific category of a specific portal participant.  # 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_portal_category_products_request_participantcategories_category_idproducts_get_with_http_info(accept, participant, category_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str accept: Accept Header (required)
        :param str participant: Alphanumerical customer number of a portal participiant (always end with \"-K\") (in german: Kunden-Nr.) (required)
        :param int category_id: The unique identifier of a category (required)
        :param str include: Return additional data specified by a comma-separated list of values (current possible values: \"packaginginformation\", \"producer\", \"images\", \"prices\", \"prices_current\", \"pharmacy_wholesaler_availabilities\", \"categories\", \"abda_artikelstamm\", \"abdata_laiendaten\", \"abda_other_pack_sizes\", \"bundles\"\", \"translations\").
        :param int shop_id: The unique identifier of a shop which is used to determine the shop and image urls (if not specified, the first available shop will be used)
        :param int offset: The (zero-based) offset of the first item in the collection to return (default: 0)
        :param int limit: The maximum number of entries to return. If the value exceeds the maximum, then the maximum value will be used. (default: 1000, maximum: 1000)
        :return: GetPortalCategoryProductsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['accept', 'participant', 'category_id', 'include', 'shop_id', 'offset', 'limit']  # 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_portal_category_products_request_participantcategories_category_idproducts_get" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'accept' is set
        if ('accept' not in params or
                params['accept'] is None):
            raise ValueError("Missing the required parameter `accept` when calling `get_portal_category_products_request_participantcategories_category_idproducts_get`")  # noqa: E501
        # verify the required parameter 'participant' is set
        if ('participant' not in params or
                params['participant'] is None):
            raise ValueError("Missing the required parameter `participant` when calling `get_portal_category_products_request_participantcategories_category_idproducts_get`")  # noqa: E501
        # verify the required parameter 'category_id' is set
        if ('category_id' not in params or
                params['category_id'] is None):
            raise ValueError("Missing the required parameter `category_id` when calling `get_portal_category_products_request_participantcategories_category_idproducts_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'participant' in params:
            path_params['Participant'] = params['participant']  # noqa: E501
        if 'category_id' in params:
            path_params['CategoryId'] = params['category_id']  # noqa: E501

        query_params = []
        if 'include' in params:
            query_params.append(('Include', params['include']))  # noqa: E501
        if 'shop_id' in params:
            query_params.append(('ShopId', params['shop_id']))  # noqa: E501
        if 'offset' in params:
            query_params.append(('Offset', params['offset']))  # noqa: E501
        if 'limit' in params:
            query_params.append(('Limit', params['limit']))  # noqa: E501

        header_params = {}
        if 'accept' in params:
            header_params['Accept'] = params['accept']  # 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 = ['basic']  # noqa: E501

        return self.api_client.call_api(
            '/portal/{Participant}/categories/{CategoryId}/products', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GetPortalCategoryProductsResponse',  # 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)
