Copyright | (c) 2023 Finley McIlwaine |
---|---|
License | MIT (see LICENSE) |
Maintainer | Finley McIlwaine <finleymcilwaine@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.EBird.API.Observations
Description
Types and functions related to eBird observation API values.
Synopsis
- data Observation (detail :: DetailLevel) = Observation {
- _observationSpeciesCode :: Text
- _observationCommonName :: Text
- _observationScientificName :: Text
- _observationLocationId :: Text
- _observationLocationName :: Text
- _observationDateTime :: EBirdDateTime
- _observationHowMany :: Maybe Integer
- _observationLatitude :: Double
- _observationLongitude :: Double
- _observationValid :: Bool
- _observationReviewed :: Bool
- _observationLocationPrivate :: Bool
- _observationSubId :: Text
- _observationFullDetail :: ObservationDetails detail
- data ObservationDetails (detail :: DetailLevel) where
- NoDetails :: ObservationDetails 'Simple
- FullDetails :: {..} -> ObservationDetails 'Full
- data SomeObservation where
- SomeObservation :: Observation detail -> SomeObservation
- data DetailLevel
- data SortObservationsBy
- data SelectObservation
- observationValid :: forall detail. Lens' (Observation detail) Bool
- observationSubId :: forall detail. Lens' (Observation detail) Text
- observationSpeciesCode :: forall detail. Lens' (Observation detail) Text
- observationScientificName :: forall detail. Lens' (Observation detail) Text
- observationReviewed :: forall detail. Lens' (Observation detail) Bool
- observationLongitude :: forall detail. Lens' (Observation detail) Double
- observationLocationPrivate :: forall detail. Lens' (Observation detail) Bool
- observationLocationName :: forall detail. Lens' (Observation detail) Text
- observationLocationId :: forall detail. Lens' (Observation detail) Text
- observationLatitude :: forall detail. Lens' (Observation detail) Double
- observationHowMany :: forall detail. Lens' (Observation detail) (Maybe Integer)
- observationFullDetail :: forall detail detail. Lens (Observation detail) (Observation detail) (ObservationDetails detail) (ObservationDetails detail)
- observationDateTime :: forall detail. Lens' (Observation detail) EBirdDateTime
- observationCommonName :: forall detail. Lens' (Observation detail) Text
- observationDetailsSubnational2Code :: Lens' (ObservationDetails 'Full) Region
- observationDetailsSubnational2Name :: Lens' (ObservationDetails 'Full) Text
- observationDetailsSubnational1Code :: Lens' (ObservationDetails 'Full) Region
- observationDetailsSubnational1Name :: Lens' (ObservationDetails 'Full) Text
- observationDetailsCountryCode :: Lens' (ObservationDetails 'Full) Region
- observationDetailsCountryName :: Lens' (ObservationDetails 'Full) Text
- observationDetailsUserDisplayName :: Lens' (ObservationDetails 'Full) Text
- observationDetailsObsId :: Lens' (ObservationDetails 'Full) Text
- observationDetailsChecklistId :: Lens' (ObservationDetails 'Full) Text
- observationDetailsPresenceNoted :: Lens' (ObservationDetails 'Full) Bool
- observationDetailsHasComments :: Lens' (ObservationDetails 'Full) Bool
- observationDetailsLastName :: Lens' (ObservationDetails 'Full) Text
- observationDetailsFirstName :: Lens' (ObservationDetails 'Full) Text
- observationDetailsHasRichMedia :: Lens' (ObservationDetails 'Full) Bool
- parseDetailLevel :: Parser DetailLevel
- parseSortObservationsBy :: Parser SortObservationsBy
- parseSelectObservation :: Parser SelectObservation
Observation types
data Observation (detail :: DetailLevel) Source #
An observation of a species submitted to eBird within a checklist. The
DetailLevel
index indicates whether the observation data includes "full"
details.
Constructors
Observation | |
Fields
|
Instances
data ObservationDetails (detail :: DetailLevel) where Source #
Extra details that may be attached to an observation. At the moment, it
only seems possible to get Full
detailed observations from the notable
observation endpoints (e.g. RecentNotableObservationsAPI
).
Constructors
NoDetails :: ObservationDetails 'Simple | |
FullDetails | |
Fields
|
Instances
data SomeObservation where Source #
Observation
values of existentially quantified detail.
Constructors
SomeObservation :: Observation detail -> SomeObservation |
Instances
Show SomeObservation Source # | |
Defined in Data.EBird.API.Observations Methods showsPrec :: Int -> SomeObservation -> ShowS # show :: SomeObservation -> String # showList :: [SomeObservation] -> ShowS # | |
FromJSON SomeObservation Source # | Switches between parsing a |
Defined in Data.EBird.API.Observations Methods parseJSON :: Value -> Parser SomeObservation # parseJSONList :: Value -> Parser [SomeObservation] # | |
ToJSON SomeObservation Source # | Switches between encoding a |
Defined in Data.EBird.API.Observations Methods toJSON :: SomeObservation -> Value # toEncoding :: SomeObservation -> Encoding # toJSONList :: [SomeObservation] -> Value # toEncodingList :: [SomeObservation] -> Encoding # |
Auxiliary eBird observation API types
data DetailLevel Source #
The promoted constructors of this type are used as type-level indices on
the Observation
type to determine whether an observation is Simple
detail
or Full
detail.
Instances
data SortObservationsBy Source #
Values representing the ways that observations may be sorted in responses from the API.
Constructors
SortObservationsByDate | |
SortObservationsBySpecies |
Instances
data SelectObservation Source #
Values representing how to pick which Observation
s are returned from the
HistoricalObservationsAPI
in the case that there are several
observations of the same species on the date.
Constructors
SelectFirstObservation | |
SelectLastObservation |
Instances
Optics for observation types
observationValid :: forall detail. Lens' (Observation detail) Bool Source #
observationSubId :: forall detail. Lens' (Observation detail) Text Source #
observationSpeciesCode :: forall detail. Lens' (Observation detail) Text Source #
observationScientificName :: forall detail. Lens' (Observation detail) Text Source #
observationReviewed :: forall detail. Lens' (Observation detail) Bool Source #
observationLongitude :: forall detail. Lens' (Observation detail) Double Source #
observationLocationPrivate :: forall detail. Lens' (Observation detail) Bool Source #
observationLocationName :: forall detail. Lens' (Observation detail) Text Source #
observationLocationId :: forall detail. Lens' (Observation detail) Text Source #
observationLatitude :: forall detail. Lens' (Observation detail) Double Source #
observationHowMany :: forall detail. Lens' (Observation detail) (Maybe Integer) Source #
observationFullDetail :: forall detail detail. Lens (Observation detail) (Observation detail) (ObservationDetails detail) (ObservationDetails detail) Source #
observationDateTime :: forall detail. Lens' (Observation detail) EBirdDateTime Source #
observationCommonName :: forall detail. Lens' (Observation detail) Text Source #
attoparsec parsers
parseSortObservationsBy :: Parser SortObservationsBy Source #
Parse a SortObservationsBy
value
parseSelectObservation :: Parser SelectObservation Source #
Parse a SelectObservation
value