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 taxonomy-related eBird API queries.
Synopsis
- taxonomy :: TaxonomyParams -> ClientM [Taxon]
- data TaxonomyParams = TaxonomyParams {}
- defaultTaxonomyParams :: TaxonomyParams
- taxonomyParamsVersion :: Lens' TaxonomyParams (Maybe Text)
- taxonomyParamsSpecies :: Lens' TaxonomyParams (Maybe SpeciesCodes)
- taxonomyParamsLocale :: Lens' TaxonomyParams (Maybe SPPLocale)
- taxonomyParamsCategories :: Lens' TaxonomyParams (Maybe TaxonomyCategories)
- taxonomicForms :: Text -> SpeciesCode -> ClientM SpeciesCodes
- taxaLocaleCodes :: Text -> TaxaLocaleCodesParams -> ClientM [SPPLocaleListEntry]
- newtype TaxaLocaleCodesParams = TaxaLocaleCodesParams {}
- defaultTaxaLocaleCodesParams :: TaxaLocaleCodesParams
- taxaLocaleCodesParamsLocale :: Iso' TaxaLocaleCodesParams (Maybe SPPLocale)
- taxonomyVersions :: ClientM [TaxonomyVersionListEntry]
- taxonomicGroups :: SPPGrouping -> TaxonomicGroupsParams -> ClientM [TaxonomicGroupListEntry]
- newtype TaxonomicGroupsParams = TaxonomicGroupsParams {}
- defaultTaxonomicGroupsParams :: TaxonomicGroupsParams
- taxonomicGroupsParamsLocale :: Iso' TaxonomicGroupsParams (Maybe SPPLocale)
Documentation
:: TaxonomyParams | Optional parameters default: |
-> ClientM [Taxon] |
Get any version of the eBird taxonomy, with optional filtering based on taxonomy categories and species.
For example, get the taxa for species in the "hybrid" category:
askEBird $ taxonomy (def & #categories ?~ "hybrid")
See the eBird API documentation for the corresponding endpoint.
data TaxonomyParams Source #
Optional parameters accepted by the TaxonomyAPI
.
Note that defaultTaxonomyParams
(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
_taxonomyParamsSpecies
field to "bohwax":
def & taxonomyParamsSpecies ?~ "bohwax"
Or, using -XOverloadedLabels
:
def & #species ?~ "bohwax"
TaxonomyParams | |
|
Instances
defaultTaxonomyParams :: TaxonomyParams 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 TaxonomyParams
:: Text | eBird API key |
-> SpeciesCode | The species to get subspecies of |
-> ClientM SpeciesCodes |
Get the list of subspecies of a given species recognized in the eBird taxonomy.
For example, get subspecies of Canada Goose (using
-XOverloadedStrings
):
askEBird $ taxonomicForms key "cangoo"
Note that the endpoint for this query is simple enough that taxonomicForms
is equivalent to the generated taxonomicForms_
.
See the eBird API documentation for the corresponding endpoint.
:: Text | eBird API key |
-> TaxaLocaleCodesParams | Optional parameters default: |
-> ClientM [SPPLocaleListEntry] |
Get the supported locale codes and names for species common names, with the last time they were updated.
For example:
askEBird $ taxaLocaleCodes key def
See the eBird API documentation for the corresponding endpoint.
newtype TaxaLocaleCodesParams Source #
Optional parameters accepted by the TaxaLocaleCodesAPI
.
Note that defaultTaxaLocaleCodesParams
(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
_taxaLocaleCodesParamsLocale
field to Es
:
def & taxaLocaleCodesParamsLocale ?~ Es
Or, using -XOverloadedLabels
:
def & #locale ?~ Es
TaxaLocaleCodesParams | |
|
Instances
Read TaxaLocaleCodesParams Source # | |
Show TaxaLocaleCodesParams Source # | |
Defined in Data.EBird.Client.Taxonomy showsPrec :: Int -> TaxaLocaleCodesParams -> ShowS # show :: TaxaLocaleCodesParams -> String # showList :: [TaxaLocaleCodesParams] -> ShowS # | |
Default TaxaLocaleCodesParams Source # | |
Defined in Data.EBird.Client.Taxonomy | |
Eq TaxaLocaleCodesParams Source # | |
Defined in Data.EBird.Client.Taxonomy (==) :: TaxaLocaleCodesParams -> TaxaLocaleCodesParams -> Bool # (/=) :: TaxaLocaleCodesParams -> TaxaLocaleCodesParams -> Bool # | |
(k ~ An_Iso, a ~ Maybe SPPLocale, b ~ Maybe SPPLocale) => LabelOptic "locale" k TaxaLocaleCodesParams TaxaLocaleCodesParams a b Source # | |
Defined in Data.EBird.Client.Taxonomy |
defaultTaxaLocaleCodesParams :: TaxaLocaleCodesParams 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 TaxaLocaleCodesParams
Taxonomy versions
taxonomyVersions :: ClientM [TaxonomyVersionListEntry] Source #
Get all versions of the taxonomy, with a flag indicating which is latest.
For example:
askEBird taxonomyVersions
Note that the endpoint for this query is simple enough that taxonomyVersions
is equivalent to the generated taxonomyVersions_
.
See the eBird API documentation for the corresponding endpoint.
Taxonomic groups
:: SPPGrouping |
|
-> TaxonomicGroupsParams | Optional parameters default: |
-> ClientM [TaxonomicGroupListEntry] |
Get the list of species groups, in either Merlin or eBird grouping.
For example, get the taxonomic groups using eBird grouping order (using
-XOverloadedStrings
):
askEBird $ taxonomicGroups "ebird" def
See the eBird API documentation for the corresponding endpoint.
newtype TaxonomicGroupsParams Source #
Optional parameters accepted by the TaxonomicGroupsAPI
.
Note that defaultTaxonomicGroupsParams
(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
_taxonomicGroupsParamsLocale
field to Es
:
def & taxonomicGroupsParamsLocale ?~ Es
Or, using -XOverloadedLabels
:
def & #locale ?~ Es
Instances
Read TaxonomicGroupsParams Source # | |
Show TaxonomicGroupsParams Source # | |
Defined in Data.EBird.Client.Taxonomy showsPrec :: Int -> TaxonomicGroupsParams -> ShowS # show :: TaxonomicGroupsParams -> String # showList :: [TaxonomicGroupsParams] -> ShowS # | |
Default TaxonomicGroupsParams Source # | |
Defined in Data.EBird.Client.Taxonomy | |
Eq TaxonomicGroupsParams Source # | |
Defined in Data.EBird.Client.Taxonomy (==) :: TaxonomicGroupsParams -> TaxonomicGroupsParams -> Bool # (/=) :: TaxonomicGroupsParams -> TaxonomicGroupsParams -> Bool # | |
(k ~ An_Iso, a ~ Maybe SPPLocale, b ~ Maybe SPPLocale) => LabelOptic "locale" k TaxonomicGroupsParams TaxonomicGroupsParams a b Source # | |
Defined in Data.EBird.Client.Taxonomy |
defaultTaxonomicGroupsParams :: TaxonomicGroupsParams 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.