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

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.pagination import AsyncPager, SyncPager
from ..core.request_options import RequestOptions
from ..types.address import Address
from ..types.address_response import AddressResponse
from ..types.create_address_request_geofence import CreateAddressRequestGeofence
from ..types.list_addresses_response import ListAddressesResponse
from ..types.update_address_request_geofence import UpdateAddressRequestGeofence
from .raw_client import AsyncRawAddressesClient, RawAddressesClient
from .types.create_address_request_address_types_item import CreateAddressRequestAddressTypesItem
from .types.update_address_request_address_types_item import UpdateAddressRequestAddressTypesItem

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


class AddressesClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAddressesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawAddressesClient
        """
        return self._raw_client

    def list(
        self,
        *,
        limit: typing.Optional[int] = None,
        after: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        created_after_time: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> SyncPager[Address, ListAddressesResponse]:
        """
        Returns a list of all addresses in an organization.

         **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 **Read Addresses** under the Addresses 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
        ----------
        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.

        parent_tag_ids : typing.Optional[typing.Union[str, typing.Sequence[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`

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

        created_after_time : typing.Optional[str]
            A filter on data to have a created at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).

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

        Returns
        -------
        SyncPager[Address, ListAddressesResponse]
            List of all addresses in the organization

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

        client = Samsara(
            token="YOUR_TOKEN",
        )
        response = client.addresses.list()
        for item in response:
            yield item
        # alternatively, you can paginate page-by-page
        for page in response.iter_pages():
            yield page
        """
        return self._raw_client.list(
            limit=limit,
            after=after,
            parent_tag_ids=parent_tag_ids,
            tag_ids=tag_ids,
            created_after_time=created_after_time,
            request_options=request_options,
        )

    def create(
        self,
        *,
        formatted_address: str,
        geofence: CreateAddressRequestGeofence,
        name: str,
        address_types: typing.Optional[typing.Sequence[CreateAddressRequestAddressTypesItem]] = OMIT,
        contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        latitude: typing.Optional[float] = OMIT,
        longitude: typing.Optional[float] = OMIT,
        notes: typing.Optional[str] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddressResponse:
        """
        Creates a new address in the organization.

         **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 Addresses** under the Addresses 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
        ----------
        formatted_address : str
            The full street address for this address/geofence, as it might be recognized by Google Maps.

        geofence : CreateAddressRequestGeofence

        name : str
            Name of the address.

        address_types : typing.Optional[typing.Sequence[CreateAddressRequestAddressTypesItem]]
            Reporting location type associated with the address (used for ELD reporting purposes). Valid values: `yard`, `shortHaul`, `workforceSite`, `riskZone`, `industrialSite`, `alertsOnly`, `agricultureSource`, `avoidanceZone`, `knownGPSJammingZone`, `authorizedZone`, `unauthorizedZone`, `vendor`, `inventory`.

        contact_ids : typing.Optional[typing.Sequence[str]]
            An array of Contact IDs associated with this Address.

        external_ids : typing.Optional[typing.Dict[str, str]]
            The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object.

        latitude : typing.Optional[float]
            Latitude of the address. Will be geocoded from `formattedAddress` if not provided.

        longitude : typing.Optional[float]
            Longitude of the address. Will be geocoded from `formattedAddress` if not provided.

        notes : typing.Optional[str]
            Notes about the address.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this address.

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

        Returns
        -------
        AddressResponse
            Newly created address object with ID.

        Examples
        --------
        from samsara import CreateAddressRequestGeofence, Samsara

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.addresses.create(
            formatted_address="350 Rhode Island St, San Francisco, CA",
            geofence=CreateAddressRequestGeofence(),
            name="Samsara HQ",
        )
        """
        _response = self._raw_client.create(
            formatted_address=formatted_address,
            geofence=geofence,
            name=name,
            address_types=address_types,
            contact_ids=contact_ids,
            external_ids=external_ids,
            latitude=latitude,
            longitude=longitude,
            notes=notes,
            tag_ids=tag_ids,
            request_options=request_options,
        )
        return _response.data

    def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AddressResponse:
        """
        Returns a specific address.

         **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 **Read Addresses** under the Addresses 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
        ----------
        id : str
            ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123`

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

        Returns
        -------
        AddressResponse
            An Address.

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

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

    def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete a specific address.

         **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 Addresses** under the Addresses 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
        ----------
        id : str
            ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123`

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

        Returns
        -------
        None

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

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

    def update(
        self,
        id: str,
        *,
        address_types: typing.Optional[typing.Sequence[UpdateAddressRequestAddressTypesItem]] = OMIT,
        contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        formatted_address: typing.Optional[str] = OMIT,
        geofence: typing.Optional[UpdateAddressRequestGeofence] = OMIT,
        latitude: typing.Optional[float] = OMIT,
        longitude: typing.Optional[float] = OMIT,
        name: typing.Optional[str] = OMIT,
        notes: typing.Optional[str] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddressResponse:
        """
        Update a specific address.

         **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 Addresses** under the Addresses 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
        ----------
        id : str
            ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123`

        address_types : typing.Optional[typing.Sequence[UpdateAddressRequestAddressTypesItem]]
            Reporting location type associated with the address (used for ELD reporting purposes). Valid values: `yard`, `shortHaul`, `workforceSite`, `riskZone`, `industrialSite`, `alertsOnly`, `agricultureSource`, `avoidanceZone`, `knownGPSJammingZone`, `authorizedZone`, `unauthorizedZone`, `vendor`, `inventory`.

        contact_ids : typing.Optional[typing.Sequence[str]]
            An array of Contact IDs associated with this Address.

        external_ids : typing.Optional[typing.Dict[str, str]]
            The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object.

        formatted_address : typing.Optional[str]
            The full street address for this address/geofence, as it might be recognized by Google Maps.

        geofence : typing.Optional[UpdateAddressRequestGeofence]

        latitude : typing.Optional[float]
            Latitude of the address. Will be geocoded from `formattedAddress` if not provided.

        longitude : typing.Optional[float]
            Longitude of the address. Will be geocoded from `formattedAddress` if not provided.

        name : typing.Optional[str]
            Name of the address.

        notes : typing.Optional[str]
            Notes about the address.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this address.

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

        Returns
        -------
        AddressResponse
            Updated address object with ID.

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

        client = Samsara(
            token="YOUR_TOKEN",
        )
        client.addresses.update(
            id="id",
        )
        """
        _response = self._raw_client.update(
            id,
            address_types=address_types,
            contact_ids=contact_ids,
            external_ids=external_ids,
            formatted_address=formatted_address,
            geofence=geofence,
            latitude=latitude,
            longitude=longitude,
            name=name,
            notes=notes,
            tag_ids=tag_ids,
            request_options=request_options,
        )
        return _response.data


class AsyncAddressesClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAddressesClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawAddressesClient
        """
        return self._raw_client

    async def list(
        self,
        *,
        limit: typing.Optional[int] = None,
        after: typing.Optional[str] = None,
        parent_tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        tag_ids: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        created_after_time: typing.Optional[str] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AsyncPager[Address, ListAddressesResponse]:
        """
        Returns a list of all addresses in an organization.

         **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 **Read Addresses** under the Addresses 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
        ----------
        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.

        parent_tag_ids : typing.Optional[typing.Union[str, typing.Sequence[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`

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

        created_after_time : typing.Optional[str]
            A filter on data to have a created at time after or equal to this specified time in RFC 3339 format. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).

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

        Returns
        -------
        AsyncPager[Address, ListAddressesResponse]
            List of all addresses in the organization

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            response = await client.addresses.list()
            async for item in response:
                yield item

            # alternatively, you can paginate page-by-page
            async for page in response.iter_pages():
                yield page


        asyncio.run(main())
        """
        return await self._raw_client.list(
            limit=limit,
            after=after,
            parent_tag_ids=parent_tag_ids,
            tag_ids=tag_ids,
            created_after_time=created_after_time,
            request_options=request_options,
        )

    async def create(
        self,
        *,
        formatted_address: str,
        geofence: CreateAddressRequestGeofence,
        name: str,
        address_types: typing.Optional[typing.Sequence[CreateAddressRequestAddressTypesItem]] = OMIT,
        contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        latitude: typing.Optional[float] = OMIT,
        longitude: typing.Optional[float] = OMIT,
        notes: typing.Optional[str] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddressResponse:
        """
        Creates a new address in the organization.

         **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 Addresses** under the Addresses 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
        ----------
        formatted_address : str
            The full street address for this address/geofence, as it might be recognized by Google Maps.

        geofence : CreateAddressRequestGeofence

        name : str
            Name of the address.

        address_types : typing.Optional[typing.Sequence[CreateAddressRequestAddressTypesItem]]
            Reporting location type associated with the address (used for ELD reporting purposes). Valid values: `yard`, `shortHaul`, `workforceSite`, `riskZone`, `industrialSite`, `alertsOnly`, `agricultureSource`, `avoidanceZone`, `knownGPSJammingZone`, `authorizedZone`, `unauthorizedZone`, `vendor`, `inventory`.

        contact_ids : typing.Optional[typing.Sequence[str]]
            An array of Contact IDs associated with this Address.

        external_ids : typing.Optional[typing.Dict[str, str]]
            The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object.

        latitude : typing.Optional[float]
            Latitude of the address. Will be geocoded from `formattedAddress` if not provided.

        longitude : typing.Optional[float]
            Longitude of the address. Will be geocoded from `formattedAddress` if not provided.

        notes : typing.Optional[str]
            Notes about the address.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this address.

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

        Returns
        -------
        AddressResponse
            Newly created address object with ID.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara, CreateAddressRequestGeofence

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


        async def main() -> None:
            await client.addresses.create(
                formatted_address="350 Rhode Island St, San Francisco, CA",
                geofence=CreateAddressRequestGeofence(),
                name="Samsara HQ",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            formatted_address=formatted_address,
            geofence=geofence,
            name=name,
            address_types=address_types,
            contact_ids=contact_ids,
            external_ids=external_ids,
            latitude=latitude,
            longitude=longitude,
            notes=notes,
            tag_ids=tag_ids,
            request_options=request_options,
        )
        return _response.data

    async def get(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> AddressResponse:
        """
        Returns a specific address.

         **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 **Read Addresses** under the Addresses 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
        ----------
        id : str
            ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123`

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

        Returns
        -------
        AddressResponse
            An Address.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


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


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

    async def delete(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
        """
        Delete a specific address.

         **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 Addresses** under the Addresses 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
        ----------
        id : str
            ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123`

        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.addresses.delete(
                id="id",
            )


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

    async def update(
        self,
        id: str,
        *,
        address_types: typing.Optional[typing.Sequence[UpdateAddressRequestAddressTypesItem]] = OMIT,
        contact_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        external_ids: typing.Optional[typing.Dict[str, str]] = OMIT,
        formatted_address: typing.Optional[str] = OMIT,
        geofence: typing.Optional[UpdateAddressRequestGeofence] = OMIT,
        latitude: typing.Optional[float] = OMIT,
        longitude: typing.Optional[float] = OMIT,
        name: typing.Optional[str] = OMIT,
        notes: typing.Optional[str] = OMIT,
        tag_ids: typing.Optional[typing.Sequence[str]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddressResponse:
        """
        Update a specific address.

         **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 Addresses** under the Addresses 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
        ----------
        id : str
            ID of the Address. This can either be the Samsara-provided 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, `crmId:abc123`

        address_types : typing.Optional[typing.Sequence[UpdateAddressRequestAddressTypesItem]]
            Reporting location type associated with the address (used for ELD reporting purposes). Valid values: `yard`, `shortHaul`, `workforceSite`, `riskZone`, `industrialSite`, `alertsOnly`, `agricultureSource`, `avoidanceZone`, `knownGPSJammingZone`, `authorizedZone`, `unauthorizedZone`, `vendor`, `inventory`.

        contact_ids : typing.Optional[typing.Sequence[str]]
            An array of Contact IDs associated with this Address.

        external_ids : typing.Optional[typing.Dict[str, str]]
            The [external IDs](https://developers.samsara.com/docs/external-ids) for the given object.

        formatted_address : typing.Optional[str]
            The full street address for this address/geofence, as it might be recognized by Google Maps.

        geofence : typing.Optional[UpdateAddressRequestGeofence]

        latitude : typing.Optional[float]
            Latitude of the address. Will be geocoded from `formattedAddress` if not provided.

        longitude : typing.Optional[float]
            Longitude of the address. Will be geocoded from `formattedAddress` if not provided.

        name : typing.Optional[str]
            Name of the address.

        notes : typing.Optional[str]
            Notes about the address.

        tag_ids : typing.Optional[typing.Sequence[str]]
            An array of IDs of tags to associate with this address.

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

        Returns
        -------
        AddressResponse
            Updated address object with ID.

        Examples
        --------
        import asyncio

        from samsara import AsyncSamsara

        client = AsyncSamsara(
            token="YOUR_TOKEN",
        )


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


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            id,
            address_types=address_types,
            contact_ids=contact_ids,
            external_ids=external_ids,
            formatted_address=formatted_address,
            geofence=geofence,
            latitude=latitude,
            longitude=longitude,
            name=name,
            notes=notes,
            tag_ids=tag_ids,
            request_options=request_options,
        )
        return _response.data
