Copyright | (c) 2023 Finley McIlwaine |
---|---|
License | MIT (see LICENSE) |
Maintainer | Finley McIlwaine <finleymcilwaine@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Types and functions for product-related eBird API queries.
Synopsis
- recentChecklists :: Text -> RegionCode -> RecentChecklistsParams -> ClientM [ChecklistFeedEntry]
- newtype RecentChecklistsParams = RecentChecklistsParams {}
- defaultRecentChecklistsParams :: RecentChecklistsParams
- recentChecklistsParamsMaxResults :: Iso' RecentChecklistsParams (Maybe Integer)
- top100 :: Text -> Region -> EBirdDate -> Top100Params -> ClientM [Top100ListEntry]
- data Top100Params = Top100Params {
- _top100ParamsRankBy :: Maybe RankTop100By
- _top100ParamsMaxResults :: Maybe Integer
- defaultTop100Params :: Top100Params
- top100ParamsRankBy :: Lens' Top100Params (Maybe RankTop100By)
- top100ParamsMaxResults :: Lens' Top100Params (Maybe Integer)
- checklistFeed :: Text -> Region -> EBirdDate -> ChecklistFeedParams -> ClientM [ChecklistFeedEntry]
- data ChecklistFeedParams = ChecklistFeedParams {
- _checklistFeedParamsSortBy :: Maybe SortChecklistsBy
- _checklistFeedParamsMaxResults :: Maybe Integer
- defaultChecklistFeedParams :: ChecklistFeedParams
- checklistFeedParamsSortBy :: Lens' ChecklistFeedParams (Maybe SortChecklistsBy)
- checklistFeedParamsMaxResults :: Lens' ChecklistFeedParams (Maybe Integer)
- regionalStatistics :: Text -> Region -> EBirdDate -> ClientM RegionalStatistics
- speciesList :: Text -> Region -> ClientM [SpeciesCode]
- viewChecklist :: Text -> Text -> ClientM Checklist
Recent checklists
:: Text | eBird API key |
-> RegionCode | Region(s) to get Checklists from |
-> RecentChecklistsParams | Optional parameters default: |
-> ClientM [ChecklistFeedEntry] |
Get a list recently submitted checklists within a region.
For example, get up to 3 recent checklists submitted in Park County, Wyoming
(using -XOverloadedLabels
and -XOverloadedStrings
):
askEBird $ recentChecklists key "US-WY-029" (def & #maxResults ?~ 3)
See the eBird API documentation for the corresponding endpoint.
newtype RecentChecklistsParams Source #
Optional parameters accepted by the RecentChecklistsAPI
.
Note that defaultRecentChecklistsParams
(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
_recentChecklistsParamsMaxResults
field to 3:
def & recentChecklistsParamsMaxResults ?~ 3
Or, using -XOverloadedLabels
:
def & #maxResults ?~ 3
RecentChecklistsParams | |
|
Instances
Read RecentChecklistsParams Source # | |
Show RecentChecklistsParams Source # | |
Defined in Data.EBird.Client.Product showsPrec :: Int -> RecentChecklistsParams -> ShowS # show :: RecentChecklistsParams -> String # showList :: [RecentChecklistsParams] -> ShowS # | |
Default RecentChecklistsParams Source # | |
Defined in Data.EBird.Client.Product | |
Eq RecentChecklistsParams Source # | |
Defined in Data.EBird.Client.Product | |
(k ~ An_Iso, a ~ Maybe Integer, b ~ Maybe Integer) => LabelOptic "maxResults" k RecentChecklistsParams RecentChecklistsParams a b Source # | |
Defined in Data.EBird.Client.Product |
defaultRecentChecklistsParams :: RecentChecklistsParams 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 RecentChecklistsParams
Top 100
:: Text | eBird API key |
-> Region | Region to fetch the ranking for Note: Only country, subnational1, or location regions are supported for this endpoint of the eBird API. |
-> EBirdDate | Date to get the top 100 on |
-> Top100Params | Optional parameters default: |
-> ClientM [Top100ListEntry] |
Get a list of top contributors for a region on a specific date, ranked by number of species observed or number of checklists submitted.
For example, get the top 10 contributors by number of species observed on
July 11th, 2023 in Wyoming (using -XOverloadedLabels
and
-XOverloadedStrings
):
askEBird $ top100 key "US-WY" "2023-07-11" (def & #maxResults ?~ 10)
See the eBird API documentation for the corresponding endpoint.
data Top100Params Source #
Optional parameters accepted by the Top100API
.
Note that defaultTop100Params
(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
_top100ParamsMaxResults
field to 50:
def & top100ParamsMaxResults ?~ 50
Or, using -XOverloadedLabels
:
def & #maxResults ?~ 50
Top100Params | |
|
Instances
Read Top100Params Source # | |
Defined in Data.EBird.Client.Product readsPrec :: Int -> ReadS Top100Params # readList :: ReadS [Top100Params] # | |
Show Top100Params Source # | |
Defined in Data.EBird.Client.Product showsPrec :: Int -> Top100Params -> ShowS # show :: Top100Params -> String # showList :: [Top100Params] -> ShowS # | |
Default Top100Params Source # | |
Defined in Data.EBird.Client.Product def :: Top100Params # | |
Eq Top100Params Source # | |
Defined in Data.EBird.Client.Product (==) :: Top100Params -> Top100Params -> Bool # (/=) :: Top100Params -> Top100Params -> Bool # | |
(k ~ A_Lens, a ~ Maybe Integer, b ~ Maybe Integer) => LabelOptic "maxResults" k Top100Params Top100Params a b Source # | |
Defined in Data.EBird.Client.Product labelOptic :: Optic k NoIx Top100Params Top100Params a b # | |
(k ~ A_Lens, a ~ Maybe RankTop100By, b ~ Maybe RankTop100By) => LabelOptic "rankBy" k Top100Params Top100Params a b Source # | |
Defined in Data.EBird.Client.Product labelOptic :: Optic k NoIx Top100Params Top100Params a b # |
defaultTop100Params :: Top100Params 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 Top100Params
top100ParamsRankBy :: Lens' Top100Params (Maybe RankTop100By) Source #
Checklist feed
:: Text | eBird API key |
-> Region | Region to fetch the checklist feed for |
-> EBirdDate | Date to get the checklist feed on |
-> ChecklistFeedParams | Optional parameters default: |
-> ClientM [ChecklistFeedEntry] |
Get a list of checklists submitted within a region on a specific date.
For example, get a feed of 10 checklists submitted in Park County, Wyoming on
July 11th, 2023 (using -XOverloadedLabels
and -XOverloadedStrings
):
askEBird $ checklistFeed key "US-WY-029" "2023-07-11" (def & #maxResults ?~ 10)
See the eBird API documentation for the corresponding endpoint.
data ChecklistFeedParams Source #
Optional parameters accepted by the ChecklistFeedAPI
.
Note that defaultChecklistFeedParams
(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
_checklistFeedParamsMaxResults
field to 50:
def & checklistFeedParamsMaxResults ?~ 50
Or, using -XOverloadedLabels
:
def & #maxResults ?~ 50
ChecklistFeedParams | |
|
Instances
Read ChecklistFeedParams Source # | |
Defined in Data.EBird.Client.Product | |
Show ChecklistFeedParams Source # | |
Defined in Data.EBird.Client.Product showsPrec :: Int -> ChecklistFeedParams -> ShowS # show :: ChecklistFeedParams -> String # showList :: [ChecklistFeedParams] -> ShowS # | |
Default ChecklistFeedParams Source # | |
Defined in Data.EBird.Client.Product | |
Eq ChecklistFeedParams Source # | |
Defined in Data.EBird.Client.Product (==) :: ChecklistFeedParams -> ChecklistFeedParams -> Bool # (/=) :: ChecklistFeedParams -> ChecklistFeedParams -> Bool # | |
(k ~ A_Lens, a ~ Maybe Integer, b ~ Maybe Integer) => LabelOptic "maxResults" k ChecklistFeedParams ChecklistFeedParams a b Source # | |
Defined in Data.EBird.Client.Product | |
(k ~ A_Lens, a ~ Maybe SortChecklistsBy, b ~ Maybe SortChecklistsBy) => LabelOptic "sortBy" k ChecklistFeedParams ChecklistFeedParams a b Source # | |
Defined in Data.EBird.Client.Product |
defaultChecklistFeedParams :: ChecklistFeedParams 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 ChecklistFeedParams
checklistFeedParamsSortBy :: Lens' ChecklistFeedParams (Maybe SortChecklistsBy) Source #
Regional statistics
:: Text | eBird API key |
-> Region | Region to fetch the statistics for |
-> EBirdDate | Date to get the statistics on |
-> ClientM RegionalStatistics |
Get the RegionalStatistics
for a region on a specific date.
For example, get the statistics for Wyoming on July 11th, 2023 (using
-XOverloadedStrings
):
askEBird $ regionalStatistics key "US-WY" "2023-07-11"
See the eBird API documentation for the corresponding endpoint.
Species list
Get a list of all species ever seen in a Region
.
For example, get all species ever seen in Park County, Wyoming (using
-XOverloadedStrings
):
askEBird $ speciesList key "US-WY-029"
Note that the endpoint for this query is simple enough that speciesList
is
equivalent to the generated speciesList_
.
See the eBird API documentation for the corresponding endpoint.
View checklist
Get information about a checklist.
For example, get information for a checklist with submission ID
"S144646447" (using -XOverloadedStrings
):
askEBird $ viewChecklist key S144646447
Note that the endpoint for this query is simple enough that viewChecklist
is equivalent to the generated viewChecklist_
.
See the eBird API documentation for the corresponding endpoint.