def get_charges_summary(self,
                            status,
                            created_since=None,
                            created_until=None):
        """Does a GET request to /charges/summary.

        TODO: type endpoint description here.

        Args:
            status (string): TODO: type description here. Example: 
            created_since (datetime, optional): TODO: type description here.
                Example: 
            created_until (datetime, optional): TODO: type description here.
                Example: 

        Returns:
            GetChargesSummaryResponse: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/charges/summary'
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'status':
            status,
            'created_since':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_since),
            'created_until':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_until)
        }
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json'}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        BasicAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            GetChargesSummaryResponse.from_dictionary)
    def get_anticipation_limits(self,
                                recipient_id,
                                timeframe,
                                payment_date):
        """Does a GET request to /recipients/{recipient_id}/anticipation_limits.

        Gets the anticipation limits for a recipient

        Args:
            recipient_id (string): Recipient id
            timeframe (string): Timeframe
            payment_date (datetime): Anticipation payment date

        Returns:
            GetAnticipationLimitResponse: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/recipients/{recipient_id}/anticipation_limits'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'recipient_id': recipient_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'timeframe': timeframe,
            'payment_date': APIHelper.when_defined(APIHelper.RFC3339DateTime, payment_date)
        }
        _query_builder = APIHelper.append_url_with_query_parameters(_query_builder,
            _query_parameters, Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {
            'accept': 'application/json'
        }

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        BasicAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body, GetAnticipationLimitResponse.from_dictionary)
    def get_charges(self,
                    page=None,
                    size=None,
                    code=None,
                    status=None,
                    payment_method=None,
                    customer_id=None,
                    order_id=None,
                    created_since=None,
                    created_until=None):
        """Does a GET request to /charges.

        Lists all charges

        Args:
            page (int, optional): Page number
            size (int, optional): Page size
            code (string, optional): Filter for charge's code
            status (string, optional): Filter for charge's status
            payment_method (string, optional): Filter for charge's payment
                method
            customer_id (string, optional): Filter for charge's customer id
            order_id (string, optional): Filter for charge's order id
            created_since (datetime, optional): Filter for the beginning of
                the range for charge's creation
            created_until (datetime, optional): Filter for the end of the
                range for charge's creation

        Returns:
            ListChargesResponse: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/charges'
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'page':
            page,
            'size':
            size,
            'code':
            code,
            'status':
            status,
            'payment_method':
            payment_method,
            'customer_id':
            customer_id,
            'order_id':
            order_id,
            'created_since':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_since),
            'created_until':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_until)
        }
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json'}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        BasicAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          ListChargesResponse.from_dictionary)
Exemple #4
0
    def get_plans(self,
                  page=None,
                  size=None,
                  name=None,
                  status=None,
                  billing_type=None,
                  created_since=None,
                  created_until=None):
        """Does a GET request to /plans.

        Gets all plans

        Args:
            page (int, optional): Page number
            size (int, optional): Page size
            name (string, optional): Filter for Plan's name
            status (string, optional): Filter for Plan's status
            billing_type (string, optional): Filter for plan's billing type
            created_since (datetime, optional): Filter for plan's creation
                date start range
            created_until (datetime, optional): Filter for plan's creation
                date end range

        Returns:
            ListPlansResponse: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/plans'
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'page':
            page,
            'size':
            size,
            'name':
            name,
            'status':
            status,
            'billing_type':
            billing_type,
            'created_since':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_since),
            'created_until':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_until)
        }
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json'}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        BasicAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          ListPlansResponse.from_dictionary)
Exemple #5
0
    def get_sellers(self,
                    page=None,
                    size=None,
                    name=None,
                    document=None,
                    code=None,
                    status=None,
                    mtype=None,
                    created_since=None,
                    created_until=None):
        """Does a GET request to /sellers.

        TODO: type endpoint description here.

        Args:
            page (int, optional): Page number
            size (int, optional): Page size
            name (string, optional): TODO: type description here. Example: 
            document (string, optional): TODO: type description here. Example:
                            code (string, optional): TODO: type description here. Example: 
            status (string, optional): TODO: type description here. Example: 
            mtype (string, optional): TODO: type description here. Example: 
            created_since (datetime, optional): TODO: type description here.
                Example: 
            created_until (datetime, optional): TODO: type description here.
                Example: 

        Returns:
            ListSellerResponse: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/sellers'
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'page':
            page,
            'size':
            size,
            'name':
            name,
            'document':
            document,
            'code':
            code,
            'status':
            status,
            'type':
            mtype,
            'created_Since':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_since),
            'created_Until':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_until)
        }
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json'}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        BasicAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(_context.response.raw_body,
                                          ListSellerResponse.from_dictionary)
    def get_anticipations(self,
                          recipient_id,
                          page=None,
                          size=None,
                          status=None,
                          timeframe=None,
                          payment_date_since=None,
                          payment_date_until=None,
                          created_since=None,
                          created_until=None):
        """Does a GET request to /recipients/{recipient_id}/anticipations.

        Retrieves a paginated list of anticipations from a recipient

        Args:
            recipient_id (string): Recipient id
            page (int, optional): Page number
            size (int, optional): Page size
            status (string, optional): Filter for anticipation status
            timeframe (string, optional): Filter for anticipation timeframe
            payment_date_since (datetime, optional): Filter for start range
                for anticipation payment date
            payment_date_until (datetime, optional): Filter for end range for
                anticipation payment date
            created_since (datetime, optional): Filter for start range for
                anticipation creation date
            created_until (datetime, optional): Filter for end range for
                anticipation creation date

        Returns:
            ListAnticipationResponse: Response from the API. 

        Raises:
            APIException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        # Prepare query URL
        _url_path = '/recipients/{recipient_id}/anticipations'
        _url_path = APIHelper.append_url_with_template_parameters(
            _url_path, {'recipient_id': recipient_id})
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'page':
            page,
            'size':
            size,
            'status':
            status,
            'timeframe':
            timeframe,
            'payment_date_since':
            APIHelper.when_defined(APIHelper.RFC3339DateTime,
                                   payment_date_since),
            'payment_date_until':
            APIHelper.when_defined(APIHelper.RFC3339DateTime,
                                   payment_date_until),
            'created_since':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_since),
            'created_until':
            APIHelper.when_defined(APIHelper.RFC3339DateTime, created_until)
        }
        _query_builder = APIHelper.append_url_with_query_parameters(
            _query_builder, _query_parameters,
            Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare headers
        _headers = {'accept': 'application/json'}

        # Prepare and execute request
        _request = self.http_client.get(_query_url, headers=_headers)
        BasicAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return APIHelper.json_deserialize(
            _context.response.raw_body,
            ListAnticipationResponse.from_dictionary)