Exemplo n.º 1
0
 def request(self, method, url, query_params=None, headers=None,
             post_params=None, body=None, _preload_content=True,
             _request_timeout=None):
     """Makes the HTTP request using RESTClient."""
     if method == "GET":
         return self.rest_client.GET(url,
                                     query_params=query_params,
                                     _preload_content=_preload_content,
                                     _request_timeout=_request_timeout,
                                     headers=headers)
     elif method == "HEAD":
         return self.rest_client.HEAD(url,
                                      query_params=query_params,
                                      _preload_content=_preload_content,
                                      _request_timeout=_request_timeout,
                                      headers=headers)
     elif method == "OPTIONS":
         return self.rest_client.OPTIONS(url,
                                         query_params=query_params,
                                         headers=headers,
                                         _preload_content=_preload_content,
                                         _request_timeout=_request_timeout)
     elif method == "POST":
         return self.rest_client.POST(url,
                                      query_params=query_params,
                                      headers=headers,
                                      post_params=post_params,
                                      _preload_content=_preload_content,
                                      _request_timeout=_request_timeout,
                                      body=body)
     elif method == "PUT":
         return self.rest_client.PUT(url,
                                     query_params=query_params,
                                     headers=headers,
                                     post_params=post_params,
                                     _preload_content=_preload_content,
                                     _request_timeout=_request_timeout,
                                     body=body)
     elif method == "PATCH":
         return self.rest_client.PATCH(url,
                                       query_params=query_params,
                                       headers=headers,
                                       post_params=post_params,
                                       _preload_content=_preload_content,
                                       _request_timeout=_request_timeout,
                                       body=body)
     elif method == "DELETE":
         return self.rest_client.DELETE(url,
                                        query_params=query_params,
                                        headers=headers,
                                        _preload_content=_preload_content,
                                        _request_timeout=_request_timeout,
                                        body=body)
     else:
         raise ApiValueError(
             "http method must be `GET`, `HEAD`, `OPTIONS`,"
             " `POST`, `PATCH`, `PUT` or `DELETE`."
         )
Exemplo n.º 2
0
    def update_params_for_auth(self, headers, querys, auth_settings):
        """Updates header and query params based on authentication setting.

        :param headers: Header parameters dict to be updated.
        :param querys: Query parameters tuple list to be updated.
        :param auth_settings: Authentication setting identifiers list.
        """
        if not auth_settings:
            return

        for auth in auth_settings:
            auth_setting = self.configuration.auth_settings().get(auth)
            if auth_setting:
                if auth_setting['in'] == 'cookie':
                    headers['Cookie'] = auth_setting['value']
                elif auth_setting['in'] == 'header':
                    headers[auth_setting['key']] = auth_setting['value']
                elif auth_setting['in'] == 'query':
                    querys.append((auth_setting['key'], auth_setting['value']))
                else:
                    raise ApiValueError(
                        'Authentication token must be in `query` or `header`'
                    )
Exemplo n.º 3
0
    def request(self, method, url, query_params=None, headers=None,
                body=None, post_params=None, _preload_content=True,
                _request_timeout=None):
        """Perform requests.

        :param method: http request method
        :param url: http request url
        :param query_params: query parameters in the url
        :param headers: http request headers
        :param body: request json body, for `application/json`
        :param post_params: request post parameters,
                            `application/x-www-form-urlencoded`
                            and `multipart/form-data`
        :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.
        """
        method = method.upper()
        assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT',
                          'PATCH', 'OPTIONS']

        if post_params and body:
            raise ApiValueError(
                "body parameter cannot be used with post_params parameter."
            )

        post_params = post_params or {}
        headers = headers or {}

        timeout = None
        if _request_timeout:
            if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)):  # noqa: E501,F821
                timeout = urllib3.Timeout(total=_request_timeout)
            elif (isinstance(_request_timeout, tuple) and
                  len(_request_timeout) == 2):
                timeout = urllib3.Timeout(
                    connect=_request_timeout[0], read=_request_timeout[1])

        if 'Content-Type' not in headers:
            headers['Content-Type'] = 'application/json'

        try:
            # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
            if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
                if query_params:
                    url += '?' + urlencode(query_params)
                if re.search('json', headers['Content-Type'], re.IGNORECASE):
                    request_body = None
                    if body is not None:
                        request_body = json.dumps(body)
                    r = self.pool_manager.request(
                        method, url,
                        body=request_body,
                        preload_content=_preload_content,
                        timeout=timeout,
                        headers=headers)
                elif headers['Content-Type'] == 'application/x-www-form-urlencoded':  # noqa: E501
                    r = self.pool_manager.request(
                        method, url,
                        fields=post_params,
                        encode_multipart=False,
                        preload_content=_preload_content,
                        timeout=timeout,
                        headers=headers)
                elif headers['Content-Type'] == 'multipart/form-data':
                    # must del headers['Content-Type'], or the correct
                    # Content-Type which generated by urllib3 will be
                    # overwritten.
                    del headers['Content-Type']
                    r = self.pool_manager.request(
                        method, url,
                        fields=post_params,
                        encode_multipart=True,
                        preload_content=_preload_content,
                        timeout=timeout,
                        headers=headers)
                # Pass a `string` parameter directly in the body to support
                # other content types than Json when `body` argument is
                # provided in serialized form
                elif isinstance(body, str) or isinstance(body, bytes):
                    request_body = body
                    r = self.pool_manager.request(
                        method, url,
                        body=request_body,
                        preload_content=_preload_content,
                        timeout=timeout,
                        headers=headers)
                else:
                    # Cannot generate the request from given parameters
                    msg = """Cannot prepare a request message for provided
                             arguments. Please check that your arguments match
                             declared content type."""
                    raise ApiException(status=0, reason=msg)
            # For `GET`, `HEAD`
            else:
                r = self.pool_manager.request(method, url,
                                              fields=query_params,
                                              preload_content=_preload_content,
                                              timeout=timeout,
                                              headers=headers)
        except urllib3.exceptions.SSLError as e:
            msg = "{0}\n{1}".format(type(e).__name__, str(e))
            raise ApiException(status=0, reason=msg)

        if _preload_content:
            r = RESTResponse(r)

            # In the python 3, the response.data is bytes.
            # we need to decode it to string.
            if six.PY3:
                r.data = r.data.decode('utf8')

            # log response body
            logger.debug("response body: %s", r.data)

        if not 200 <= r.status <= 299:
            raise ApiException(http_resp=r)

        return r
