# -*- coding: utf-8 -*-

"""
shelldatareportingapis

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""

from shelldatareportingapis.api_helper import APIHelper
from shelldatareportingapis.configuration import Server
from shelldatareportingapis.controllers.base_controller import BaseController
from apimatic_core.request_builder import RequestBuilder
from apimatic_core.response_handler import ResponseHandler
from apimatic_core.types.parameter import Parameter
from shelldatareportingapis.http.http_method_enum import HttpMethodEnum
from apimatic_core.authentication.multiple.single_auth import Single
from shelldatareportingapis.models.priced_transaction_response import PricedTransactionResponse
from shelldatareportingapis.models.priced_trans_summary_response import PricedTransSummaryResponse
from shelldatareportingapis.models.multi_priced_transaction_response import MultiPricedTransactionResponse
from shelldatareportingapis.models.card_usage_summary_response import CardUsageSummaryResponse
from shelldatareportingapis.models.volume_based_bonus_response import VolumeBasedBonusResponse
from shelldatareportingapis.models.volume_based_pricing_response import VolumeBasedPricingResponse
from shelldatareportingapis.models.transaction_fees_response import TransactionFeesResponse
from shelldatareportingapis.models.fee_summary_response import FeeSummaryResponse
from shelldatareportingapis.models.fuel_consumption_response import FuelConsumptionResponse
from shelldatareportingapis.models.update_odometer_response import UpdateOdometerResponse
from shelldatareportingapis.models.transaction_exceptions_response import TransactionExceptionsResponse
from shelldatareportingapis.models.recent_transactions_response import RecentTransactionsResponse
from shelldatareportingapis.models.priced_transaction_response_v_2 import PricedTransactionResponseV2
from shelldatareportingapis.exceptions.default_error_exception import DefaultErrorException
from shelldatareportingapis.exceptions.error_user_access_error_1_exception import ErrorUserAccessError1Exception
from shelldatareportingapis.exceptions.error_object_exception import ErrorObjectException


class TransactionController(BaseController):

    """A Controller to access Endpoints in the shelldatareportingapis API."""
    def __init__(self, config):
        super(TransactionController, self).__init__(config)

    def priced_transactions(self,
                            apikey,
                            request_id,
                            body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/pricedtransactions.

        This API allows querying transaction data (i.e. Priced, Billed and
        Unbilled sales items). It provides a flexible search criteria and
        supports paging. 
        Transactions that are posted but not yet priced, billed or that are in
        error will not be returned by this API. The API also supports
        returning Fee Items.
        #### Supported operations
          * Get sales items and fee transactions
            * Search by invoice status
            * Search by fixed date period
            * Search by date range
            * Search by account
            * Search by card
          * Get sales items only
            * Search by transaction Id or location
            * Search by transaction posting date
            * Search by invoice number or date
            * Search by driver name or vehicle registration number
            * Search by card group
            * Search by fuel only transactions
            * Search by product

         This API fetches transactions for a period based on the below
        parameters and priority order:
        1.    InvoiceNumber
         2.    InvoiceDate
         3.    FromDate, ToDate
        4.    PostingFromDate, PostingToDate (Can be used only when
        IncludeFees = false)
         5.    InvoiceDateFrom, InvoiceDateTo
         6.    Period
         This API considers only one of the above set of parameters at a time.
        For example, if InvoiceNumber and Period are provided in the input
        then Period is ignored and transactions associated to the given
        invoice number are returned.
        If none of the above parameters are provided then last 7 days
        transactions will be fetched.
        This operation can fetch transactions that are old up to 24
        (configurable) months. However, the date range between any of the
        ‘From’ and ‘To’ dates in the above combination cannot be more than 210
        (configurable) days.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (PriceTransactionRequest, optional): Priced Transaction
                Request Body

        Returns:
            PricedTransactionResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/pricedtransactions')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(PricedTransactionResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def priced_transactions_summary(self,
                                    apikey,
                                    request_id,
                                    body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/pricedtransactionssummary.

        This API returns the transaction summary data (i.e. Priced, Billed and
        Unbilled sales items). It provides a flexible search criteria. 
        The API also supports returning Fee Items. Transactions posted for fee
        items that are in error are not included in the summary.
        The endpoint supports the exact same search criteria as the endpoint
        *transaction/prciedtransactions*.
        #### Supported operations
          * Get sales items and fee transactions
            * Search by invoice status
            * Search by fixed date period
            * Search by date range
            * Search by account
            * Search by card
          * Get sales items only
            * Search by transaction Id or location
            * Search by transaction posting date
            * Search by invoice number or date
            * Search by driver name or vehicle registration number
            * Search by card group
            * Search by fuel only transactions
            * Search by product

         This API fetches transactions for a period based on the below
        parameters and priority order:
         1.    InvoiceNumber
         2.    InvoiceDate
         3.    FromDate, ToDate
         4.    PostingFromDate, PostingToDate (Can be used only when
        IncludeFees = false)
         5.    InvoiceDateFrom, InvoiceDateTo
         6.    Period
         This API considers only one of the above set of parameters at a time.
        For example, if InvoiceNumber and Period are provided in the input
        then Period is ignored and transactions associated to the given
        invoice number are returned.
        If none of the above parameters are provided then last 7 days
        transactions will be fetched.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (PriceTransSummaryRequest, optional): PricedSummary
                RequestBody

        Returns:
            PricedTransSummaryResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/pricedtransactionssummary')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(PricedTransSummaryResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def multipriced_transactions(self,
                                 apikey,
                                 request_id,
                                 body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/multipayerspricedtransactions.

        This API allows querying transaction data (i.e. Priced, Billed and
        Unbilled sales items) for multiple payers. It provides a flexible
        search criteria and supports paging. 
        Transactions that are posted but not yet priced, billed or that are in
        error will not be returned by this API. The API also supports
        returning Fee Items.
        At least one payer should be provided. Multiple payers must belong to
        the same payer group.
        #### Supported operations
          * Get sales items and fee transactions for multiple payers
            * Search by invoice status
            * Search by fixed date period
            * Search by date range
          * Get sales items only for multiple payers
            * Search by transaction location
            * Search by transaction posting date
            * Search by invoice number or date
            * Search by fuel only transactions

         This API fetches transactions for a period based on the below
        parameters and priority order:
         1.    InvoiceNumber
         2.    InvoiceDate
         3.    FromDate, ToDate
         4.    PostingFromDate, PostingToDate (Can be used only when
        IncludeFees = false)
         5.    InvoiceDateFrom, InvoiceDateTo
         6.    Period
         This API considers only one of the above set of parameters at a time.
        For example, if InvoiceNumber and Period are provided in the input
        then Period is ignored and transactions associated to the given
        invoice number are returned.
        If none of the above parameters are provided then last 7 days
        transactions will be fetched.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (MultiPricedTransactionRequest, optional): MultiPayer
                RequestBody

        Returns:
            MultiPricedTransactionResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/multipayerspricedtransactions')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(MultiPricedTransactionResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def card_usage_summary(self,
                           apikey,
                           request_id,
                           body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/cardusagesummary.

        This operation is to provide the expenditure analysis for a card for
        the past 7 months.
        The response contains a daily summary of the transactions (billed &
        unbilled) from 1st of the last 7 months for the requested card grouped
        by card, site-group and product.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (CardUsageSummaryRequest, optional): Card Usage Summary
                RequestBody

        Returns:
            CardUsageSummaryResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/cardusagesummary')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(CardUsageSummaryResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def volume_based_bonus(self,
                           apikey,
                           request_id,
                           body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/volumebasedbonus.

        - This API provides the details of the bonus and/or association bonus
        rules setup for the given payer and that are active on the current
        date.
        - This API also returns the details of the monthly breakup of current
        period consumption as well as the details of the previously calculated
        bonus and consumption of the applicable payers.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (VolumeBasedBonusRequest, optional): VolumeBasedBonus
                RequestBody

        Returns:
            VolumeBasedBonusResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/volumebasedbonus')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(VolumeBasedBonusResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def volume_based_pricing(self,
                             apikey,
                             request_id,
                             body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/volumebasedpricing.

        - This API will return the details of the in arrear fee rule applied
        to the payer along with details of locations, products, tiers as
        applied.  
        - It will also show historical and current volume consumption and
        related tier applied for the following month.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (VolumeBasedPricingRequest, optional): VolumeBasedPricing
                RequestBody

        Returns:
            VolumeBasedPricingResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/volumebasedpricing')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(VolumeBasedPricingResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def fees(self,
             apikey,
             request_id,
             body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/fees.

        This API returns the fee/charges levied from a  customer's account in
        a billing period or date range. The API returns both billed and
        unbilled fee items.  
        To get the summary of charges, the endpoint *transaction/feessummary*
        should be called with the same input criteria.
        #### Supported operations
          * Get fees by invoice status
          * Get fees by date period
          * Get fees by account
          * Get fees by card Id or PAN
          * Get fees by fee type charges
          * Get fees including cancelled items
          * Get fees by line item description
          * Get fees by product

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (TransactionFeesRequest, optional): Transaction Fees
                RequestBody

        Returns:
            TransactionFeesResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/fees')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(TransactionFeesResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def fee_summary_response(self,
                             apikey,
                             request_id,
                             body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/feessummary.

        This API returns the summary data of the fee/charges levied from a
        customer's account in a billing period or date range. The API returns
        both billed and unbilled fee items. 
        The endpoint supports the exact same search criteria as the endpoint
        *transaction/feessummary*.
        #### Supported operations
          * Get fees by invoice status
          * Get fees by date period
          * Get fees by account
          * Get fees by card Id or PAN
          * Get fees by fee type charges
          * Get fees including cancelled items
          * Get fees by line item description
          * Get fees by product

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (TransactionFeesRequest, optional): FeeSummary RequestBody

        Returns:
            FeeSummaryResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/feessummary')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(FeeSummaryResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def fuel_consumption(self,
                         apikey,
                         request_id,
                         body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/fuelconsumption.

        - This API returns the customer an overview of how many transactions,
        how much fuel volume used over a given period and the total volume
        used by a card 
        - This operation response will contains card & transaction details for
        given period aggregated by payer, account, cardGroup, PAN, DriverName
        and VRN

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (FuelConsumptionRequest, optional): FuelConsumption
                RequestBody

        Returns:
            FuelConsumptionResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/fuelconsumption')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(FuelConsumptionResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def update_odometer(self,
                        apikey,
                        request_id,
                        body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/updateodometer.

        - This API allows the users to update the odometer readings on the
        sales items (transaction data) 
        - This is an asynchronous operation. If opted, the user will be
        notified on completion of processing.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (UpdateOdometerRequest, optional): updateOdometer RequestBody

        Returns:
            UpdateOdometerResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/updateodometer')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(UpdateOdometerResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def transaction_exceptions(self,
                               apikey,
                               request_id,
                               body=None):
        """Does a POST request to /fleetmanagement/v1/transaction/exceptions.

        - This API provides the details of the Cards or Transaction related
        exceptions based on the given conditions for the Requested period.
        - This API will return the Transactions related exceptions when the
        OutputType input parameter is passed as ‘Transaction’ else will return
        the Cards related exceptions.

        Args:
            apikey (str): This is the API key of the specific environment
                which needs to be passed by the client.
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (TransactionExceptionsRequest, optional): Transaction
                Exceptions RequestBody

        Returns:
            TransactionExceptionsResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/fleetmanagement/v1/transaction/exceptions')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('apikey')
                          .value(apikey))
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BasicAuth'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(TransactionExceptionsResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request  due to something that is perceived to be a client\r\n error (e.g., malformed request syntax, invalid \r\n request message framing, or deceptive request routing).', DefaultErrorException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', DefaultErrorException)
            .local_error('403', 'The server understood the request but refuses to authorize it.', ErrorUserAccessError1Exception)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', DefaultErrorException)
            .local_error('500', 'The server encountered an unexpected condition the prevented it from fulfilling the request.', DefaultErrorException)
        ).execute()

    def recent_transactions_new(self,
                                request_id,
                                body=None):
        """Does a POST request to /transaction-data/v1/recent.

        This endpoint allows querying last 48 hours of transaction data of
        Shell Card (i.e. Priced, Billed, Unbilled etc. sales items). It
        provides a flexible search criteria and supports pagination. E.g., if
        the request is made at 08:30 AM on 18 Aug 2022 then transactions until
        16 Aug 2022 08:30 AM (including) can be retrieved.
        #### Supported operations
            * Search by Date and Time range (within the last 48 hours only)
            * Search by Payer and/or Account number
            * Search by Card
            * Search by Purchased Country
            * Search by Transaction posting date
            * Search by Driver Name or Vehicle registration number
            * Search by Fuel only transactions
            * Search by Product and/or Product group

        Args:
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (RecentTransactionRequest, optional): New Recent Transaction
                RequestBody

        Returns:
            RecentTransactionsResponse: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/transaction-data/v1/recent')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BearerToken'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(RecentTransactionsResponse.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).', ErrorObjectException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', ErrorObjectException)
            .local_error('403', 'Forbidden', ErrorObjectException)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', ErrorObjectException)
            .local_error('500', 'The server encountered an unexpected condition that  prevented it from fulfilling the request.', ErrorObjectException)
        ).execute()

    def priced_transactions_v_2(self,
                                request_id,
                                body=None):
        """Does a POST request to /transaction-data/v1/priced.

        This API allows querying transaction data (i.e. Priced, Billed and
        Unbilled sales items). It provides a flexible search criteria and
        supports paging. 
        The version 2 is an enhancement to the version 1 where EV transactions
        and their details are added in the response. 
        Transactions that are posted but not yet priced, billed or that are in
        error will not be returned by this API. The API also supports
        returning Fee Items.
        #### Supported operations
          * Get sales items and fee transactions
            * Search by invoice status
            * Search by fixed date period
            * Search by date range
            * Search by account
            * Search by card
          * Get sales items only
            * Search by transaction Id or location
            * Search by transaction posting date
            * Search by invoice number or date
            * Search by driver name or vehicle registration number
            * Search by card group
            * Search by fuel only transactions
            * Search by product
         * EV transaction details - Below are EV specific parameters
            * EVOperator
            * EVSerialId
            * EVChargePointSerial
            * EVChargePointConnectorType
            * EVChargePointConnectorTypeDescription
            * EVChargeDuration
            * EVChargeStartDate
            * EVChargeStartTime
            * EVChargeEndDate
            * EVChargeEndTime

        Args:
            request_id (str): Mandatory UUID (according to RFC 4122 standards)
                for requests and responses. This will be played back in the
                response from the request.
            body (PricedTransactionRequestV2, optional): Priced TransactionV2
                RequestBody

        Returns:
            PricedTransactionResponseV2: Response from the API. OK

        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.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SHELL)
            .path('/transaction-data/v1/priced')
            .http_method(HttpMethodEnum.POST)
            .header_param(Parameter()
                          .key('RequestId')
                          .value(request_id))
            .header_param(Parameter()
                          .key('Content-Type')
                          .value('application/json'))
            .body_param(Parameter()
                        .value(body))
            .header_param(Parameter()
                          .key('accept')
                          .value('application/json'))
            .body_serializer(APIHelper.json_serialize)
            .auth(Single('BearerToken'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(PricedTransactionResponseV2.from_dictionary)
            .local_error('400', 'The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).', ErrorObjectException)
            .local_error('401', 'The request has not been applied because it lacks valid  authentication credentials for the target resource.', ErrorObjectException)
            .local_error('403', 'Forbidden', ErrorObjectException)
            .local_error('404', 'The origin server did not find a current representation  for the target resource or is not willing to disclose  that one exists.', ErrorObjectException)
            .local_error('500', 'The server encountered an unexpected condition that  prevented it from fulfilling the request.', ErrorObjectException)
        ).execute()
