# This file was auto-generated by Fern from our API Definition.

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.ifta_create_ifta_detail_job_response_body import IftaCreateIftaDetailJobResponseBody
from ..types.ifta_get_ifta_detail_job_response_body import IftaGetIftaDetailJobResponseBody
from ..types.ifta_get_ifta_jurisdiction_reports_response_body import IftaGetIftaJurisdictionReportsResponseBody
from ..types.ifta_get_ifta_vehicle_reports_response_body import IftaGetIftaVehicleReportsResponseBody
from .raw_client import AsyncRawIftaClient, RawIftaClient
from .types.get_ifta_jurisdiction_reports_request_fuel_type import GetIftaJurisdictionReportsRequestFuelType
from .types.get_ifta_jurisdiction_reports_request_month import GetIftaJurisdictionReportsRequestMonth
from .types.get_ifta_jurisdiction_reports_request_quarter import GetIftaJurisdictionReportsRequestQuarter
from .types.get_ifta_vehicle_reports_request_fuel_type import GetIftaVehicleReportsRequestFuelType
from .types.get_ifta_vehicle_reports_request_month import GetIftaVehicleReportsRequestMonth
from .types.get_ifta_vehicle_reports_request_quarter import GetIftaVehicleReportsRequestQuarter

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class IftaClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawIftaClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> RawIftaClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawIftaClient
        """
        return self._raw_client

    def get_ifta_jurisdiction_reports(
        self,
        *,
        year: int,
        month: typing.Optional[GetIftaJurisdictionReportsRequestMonth] = None,
        quarter: typing.Optional[GetIftaJurisdictionReportsRequestQuarter] = None,
        jurisdictions: typing.Optional[str] = None,
        fuel_type: typing.Optional[GetIftaJurisdictionReportsRequestFuelType] = None,
        vehicle_ids: typing.Optional[str] = None,
        tag_ids: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> IftaGetIftaJurisdictionReportsResponseBody:
        """
        Get all jurisdiction IFTA reports for the requested time duration. Data is returned in your organization's defined timezone.

        **Note:** The most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours.

         <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        year : int
             The year of the requested IFTA report summary. Must be provided with a month or quarter param. Example: `year=2021`

        month : typing.Optional[GetIftaJurisdictionReportsRequestMonth]
             The month of the requested IFTA report summary. Can not be provided with the quarter param. Example: `month=January`  Valid values: `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November`, `December`

        quarter : typing.Optional[GetIftaJurisdictionReportsRequestQuarter]
             The quarter of the requested IFTA report summary. Can not be provided with the month param. Q1: January, February, March. Q2: April, May, June. Q3: July, August, September. Q4: October, November, December. Example: `quarter=Q1`  Valid values: `Q1`, `Q2`, `Q3`, `Q4`

        jurisdictions : typing.Optional[str]
             A filter on the data based on this comma-separated list of jurisdictions. Example: `jurisdictions=GA`

        fuel_type : typing.Optional[GetIftaJurisdictionReportsRequestFuelType]
             A filter on the data based on this comma-separated list of IFTA fuel types. Example: `fuelType=Diesel`  Valid values: `Unspecified`, `A55`, `Biodiesel`, `CompressedNaturalGas`, `Diesel`, `E85`, `Electricity`, `Ethanol`, `Gasohol`, `Gasoline`, `Hydrogen`, `LiquifiedNaturalGas`, `M85`, `Methanol`, `Propane`, `Other`

        vehicle_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle IDs and externalIds. Example: `vehicleIds=1234,5678,samsara.vin:1HGBH41JXMN109186`

        tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`

        parent_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaGetIftaJurisdictionReportsResponseBody
            OK response.

        Examples
        --------
        from samsara import Samsara

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.ifta.get_ifta_jurisdiction_reports(
            year=1000000,
        )
        """
        _response = self._raw_client.get_ifta_jurisdiction_reports(
            year=year,
            month=month,
            quarter=quarter,
            jurisdictions=jurisdictions,
            fuel_type=fuel_type,
            vehicle_ids=vehicle_ids,
            tag_ids=tag_ids,
            parent_tag_ids=parent_tag_ids,
            request_options=request_options,
        )
        return _response.data

    def get_ifta_vehicle_reports(
        self,
        *,
        year: int,
        month: typing.Optional[GetIftaVehicleReportsRequestMonth] = None,
        quarter: typing.Optional[GetIftaVehicleReportsRequestQuarter] = None,
        jurisdictions: typing.Optional[str] = None,
        fuel_type: typing.Optional[GetIftaVehicleReportsRequestFuelType] = None,
        vehicle_ids: typing.Optional[str] = None,
        tag_ids: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[str] = None,
        after: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> IftaGetIftaVehicleReportsResponseBody:
        """
        Get all vehicle IFTA reports for the requested time duration. Data is returned in your organization's defined timezone.

        **Note:** The most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours.

         <b>Rate limit:</b> 25 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        year : int
             The year of the requested IFTA report summary. Must be provided with a month or quarter param. Example: `year=2021`

        month : typing.Optional[GetIftaVehicleReportsRequestMonth]
             The month of the requested IFTA report summary. Can not be provided with the quarter param. Example: `month=January`  Valid values: `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November`, `December`

        quarter : typing.Optional[GetIftaVehicleReportsRequestQuarter]
             The quarter of the requested IFTA report summary. Can not be provided with the month param. Q1: January, February, March. Q2: April, May, June. Q3: July, August, September. Q4: October, November, December. Example: `quarter=Q1`  Valid values: `Q1`, `Q2`, `Q3`, `Q4`

        jurisdictions : typing.Optional[str]
             A filter on the data based on this comma-separated list of jurisdictions. Example: `jurisdictions=GA`

        fuel_type : typing.Optional[GetIftaVehicleReportsRequestFuelType]
             A filter on the data based on this comma-separated list of IFTA fuel types. Example: `fuelType=Diesel`  Valid values: `Unspecified`, `A55`, `Biodiesel`, `CompressedNaturalGas`, `Diesel`, `E85`, `Electricity`, `Ethanol`, `Gasohol`, `Gasoline`, `Hydrogen`, `LiquifiedNaturalGas`, `M85`, `Methanol`, `Propane`, `Other`

        vehicle_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle IDs and externalIds. Example: `vehicleIds=1234,5678,samsara.vin:1HGBH41JXMN109186`

        tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`

        parent_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`

        after : typing.Optional[str]
             If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaGetIftaVehicleReportsResponseBody
            OK response.

        Examples
        --------
        from samsara import Samsara

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.ifta.get_ifta_vehicle_reports(
            year=1000000,
        )
        """
        _response = self._raw_client.get_ifta_vehicle_reports(
            year=year,
            month=month,
            quarter=quarter,
            jurisdictions=jurisdictions,
            fuel_type=fuel_type,
            vehicle_ids=vehicle_ids,
            tag_ids=tag_ids,
            parent_tag_ids=parent_tag_ids,
            after=after,
            request_options=request_options,
        )
        return _response.data

    def create_ifta_detail_job(
        self,
        *,
        end_hour: str,
        start_hour: str,
        vehicle_ids: typing.Optional[str] = OMIT,
        vehicle_parent_tag_ids: typing.Optional[str] = OMIT,
        vehicle_tag_ids: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> IftaCreateIftaDetailJobResponseBody:
        """
        Create a job to generate csv files of IFTA mileage segments.

         <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Write IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        end_hour : str
             An end time in RFC 3339 format. Hour precision and timezones are supported. Any minutes or seconds will be truncated down to the nearest hour. Note that the most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours. The maximum request duration is 1 month. Limit the number of vehicles to 1000 when requesting more than 24 hours of data. (Examples: 2019-06-13T19:00:00Z, 2019-06-13T19:00:00.000Z, OR 2015-09-15T14:00:00-04:00).

        start_hour : str
             A start time in RFC 3339 format. Hour precision and timezones are supported. Any minutes or seconds will be truncated down to the nearest hour. Note that the most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours. The maximum request duration is 1 month. Limit the number of vehicles to 1000 when requesting more than 24 hours of data. (Examples: 2019-06-13T19:00:00Z, 2019-06-13T19:00:00.000Z, OR 2015-09-15T14:00:00-04:00).

        vehicle_ids : typing.Optional[str]
            A filter on the data based on this comma-separated list of vehicle IDs and external IDs. The number of vehicles requested per job shouldn't exceed 5000. Example: `vehicleIds: '1234,5678,samsara.vin:1HGBH41JXMN109186'`

        vehicle_parent_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle parent tag IDs. The number of vehicles requested per job shouldn't exceed 5000. Example: `vehicleParentTagIds: '1234,5678'`

        vehicle_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle tag IDs. The number of vehicles requested per job shouldn't exceed 5000. Example: `vehicleTagIds: '1234,5678'`

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaCreateIftaDetailJobResponseBody
            Created response.

        Examples
        --------
        from samsara import Samsara

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.ifta.create_ifta_detail_job(
            end_hour="2019-06-13T19:00:00Z",
            start_hour="2019-06-13T19:00:00Z",
        )
        """
        _response = self._raw_client.create_ifta_detail_job(
            end_hour=end_hour,
            start_hour=start_hour,
            vehicle_ids=vehicle_ids,
            vehicle_parent_tag_ids=vehicle_parent_tag_ids,
            vehicle_tag_ids=vehicle_tag_ids,
            request_options=request_options,
        )
        return _response.data

    def get_ifta_detail_job(
        self, id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IftaGetIftaDetailJobResponseBody:
        """
        Get information about an existing IFTA detail job.

         <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        id : str
            ID of the requested job.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaGetIftaDetailJobResponseBody
            OK response.

        Examples
        --------
        from samsara import Samsara

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.ifta.get_ifta_detail_job(
            id="id",
        )
        """
        _response = self._raw_client.get_ifta_detail_job(id, request_options=request_options)
        return _response.data


class AsyncIftaClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawIftaClient(client_wrapper=client_wrapper)

    @property
    def with_raw_response(self) -> AsyncRawIftaClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawIftaClient
        """
        return self._raw_client

    async def get_ifta_jurisdiction_reports(
        self,
        *,
        year: int,
        month: typing.Optional[GetIftaJurisdictionReportsRequestMonth] = None,
        quarter: typing.Optional[GetIftaJurisdictionReportsRequestQuarter] = None,
        jurisdictions: typing.Optional[str] = None,
        fuel_type: typing.Optional[GetIftaJurisdictionReportsRequestFuelType] = None,
        vehicle_ids: typing.Optional[str] = None,
        tag_ids: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> IftaGetIftaJurisdictionReportsResponseBody:
        """
        Get all jurisdiction IFTA reports for the requested time duration. Data is returned in your organization's defined timezone.

        **Note:** The most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours.

         <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        year : int
             The year of the requested IFTA report summary. Must be provided with a month or quarter param. Example: `year=2021`

        month : typing.Optional[GetIftaJurisdictionReportsRequestMonth]
             The month of the requested IFTA report summary. Can not be provided with the quarter param. Example: `month=January`  Valid values: `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November`, `December`

        quarter : typing.Optional[GetIftaJurisdictionReportsRequestQuarter]
             The quarter of the requested IFTA report summary. Can not be provided with the month param. Q1: January, February, March. Q2: April, May, June. Q3: July, August, September. Q4: October, November, December. Example: `quarter=Q1`  Valid values: `Q1`, `Q2`, `Q3`, `Q4`

        jurisdictions : typing.Optional[str]
             A filter on the data based on this comma-separated list of jurisdictions. Example: `jurisdictions=GA`

        fuel_type : typing.Optional[GetIftaJurisdictionReportsRequestFuelType]
             A filter on the data based on this comma-separated list of IFTA fuel types. Example: `fuelType=Diesel`  Valid values: `Unspecified`, `A55`, `Biodiesel`, `CompressedNaturalGas`, `Diesel`, `E85`, `Electricity`, `Ethanol`, `Gasohol`, `Gasoline`, `Hydrogen`, `LiquifiedNaturalGas`, `M85`, `Methanol`, `Propane`, `Other`

        vehicle_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle IDs and externalIds. Example: `vehicleIds=1234,5678,samsara.vin:1HGBH41JXMN109186`

        tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`

        parent_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaGetIftaJurisdictionReportsResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.ifta.get_ifta_jurisdiction_reports(
                year=1000000,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_ifta_jurisdiction_reports(
            year=year,
            month=month,
            quarter=quarter,
            jurisdictions=jurisdictions,
            fuel_type=fuel_type,
            vehicle_ids=vehicle_ids,
            tag_ids=tag_ids,
            parent_tag_ids=parent_tag_ids,
            request_options=request_options,
        )
        return _response.data

    async def get_ifta_vehicle_reports(
        self,
        *,
        year: int,
        month: typing.Optional[GetIftaVehicleReportsRequestMonth] = None,
        quarter: typing.Optional[GetIftaVehicleReportsRequestQuarter] = None,
        jurisdictions: typing.Optional[str] = None,
        fuel_type: typing.Optional[GetIftaVehicleReportsRequestFuelType] = None,
        vehicle_ids: typing.Optional[str] = None,
        tag_ids: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[str] = None,
        after: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> IftaGetIftaVehicleReportsResponseBody:
        """
        Get all vehicle IFTA reports for the requested time duration. Data is returned in your organization's defined timezone.

        **Note:** The most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours.

         <b>Rate limit:</b> 25 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        year : int
             The year of the requested IFTA report summary. Must be provided with a month or quarter param. Example: `year=2021`

        month : typing.Optional[GetIftaVehicleReportsRequestMonth]
             The month of the requested IFTA report summary. Can not be provided with the quarter param. Example: `month=January`  Valid values: `January`, `February`, `March`, `April`, `May`, `June`, `July`, `August`, `September`, `October`, `November`, `December`

        quarter : typing.Optional[GetIftaVehicleReportsRequestQuarter]
             The quarter of the requested IFTA report summary. Can not be provided with the month param. Q1: January, February, March. Q2: April, May, June. Q3: July, August, September. Q4: October, November, December. Example: `quarter=Q1`  Valid values: `Q1`, `Q2`, `Q3`, `Q4`

        jurisdictions : typing.Optional[str]
             A filter on the data based on this comma-separated list of jurisdictions. Example: `jurisdictions=GA`

        fuel_type : typing.Optional[GetIftaVehicleReportsRequestFuelType]
             A filter on the data based on this comma-separated list of IFTA fuel types. Example: `fuelType=Diesel`  Valid values: `Unspecified`, `A55`, `Biodiesel`, `CompressedNaturalGas`, `Diesel`, `E85`, `Electricity`, `Ethanol`, `Gasohol`, `Gasoline`, `Hydrogen`, `LiquifiedNaturalGas`, `M85`, `Methanol`, `Propane`, `Other`

        vehicle_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle IDs and externalIds. Example: `vehicleIds=1234,5678,samsara.vin:1HGBH41JXMN109186`

        tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of tag IDs. Example: `tagIds=1234,5678`

        parent_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of parent tag IDs, for use by orgs with tag hierarchies. Specifying a parent tag will implicitly include all descendent tags of the parent tag. Example: `parentTagIds=345,678`

        after : typing.Optional[str]
             If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaGetIftaVehicleReportsResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.ifta.get_ifta_vehicle_reports(
                year=1000000,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_ifta_vehicle_reports(
            year=year,
            month=month,
            quarter=quarter,
            jurisdictions=jurisdictions,
            fuel_type=fuel_type,
            vehicle_ids=vehicle_ids,
            tag_ids=tag_ids,
            parent_tag_ids=parent_tag_ids,
            after=after,
            request_options=request_options,
        )
        return _response.data

    async def create_ifta_detail_job(
        self,
        *,
        end_hour: str,
        start_hour: str,
        vehicle_ids: typing.Optional[str] = OMIT,
        vehicle_parent_tag_ids: typing.Optional[str] = OMIT,
        vehicle_tag_ids: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> IftaCreateIftaDetailJobResponseBody:
        """
        Create a job to generate csv files of IFTA mileage segments.

         <b>Rate limit:</b> 100 requests/min (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Write IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        end_hour : str
             An end time in RFC 3339 format. Hour precision and timezones are supported. Any minutes or seconds will be truncated down to the nearest hour. Note that the most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours. The maximum request duration is 1 month. Limit the number of vehicles to 1000 when requesting more than 24 hours of data. (Examples: 2019-06-13T19:00:00Z, 2019-06-13T19:00:00.000Z, OR 2015-09-15T14:00:00-04:00).

        start_hour : str
             A start time in RFC 3339 format. Hour precision and timezones are supported. Any minutes or seconds will be truncated down to the nearest hour. Note that the most recent 72 hours of data may still be processing and is subject to change and latency, so it is not recommended to request data for the most recent 72 hours. The maximum request duration is 1 month. Limit the number of vehicles to 1000 when requesting more than 24 hours of data. (Examples: 2019-06-13T19:00:00Z, 2019-06-13T19:00:00.000Z, OR 2015-09-15T14:00:00-04:00).

        vehicle_ids : typing.Optional[str]
            A filter on the data based on this comma-separated list of vehicle IDs and external IDs. The number of vehicles requested per job shouldn't exceed 5000. Example: `vehicleIds: '1234,5678,samsara.vin:1HGBH41JXMN109186'`

        vehicle_parent_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle parent tag IDs. The number of vehicles requested per job shouldn't exceed 5000. Example: `vehicleParentTagIds: '1234,5678'`

        vehicle_tag_ids : typing.Optional[str]
             A filter on the data based on this comma-separated list of vehicle tag IDs. The number of vehicles requested per job shouldn't exceed 5000. Example: `vehicleTagIds: '1234,5678'`

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaCreateIftaDetailJobResponseBody
            Created response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.ifta.create_ifta_detail_job(
                end_hour="2019-06-13T19:00:00Z",
                start_hour="2019-06-13T19:00:00Z",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_ifta_detail_job(
            end_hour=end_hour,
            start_hour=start_hour,
            vehicle_ids=vehicle_ids,
            vehicle_parent_tag_ids=vehicle_parent_tag_ids,
            vehicle_tag_ids=vehicle_tag_ids,
            request_options=request_options,
        )
        return _response.data

    async def get_ifta_detail_job(
        self, id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> IftaGetIftaDetailJobResponseBody:
        """
        Get information about an existing IFTA detail job.

         <b>Rate limit:</b> 5 requests/sec (learn more about rate limits <a href="https://developers.samsara.com/docs/rate-limits" target="_blank">here</a>).

        To use this endpoint, select **Read IFTA (US)** under the Compliance category when creating or editing an API token. <a href="https://developers.samsara.com/docs/authentication#scopes-for-api-tokens" target="_blank">Learn More.</a>


         **Submit Feedback**: Likes, dislikes, and API feature requests should be filed as feedback in our <a href="https://forms.gle/zkD4NCH7HjKb7mm69" target="_blank">API feedback form</a>. If you encountered an issue or noticed inaccuracies in the API documentation, please <a href="https://www.samsara.com/help" target="_blank">submit a case</a> to our support team.

        Parameters
        ----------
        id : str
            ID of the requested job.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        IftaGetIftaDetailJobResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.ifta.get_ifta_detail_job(
                id="id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_ifta_detail_job(id, request_options=request_options)
        return _response.data
