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

from ....core.client_wrapper import SyncClientWrapper
from .raw_client import RawRegionalClient
import typing
from ....types.timezone import Timezone
from ....types.units import Units
from ....core.request_options import RequestOptions
from ....types.gftus_hourly_weather_response import GftusHourlyWeatherResponse
from ....core.client_wrapper import AsyncClientWrapper
from .raw_client import AsyncRawRegionalClient


class RegionalClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawRegionalClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawRegionalClient
        """
        return self._raw_client

    def usa(
        self,
        *,
        latitude: float,
        longitude: float,
        timezone: typing.Optional[Timezone] = None,
        units: typing.Optional[Units] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GftusHourlyWeatherResponse:
        """
        Get hourly weather forecast for a specific location and time

        Parameters
        ----------
        latitude : float

        longitude : float

        timezone : typing.Optional[Timezone]

        units : typing.Optional[Units]

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

        Returns
        -------
        GftusHourlyWeatherResponse
            Successful Response

        Examples
        --------
        from silurian import Earth

        client = Earth(
            api_key="YOUR_API_KEY",
        )
        client.weather.experimental.regional.usa(
            latitude=47.6061,
            longitude=-122.3328,
        )
        """
        response = self._raw_client.usa(
            latitude=latitude, longitude=longitude, timezone=timezone, units=units, request_options=request_options
        )
        return response.data


class AsyncRegionalClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawRegionalClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawRegionalClient
        """
        return self._raw_client

    async def usa(
        self,
        *,
        latitude: float,
        longitude: float,
        timezone: typing.Optional[Timezone] = None,
        units: typing.Optional[Units] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> GftusHourlyWeatherResponse:
        """
        Get hourly weather forecast for a specific location and time

        Parameters
        ----------
        latitude : float

        longitude : float

        timezone : typing.Optional[Timezone]

        units : typing.Optional[Units]

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

        Returns
        -------
        GftusHourlyWeatherResponse
            Successful Response

        Examples
        --------
        import asyncio

        from silurian import AsyncEarth

        client = AsyncEarth(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.weather.experimental.regional.usa(
                latitude=47.6061,
                longitude=-122.3328,
            )


        asyncio.run(main())
        """
        response = await self._raw_client.usa(
            latitude=latitude, longitude=longitude, timezone=timezone, units=units, request_options=request_options
        )
        return response.data
