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

import typing
from json.decoder import JSONDecodeError

from ..core.api_error import ApiError
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.http_response import AsyncHttpResponse, HttpResponse
from ..core.pydantic_utilities import parse_obj_as
from ..core.request_options import RequestOptions
from ..core.serialization import convert_and_respect_annotation_metadata
from ..types.inline_response_2009 import InlineResponse2009
from ..types.v_1_cargo_response import V1CargoResponse
from ..types.v_1_door_response import V1DoorResponse
from ..types.v_1_humidity_response import V1HumidityResponse
from ..types.v_1_sensor_history_response import V1SensorHistoryResponse
from ..types.v_1_sensors_history_series import V1SensorsHistorySeries
from ..types.v_1_temperature_response import V1TemperatureResponse
from .types.inline_object_6_fill_missing import InlineObject6FillMissing

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


class RawSensorsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._client_wrapper = client_wrapper

    def v_1_get_sensors_cargo(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[V1CargoResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get cargo monitor status (empty / full) for requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        HttpResponse[V1CargoResponse]
            List of sensor objects containing the current cargo status reported by each sensor.
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/sensors/cargo",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1CargoResponse,
                    parse_obj_as(
                        type_=V1CargoResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def v_1_get_sensors_door(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[V1DoorResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get door monitor status (closed / open) for requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        HttpResponse[V1DoorResponse]
            List of sensor objects containing the current door status reported by each sensor.
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/sensors/door",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1DoorResponse,
                    parse_obj_as(
                        type_=V1DoorResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def v_1_get_sensors_history(
        self,
        *,
        end_ms: int,
        series: typing.Sequence[V1SensorsHistorySeries],
        start_ms: int,
        step_ms: int,
        fill_missing: typing.Optional[InlineObject6FillMissing] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> HttpResponse[V1SensorHistoryResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get historical data for specified sensors. This method returns a set of historical data for the specified sensors in the specified time range and at the specified time resolution.

         <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>).

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        end_ms : int
            End of the time range, specified in milliseconds UNIX time.

        series : typing.Sequence[V1SensorsHistorySeries]

        start_ms : int
            Beginning of the time range, specified in milliseconds UNIX time.

        step_ms : int
            Time resolution for which data should be returned, in milliseconds. Specifying 3600000 will return data at hour intervals.

        fill_missing : typing.Optional[InlineObject6FillMissing]

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

        Returns
        -------
        HttpResponse[V1SensorHistoryResponse]
            List of results objects, each containing a time and a datapoint for each requested sensor/field pair.
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/sensors/history",
            method="POST",
            json={
                "endMs": end_ms,
                "fillMissing": fill_missing,
                "series": convert_and_respect_annotation_metadata(
                    object_=series, annotation=typing.Sequence[V1SensorsHistorySeries], direction="write"
                ),
                "startMs": start_ms,
                "stepMs": step_ms,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1SensorHistoryResponse,
                    parse_obj_as(
                        type_=V1SensorHistoryResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def v_1_get_sensors_humidity(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[V1HumidityResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get humidity for requested sensors. This method returns the current relative humidity for the requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        HttpResponse[V1HumidityResponse]
            List of sensor objects containing the current humidity reported by each sensor.
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/sensors/humidity",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1HumidityResponse,
                    parse_obj_as(
                        type_=V1HumidityResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def v_1_get_sensors(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[InlineResponse2009]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get sensor objects. This method returns a list of the sensor objects in the Samsara Cloud and information about them.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

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

        Returns
        -------
        HttpResponse[InlineResponse2009]
            List of sensor objects.
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/sensors/list",
            method="POST",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    InlineResponse2009,
                    parse_obj_as(
                        type_=InlineResponse2009,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    def v_1_get_sensors_temperature(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> HttpResponse[V1TemperatureResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get temperature for requested sensors. This method returns the current ambient temperature (and probe temperature if applicable) for the requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        HttpResponse[V1TemperatureResponse]
            List of sensor objects containing the current temperature reported by each sensor.
        """
        _response = self._client_wrapper.httpx_client.request(
            "v1/sensors/temperature",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1TemperatureResponse,
                    parse_obj_as(
                        type_=V1TemperatureResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return HttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)


class AsyncRawSensorsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._client_wrapper = client_wrapper

    async def v_1_get_sensors_cargo(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[V1CargoResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get cargo monitor status (empty / full) for requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        AsyncHttpResponse[V1CargoResponse]
            List of sensor objects containing the current cargo status reported by each sensor.
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/sensors/cargo",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1CargoResponse,
                    parse_obj_as(
                        type_=V1CargoResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def v_1_get_sensors_door(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[V1DoorResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get door monitor status (closed / open) for requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        AsyncHttpResponse[V1DoorResponse]
            List of sensor objects containing the current door status reported by each sensor.
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/sensors/door",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1DoorResponse,
                    parse_obj_as(
                        type_=V1DoorResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def v_1_get_sensors_history(
        self,
        *,
        end_ms: int,
        series: typing.Sequence[V1SensorsHistorySeries],
        start_ms: int,
        step_ms: int,
        fill_missing: typing.Optional[InlineObject6FillMissing] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncHttpResponse[V1SensorHistoryResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get historical data for specified sensors. This method returns a set of historical data for the specified sensors in the specified time range and at the specified time resolution.

         <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>).

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        end_ms : int
            End of the time range, specified in milliseconds UNIX time.

        series : typing.Sequence[V1SensorsHistorySeries]

        start_ms : int
            Beginning of the time range, specified in milliseconds UNIX time.

        step_ms : int
            Time resolution for which data should be returned, in milliseconds. Specifying 3600000 will return data at hour intervals.

        fill_missing : typing.Optional[InlineObject6FillMissing]

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

        Returns
        -------
        AsyncHttpResponse[V1SensorHistoryResponse]
            List of results objects, each containing a time and a datapoint for each requested sensor/field pair.
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/sensors/history",
            method="POST",
            json={
                "endMs": end_ms,
                "fillMissing": fill_missing,
                "series": convert_and_respect_annotation_metadata(
                    object_=series, annotation=typing.Sequence[V1SensorsHistorySeries], direction="write"
                ),
                "startMs": start_ms,
                "stepMs": step_ms,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1SensorHistoryResponse,
                    parse_obj_as(
                        type_=V1SensorHistoryResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def v_1_get_sensors_humidity(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[V1HumidityResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get humidity for requested sensors. This method returns the current relative humidity for the requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        AsyncHttpResponse[V1HumidityResponse]
            List of sensor objects containing the current humidity reported by each sensor.
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/sensors/humidity",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1HumidityResponse,
                    parse_obj_as(
                        type_=V1HumidityResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def v_1_get_sensors(
        self, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[InlineResponse2009]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get sensor objects. This method returns a list of the sensor objects in the Samsara Cloud and information about them.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

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

        Returns
        -------
        AsyncHttpResponse[InlineResponse2009]
            List of sensor objects.
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/sensors/list",
            method="POST",
            request_options=request_options,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    InlineResponse2009,
                    parse_obj_as(
                        type_=InlineResponse2009,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

    async def v_1_get_sensors_temperature(
        self, *, sensors: typing.Sequence[int], request_options: typing.Optional[RequestOptions] = None
    ) -> AsyncHttpResponse[V1TemperatureResponse]:
        """
        <n class="warning">
        <nh>
        <i class="fa fa-exclamation-circle"></i>
        This endpoint is still on our legacy API.
        </nh>
        </n>

        Get temperature for requested sensors. This method returns the current ambient temperature (and probe temperature if applicable) for the requested sensors.

         **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.

        To use this endpoint, select **Write Sensors** under the Equipment 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>

        Parameters
        ----------
        sensors : typing.Sequence[int]
            List of sensor IDs to query.

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

        Returns
        -------
        AsyncHttpResponse[V1TemperatureResponse]
            List of sensor objects containing the current temperature reported by each sensor.
        """
        _response = await self._client_wrapper.httpx_client.request(
            "v1/sensors/temperature",
            method="POST",
            json={
                "sensors": sensors,
            },
            headers={
                "content-type": "application/json",
            },
            request_options=request_options,
            omit=OMIT,
        )
        try:
            if 200 <= _response.status_code < 300:
                _data = typing.cast(
                    V1TemperatureResponse,
                    parse_obj_as(
                        type_=V1TemperatureResponse,  # type: ignore
                        object_=_response.json(),
                    ),
                )
                return AsyncHttpResponse(response=_response, data=_data)
            _response_json = _response.json()
        except JSONDecodeError:
            raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
        raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
