"""staxfattmerchantapi.

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

# ruff: noqa: D410, E501, E101, D206
from apimatic_core.authentication.multiple.single_auth import (
    Single,
)
from apimatic_core.request_builder import RequestBuilder
from apimatic_core.response_handler import ResponseHandler
from apimatic_core.types.parameter import Parameter

from staxfattmerchantapi.apis.base_api import (
    BaseApi,
)
from staxfattmerchantapi.configuration import (
    Server,
)
from staxfattmerchantapi.http.http_method_enum import (
    HttpMethodEnum,
)


class ReportingApi(BaseApi):
    """A Controller to access Endpoints in the staxfattmerchantapi API."""

    def __init__(self, config):
        """Initialize ReportingApi object."""
        super(ReportingApi, self).__init__(config)

    def get_report(self,
                   start_date=None,
                   end_date=None):
        """Perform a GET request to /report.

        Args:
            start_date (date, optional): The request query parameter.
            end_date (date, optional): The request query parameter.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Report data

        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.DEFAULT)
            .path("/report")
            .http_method(HttpMethodEnum.GET)
            .query_param(Parameter()
                .key("startDate")
                .value(start_date))
            .query_param(Parameter()
                .key("endDate")
                .value(end_date))
            .auth(Single("bearerAuth")),
        ).response(
            ResponseHandler()
            .is_api_response(True),
        ).execute()

    def get_team_summary(self):
        """Perform a GET request to /report/team-summary.

        Returns:
            ApiResponse: An object with the response value as well as other useful
                information such as status codes and headers. Team summary data

        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.DEFAULT)
            .path("/report/team-summary")
            .http_method(HttpMethodEnum.GET)
            .auth(Single("bearerAuth")),
        ).response(
            ResponseHandler()
            .is_api_response(True),
        ).execute()
