-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Requesting and introspecting Tables within an Airtable project. -- -- Requesting and introspecting Tables within an Airtable project. @package airtable-api @version 0.2.0.1 module Airtable.Table -- | Airtable's record ID for use in indexing records newtype RecordID RecordID :: Text -> RecordID rec2str :: RecordID -> String -- | A convenience typeclass for selecting records using RecordID-like -- keys. class IsRecord a toRec :: IsRecord a => a -> RecordID -- | Airtable's table type data Table a Table :: HashMap RecordID a -> Maybe Text -> Table a [tableRecords] :: Table a -> HashMap RecordID a [tableOffset] :: Table a -> Maybe Text -- | Synonym used in querying tables from the API. type TableName = String parseRecord :: (UTCTime -> RecordID -> Value -> Parser a) -> Value -> Parser a parseFields :: (Value -> Parser a) -> Value -> Parser a -- | Convert a Table to a list of key-record pairs. toList :: Table a -> [(RecordID, a)] -- | Check if a record exists at the given key in a table. exists :: (IsRecord r) => Table a -> r -> Bool -- | Unsafely lookup a record using its RecordID. Will throw a -- pretty-printed error if record does not exist. select :: (HasCallStack, IsRecord r, Show a) => Table a -> r -> a -- | Safely lookup a record using its RecordID. selectMaybe :: (IsRecord r) => Table a -> r -> Maybe a -- | Read all records. selectAll :: Table a -> [a] -- | Read all RecordID's. selectAllKeys :: Table a -> [RecordID] -- | Select all records satisfying a condition. selectWhere :: Table a -> (RecordID -> a -> Bool) -> [a] -- | Select all RecordID's satisfying a condition. selectKeyWhere :: Table a -> (RecordID -> a -> Bool) -> [RecordID] -- | Delete all Records satisfying a condition. deleteWhere :: Table a -> (RecordID -> a -> Bool) -> Table a instance GHC.Base.Functor Airtable.Table.Table instance GHC.Generics.Generic (Airtable.Table.Table a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Airtable.Table.Table a) instance GHC.Read.Read a => GHC.Read.Read (Airtable.Table.Table a) instance GHC.Show.Show a => GHC.Show.Show (Airtable.Table.Table a) instance GHC.Classes.Ord Airtable.Table.RecordID instance GHC.Generics.Generic Airtable.Table.RecordID instance GHC.Classes.Eq Airtable.Table.RecordID instance GHC.Read.Read Airtable.Table.RecordID instance GHC.Show.Show Airtable.Table.RecordID instance Data.Aeson.Types.FromJSON.FromJSON Airtable.Table.RecordID instance Data.Hashable.Class.Hashable Airtable.Table.RecordID instance Airtable.Table.IsRecord Airtable.Table.RecordID instance Airtable.Table.IsRecord GHC.Base.String instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Airtable.Table.Table a) instance GHC.Base.Monoid (Airtable.Table.Table a) module Airtable.Query -- | Options data AirtableOptions AirtableOptions :: String -> String -> Int -> AirtableOptions -- | the API key for your project [apiKey] :: AirtableOptions -> String -- | the app ID for your project (http://api.airtable.com/v0/app...) [appId] :: AirtableOptions -> String -- | api version (http://api.airtable.com/v../...) [apiVersion] :: AirtableOptions -> Int -- | Airtable options defaulting to API version 0. Please change the -- apiKey and appId fields. defaultAirtableOptions :: AirtableOptions -- | Retrieve a table from airtable.com given its name. Handles pagination -- correctly. getTable :: (FromJSON a) => AirtableOptions -> TableName -> IO (Table a)