# 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.goa_attribute_tiny_request_body import GoaAttributeTinyRequestBody
from ..types.trailers_create_trailer_response_body import TrailersCreateTrailerResponseBody
from ..types.trailers_get_trailer_response_body import TrailersGetTrailerResponseBody
from ..types.trailers_list_trailers_response_body import TrailersListTrailersResponseBody
from ..types.trailers_update_trailer_response_body import TrailersUpdateTrailerResponseBody
from .raw_client import AsyncRawTrailersClient, RawTrailersClient

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


class TrailersClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawTrailersClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawTrailersClient
        """
        return self._raw_client

    def list_trailers(
        self,
        *,
        tag_ids: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        after: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TrailersListTrailersResponseBody:
        """
        List all trailers.

         <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 Trailers** under the Trailers 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
        ----------
        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`

        limit : typing.Optional[int]
            The limit for how many objects will be in the response. Default and max for this value is 512 objects.

        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
        -------
        TrailersListTrailersResponseBody
            OK response.

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

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.trailers.list_trailers()
        """
        _response = self._raw_client.list_trailers(
            tag_ids=tag_ids, parent_tag_ids=parent_tag_ids, limit=limit, after=after, request_options=request_options
        )
        return _response.data

    def create_trailer(
        self,
        *,
        name: str,
        attributes: typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]] = OMIT,
        enabled_for_mobile: typing.Optional[bool] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        license_plate: typing.Optional[str] = OMIT,
        notes: typing.Optional[str] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        trailer_serial_number: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TrailersCreateTrailerResponseBody:
        """
        Creates a new trailer asset.

         <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 Trailers** under the Trailers 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
        ----------
        name : str
            The human-readable name of the Trailer. This is set by a fleet administrator and will appear in both Samsara’s cloud dashboard as well as the Samsara Driver mobile app. By default, this name is the serial number of the Samsara Asset Gateway. It can be set or updated through the Samsara Dashboard or through the API at any time.

        attributes : typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]]
            A list of attributes to assign to the trailer.

        enabled_for_mobile : typing.Optional[bool]
            Indicates if the trailer is visible on the Samsara mobile apps.

        external_ids : typing.Optional[typing.Dict[str, str]]
            A map of external ids

        license_plate : typing.Optional[str]
            The license plate of the Trailer. **By default**: empty. Can be set or updated through the Samsara Dashboard or the API at any time.

        notes : typing.Optional[str]
            These are generic notes about the Trailer. Empty by default. Can be set or updated through the Samsara Dashboard or the API at any time.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this trailer. If your access to the API is scoped by one or more tags, this field is required to pass in.

        trailer_serial_number : typing.Optional[str]
            The serial number of the trailer.

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

        Returns
        -------
        TrailersCreateTrailerResponseBody
            OK response.

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

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.trailers.create_trailer(
            name="Trailer-123",
        )
        """
        _response = self._raw_client.create_trailer(
            name=name,
            attributes=attributes,
            enabled_for_mobile=enabled_for_mobile,
            external_ids=external_ids,
            license_plate=license_plate,
            notes=notes,
            tag_ids=tag_ids,
            trailer_serial_number=trailer_serial_number,
            request_options=request_options,
        )
        return _response.data

    def get_trailer(
        self, id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TrailersGetTrailerResponseBody:
        """
        Retrieve a trailer with given ID.

         <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 Trailers** under the Trailers 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 trailer. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: "key:value". For example, "maintenanceId:250020".

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

        Returns
        -------
        TrailersGetTrailerResponseBody
            OK response.

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

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

    def delete_trailer(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete a trailer with the given ID.

         <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 Trailers** under the Trailers 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
            Unique identifier for the trailer to delete.

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

        Returns
        -------
        None

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

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

    def update_trailer(
        self,
        id: str,
        *,
        attributes: typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]] = OMIT,
        enabled_for_mobile: typing.Optional[bool] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        license_plate: typing.Optional[str] = OMIT,
        name: typing.Optional[str] = OMIT,
        notes: typing.Optional[str] = OMIT,
        odometer_meters: typing.Optional[int] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        trailer_serial_number: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TrailersUpdateTrailerResponseBody:
        """
        Update a trailer.  **Note** this implementation of patch uses [the JSON merge patch](https://tools.ietf.org/html/rfc7396) proposed standard.
         This means that any fields included in the patch request will _overwrite_ fields which exist on the target resource.
         For arrays, this means any array included in the request will _replace_ the array that exists at the specified path, it will not _add_ to the existing array

         <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 Trailers** under the Trailers 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 trailer. Can be either unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the trailer.

        attributes : typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]]
            A list of attributes to assign to the trailer.

        enabled_for_mobile : typing.Optional[bool]
            Indicates if the trailer is visible on the Samsara mobile apps.

        external_ids : typing.Optional[typing.Dict[str, str]]
            A map of external ids

        license_plate : typing.Optional[str]
            The license plate of the Trailer. **By default**: empty. Can be set or updated through the Samsara Dashboard or the API at any time.

        name : typing.Optional[str]
            The human-readable name of the Trailer. This is set by a fleet administrator and will appear in both Samsara’s cloud dashboard as well as the Samsara Driver mobile app. By default, this name is the serial number of the Samsara Asset Gateway. It can be set or updated through the Samsara Dashboard or through the API at any time.

        notes : typing.Optional[str]
            These are generic notes about the Trailer. Empty by default. Can be set or updated through the Samsara Dashboard or the API at any time.

        odometer_meters : typing.Optional[int]
            When you provide a manual odometer override, Samsara will begin updating a trailer's odometer using GPS distance traveled since this override was set. Only applies to trailers installed with Samsara gateways.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this trailer. If your access to the API is scoped by one or more tags, this field is required to pass in.

        trailer_serial_number : typing.Optional[str]
            The serial number of the trailer.

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

        Returns
        -------
        TrailersUpdateTrailerResponseBody
            OK response.

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

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.trailers.update_trailer(
            id="id",
        )
        """
        _response = self._raw_client.update_trailer(
            id,
            attributes=attributes,
            enabled_for_mobile=enabled_for_mobile,
            external_ids=external_ids,
            license_plate=license_plate,
            name=name,
            notes=notes,
            odometer_meters=odometer_meters,
            tag_ids=tag_ids,
            trailer_serial_number=trailer_serial_number,
            request_options=request_options,
        )
        return _response.data


class AsyncTrailersClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawTrailersClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawTrailersClient
        """
        return self._raw_client

    async def list_trailers(
        self,
        *,
        tag_ids: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[str] = None,
        limit: typing.Optional[int] = None,
        after: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TrailersListTrailersResponseBody:
        """
        List all trailers.

         <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 Trailers** under the Trailers 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
        ----------
        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`

        limit : typing.Optional[int]
            The limit for how many objects will be in the response. Default and max for this value is 512 objects.

        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
        -------
        TrailersListTrailersResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.trailers.list_trailers()


        asyncio.run(main())
        """
        _response = await self._raw_client.list_trailers(
            tag_ids=tag_ids, parent_tag_ids=parent_tag_ids, limit=limit, after=after, request_options=request_options
        )
        return _response.data

    async def create_trailer(
        self,
        *,
        name: str,
        attributes: typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]] = OMIT,
        enabled_for_mobile: typing.Optional[bool] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        license_plate: typing.Optional[str] = OMIT,
        notes: typing.Optional[str] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        trailer_serial_number: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TrailersCreateTrailerResponseBody:
        """
        Creates a new trailer asset.

         <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 Trailers** under the Trailers 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
        ----------
        name : str
            The human-readable name of the Trailer. This is set by a fleet administrator and will appear in both Samsara’s cloud dashboard as well as the Samsara Driver mobile app. By default, this name is the serial number of the Samsara Asset Gateway. It can be set or updated through the Samsara Dashboard or through the API at any time.

        attributes : typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]]
            A list of attributes to assign to the trailer.

        enabled_for_mobile : typing.Optional[bool]
            Indicates if the trailer is visible on the Samsara mobile apps.

        external_ids : typing.Optional[typing.Dict[str, str]]
            A map of external ids

        license_plate : typing.Optional[str]
            The license plate of the Trailer. **By default**: empty. Can be set or updated through the Samsara Dashboard or the API at any time.

        notes : typing.Optional[str]
            These are generic notes about the Trailer. Empty by default. Can be set or updated through the Samsara Dashboard or the API at any time.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this trailer. If your access to the API is scoped by one or more tags, this field is required to pass in.

        trailer_serial_number : typing.Optional[str]
            The serial number of the trailer.

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

        Returns
        -------
        TrailersCreateTrailerResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.trailers.create_trailer(
                name="Trailer-123",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create_trailer(
            name=name,
            attributes=attributes,
            enabled_for_mobile=enabled_for_mobile,
            external_ids=external_ids,
            license_plate=license_plate,
            notes=notes,
            tag_ids=tag_ids,
            trailer_serial_number=trailer_serial_number,
            request_options=request_options,
        )
        return _response.data

    async def get_trailer(
        self, id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> TrailersGetTrailerResponseBody:
        """
        Retrieve a trailer with given ID.

         <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 Trailers** under the Trailers 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 trailer. This can either be the Samsara-specified ID, or an external ID. External IDs are customer specified key-value pairs created in the POST or PATCH requests of this resource. To specify an external ID as part of a path parameter, use the following format: "key:value". For example, "maintenanceId:250020".

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

        Returns
        -------
        TrailersGetTrailerResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


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


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

    async def delete_trailer(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete a trailer with the given ID.

         <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 Trailers** under the Trailers 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
            Unique identifier for the trailer to delete.

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

        Returns
        -------
        None

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


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


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

    async def update_trailer(
        self,
        id: str,
        *,
        attributes: typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]] = OMIT,
        enabled_for_mobile: typing.Optional[bool] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        license_plate: typing.Optional[str] = OMIT,
        name: typing.Optional[str] = OMIT,
        notes: typing.Optional[str] = OMIT,
        odometer_meters: typing.Optional[int] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        trailer_serial_number: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> TrailersUpdateTrailerResponseBody:
        """
        Update a trailer.  **Note** this implementation of patch uses [the JSON merge patch](https://tools.ietf.org/html/rfc7396) proposed standard.
         This means that any fields included in the patch request will _overwrite_ fields which exist on the target resource.
         For arrays, this means any array included in the request will _replace_ the array that exists at the specified path, it will not _add_ to the existing array

         <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 Trailers** under the Trailers 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 trailer. Can be either unique Samsara ID or an [external ID](https://developers.samsara.com/docs/external-ids) for the trailer.

        attributes : typing.Optional[typing.Sequence[GoaAttributeTinyRequestBody]]
            A list of attributes to assign to the trailer.

        enabled_for_mobile : typing.Optional[bool]
            Indicates if the trailer is visible on the Samsara mobile apps.

        external_ids : typing.Optional[typing.Dict[str, str]]
            A map of external ids

        license_plate : typing.Optional[str]
            The license plate of the Trailer. **By default**: empty. Can be set or updated through the Samsara Dashboard or the API at any time.

        name : typing.Optional[str]
            The human-readable name of the Trailer. This is set by a fleet administrator and will appear in both Samsara’s cloud dashboard as well as the Samsara Driver mobile app. By default, this name is the serial number of the Samsara Asset Gateway. It can be set or updated through the Samsara Dashboard or through the API at any time.

        notes : typing.Optional[str]
            These are generic notes about the Trailer. Empty by default. Can be set or updated through the Samsara Dashboard or the API at any time.

        odometer_meters : typing.Optional[int]
            When you provide a manual odometer override, Samsara will begin updating a trailer's odometer using GPS distance traveled since this override was set. Only applies to trailers installed with Samsara gateways.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this trailer. If your access to the API is scoped by one or more tags, this field is required to pass in.

        trailer_serial_number : typing.Optional[str]
            The serial number of the trailer.

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

        Returns
        -------
        TrailersUpdateTrailerResponseBody
            OK response.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


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


        asyncio.run(main())
        """
        _response = await self._raw_client.update_trailer(
            id,
            attributes=attributes,
            enabled_for_mobile=enabled_for_mobile,
            external_ids=external_ids,
            license_plate=license_plate,
            name=name,
            notes=notes,
            odometer_meters=odometer_meters,
            tag_ids=tag_ids,
            trailer_serial_number=trailer_serial_number,
            request_options=request_options,
        )
        return _response.data