Exemplo n.º 4
0
    def badge_applications_get_one_with_http_info(self, application_id,
                                                  **kwargs):  # noqa: E501
        """[BETA] Get a badge application details  # noqa: E501

        Use this resource to get a badge application details. <a href=\"/badge/#3\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.badge_applications_get_one_with_http_info(application_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str application_id: Badge application ID. (required)
        :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(BadgeApplication, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['application_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')

        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 badge_applications_get_one" %
                                   key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'application_id' is set
        if self.api_client.client_side_validation and (
                'application_id' not in local_var_params or  # noqa: E501
                local_var_params['application_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `application_id` when calling `badge_applications_get_one`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'application_id' in local_var_params:
            path_params['applicationId'] = local_var_params[
                'application_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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/badge-applications/{applicationId}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BadgeApplication',  # 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)
Exemplo n.º 5
0
    def get_offer_events_with_http_info(self, **kwargs):  # noqa: E501
        """Get events about the seller's offers  # noqa: E501

        Use this endpoint to get events concerning changes in the authorized seller's offers. At present we support the following events:   - OFFER_ACTIVATED - offer is visible on site and available for purchase, occurs when offer status changes from ACTIVATING to ACTIVE.   - OFFER_CHANGED - occurs when offer's fields has been changed e.g. description or photos.   - OFFER_ENDED - offer is no longer available for purchase, occurs when offer status changes from ACTIVE to ENDED.   - OFFER_STOCK_CHANGED - stock in an offer was changed either via purchase or by seller.   - OFFER_PRICE_CHANGED - occurs when price in an offer was changed.   - OFFER_ARCHIVED - offer is no longer available on listing and has been archived.   - OFFER_BID_PLACED - bid was placed on the offer   - OFFER_BID_CANCELED - bid for offer was canceled  Returned events may occur by actions made via browser or API. The resource allows you to get events concerning active offers and offers scheduled for activation (status ACTIVE and ACTIVATING). Returned events do not concern offers in INACTIVE and ENDED status (the exception is OFFER_ARCHIVED event). Please note that one change may result in more than one event.  # 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_offer_events_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str _from: The ID of the last seen event. Events that occured after the given event will be returned.
        :param int limit: The number of events that will be returned in the response.
        :param list[str] type: The types of events that will be returned in the response. All types of events are returned by default.
        :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(SellerOfferEventsResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['_from', 'limit', 'type']  # 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 get_offer_events" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and (
                '_from' in local_var_params and  # noqa: E501
                len(local_var_params['_from']) > 256):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `_from` when calling `get_offer_events`, length must be less than or equal to `256`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] > 1000:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_offer_events`, must be a value less than or equal to `1000`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] < 1:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_offer_events`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if '_from' in local_var_params and local_var_params[
                '_from'] is not None:  # noqa: E501
            query_params.append(
                ('from', local_var_params['_from']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # noqa: E501
        if 'type' in local_var_params and local_var_params[
                'type'] is not None:  # noqa: E501
            query_params.append(
                ('type', local_var_params['type']))  # noqa: E501
            collection_formats['type'] = 'multi'  # 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/vnd.allegro.public.v1+json',
             'application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offer-events',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='SellerOfferEventsResponse',  # 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)
Exemplo n.º 6
0
    def get_user_summary_using_get_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """Get any user's ratings summary  # noqa: E501

        Use this resource to receive feedback statistics. <a href=\"../../news/2017-10-09-news_informacje_o_ocenach/\" target=\"_blank\">Read more</a>.  # 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_user_summary_using_get_with_http_info(user_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str user_id: The ID of the user. (required)
        :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(UserRatingSummaryResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['user_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')

        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 get_user_summary_using_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'user_id' is set
        if self.api_client.client_side_validation and ('user_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['user_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `user_id` when calling `get_user_summary_using_get`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user_id' in local_var_params:
            path_params['userId'] = local_var_params['user_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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/users/{userId}/ratings-summary', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='UserRatingSummaryResponse',  # 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)
Exemplo n.º 7
0
    def change_publication_status_using_put_with_http_info(
            self, command_id, publication_change_command_dto,
            **kwargs):  # noqa: E501
        """Batch offer publish / unpublish  # noqa: E501

        Use this resource to modify multiple offers publication at once. <a href=\"../../sale/#step-8-offer-publication-commands\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.change_publication_status_using_put_with_http_info(command_id, publication_change_command_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str command_id: Command identifier. (required)
        :param PublicationChangeCommandDto publication_change_command_dto: publicationChangeCommandDto (required)
        :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(GeneralReport, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['command_id',
                      'publication_change_command_dto']  # 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 change_publication_status_using_put" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'command_id' is set
        if self.api_client.client_side_validation and (
                'command_id' not in local_var_params or  # noqa: E501
                local_var_params['command_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `command_id` when calling `change_publication_status_using_put`"
            )  # noqa: E501
        # verify the required parameter 'publication_change_command_dto' is set
        if self.api_client.client_side_validation and (
                'publication_change_command_dto' not in local_var_params
                or  # noqa: E501
                local_var_params['publication_change_command_dto'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `publication_change_command_dto` when calling `change_publication_status_using_put`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'command_id' in local_var_params:
            path_params['commandId'] = local_var_params[
                'command_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'publication_change_command_dto' in local_var_params:
            body_params = local_var_params['publication_change_command_dto']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offer-publication-commands/{commandId}',
            'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='GeneralReport',  # 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)
Exemplo n.º 8
0
    def create_offer_using_post_with_http_info(self, offer,
                                               **kwargs):  # noqa: E501
        """Create a draft offer  # noqa: E501

        Use this resource to create a draft offer. <a href=\"../../sale/#step-6-draft\" target=\"_blank\">Read more</a>.  # 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_offer_using_post_with_http_info(offer, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param Offer offer: offer (required)
        :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(Offer, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offer']  # 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 create_offer_using_post" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer' is set
        if self.api_client.client_side_validation and (
                'offer' not in local_var_params or  # noqa: E501
                local_var_params['offer'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `offer` when calling `create_offer_using_post`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'offer' in local_var_params:
            body_params = local_var_params['offer']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offers',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Offer',  # 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 get_public_seller_listing_using_get_with_http_info(
            self, seller_id, **kwargs):  # noqa: E501
        """Get the user's implied warranties  # noqa: E501

        Use this resource to get seller implied warranties listing. <a href=\"../../news/2017-04-05-news_warunki_oferty/\" target=\"_blank\">Read more</a>.  # 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_public_seller_listing_using_get_with_http_info(seller_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str seller_id: Filter by user id. You are allowed to get your implied warranties only. (required)
        :param int limit: The limit of elements in the response.
        :param int offset: The offset of elements in the response.
        :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(ImpliedWarrantiesListImpliedWarrantyBasic, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['seller_id', 'limit', 'offset']  # 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 get_public_seller_listing_using_get" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'seller_id' is set
        if self.api_client.client_side_validation and (
                'seller_id' not in local_var_params or  # noqa: E501
                local_var_params['seller_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `seller_id` when calling `get_public_seller_listing_using_get`"
            )  # noqa: E501

        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] > 60:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_public_seller_listing_using_get`, must be a value less than or equal to `60`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] < 1:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_public_seller_listing_using_get`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[
                'offset'] > 59:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `offset` when calling `get_public_seller_listing_using_get`, must be a value less than or equal to `59`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[
                'offset'] < 0:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `offset` when calling `get_public_seller_listing_using_get`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'seller_id' in local_var_params and local_var_params[
                'seller_id'] is not None:  # noqa: E501
            query_params.append(
                ('seller.id', local_var_params['seller_id']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params[
                'offset'] is not None:  # noqa: E501
            query_params.append(
                ('offset', local_var_params['offset']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/after-sales-service-conditions/implied-warranties',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=
            'ImpliedWarrantiesListImpliedWarrantyBasic',  # 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)
Exemplo n.º 10
0
    def add_promotion_to_campaign_using_post_with_http_info(
            self, promotion_campaign_request_dto, **kwargs):  # noqa: E501
        """Create an application for a promotion campaign  # noqa: E501

        For an additional fee, you can place a discount mark on a list of offers.         You have to define promotion id and campaign section giving LISTING_BADGE as the id.         Your promotion campaign application will be verified and you will be notified about the verification status via e-mail.         Fees will be charged in accordance with Annex No. 1 to the Daily deals zone regulations.         <a href=\"../../offer_bundles/#11\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_promotion_to_campaign_using_post_with_http_info(promotion_campaign_request_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param PromotionCampaignRequestDto promotion_campaign_request_dto: request (required)
        :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(PromotionCampaignResponseDto, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['promotion_campaign_request_dto']  # 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 add_promotion_to_campaign_using_post" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'promotion_campaign_request_dto' is set
        if self.api_client.client_side_validation and (
                'promotion_campaign_request_dto' not in local_var_params
                or  # noqa: E501
                local_var_params['promotion_campaign_request_dto'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `promotion_campaign_request_dto` when calling `add_promotion_to_campaign_using_post`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'promotion_campaign_request_dto' in local_var_params:
            body_params = local_var_params['promotion_campaign_request_dto']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/loyalty/promotion-campaigns',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='PromotionCampaignResponseDto',  # 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)
Exemplo n.º 11
0
    def delete_campaign_from_promotion_using_delete_with_http_info(
            self, promotion_id, campaign_id, **kwargs):  # noqa: E501
        """Delete a campaign in a promotion  # noqa: E501

        Use this resource to delete campaign from promotion by promotion id and campaign id. <a href=\"../../offer_bundles/#16\" target=\"_blank\">Read more</a>.  # 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_campaign_from_promotion_using_delete_with_http_info(promotion_id, campaign_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str promotion_id: The promotion unique id. (required)
        :param str campaign_id: The campaign unique id. (required)
        :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: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['promotion_id', 'campaign_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')

        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 delete_campaign_from_promotion_using_delete" %
                    key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'promotion_id' is set
        if self.api_client.client_side_validation and (
                'promotion_id' not in local_var_params or  # noqa: E501
                local_var_params['promotion_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `promotion_id` when calling `delete_campaign_from_promotion_using_delete`"
            )  # noqa: E501
        # verify the required parameter 'campaign_id' is set
        if self.api_client.client_side_validation and (
                'campaign_id' not in local_var_params or  # noqa: E501
                local_var_params['campaign_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `campaign_id` when calling `delete_campaign_from_promotion_using_delete`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'promotion_id' in local_var_params and local_var_params[
                'promotion_id'] is not None:  # noqa: E501
            query_params.append(
                ('promotion.id',
                 local_var_params['promotion_id']))  # noqa: E501
        if 'campaign_id' in local_var_params and local_var_params[
                'campaign_id'] is not None:  # noqa: E501
            query_params.append(
                ('campaign.id', local_var_params['campaign_id']))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/loyalty/promotion-campaigns',
            '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=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 create_or_update_variant_set_with_http_info(self, set_id, variant_set, **kwargs):  # noqa: E501
        """[BETA] Create or update variant set  # noqa: E501

        [BETA] Use this resource to create or update variant set.   A valid variant set must consist of three required elements:  - name:    - it can't be blank and must not be longer than 50 characters  - parameters:    - it should contain parameter identifiers used for offer grouping    - parameter identifiers from the offers and special `color/pattern` value (for grouping via image) are permitted    - it must contain at least one element (up to 2)  - offers:    - it must contain at least 2 offers (500 at most)    - `colorPattern` value must be set for every offer if `color/pattern` parameter is used    - `colorPattern` value can't be blank and must not be longer than 50 characters    - `colorPattern` can take arbitrary string value like `red`, `b323592c-522f-4ec1-b9ea-3764538e0ac4` (UUID), etc.    - offers having the same image should have identical `colorPattern` value    Let's assume we have 4 offers:    - offer with id 2 having an image of a red t-shirt and S as a value of parameter with id 21    - offer with id 3 having an image of a red t-shirt and M as a value of parameter with id 21    - offer with id 4 having an image of a blue t-shirt and S as a value of parameter with id 21    - offer with id 5 having an image of a blue t-shirt and M as a value of parameter with id 21    You can build a variant set by grouping offers using combination of available parameters - examples are available in <i>Request samples</i>.    More general information about variant sets can be found [here](https://allegro.pl/pomoc/faq/wielowariantowosc-jak-polaczyc-oferty-xGgaOByGgTb#dodatkowe-informacje),  more information about variant sets API can be found <a href=\"../../news/2018-07-09-wielowariantowosc/#03\" target=\"_blank\">here</a>.  # 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_or_update_variant_set_with_http_info(set_id, variant_set, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str set_id: Variant set identifier. (required)
        :param VariantSet variant_set: (required)
        :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: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['set_id', 'variant_set']  # 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 create_or_update_variant_set" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'set_id' is set
        if self.api_client.client_side_validation and ('set_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['set_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `set_id` when calling `create_or_update_variant_set`")  # noqa: E501
        # verify the required parameter 'variant_set' is set
        if self.api_client.client_side_validation and ('variant_set' not in local_var_params or  # noqa: E501
                                                        local_var_params['variant_set'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `variant_set` when calling `create_or_update_variant_set`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'set_id' in local_var_params:
            path_params['setId'] = local_var_params['set_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'variant_set' in local_var_params:
            body_params = local_var_params['variant_set']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offer-variants/{setId}', '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=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 get_variant_sets_with_http_info(self, user_id, **kwargs):  # noqa: E501
        """[BETA] Get the user's variant sets  # noqa: E501

        [BETA] Use this resource to get created variant sets. The returned variant sets are ordered by name. <a href=\"../../news/2018-07-09-wielowariantowosc/\" target=\"_blank\">Read more</a>.  # 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_variant_sets_with_http_info(user_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str user_id: Filter by user id, you are allowed to get your variant sets only. (required)
        :param int offset: Index of first returned variant set.
        :param int limit: Maximum number of returned variant sets.
        :param str query: Filter variant sets by name or offer id.
        :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(VariantSets, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['user_id', 'offset', 'limit', 'query']  # 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 get_variant_sets" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'user_id' is set
        if self.api_client.client_side_validation and ('user_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['user_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `user_id` when calling `get_variant_sets`")  # noqa: E501

        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] > 9950:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `offset` when calling `get_variant_sets`, must be a value less than or equal to `9950`")  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `offset` when calling `get_variant_sets`, must be a value greater than or equal to `0`")  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 50:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `limit` when calling `get_variant_sets`, must be a value less than or equal to `50`")  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `limit` when calling `get_variant_sets`, must be a value greater than or equal to `1`")  # noqa: E501
        if self.api_client.client_side_validation and ('query' in local_var_params and  # noqa: E501
                                                        len(local_var_params['query']) > 50):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `query` when calling `get_variant_sets`, length must be less than or equal to `50`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'user_id' in local_var_params and local_var_params['user_id'] is not None:  # noqa: E501
            query_params.append(('user.id', local_var_params['user_id']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params['offset'] is not None:  # noqa: E501
            query_params.append(('offset', local_var_params['offset']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params['limit'] is not None:  # noqa: E501
            query_params.append(('limit', local_var_params['limit']))  # noqa: E501
        if 'query' in local_var_params and local_var_params['query'] is not None:  # noqa: E501
            query_params.append(('query', local_var_params['query']))  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offer-variants', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='VariantSets',  # 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 create_offer_attachment_using_post_with_http_info(
            self, offer_attachment_request, **kwargs):  # noqa: E501
        """Create an offer attachment  # noqa: E501

        You can attach PDF files to your offers. We will present them under the offer description in the Additional information section. You can attach up to 7 files to one offer – one per each type from the list:   * \\- Guide (MANUAL)   * \\- Special offer terms (SPECIAL_OFFER_RULES)   * \\- Competition terms (COMPETITION_RULES)   * \\- Book excerpt (BOOK_EXCERPT)   * \\- Manual (USER_MANUAL)   * \\- Installation manual (INSTALLATION_INSTRUCTIONS)   * \\- Game manual (GAME_INSTRUCTIONS)  Uploading attachments flow:   1. Create an attachment object to receive an upload URL (*POST /sale/offer-attachments*),   2. Use the upload URL to submit the PDF file (*PUT /sale/offer-attachments/{attachmentId}*),   3. Add attachments to the offer (*PUT /sale/offers/{offerId}*).  # 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_offer_attachment_using_post_with_http_info(offer_attachment_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param OfferAttachmentRequest offer_attachment_request: offer attachment (required)
        :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(OfferAttachment, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offer_attachment_request']  # 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 create_offer_attachment_using_post" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer_attachment_request' is set
        if self.api_client.client_side_validation and (
                'offer_attachment_request' not in local_var_params
                or  # noqa: E501
                local_var_params['offer_attachment_request'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `offer_attachment_request` when calling `create_offer_attachment_using_post`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'offer_attachment_request' in local_var_params:
            body_params = local_var_params['offer_attachment_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offer-attachments',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OfferAttachment',  # 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 upload_offer_image_using_post_with_http_info(
            self, offer_image_link_upload_request, **kwargs):  # noqa: E501
        """Upload an offer image  # noqa: E501

        Upload image to our servers. You can choose from two upload options:   * \\- provide a link and we will download an image for you   * \\- send an image as binary data  **Important!** Remember to use dedicated domain for upload, i.e.   * \\- https://upload.allegro.pl for Production   * \\- https://upload.allegro.pl.allegrosandbox.pl for Sandbox  More information about rules for photos in an offer's gallery and description you will find <a href=\"https://allegro.pl/dla-sprzedajacych/nowe-zasady-dla-zdjec-w-galerii-i-w-opisie-YLlAAa2oXf7\" target=\"_blank\">here</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_offer_image_using_post_with_http_info(offer_image_link_upload_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param OfferImageLinkUploadRequest offer_image_link_upload_request: (required)
        :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(OfferImageUploadResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_hosts = ['https://upload.{environment}']  # noqa: E501
        local_var_host = local_var_hosts[0]
        if kwargs.get('_host_index'):
            if int(kwags.get('_host_index')) < 0 or int(
                    kawgs.get('_host_index')) >= len(local_var_hosts):
                raise ApiValueError(
                    "Invalid host index. Must be 0 <= index < %s" %
                    len(local_var_host))
            local_var_host = local_var_hosts[int(kwargs.get('_host_index'))]
        local_var_params = locals()

        all_params = ['offer_image_link_upload_request']  # 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 and key != "_host_index":
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method upload_offer_image_using_post" %
                                   key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer_image_link_upload_request' is set
        if self.api_client.client_side_validation and (
                'offer_image_link_upload_request' not in local_var_params
                or  # noqa: E501
                local_var_params['offer_image_link_upload_request'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `offer_image_link_upload_request` when calling `upload_offer_image_using_post`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'offer_image_link_upload_request' in local_var_params:
            body_params = local_var_params['offer_image_link_upload_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                [
                    'application/vnd.allegro.public.v1+json', 'image/jpeg',
                    'image/png'
                ])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/images',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OfferImageUploadResponse',  # 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'),
            _host=local_var_host,
            collection_formats=collection_formats)
Exemplo n.º 16
0
    def get_listing_with_http_info(self, **kwargs):  # noqa: E501
        """Search offers  # noqa: E501

        Use this resource to get a list of offers based on the provided query parameters. At least one of: phrase, seller.id or category.id is required. Additional available parameters vary depending on category.id. The parameters are defined in the filters entity. <a href=\"../../news/2018-07-03-listing_ofert/\" target=\"_blank\">Read more</a>.  # 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_listing_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str category_id: The identifier of the category, where you want to search for offers.
        :param str phrase: The search phrase. The phrase is searched in different fields of the offers depending on the value of the `searchMode` parameter.
        :param str seller_id: The identifier of a seller, to limit the results to offers from this seller. May be provided more than once.
        :param str search_mode: Defines where the given phrase should be searched in. Allowed values:    - *REGULAR* - searching for a phrase in the title,   - *DESCRIPTIONS* - searching for a phrase in the title and the descriptions,   - *CLOSED* - searching for a phrase in the title of closed offers.
        :param int offset: Index of the first returned offer from all search results.
        :param int limit: The maximum number of offers in a response.
        :param str sort: Search results sorting order. `+` or no prefix in the value means ascending order. `-` prefix means descending order.
        :param str include: Specify parts of the response that should be included in the output. Allowed values are the names of top level entities and *all* as an alias to all entities. By default, all top level entities are included. Use `-` prefix to exclude an entity. Example: `include=-all&include=filters&include=sort` - returns only filters and sort entities.
        :param bool fallback: Defines the behaviour of the search engine when no results with exact phrase match are found:    - *true* - related (not exact) results are returned,   - *false* - empty results are returned.
        :param dict(str, str) dynamic_filters: You can filter and customize your search results to find exactly what you need by applying filters ids and their dictionary values to query according to the flowing pattern: id=value. When the filter definition looks like:   ````     {      \"id\": \"parameter.11323\",      \"type\": \"MULTI\",      \"name\": \"Stan\",      \"values\": [{        \"value\": \"11323_1\",        \"name\": \"nowe\",        \"count\": 21,        \"selected\": false       },       {        \"value\": \"11323_2\",        \"name\": \"używane\",        \"count\": 157,        \"selected\": false       },       {        \"value\": \"11323_238066\",        \"name\": \"po zwrocie\",        \"count\": 1,        \"selected\": false       }      ]     }   ```` You can use 'Stan' filter to query results, i.e.:   * `parameter.11323=11323_1` for \"nowe\"   * `parameter.11323=11323_2` for \"używane\"   * `parameter.11323=11323_238066` for \"po zwrocie\".
        :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(ListingResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'category_id', 'phrase', 'seller_id', 'search_mode', 'offset',
            'limit', 'sort', 'include', 'fallback', 'dynamic_filters'
        ]  # 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 get_listing" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] > 100:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_listing`, must be a value less than or equal to `100`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] < 0:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_listing`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'category_id' in local_var_params and local_var_params[
                'category_id'] is not None:  # noqa: E501
            query_params.append(
                ('category.id', local_var_params['category_id']))  # noqa: E501
        if 'phrase' in local_var_params and local_var_params[
                'phrase'] is not None:  # noqa: E501
            query_params.append(
                ('phrase', local_var_params['phrase']))  # noqa: E501
        if 'seller_id' in local_var_params and local_var_params[
                'seller_id'] is not None:  # noqa: E501
            query_params.append(
                ('seller.id', local_var_params['seller_id']))  # noqa: E501
        if 'search_mode' in local_var_params and local_var_params[
                'search_mode'] is not None:  # noqa: E501
            query_params.append(
                ('searchMode', local_var_params['search_mode']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params[
                'offset'] is not None:  # noqa: E501
            query_params.append(
                ('offset', local_var_params['offset']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # noqa: E501
        if 'sort' in local_var_params and local_var_params[
                'sort'] is not None:  # noqa: E501
            query_params.append(
                ('sort', local_var_params['sort']))  # noqa: E501
        if 'include' in local_var_params and local_var_params[
                'include'] is not None:  # noqa: E501
            query_params.append(
                ('include', local_var_params['include']))  # noqa: E501
        if 'fallback' in local_var_params and local_var_params[
                'fallback'] is not None:  # noqa: E501
            query_params.append(
                ('fallback', local_var_params['fallback']))  # noqa: E501
        if 'dynamic_filters' in local_var_params and local_var_params[
                'dynamic_filters'] is not None:  # noqa: E501
            query_params.append(
                ('Dynamic filters',
                 local_var_params['dynamic_filters']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = [
            'bearer-token-for-application', 'bearer-token-for-user'
        ]  # noqa: E501

        return self.api_client.call_api(
            '/offers/listing',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ListingResponse',  # 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)
Exemplo n.º 17
0
    def get_billing_entries_with_http_info(self, **kwargs):  # noqa: E501
        """Get a list of billing entries  # noqa: E501

        The billing entries are sorted in a descending order (newest first) by date on which they occurred.  # 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_billing_entries_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param datetime occurred_at_gte: Date from which billing entries are filtered. If occurredAt.lte is also set, occurredAt.gte cannot be later.
        :param datetime occurred_at_lte: Date to which billing entries are filtered. If occurredAt.gte is also set, occurredAt.lte cannot be earlier.
        :param list[str] type_id: List of billing types by which billing entries are filtered.
        :param str offer_id: Offer ID by which billing entries are filtered.
        :param int limit: Number of returned operations.
        :param int offset: Index of the first returned payment operation from all search results.
        :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(object, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'occurred_at_gte', 'occurred_at_lte', 'type_id', 'offer_id',
            'limit', 'offset'
        ]  # 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 get_billing_entries" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] > 100:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_billing_entries`, must be a value less than or equal to `100`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] < 1:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `get_billing_entries`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[
                'offset'] > 1000:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `offset` when calling `get_billing_entries`, must be a value less than or equal to `1000`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[
                'offset'] < 0:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `offset` when calling `get_billing_entries`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'occurred_at_gte' in local_var_params and local_var_params[
                'occurred_at_gte'] is not None:  # noqa: E501
            query_params.append(
                ('occurredAt.gte',
                 local_var_params['occurred_at_gte']))  # noqa: E501
        if 'occurred_at_lte' in local_var_params and local_var_params[
                'occurred_at_lte'] is not None:  # noqa: E501
            query_params.append(
                ('occurredAt.lte',
                 local_var_params['occurred_at_lte']))  # noqa: E501
        if 'type_id' in local_var_params and local_var_params[
                'type_id'] is not None:  # noqa: E501
            query_params.append(
                ('type.id', local_var_params['type_id']))  # noqa: E501
            collection_formats['type.id'] = 'multi'  # noqa: E501
        if 'offer_id' in local_var_params and local_var_params[
                'offer_id'] is not None:  # noqa: E501
            query_params.append(
                ('offer.id', local_var_params['offer_id']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params[
                'offset'] is not None:  # noqa: E501
            query_params.append(
                ('offset', local_var_params['offset']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/billing/billing-entries',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='object',  # 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)
Exemplo n.º 18
0
    def get_messages_from_dispute_using_get_with_http_info(self, dispute_id, **kwargs):  # noqa: E501
        """Get the messages within a dispute  # noqa: E501

        Use this resource to get the list of messages within dispute. <a href=\"../../news/2018-09-18-dyskusje/#GetMessage\" target=\"_blank\">Read more</a>.  # 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_messages_from_dispute_using_get_with_http_info(dispute_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str dispute_id: Dispute identifier. (required)
        :param int limit: The maximum number of messages within dispute returned in a response.
        :param int offset: Index of first returned message within dispute.
        :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(DisputeMessageList, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['dispute_id', 'limit', 'offset']  # 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 get_messages_from_dispute_using_get" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'dispute_id' is set
        if self.api_client.client_side_validation and ('dispute_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['dispute_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `dispute_id` when calling `get_messages_from_dispute_using_get`")  # noqa: E501

        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `limit` when calling `get_messages_from_dispute_using_get`, must be a value less than or equal to `100`")  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `limit` when calling `get_messages_from_dispute_using_get`, must be a value greater than or equal to `1`")  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0:  # noqa: E501
            raise ApiValueError("Invalid value for parameter `offset` when calling `get_messages_from_dispute_using_get`, must be a value greater than or equal to `0`")  # noqa: E501
        collection_formats = {}

        path_params = {}
        if 'dispute_id' in local_var_params:
            path_params['disputeId'] = local_var_params['dispute_id']  # noqa: E501

        query_params = []
        if 'limit' in local_var_params and local_var_params['limit'] is not None:  # noqa: E501
            query_params.append(('limit', local_var_params['limit']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params['offset'] is not None:  # noqa: E501
            query_params.append(('offset', local_var_params['offset']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/disputes/{disputeId}/messages', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DisputeMessageList',  # 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)
Exemplo n.º 19
0
    def create_change_price_command_using_put_with_http_info(
            self, offer_id, command_id, change_price_without_output,
            **kwargs):  # noqa: E501
        """Modify the Buy Now price in an offer  # noqa: E501

        Use this resource to change the Buy Now price in a single offer. <a href=\"../../news/2016-08-01-zmiana-ceny/\" target=\"_blank\">Read more</a>.  # 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_change_price_command_using_put_with_http_info(offer_id, command_id, change_price_without_output, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str offer_id: The offer identifier. (required)
        :param str command_id: The unique command id generated by you. (required)
        :param ChangePriceWithoutOutput change_price_without_output: (required)
        :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(ChangePrice, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offer_id', 'command_id',
                      'change_price_without_output']  # 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 create_change_price_command_using_put" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer_id' is set
        if self.api_client.client_side_validation and (
                'offer_id' not in local_var_params or  # noqa: E501
                local_var_params['offer_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `offer_id` when calling `create_change_price_command_using_put`"
            )  # noqa: E501
        # verify the required parameter 'command_id' is set
        if self.api_client.client_side_validation and (
                'command_id' not in local_var_params or  # noqa: E501
                local_var_params['command_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `command_id` when calling `create_change_price_command_using_put`"
            )  # noqa: E501
        # verify the required parameter 'change_price_without_output' is set
        if self.api_client.client_side_validation and (
                'change_price_without_output' not in local_var_params
                or  # noqa: E501
                local_var_params['change_price_without_output'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `change_price_without_output` when calling `create_change_price_command_using_put`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'offer_id' in local_var_params:
            path_params['offerId'] = local_var_params['offer_id']  # noqa: E501
        if 'command_id' in local_var_params:
            path_params['commandId'] = local_var_params[
                'command_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'change_price_without_output' in local_var_params:
            body_params = local_var_params['change_price_without_output']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/offers/{offerId}/change-price-commands/{commandId}',
            'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ChangePrice',  # 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)
Exemplo n.º 20
0
    def add_message_to_dispute_using_post_with_http_info(self, dispute_id, message_request, **kwargs):  # noqa: E501
        """Add a message to a dispute  # noqa: E501

        Use this resource to post a message in certain dispute. At least one of fields: 'text', 'attachment' has to be present. <a href=\"../../news/2018-09-18-dyskusje/#PostMessage\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.add_message_to_dispute_using_post_with_http_info(dispute_id, message_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str dispute_id: Dispute identifier. (required)
        :param MessageRequest message_request: Message request (required)
        :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(DisputeMessage, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['dispute_id', 'message_request']  # 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 add_message_to_dispute_using_post" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'dispute_id' is set
        if self.api_client.client_side_validation and ('dispute_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['dispute_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `dispute_id` when calling `add_message_to_dispute_using_post`")  # noqa: E501
        # verify the required parameter 'message_request' is set
        if self.api_client.client_side_validation and ('message_request' not in local_var_params or  # noqa: E501
                                                        local_var_params['message_request'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `message_request` when calling `add_message_to_dispute_using_post`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'dispute_id' in local_var_params:
            path_params['disputeId'] = local_var_params['dispute_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'message_request' in local_var_params:
            body_params = local_var_params['message_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/disputes/{disputeId}/messages', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DisputeMessage',  # 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)
Exemplo n.º 21
0
    def delete_offer_using_delete_with_http_info(self, offer_id,
                                                 **kwargs):  # noqa: E501
        """Delete a draft offer  # noqa: E501

        Use this resource to delete a draft offer. <a href=\"../../news/2018-10-09_draft_delete/\" target=\"_blank\">Read more</a>.  # 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_offer_using_delete_with_http_info(offer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str offer_id: Offer identifier. (required)
        :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: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offer_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')

        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 delete_offer_using_delete" %
                                   key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer_id' is set
        if self.api_client.client_side_validation and (
                'offer_id' not in local_var_params or  # noqa: E501
                local_var_params['offer_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `offer_id` when calling `delete_offer_using_delete`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'offer_id' in local_var_params:
            path_params['offerId'] = local_var_params['offer_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offers/{offerId}',
            '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=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)
Exemplo n.º 22
0
    def upload_dispute_attachment_using_put_with_http_info(self, attachment_id, body, **kwargs):  # noqa: E501
        """Upload a dispute message attachment  # noqa: E501

        Upload a dispute message attachment. This operation should be used after creating an attachment declaration with *POST /sale/dispute-attachments* **Important!** You can find the URL address to upload the file to our server in the *Location* response header of *POST /sale/dispute-attachments*. The URL is unique and one-time. As its format may change in time, you should always use the address from the header. Do not compose the address on your own.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.upload_dispute_attachment_using_put_with_http_info(attachment_id, body, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str attachment_id: Attachment identifier. (required)
        :param file body: (required)
        :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: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_hosts = ['https://upload.{environment}']  # noqa: E501
        local_var_host = local_var_hosts[0]
        if kwargs.get('_host_index'):
            if int(kwags.get('_host_index')) < 0 or int(kawgs.get('_host_index')) >= len(local_var_hosts):
                raise ApiValueError("Invalid host index. Must be 0 <= index < %s" % len(local_var_host))
            local_var_host = local_var_hosts[int(kwargs.get('_host_index'))]
        local_var_params = locals()

        all_params = ['attachment_id', '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')

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

        collection_formats = {}

        path_params = {}
        if 'attachment_id' in local_var_params:
            path_params['attachmentId'] = local_var_params['attachment_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'body' in local_var_params:
            body_params = local_var_params['body']
        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['image/png', 'image/gif', 'image/bmp', 'image/tiff', 'image/jpeg', 'application/pdf'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/dispute-attachments/{attachmentId}', '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=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'),
            _host=local_var_host,
            collection_formats=collection_formats)
Exemplo n.º 23
0
    def get_publication_tasks_using_get_with_http_info(self, command_id,
                                                       **kwargs):  # noqa: E501
        """Publish command detailed report  # noqa: E501

        Use this resource to retrieve information about the offer statuses on the site (Defaults: limit = 100, offset = 0). <a href=\"../../sale/#step-8-offer-publication-commands\" target=\"_blank\">Read more</a>.  # 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_publication_tasks_using_get_with_http_info(command_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str command_id: Command identifier. (required)
        :param int limit: The limit of elements in the response.
        :param int offset: The offset of elements in the response.
        :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(TaskReport, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['command_id', 'limit', 'offset']  # 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 get_publication_tasks_using_get" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'command_id' is set
        if self.api_client.client_side_validation and (
                'command_id' not in local_var_params or  # noqa: E501
                local_var_params['command_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `command_id` when calling `get_publication_tasks_using_get`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'command_id' in local_var_params:
            path_params['commandId'] = local_var_params[
                'command_id']  # noqa: E501

        query_params = []
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params[
                'offset'] is not None:  # noqa: E501
            query_params.append(
                ('offset', local_var_params['offset']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offer-publication-commands/{commandId}/tasks',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TaskReport',  # 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 modify_pos_using_put_with_http_info(self, id, pos,
                                            **kwargs):  # noqa: E501
        """Modify a point of service  # noqa: E501

        Use this resource to modify a point of service. <a href=\"../../news/2017-08-11-punkty_odbioru/#2\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.modify_pos_using_put_with_http_info(id, pos, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str id: Point of service ID. Must match values with 'id' property from the body. (required)
        :param Pos pos: Point of service (required)
        :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(Pos, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['id', 'pos']  # 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 modify_pos_using_put" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'id' is set
        if self.api_client.client_side_validation and (
                'id' not in local_var_params or  # noqa: E501
                local_var_params['id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `id` when calling `modify_pos_using_put`"
            )  # noqa: E501
        # verify the required parameter 'pos' is set
        if self.api_client.client_side_validation and (
                'pos' not in local_var_params or  # noqa: E501
                local_var_params['pos'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `pos` when calling `modify_pos_using_put`"
            )  # noqa: E501

        collection_formats = {}

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

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'pos' in local_var_params:
            body_params = local_var_params['pos']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/points-of-service/{id}',
            'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='Pos',  # 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)
Exemplo n.º 25
0
    def search_offers_using_get_with_http_info(self, **kwargs):  # noqa: E501
        """Get seller's offers  # noqa: E501

        Use this resource to get the list of the seller's offers. You can use different query parameters to filter the list.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.search_offers_using_get_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str offer_id: Offer ID.
        :param str name: The text to search in the offer title.
        :param float selling_mode_price_amount_gte: The lower threshold of price.
        :param float selling_mode_price_amount_lte: The upper threshold of price.
        :param list[str] publication_status: The publication status of the offer. Passing more than one value will search for offers with any of the given statuses. By default all statuses are included. Example: `publication.status=INACTIVE&publication.status=ACTIVE` - returns offers with status `INACTIVE` or `ACTIVE`.
        :param list[str] selling_mode_format: The offer's selling format. Passing more than one value will search for offers with any of the given formats. By default all formats are included. Example: `sellingMode.format=BUY_NOW&sellingMode.format=ADVERTISEMENT` - returns offers with with format `BUY_NOW` or `ADVERTISEMENT`.
        :param list[str] external_id: The ID from the client's external system. Passing more than one value will search for offers with any of the given IDs. By default no ID is included. Example: `external.id=1233&external.id=1234` - returns offers with ID `1233` or `1234`. Single ID length shouldn't exceed 100 characters.
        :param str delivery_shipping_rates_id: The ID of shipping rates. Returns offers with given shipping rates ID.
        :param bool delivery_shipping_rates_id_empty: Allow to filter offers by existence of shipping rates ID.
        :param str sort: The results' sorting order. No prefix in the value means ascending order. `-` prefix means descending order. If you don't provide the sort parameter, the list is sorted by offer creation time, descending.
        :param int limit: The maximum number of offers returned in the response.
        :param int offset: Index of the first returned offer from all search results.
        :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(OffersSearchResultDto, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            'offer_id', 'name', 'selling_mode_price_amount_gte',
            'selling_mode_price_amount_lte', 'publication_status',
            'selling_mode_format', 'external_id', 'delivery_shipping_rates_id',
            'delivery_shipping_rates_id_empty', 'sort', 'limit', 'offset'
        ]  # 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 search_offers_using_get" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and (
                'external_id' in local_var_params and  # noqa: E501
                len(local_var_params['external_id']) > 100):  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `external_id` when calling `search_offers_using_get`, number of items must be less than or equal to `100`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] > 1000:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `search_offers_using_get`, must be a value less than or equal to `1000`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] < 1:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `search_offers_using_get`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params[
                'offset'] < 0:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `offset` when calling `search_offers_using_get`, must be a value greater than or equal to `0`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'offer_id' in local_var_params and local_var_params[
                'offer_id'] is not None:  # noqa: E501
            query_params.append(
                ('offer.id', local_var_params['offer_id']))  # noqa: E501
        if 'name' in local_var_params and local_var_params[
                'name'] is not None:  # noqa: E501
            query_params.append(
                ('name', local_var_params['name']))  # noqa: E501
        if 'selling_mode_price_amount_gte' in local_var_params and local_var_params[
                'selling_mode_price_amount_gte'] is not None:  # noqa: E501
            query_params.append(
                ('sellingMode.price.amount.gte',
                 local_var_params['selling_mode_price_amount_gte']
                 ))  # noqa: E501
        if 'selling_mode_price_amount_lte' in local_var_params and local_var_params[
                'selling_mode_price_amount_lte'] is not None:  # noqa: E501
            query_params.append(
                ('sellingMode.price.amount.lte',
                 local_var_params['selling_mode_price_amount_lte']
                 ))  # noqa: E501
        if 'publication_status' in local_var_params and local_var_params[
                'publication_status'] is not None:  # noqa: E501
            query_params.append(
                ('publication.status',
                 local_var_params['publication_status']))  # noqa: E501
            collection_formats['publication.status'] = 'multi'  # noqa: E501
        if 'selling_mode_format' in local_var_params and local_var_params[
                'selling_mode_format'] is not None:  # noqa: E501
            query_params.append(
                ('sellingMode.format',
                 local_var_params['selling_mode_format']))  # noqa: E501
            collection_formats['sellingMode.format'] = 'multi'  # noqa: E501
        if 'external_id' in local_var_params and local_var_params[
                'external_id'] is not None:  # noqa: E501
            query_params.append(
                ('external.id', local_var_params['external_id']))  # noqa: E501
            collection_formats['external.id'] = 'multi'  # noqa: E501
        if 'delivery_shipping_rates_id' in local_var_params and local_var_params[
                'delivery_shipping_rates_id'] is not None:  # noqa: E501
            query_params.append(
                ('delivery.shippingRates.id',
                 local_var_params['delivery_shipping_rates_id']))  # noqa: E501
        if 'delivery_shipping_rates_id_empty' in local_var_params and local_var_params[
                'delivery_shipping_rates_id_empty'] is not None:  # noqa: E501
            query_params.append(
                ('delivery.shippingRates.id.empty',
                 local_var_params['delivery_shipping_rates_id_empty']
                 ))  # noqa: E501
        if 'sort' in local_var_params and local_var_params[
                'sort'] is not None:  # noqa: E501
            query_params.append(
                ('sort', local_var_params['sort']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params[
                'offset'] is not None:  # noqa: E501
            query_params.append(
                ('offset', local_var_params['offset']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/offers',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OffersSearchResultDto',  # 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)
Exemplo n.º 26
0
    def offer_quotes_public_using_get_with_http_info(self, offer_id,
                                                     **kwargs):  # noqa: E501
        """Get the user's current offer quotes  # noqa: E501

        This endpoint returns current offer quotes (listing and promo fees) cycles for authenticated user and list of offers. <a href=\"../../news/2018-02-14-zasob_do_sprawdzania_daty_oplaty/\" target=\"_blank\">Read more</a>. <br/>2018-07-18 - resource update <a href=\"../../news/2018-07-18-aktualizacja_zasob_do_sprawdzania_daty_oplaty/\" target=\"_blank\">here</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.offer_quotes_public_using_get_with_http_info(offer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param list[str] offer_id: List of offer Ids, maximum 20 values. (required)
        :param str name: Offer quote name.
        :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(OfferQuotesDto, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offer_id', 'name']  # 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 offer_quotes_public_using_get" %
                                   key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer_id' is set
        if self.api_client.client_side_validation and (
                'offer_id' not in local_var_params or  # noqa: E501
                local_var_params['offer_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `offer_id` when calling `offer_quotes_public_using_get`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'name' in local_var_params and local_var_params[
                'name'] is not None:  # noqa: E501
            query_params.append(
                ('name', local_var_params['name']))  # noqa: E501
        if 'offer_id' in local_var_params and local_var_params[
                'offer_id'] is not None:  # noqa: E501
            query_params.append(
                ('offer.id', local_var_params['offer_id']))  # noqa: E501
            collection_formats['offer.id'] = 'multi'  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/pricing/offer-quotes',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OfferQuotesDto',  # 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 place_bid_with_http_info(self, offer_id, **kwargs):  # noqa: E501
        """Place a bid in an auction  # noqa: E501

        Place a bid in an auction.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.place_bid_with_http_info(offer_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str offer_id: The offer ID. (required)
        :param BidRequest bid_request:
        :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(MyBidResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['offer_id', 'bid_request']  # 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 place_bid" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'offer_id' is set
        if self.api_client.client_side_validation and ('offer_id' not in local_var_params or  # noqa: E501
                                                        local_var_params['offer_id'] is None):  # noqa: E501
            raise ApiValueError("Missing the required parameter `offer_id` when calling `place_bid`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'offer_id' in local_var_params:
            path_params['offerId'] = local_var_params['offer_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'bid_request' in local_var_params:
            body_params = local_var_params['bid_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/bidding/offers/{offerId}/bid', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='MyBidResponse',  # 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)
Exemplo n.º 28
0
    def preview_fees_public_api_using_post_with_http_info(
            self, wrapper_type_for_preview_conditions, **kwargs):  # noqa: E501
        """Preview offer fees  # noqa: E501

        This endpoint calculates fees for a provided offer conditions. The quotation is estimated and based on the current configuration of the Allegro price list and the data entered in this API. The stated price does not include package discounts. The rules of charging and amount of charges are described in the Allegro regulations in Appendix 4. The final amount of the fee for the offer will be available after approval under the tab: My Account> Accounts> History. <a href=\"../../news/2017-10-30-kalkulator_ogloszenia/\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.preview_fees_public_api_using_post_with_http_info(wrapper_type_for_preview_conditions, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param WrapperTypeForPreviewConditions wrapper_type_for_preview_conditions: command (required)
        :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(WrapsListingAndCommissionsFees, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['wrapper_type_for_preview_conditions']  # 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 preview_fees_public_api_using_post" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'wrapper_type_for_preview_conditions' is set
        if self.api_client.client_side_validation and (
                'wrapper_type_for_preview_conditions' not in local_var_params
                or  # noqa: E501
                local_var_params['wrapper_type_for_preview_conditions'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `wrapper_type_for_preview_conditions` when calling `preview_fees_public_api_using_post`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'wrapper_type_for_preview_conditions' in local_var_params:
            body_params = local_var_params[
                'wrapper_type_for_preview_conditions']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/vnd.allegro.public.v1+json'])  # noqa: E501

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

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/pricing/fee-preview',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='WrapsListingAndCommissionsFees',  # 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)
Exemplo n.º 29
0
    def badge_applications_get_all_with_http_info(self,
                                                  **kwargs):  # noqa: E501
        """[BETA] Get a list of badge applications  # noqa: E501

        Use this resource to get a list of badge applications. <a href=\"/badge/#4\" target=\"_blank\">Read more</a>.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.badge_applications_get_all_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str campaign_id: Campaign ID.
        :param str offer_id: Offer ID.
        :param int offset: Offset.
        :param int limit: The maximum number of applications returned in the response.
        :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(BadgeApplications, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['campaign_id', 'offer_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')

        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 badge_applications_get_all" %
                                   key)
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] > 1000:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `badge_applications_get_all`, must be a value less than or equal to `1000`"
            )  # noqa: E501
        if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params[
                'limit'] < 1:  # noqa: E501
            raise ApiValueError(
                "Invalid value for parameter `limit` when calling `badge_applications_get_all`, must be a value greater than or equal to `1`"
            )  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'campaign_id' in local_var_params and local_var_params[
                'campaign_id'] is not None:  # noqa: E501
            query_params.append(
                ('campaign.id', local_var_params['campaign_id']))  # noqa: E501
        if 'offer_id' in local_var_params and local_var_params[
                'offer_id'] is not None:  # noqa: E501
            query_params.append(
                ('offer.id', local_var_params['offer_id']))  # noqa: E501
        if 'offset' in local_var_params and local_var_params[
                'offset'] is not None:  # noqa: E501
            query_params.append(
                ('offset', local_var_params['offset']))  # noqa: E501
        if 'limit' in local_var_params and local_var_params[
                'limit'] is not None:  # noqa: E501
            query_params.append(
                ('limit', local_var_params['limit']))  # 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/vnd.allegro.beta.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

        return self.api_client.call_api(
            '/sale/badge-applications',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='BadgeApplications',  # 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)
Exemplo n.º 30
0
    def get_sale_products_with_http_info(self, **kwargs):  # noqa: E501
        """Get search products results  # noqa: E501

        Use this resource to get a list of products according to provided parameters. At least ean or phrase parameter is required. <a href=\"../../productization/#search\" target=\"_blank\">Read more</a>.  # 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_sale_products_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str ean: The EAN values can include EAN, ISBN, and UPC identifier types.
        :param str phrase: Search phrase.
        :param str category_id: The category identifier to filter results.
        :param dict(str, str) dynamic_filters: You can filter and customize your search results to find exactly what you need by applying filters ids and their dictionary values to query according to the flowing pattern: id=value. When the filter definition looks like:   ````   {     \"id\": \"127448\",     \"name\": \"Kolor\",     \"type\": \"SINGLE\",     \"values\": [       {         \"name\": \"biały\",         \"value\": \"2\"       },       {         \"name\": \"czarny\",         \"value\": \"1\" }     ]   }   ```` You can use 'Kolor' filter to query results, i.e.:   * `127448=2` for \"biały\"   * `127448=1` for \"czarny\".
        :param str page_id: A \"cursor\" to the next set of results.
        :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(GetSaleProductsResponse, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['ean', 'phrase', 'category_id', 'dynamic_filters', 'page_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')

        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 get_sale_products" % key
                )
            local_var_params[key] = val
        del local_var_params['kwargs']

        if self.api_client.client_side_validation and ('ean' in local_var_params and  # noqa: E501
                                                        len(local_var_params['ean']) > 18):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `ean` when calling `get_sale_products`, length must be less than or equal to `18`")  # noqa: E501
        if self.api_client.client_side_validation and ('phrase' in local_var_params and  # noqa: E501
                                                        len(local_var_params['phrase']) > 1024):  # noqa: E501
            raise ApiValueError("Invalid value for parameter `phrase` when calling `get_sale_products`, length must be less than or equal to `1024`")  # noqa: E501
        collection_formats = {}

        path_params = {}

        query_params = []
        if 'ean' in local_var_params and local_var_params['ean'] is not None:  # noqa: E501
            query_params.append(('ean', local_var_params['ean']))  # noqa: E501
        if 'phrase' in local_var_params and local_var_params['phrase'] is not None:  # noqa: E501
            query_params.append(('phrase', local_var_params['phrase']))  # noqa: E501
        if 'category_id' in local_var_params and local_var_params['category_id'] is not None:  # noqa: E501
            query_params.append(('category.id', local_var_params['category_id']))  # noqa: E501
        if 'dynamic_filters' in local_var_params and local_var_params['dynamic_filters'] is not None:  # noqa: E501
            query_params.append(('Dynamic filters', local_var_params['dynamic_filters']))  # noqa: E501
        if 'page_id' in local_var_params and local_var_params['page_id'] is not None:  # noqa: E501
            query_params.append(('page.id', local_var_params['page_id']))  # 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/vnd.allegro.public.v1+json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['bearer-token-for-user']  # noqa: E501

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