Copyright | (c) 2023 Finley McIlwaine |
---|---|
License | MIT (see LICENSE) |
Maintainer | Finley McIlwaine <finleymcilwaine@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.EBird.Client.Hotspots
Description
Types and functions for hotspot-related eBird API queries.
Synopsis
- regionHotspots :: RegionCode -> RegionHotspotsParams -> ClientM [Hotspot]
- newtype RegionHotspotsParams = RegionHotspotsParams {}
- defaultRegionHotspotsParams :: RegionHotspotsParams
- regionHotspotsParamsBack :: Iso' RegionHotspotsParams (Maybe Integer)
- nearbyHotspots :: Double -> Double -> NearbyHotspotsParams -> ClientM [Hotspot]
- data NearbyHotspotsParams = NearbyHotspotsParams {}
- defaultNearbyHotspotsParams :: NearbyHotspotsParams
- nearbyHotspotsParamsRadius :: Lens' NearbyHotspotsParams (Maybe Integer)
- nearbyHotspotsParamsBack :: Lens' NearbyHotspotsParams (Maybe Integer)
- hotspotInfo :: Text -> ClientM LocationData
Region hotspots
Arguments
:: RegionCode | Region(s) to get hotspots in |
-> RegionHotspotsParams | Optional parameters default: |
-> ClientM [Hotspot] |
Get all hotspots in a list of one or more regions (RegionCode
).
For example, get the hotspots in Albany County, Wyoming and Park County,
Wyoming that have been visited in the last 5 days (using -XOverloadedLabels
and -XOverloadedStrings
):
askEBird $ regionHotspots "US-WY-001,US-WY-029" (def & #back ?~ 5)
See the eBird API documentation for the corresponding endpoint.
newtype RegionHotspotsParams Source #
Optional parameters accepted by the RegionHotspotsAPI
.
Note that defaultRegionHotspotsParams
(or the Default
instance's def
value) may be used to accept the defaults of the eBird API.
Additionally, note that there are optics available for manipulating this
type. For example, if you would like to just set the
_regionHotspotsParamsBack
field to 10:
def & regionHotspotsParamsBack ?~ 10
Or, using -XOverloadedLabels
:
def & #back ?~ 10
Constructors
RegionHotspotsParams | |
Fields
|
Instances
Read RegionHotspotsParams Source # | |
Defined in Data.EBird.Client.Hotspots Methods readsPrec :: Int -> ReadS RegionHotspotsParams # readList :: ReadS [RegionHotspotsParams] # | |
Show RegionHotspotsParams Source # | |
Defined in Data.EBird.Client.Hotspots Methods showsPrec :: Int -> RegionHotspotsParams -> ShowS # show :: RegionHotspotsParams -> String # showList :: [RegionHotspotsParams] -> ShowS # | |
Default RegionHotspotsParams Source # | |
Defined in Data.EBird.Client.Hotspots Methods | |
Eq RegionHotspotsParams Source # | |
Defined in Data.EBird.Client.Hotspots Methods (==) :: RegionHotspotsParams -> RegionHotspotsParams -> Bool # (/=) :: RegionHotspotsParams -> RegionHotspotsParams -> Bool # | |
(k ~ An_Iso, a ~ Maybe Integer, b ~ Maybe Integer) => LabelOptic "back" k RegionHotspotsParams RegionHotspotsParams a b Source # | |
Defined in Data.EBird.Client.Hotspots Methods labelOptic :: Optic k NoIx RegionHotspotsParams RegionHotspotsParams a b # |
defaultRegionHotspotsParams :: RegionHotspotsParams Source #
Note that this value does not actually use the eBird API default values.
It simply sets every option to Nothing
, which means we just don't send any
of these parameters to the eBird API and they will use their own defaults.
Optics for RegionHotspotsParams
Nearby hotspots
Arguments
:: Double | Latitude of the location to get hotspots near |
-> Double | Longitude of the location to get hotspots near |
-> NearbyHotspotsParams | Optional parameters default: |
-> ClientM [Hotspot] |
Get all hotspots within a radius of some latitude/longitude.
For example, get the hotspots within 30km of Cody, Wyoming that have been
visited in the last 5 days (using -XOverloadedLabels
and -XOverloadedStrings
):
askEBird $ nearbyHotspots 44.526340 (-109.056534) (def & #radius ?~ 30 & #back ?~ 5)
See the eBird API documentation for the corresponding endpoint.
data NearbyHotspotsParams Source #
Optional parameters accepted by the NearbyHotspotsAPI
.
Note that defaultNearbyHotspotsParams
(or the Default
instance's def
value) may be used to accept the defaults of the eBird API.
Additionally, note that there are optics available for manipulating this
type. For example, if you would like to just set the
_nearbyHotspotsParamsBack
field to 10:
def & nearbyHotspotsParamsBack ?~ 10
Or, using -XOverloadedLabels
:
def & #back ?~ 10
Constructors
NearbyHotspotsParams | |
Fields
|
Instances
defaultNearbyHotspotsParams :: NearbyHotspotsParams Source #
Note that this value does not actually use the eBird API default values.
It simply sets every option to Nothing
, which means we just don't send any
of these parameters to the eBird API and they will use their own defaults.
Optics for NearbyHotspotsParams
Hotspot info
Get information about a hotspot.
For example, get information for a hotspot with location ID
"L2373040" (using -XOverloadedStrings
):
askEBird $ hotspotInfo L2373040
Note that the endpoint for this query is simple enough that hotspotInfo
is equivalent to the generated hotspotInfo_
.
See the eBird API documentation for the corresponding endpoint.