aws-0.24.4: Amazon Web Services (AWS) for Haskell

Copyright | Soostone Inc Chris Allen
License | BSD3
Maintainer | Ozgun Ataman <ozgun.ataman@soostone.com>
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Aws.DynamoDb.Core

Contents

- Configuration and Regions
- DynamoDB values
- Converting to/from `DValue`
- Defining new `DynVal` instances
- Working with key/value pairs
- Working with objects (attribute collections)
- Common types used by operations
- Size estimation
- Responses & Errors
- Internal Helpers

Description

Shared types and utilities for DyanmoDb functionality.

Synopsis

- data Region = Region {
  - rUri :: ByteString
  - rName :: ByteString
  }
- ddbLocal :: Region
- ddbUsEast1 :: Region
- ddbUsWest1 :: Region
- ddbUsWest2 :: Region
- ddbEuWest1 :: Region
- ddbEuWest2 :: Region
- ddbEuCentral1 :: Region
- ddbApNe1 :: Region
- ddbApSe1 :: Region
- ddbApSe2 :: Region
- ddbSaEast1 :: Region
- data DdbConfiguration qt = DdbConfiguration {
  - ddbcRegion :: Region
  - ddbcProtocol :: Protocol
  - ddbcPort :: Maybe Int
  }
- data DValue
  - = DNull
  - | DNum Scientific
  - | DString Text
  - | DBinary ByteString
  - | DNumSet (Set Scientific)
  - | DStringSet (Set Text)
  - | DBinSet (Set ByteString)
  - | DBool Bool
  - | DBoolSet (Set Bool)
  - | DList (Vector DValue)
  - | DMap (Map Text DValue)
- class DynData (DynRep a) => DynVal a where
  - type DynRep a
  - toRep :: a -> DynRep a
  - fromRep :: DynRep a -> Maybe a
- toValue :: DynVal a => a -> DValue
- fromValue :: DynVal a => DValue -> Maybe a
- newtype Bin a = Bin {
  - getBin :: a
  }
- newtype OldBool = OldBool Bool
- class Ord a => DynData a where
  - fromData :: a -> DValue
  - toData :: DValue -> Maybe a
- newtype DynBinary = DynBinary {
  - unDynBinary :: ByteString
  }
- newtype DynNumber = DynNumber {
  - unDynNumber :: Scientific
  }
- newtype DynString = DynString {
  - unDynString :: Text
  }
- newtype DynBool = DynBool {
  - unDynBool :: Bool
  }
- data Attribute = Attribute {
  - attrName :: Text
  - attrVal :: DValue
  }
- parseAttributeJson :: Value -> Parser [Attribute]
- attributeJson :: Attribute -> Pair
- attributesJson :: [Attribute] -> Value
- attrTuple :: Attribute -> (Text, DValue)
- attr :: DynVal a => Text -> a -> Attribute
- attrAs :: DynVal a => Proxy a -> Text -> a -> Attribute
- text :: Proxy Text
- int :: Proxy Integer
- double :: Proxy Double
- data PrimaryKey = PrimaryKey {
  - pkHash :: Attribute
  - pkRange :: Maybe Attribute
  }
- hk :: Text -> DValue -> PrimaryKey
- hrk :: Text -> DValue -> Text -> DValue -> PrimaryKey
- type Item = Map Text DValue
- item :: [Attribute] -> Item
- attributes :: Map Text DValue -> [Attribute]
- class ToDynItem a where
  - toItem :: a -> Item
- class FromDynItem a where
  - parseItem :: Item -> Parser a
- fromItem :: FromDynItem a => Item -> Either String a
- newtype Parser a = Parser {
  - runParser :: forall (f :: Type -> Type) r. Failure f r -> Success a f r -> f r
  }
- getAttr :: (Typeable a, DynVal a) => Text -> Item -> Parser a
- getAttr' :: DynVal a => Text -> Item -> Parser (Maybe a)
- parseAttr :: FromDynItem a => Text -> Item -> Parser a
- data Conditions = Conditions CondMerge [Condition]
- conditionsJson :: Text -> Conditions -> [Pair]
- expectsJson :: Conditions -> [Pair]
- data Condition = Condition {
  - condAttr :: Text
  - condOp :: CondOp
  }
- conditionJson :: Condition -> Pair
- data CondOp
  - = DEq DValue
  - | NotEq DValue
  - | DLE DValue
  - | DLT DValue
  - | DGE DValue
  - | DGT DValue
  - | NotNull
  - | IsNull
  - | Contains DValue
  - | NotContains DValue
  - | Begins DValue
  - | In [DValue]
  - | Between DValue DValue
- data CondMerge
  - = CondAnd
  - | CondOr
- data ConsumedCapacity = ConsumedCapacity {
  - capacityUnits :: Int64
  - capacityGlobalIndex :: [(Text, Int64)]
  - capacityLocalIndex :: [(Text, Int64)]
  - capacityTableUnits :: Maybe Int64
  - capacityTable :: Text
  }
- data ReturnConsumption
  - = RCIndexes
  - | RCTotal
  - | RCNone
- data ItemCollectionMetrics = ItemCollectionMetrics {
  - icmKey :: (Text, DValue)
  - icmEstimate :: [Double]
  }
- data ReturnItemCollectionMetrics
  - = RICMSize
  - | RICMNone
- data UpdateReturn
  - = URNone
  - | URAllOld
  - | URUpdatedOld
  - | URAllNew
  - | URUpdatedNew
- data QuerySelect
  - = SelectSpecific [Text]
  - | SelectCount
  - | SelectProjected
  - | SelectAll
- querySelectJson :: KeyValue Value t => QuerySelect -> [t]
- class DynSize a where
  - dynSize :: a -> Int
- nullAttr :: Attribute -> Bool
- data DdbResponse = DdbResponse {
  - ddbrCrc :: Maybe Text
  - ddbrMsgId :: Maybe Text
  }
- data DdbErrCode
  - = AccessDeniedException
  - | ConditionalCheckFailedException
  - | IncompleteSignatureException
  - | InvalidSignatureException
  - | LimitExceededException
  - | MissingAuthenticationTokenException
  - | ProvisionedThroughputExceededException
  - | ResourceInUseException
  - | ResourceNotFoundException
  - | ThrottlingException
  - | ValidationException
  - | RequestTooLarge
  - | InternalFailure
  - | InternalServerError
  - | ServiceUnavailableException
  - | SerializationException
- shouldRetry :: DdbErrCode -> Bool
- data DdbError = DdbError {
  - ddbStatusCode :: Int
  - ddbErrCode :: DdbErrCode
  - ddbErrMsg :: Text
  }
- ddbSignQuery :: ToJSON a => ByteString -> a -> DdbConfiguration qt -> SignatureData -> SignedQuery
- data AmazonError = AmazonError {
  - aeType :: Text
  - aeMessage :: Maybe Text
  }
- ddbResponseConsumer :: FromJSON a => IORef DdbResponse -> HTTPResponseConsumer a
- ddbHttp :: Region -> DdbConfiguration NormalQuery
- ddbHttps :: Region -> DdbConfiguration NormalQuery

# Configuration and Regions

data Region #

Constructors

Region |
Fields rUri :: ByteString rName :: ByteString

#### Instances

Instances details

Read Region # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS Region # readList :: ReadS [Region] # readPrec :: ReadPrec Region # readListPrec :: ReadPrec [Region] #
Show Region # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> Region -> ShowS # show :: Region -> String # showList :: [Region] -> ShowS #
Eq Region # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: Region -> Region -> Bool # (/=) :: Region -> Region -> Bool #

ddbLocal :: Region #

DynamoDb local connection (for development)

ddbUsEast1 :: Region #

ddbUsWest1 :: Region #

ddbUsWest2 :: Region #

ddbEuWest1 :: Region #

ddbEuWest2 :: Region #

ddbEuCentral1 :: Region #

ddbApNe1 :: Region #

ddbApSe1 :: Region #

ddbApSe2 :: Region #

ddbSaEast1 :: Region #

data DdbConfiguration qt #

Constructors

DdbConfiguration |
Fields ddbcRegion :: Region The regional endpoint. Ex: `ddbUsEast` ddbcProtocol :: Protocol `HTTP` or `HTTPS` ddbcPort :: Maybe Int Port override (mostly for local dev connection)

#### Instances

Instances details

DefaultServiceConfiguration (DdbConfiguration NormalQuery) # |
Instance details Defined in Aws.DynamoDb.Core Methods defServiceConfig :: DdbConfiguration NormalQuery # debugServiceConfig :: DdbConfiguration NormalQuery #
Default (DdbConfiguration NormalQuery) # |
Instance details Defined in Aws.DynamoDb.Core Methods def :: DdbConfiguration NormalQuery #
Show (DdbConfiguration qt) # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DdbConfiguration qt -> ShowS # show :: DdbConfiguration qt -> String # showList :: [DdbConfiguration qt] -> ShowS #

# DynamoDB values

data DValue #

Value types natively recognized by DynamoDb. We pretty much exactly reflect the AWS API onto Haskell types.

Constructors

DNull |
DNum Scientific |
DString Text |
DBinary ByteString | Binary data will automatically be base64 marshalled.
DNumSet (Set Scientific) |
DStringSet (Set Text) |
DBinSet (Set ByteString) | Binary data will automatically be base64 marshalled.
DBool Bool |
DBoolSet (Set Bool) | Composite data
DList (Vector DValue) |
DMap (Map Text DValue) |

#### Instances

Instances details

FromJSON DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods parseJSON :: Value -> Parser DValue # parseJSONList :: Value -> Parser [DValue] # omittedField :: Maybe DValue #
ToJSON DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: DValue -> Value # toEncoding :: DValue -> Encoding # toJSONList :: [DValue] -> Value # toEncodingList :: [DValue] -> Encoding # omitField :: DValue -> Bool #
DynData DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DValue -> DValue # toData :: DValue -> Maybe DValue #
DynSize DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: DValue -> Int #
DynSize Item # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Item -> Int #
DynVal DValue # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep DValue |
Instance details Defined in Aws.DynamoDb.Core type DynRep DValue = DValue
Methods toRep :: DValue -> DynRep DValue # fromRep :: DynRep DValue -> Maybe DValue #
FromDynItem Item # |
Instance details Defined in Aws.DynamoDb.Core Methods parseItem :: Item -> Parser Item #
ToDynItem Item # |
Instance details Defined in Aws.DynamoDb.Core Methods toItem :: Item -> Item #
IsString DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods fromString :: String -> DValue #
Read DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DValue # readList :: ReadS [DValue] # readPrec :: ReadPrec DValue # readListPrec :: ReadPrec [DValue] #
Show DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DValue -> ShowS # show :: DValue -> String # showList :: [DValue] -> ShowS #
Eq DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DValue -> DValue -> Bool # (/=) :: DValue -> DValue -> Bool #
Ord DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: DValue -> DValue -> Ordering # (<) :: DValue -> DValue -> Bool # (<=) :: DValue -> DValue -> Bool # (>) :: DValue -> DValue -> Bool # (>=) :: DValue -> DValue -> Bool # max :: DValue -> DValue -> DValue # min :: DValue -> DValue -> DValue #
ListResponse QueryResponse Item # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods listResponse :: QueryResponse -> [Item] #
ListResponse ScanResponse Item # |
Instance details Defined in Aws.DynamoDb.Commands.Scan Methods listResponse :: ScanResponse -> [Item] #
type DynRep DValue # |
Instance details Defined in Aws.DynamoDb.Core type DynRep DValue = DValue

# Converting to/from `DValue`

class DynData (DynRep a) => DynVal a where #

Class of Haskell types that can be represented as DynamoDb values.

This is the conversion layer; instantiate this class for your own types and then use the `toValue` and `fromValue` combinators to convert in application code.

Each Haskell type instantiated with this class will map to a DynamoDb-supported type that most naturally represents it.

Associated Types

type DynRep a #

Which of the `DynData` instances does this data type directly map to?

Methods

toRep :: a -> DynRep a #

Convert to representation

fromRep :: DynRep a -> Maybe a #

Convert from representation

#### Instances

Instances details

DynVal DValue # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep DValue |
Instance details Defined in Aws.DynamoDb.Core type DynRep DValue = DValue
Methods toRep :: DValue -> DynRep DValue # fromRep :: DynRep DValue -> Maybe DValue #
DynVal OldBool # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep OldBool |
Instance details Defined in Aws.DynamoDb.Core type DynRep OldBool = DynNumber
Methods toRep :: OldBool -> DynRep OldBool # fromRep :: DynRep OldBool -> Maybe OldBool #
DynVal ByteString # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep ByteString |
Instance details Defined in Aws.DynamoDb.Core type DynRep ByteString = DynBinary
Methods toRep :: ByteString -> DynRep ByteString # fromRep :: DynRep ByteString -> Maybe ByteString #
DynVal Int16 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Int16 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Int16 = DynNumber
Methods toRep :: Int16 -> DynRep Int16 # fromRep :: DynRep Int16 -> Maybe Int16 #
DynVal Int32 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Int32 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Int32 = DynNumber
Methods toRep :: Int32 -> DynRep Int32 # fromRep :: DynRep Int32 -> Maybe Int32 #
DynVal Int64 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Int64 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Int64 = DynNumber
Methods toRep :: Int64 -> DynRep Int64 # fromRep :: DynRep Int64 -> Maybe Int64 #
DynVal Int8 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Int8 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Int8 = DynNumber
Methods toRep :: Int8 -> DynRep Int8 # fromRep :: DynRep Int8 -> Maybe Int8 #
DynVal Word16 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Word16 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Word16 = DynNumber
Methods toRep :: Word16 -> DynRep Word16 # fromRep :: DynRep Word16 -> Maybe Word16 #
DynVal Word32 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Word32 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Word32 = DynNumber
Methods toRep :: Word32 -> DynRep Word32 # fromRep :: DynRep Word32 -> Maybe Word32 #
DynVal Word64 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Word64 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Word64 = DynNumber
Methods toRep :: Word64 -> DynRep Word64 # fromRep :: DynRep Word64 -> Maybe Word64 #
DynVal Word8 # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Word8 |
Instance details Defined in Aws.DynamoDb.Core type DynRep Word8 = DynNumber
Methods toRep :: Word8 -> DynRep Word8 # fromRep :: DynRep Word8 -> Maybe Word8 #
DynVal Text # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Text |
Instance details Defined in Aws.DynamoDb.Core type DynRep Text = DynString
Methods toRep :: Text -> DynRep Text # fromRep :: DynRep Text -> Maybe Text #
DynVal Day # | Encoded as number of days
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Day |
Instance details Defined in Aws.DynamoDb.Core type DynRep Day = DynNumber
Methods toRep :: Day -> DynRep Day # fromRep :: DynRep Day -> Maybe Day #
DynVal UTCTime # | Losslessly encoded via `Integer` picoseconds
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep UTCTime |
Instance details Defined in Aws.DynamoDb.Core type DynRep UTCTime = DynNumber
Methods toRep :: UTCTime -> DynRep UTCTime # fromRep :: DynRep UTCTime -> Maybe UTCTime #
DynVal Integer # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Integer |
Instance details Defined in Aws.DynamoDb.Core type DynRep Integer = DynNumber
Methods toRep :: Integer -> DynRep Integer # fromRep :: DynRep Integer -> Maybe Integer #
DynVal Bool # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Bool |
Instance details Defined in Aws.DynamoDb.Core type DynRep Bool = DynBool
Methods toRep :: Bool -> DynRep Bool # fromRep :: DynRep Bool -> Maybe Bool #
DynVal Double # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Double |
Instance details Defined in Aws.DynamoDb.Core type DynRep Double = DynNumber
Methods toRep :: Double -> DynRep Double # fromRep :: DynRep Double -> Maybe Double #
DynVal Int # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep Int |
Instance details Defined in Aws.DynamoDb.Core type DynRep Int = DynNumber
Methods toRep :: Int -> DynRep Int # fromRep :: DynRep Int -> Maybe Int #
Serialize a => DynVal (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep (Bin a) |
Instance details Defined in Aws.DynamoDb.Core type DynRep (Bin a) = DynBinary
Methods toRep :: Bin a -> DynRep (Bin a) # fromRep :: DynRep (Bin a) -> Maybe (Bin a) #
(DynData (DynRep (Set a)), DynVal a, Ord a) => DynVal (Set a) # | Any singular `DynVal` can be upgraded to a `Set`.
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep (Set a) |
Instance details Defined in Aws.DynamoDb.Core type DynRep (Set a) = Set (DynRep a)
Methods toRep :: Set a -> DynRep (Set a) # fromRep :: DynRep (Set a) -> Maybe (Set a) #
(DynData (DynRep [a]), DynVal a) => DynVal [a] # | Any singular `DynVal` can be upgraded to a list.
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep [a] |
Instance details Defined in Aws.DynamoDb.Core type DynRep [a] = Set (DynRep a)
Methods toRep :: [a] -> DynRep [a] # fromRep :: DynRep [a] -> Maybe [a] #

toValue :: DynVal a => a -> DValue #

Encode a Haskell value.

fromValue :: DynVal a => DValue -> Maybe a #

Decode a Haskell value.

newtype Bin a #

Type wrapper for binary data to be written to DynamoDB. Wrap any `Serialize` instance in there and `DynVal` will know how to automatically handle conversions in binary form.

Constructors

Bin |
Fields getBin :: a

#### Instances

Instances details

Serialize a => DynVal (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep (Bin a) |
Instance details Defined in Aws.DynamoDb.Core type DynRep (Bin a) = DynBinary
Methods toRep :: Bin a -> DynRep (Bin a) # fromRep :: DynRep (Bin a) -> Maybe (Bin a) #
Enum a => Enum (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Methods succ :: Bin a -> Bin a # pred :: Bin a -> Bin a # toEnum :: Int -> Bin a # fromEnum :: Bin a -> Int # enumFrom :: Bin a -> [Bin a] # enumFromThen :: Bin a -> Bin a -> [Bin a] # enumFromTo :: Bin a -> Bin a -> [Bin a] # enumFromThenTo :: Bin a -> Bin a -> Bin a -> [Bin a] #
Read a => Read (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS (Bin a) # readList :: ReadS [Bin a] # readPrec :: ReadPrec (Bin a) # readListPrec :: ReadPrec [Bin a] #
Show a => Show (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> Bin a -> ShowS # show :: Bin a -> String # showList :: [Bin a] -> ShowS #
Eq a => Eq (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: Bin a -> Bin a -> Bool # (/=) :: Bin a -> Bin a -> Bool #
Ord a => Ord (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: Bin a -> Bin a -> Ordering # (<) :: Bin a -> Bin a -> Bool # (<=) :: Bin a -> Bin a -> Bool # (>) :: Bin a -> Bin a -> Bool # (>=) :: Bin a -> Bin a -> Bool # max :: Bin a -> Bin a -> Bin a # min :: Bin a -> Bin a -> Bin a #
type DynRep (Bin a) # |
Instance details Defined in Aws.DynamoDb.Core type DynRep (Bin a) = DynBinary

newtype OldBool #

Constructors

OldBool Bool |

#### Instances

Instances details

DynVal OldBool # |
Instance details Defined in Aws.DynamoDb.Core Associated Types
type DynRep OldBool |
Instance details Defined in Aws.DynamoDb.Core type DynRep OldBool = DynNumber
Methods toRep :: OldBool -> DynRep OldBool # fromRep :: DynRep OldBool -> Maybe OldBool #
type DynRep OldBool # |
Instance details Defined in Aws.DynamoDb.Core type DynRep OldBool = DynNumber

# Defining new `DynVal` instances

class Ord a => DynData a where #

An internally used closed typeclass for values that have direct DynamoDb representations. Based on AWS API, this is basically numbers, strings and binary blobs.

This is here so that any `DynVal` haskell value can automatically be lifted to a list or a `Set` without any instance code duplication.

Do not try to create your own instances.

Methods

fromData :: a -> DValue #

toData :: DValue -> Maybe a #

#### Instances

Instances details

DynData DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DValue -> DValue # toData :: DValue -> Maybe DValue #
DynData DynBinary # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynBinary -> DValue # toData :: DValue -> Maybe DynBinary #
DynData DynBool # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynBool -> DValue # toData :: DValue -> Maybe DynBool #
DynData DynNumber # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynNumber -> DValue # toData :: DValue -> Maybe DynNumber #
DynData DynString # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynString -> DValue # toData :: DValue -> Maybe DynString #
DynData (Set DynBinary) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynBinary -> DValue # toData :: DValue -> Maybe (Set DynBinary) #
DynData (Set DynBool) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynBool -> DValue # toData :: DValue -> Maybe (Set DynBool) #
DynData (Set DynNumber) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynNumber -> DValue # toData :: DValue -> Maybe (Set DynNumber) #
DynData (Set DynString) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynString -> DValue # toData :: DValue -> Maybe (Set DynString) #

newtype DynBinary #

Binary values stored in DynamoDb. Only used in defining new `DynVal` instances.

Constructors

DynBinary |
Fields unDynBinary :: ByteString

#### Instances

Instances details

DynData DynBinary # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynBinary -> DValue # toData :: DValue -> Maybe DynBinary #
Read DynBinary # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DynBinary # readList :: ReadS [DynBinary] # readPrec :: ReadPrec DynBinary # readListPrec :: ReadPrec [DynBinary] #
Show DynBinary # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DynBinary -> ShowS # show :: DynBinary -> String # showList :: [DynBinary] -> ShowS #
Eq DynBinary # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DynBinary -> DynBinary -> Bool # (/=) :: DynBinary -> DynBinary -> Bool #
Ord DynBinary # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: DynBinary -> DynBinary -> Ordering # (<) :: DynBinary -> DynBinary -> Bool # (<=) :: DynBinary -> DynBinary -> Bool # (>) :: DynBinary -> DynBinary -> Bool # (>=) :: DynBinary -> DynBinary -> Bool # max :: DynBinary -> DynBinary -> DynBinary # min :: DynBinary -> DynBinary -> DynBinary #
DynData (Set DynBinary) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynBinary -> DValue # toData :: DValue -> Maybe (Set DynBinary) #

newtype DynNumber #

Numeric values stored in DynamoDb. Only used in defining new `DynVal` instances.

Constructors

DynNumber |
Fields unDynNumber :: Scientific

#### Instances

Instances details

DynData DynNumber # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynNumber -> DValue # toData :: DValue -> Maybe DynNumber #
Read DynNumber # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DynNumber # readList :: ReadS [DynNumber] # readPrec :: ReadPrec DynNumber # readListPrec :: ReadPrec [DynNumber] #
Show DynNumber # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DynNumber -> ShowS # show :: DynNumber -> String # showList :: [DynNumber] -> ShowS #
Eq DynNumber # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DynNumber -> DynNumber -> Bool # (/=) :: DynNumber -> DynNumber -> Bool #
Ord DynNumber # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: DynNumber -> DynNumber -> Ordering # (<) :: DynNumber -> DynNumber -> Bool # (<=) :: DynNumber -> DynNumber -> Bool # (>) :: DynNumber -> DynNumber -> Bool # (>=) :: DynNumber -> DynNumber -> Bool # max :: DynNumber -> DynNumber -> DynNumber # min :: DynNumber -> DynNumber -> DynNumber #
DynData (Set DynNumber) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynNumber -> DValue # toData :: DValue -> Maybe (Set DynNumber) #

newtype DynString #

String values stored in DynamoDb. Only used in defining new `DynVal` instances.

Constructors

DynString |
Fields unDynString :: Text

#### Instances

Instances details

DynData DynString # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynString -> DValue # toData :: DValue -> Maybe DynString #
Read DynString # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DynString # readList :: ReadS [DynString] # readPrec :: ReadPrec DynString # readListPrec :: ReadPrec [DynString] #
Show DynString # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DynString -> ShowS # show :: DynString -> String # showList :: [DynString] -> ShowS #
Eq DynString # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DynString -> DynString -> Bool # (/=) :: DynString -> DynString -> Bool #
Ord DynString # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: DynString -> DynString -> Ordering # (<) :: DynString -> DynString -> Bool # (<=) :: DynString -> DynString -> Bool # (>) :: DynString -> DynString -> Bool # (>=) :: DynString -> DynString -> Bool # max :: DynString -> DynString -> DynString # min :: DynString -> DynString -> DynString #
DynData (Set DynString) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynString -> DValue # toData :: DValue -> Maybe (Set DynString) #

newtype DynBool #

Boolean values stored in DynamoDb. Only used in defining new `DynVal` instances.

Constructors

DynBool |
Fields unDynBool :: Bool

#### Instances

Instances details

DynData DynBool # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DynBool -> DValue # toData :: DValue -> Maybe DynBool #
Read DynBool # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DynBool # readList :: ReadS [DynBool] # readPrec :: ReadPrec DynBool # readListPrec :: ReadPrec [DynBool] #
Show DynBool # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DynBool -> ShowS # show :: DynBool -> String # showList :: [DynBool] -> ShowS #
Eq DynBool # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DynBool -> DynBool -> Bool # (/=) :: DynBool -> DynBool -> Bool #
Ord DynBool # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: DynBool -> DynBool -> Ordering # (<) :: DynBool -> DynBool -> Bool # (<=) :: DynBool -> DynBool -> Bool # (>) :: DynBool -> DynBool -> Bool # (>=) :: DynBool -> DynBool -> Bool # max :: DynBool -> DynBool -> DynBool # min :: DynBool -> DynBool -> DynBool #
DynData (Set DynBool) # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: Set DynBool -> DValue # toData :: DValue -> Maybe (Set DynBool) #

# Working with key/value pairs

data Attribute #

A key-value pair

Constructors

Attribute |
Fields attrName :: Text attrVal :: DValue

#### Instances

Instances details

ToJSON Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: Attribute -> Value # toEncoding :: Attribute -> Encoding # toJSONList :: [Attribute] -> Value # toEncodingList :: [Attribute] -> Encoding # omitField :: Attribute -> Bool #
DynSize Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Attribute -> Int #
Read Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS Attribute # readList :: ReadS [Attribute] # readPrec :: ReadPrec Attribute # readListPrec :: ReadPrec [Attribute] #
Show Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> Attribute -> ShowS # show :: Attribute -> String # showList :: [Attribute] -> ShowS #
Eq Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: Attribute -> Attribute -> Bool # (/=) :: Attribute -> Attribute -> Bool #
Ord Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: Attribute -> Attribute -> Ordering # (<) :: Attribute -> Attribute -> Bool # (<=) :: Attribute -> Attribute -> Bool # (>) :: Attribute -> Attribute -> Bool # (>=) :: Attribute -> Attribute -> Bool # max :: Attribute -> Attribute -> Attribute # min :: Attribute -> Attribute -> Attribute #

parseAttributeJson :: Value -> Parser [Attribute] #

Parse a JSON object that contains attributes

attributeJson :: Attribute -> Pair #

Convert into JSON pair

attributesJson :: [Attribute] -> Value #

Convert into JSON object for AWS.

attrTuple :: Attribute -> (Text, DValue) #

Convert attribute to a tuple representation

attr :: DynVal a => Text -> a -> Attribute #

Convenience function for constructing key-value pairs

attrAs :: DynVal a => Proxy a -> Text -> a -> Attribute #

`attr` with type witness to help with cases where you're manually supplying values in code.

    > item [ attrAs text "name" "john" ]

text :: Proxy Text #

Type witness for `Text`. See `attrAs`.

int :: Proxy Integer #

Type witness for `Integer`. See `attrAs`.

double :: Proxy Double #

Type witness for `Double`. See `attrAs`.

data PrimaryKey #

Primary keys consist of either just a Hash key (mandatory) or a hash key and a range key (optional).

Constructors

PrimaryKey |
Fields pkHash :: Attribute pkRange :: Maybe Attribute

#### Instances

Instances details

FromJSON PrimaryKey # |
Instance details Defined in Aws.DynamoDb.Core Methods parseJSON :: Value -> Parser PrimaryKey # parseJSONList :: Value -> Parser [PrimaryKey] # omittedField :: Maybe PrimaryKey #
ToJSON PrimaryKey # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: PrimaryKey -> Value # toEncoding :: PrimaryKey -> Encoding # toJSONList :: [PrimaryKey] -> Value # toEncodingList :: [PrimaryKey] -> Encoding # omitField :: PrimaryKey -> Bool #
Read PrimaryKey # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS PrimaryKey # readList :: ReadS [PrimaryKey] # readPrec :: ReadPrec PrimaryKey # readListPrec :: ReadPrec [PrimaryKey] #
Show PrimaryKey # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> PrimaryKey -> ShowS # show :: PrimaryKey -> String # showList :: [PrimaryKey] -> ShowS #
Eq PrimaryKey # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: PrimaryKey -> PrimaryKey -> Bool # (/=) :: PrimaryKey -> PrimaryKey -> Bool #
Ord PrimaryKey # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: PrimaryKey -> PrimaryKey -> Ordering # (<) :: PrimaryKey -> PrimaryKey -> Bool # (<=) :: PrimaryKey -> PrimaryKey -> Bool # (>) :: PrimaryKey -> PrimaryKey -> Bool # (>=) :: PrimaryKey -> PrimaryKey -> Bool # max :: PrimaryKey -> PrimaryKey -> PrimaryKey # min :: PrimaryKey -> PrimaryKey -> PrimaryKey #

hk :: Text -> DValue -> PrimaryKey #

Construct a hash-only primary key.

    >>> hk "user-id" "ABCD"

    >>> hk "user-id" (mkVal 23)

hrk #

Arguments

:: Text | Hash key name
-> DValue | Hash key value
-> Text | Range key name
-> DValue | Range key value
-> PrimaryKey |

Construct a hash-and-range primary key.

# Working with objects (attribute collections)

type Item = Map Text DValue #

A DynamoDb object is simply a key-value dictionary.

item :: [Attribute] -> Item #

Pack a list of attributes into an Item.

attributes :: Map Text DValue -> [Attribute] #

Unpack an `Item` into a list of attributes.

class ToDynItem a where #

Types convertible to DynamoDb `Item` collections.

Use `attr` and `attrAs` combinators to conveniently define instances.

Methods

toItem :: a -> Item #

#### Instances

Instances details

ToDynItem Item # |
Instance details Defined in Aws.DynamoDb.Core Methods toItem :: Item -> Item #
DynVal a => ToDynItem [(Text, a)] # |
Instance details Defined in Aws.DynamoDb.Core Methods toItem :: [(Text, a)] -> Item #
DynVal a => ToDynItem (Map Text a) # |
Instance details Defined in Aws.DynamoDb.Core Methods toItem :: Map Text a -> Item #

class FromDynItem a where #

Types parseable from DynamoDb `Item` collections.

User `getAttr` family of functions to applicatively or monadically parse into your custom types.

Methods

parseItem :: Item -> Parser a #

#### Instances

Instances details

FromDynItem Item # |
Instance details Defined in Aws.DynamoDb.Core Methods parseItem :: Item -> Parser Item #
(Typeable a, DynVal a) => FromDynItem [(Text, a)] # |
Instance details Defined in Aws.DynamoDb.Core Methods parseItem :: Item -> Parser [(Text, a)] #
(Typeable a, DynVal a) => FromDynItem (Map Text a) # |
Instance details Defined in Aws.DynamoDb.Core Methods parseItem :: Item -> Parser (Map Text a) #

fromItem :: FromDynItem a => Item -> Either String a #

Parse an `Item` into target type using the `FromDynItem` instance.

newtype Parser a #

A continuation-based parser type.

Constructors

Parser |
Fields runParser :: forall (f :: Type -> Type) r. Failure f r -> Success a f r -> f r

#### Instances

Instances details

Alternative Parser # |
Instance details Defined in Aws.DynamoDb.Core Methods empty :: Parser a # (<|>) :: Parser a -> Parser a -> Parser a # some :: Parser a -> Parser [a] # many :: Parser a -> Parser [a] #
Applicative Parser # |
Instance details Defined in Aws.DynamoDb.Core Methods pure :: a -> Parser a # (<*>) :: Parser (a -> b) -> Parser a -> Parser b # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c # (*>) :: Parser a -> Parser b -> Parser b # (<*) :: Parser a -> Parser b -> Parser a #
Functor Parser # |
Instance details Defined in Aws.DynamoDb.Core Methods fmap :: (a -> b) -> Parser a -> Parser b # (<$) :: a -> Parser b -> Parser a #
Monad Parser # |
Instance details Defined in Aws.DynamoDb.Core Methods (>>=) :: Parser a -> (a -> Parser b) -> Parser b # (>>) :: Parser a -> Parser b -> Parser b # return :: a -> Parser a #
MonadPlus Parser # |
Instance details Defined in Aws.DynamoDb.Core Methods mzero :: Parser a # mplus :: Parser a -> Parser a -> Parser a #
MonadFail Parser # |
Instance details Defined in Aws.DynamoDb.Core Methods fail :: String -> Parser a #
Monoid (Parser a) # |
Instance details Defined in Aws.DynamoDb.Core Methods mempty :: Parser a # mappend :: Parser a -> Parser a -> Parser a # mconcat :: [Parser a] -> Parser a #
Semigroup (Parser a) # |
Instance details Defined in Aws.DynamoDb.Core Methods (<>) :: Parser a -> Parser a -> Parser a # sconcat :: NonEmpty (Parser a) -> Parser a # stimes :: Integral b => b -> Parser a -> Parser a #

getAttr #

Arguments

:: (Typeable a, DynVal a) |
=> Text | Attribute name
-> Item | Item from DynamoDb
-> Parser a |

Convenience combinator for parsing fields from an `Item` returned by DynamoDb.

getAttr' #

Arguments

:: DynVal a |
=> Text | Attribute name
-> Item | Item from DynamoDb
-> Parser (Maybe a) |

Parse attribute if it's present in the `Item`. Fail if attribute is present but conversion fails.

parseAttr #

Arguments

:: FromDynItem a |
=> Text | Attribute name
-> Item | Item from DynamoDb
-> Parser a |

Combinator for parsing an attribute into a `FromDynItem`.

# Common types used by operations

data Conditions #

Conditions used by mutation operations (`PutItem`, `UpdateItem`, etc.). The default `def` instance is empty (no condition).

Constructors

Conditions CondMerge [Condition] |

#### Instances

Instances details

Default Conditions # |
Instance details Defined in Aws.DynamoDb.Core Methods def :: Conditions #
Read Conditions # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS Conditions # readList :: ReadS [Conditions] # readPrec :: ReadPrec Conditions # readListPrec :: ReadPrec [Conditions] #
Show Conditions # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> Conditions -> ShowS # show :: Conditions -> String # showList :: [Conditions] -> ShowS #
Eq Conditions # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: Conditions -> Conditions -> Bool # (/=) :: Conditions -> Conditions -> Bool #
Ord Conditions # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: Conditions -> Conditions -> Ordering # (<) :: Conditions -> Conditions -> Bool # (<=) :: Conditions -> Conditions -> Bool # (>) :: Conditions -> Conditions -> Bool # (>=) :: Conditions -> Conditions -> Bool # max :: Conditions -> Conditions -> Conditions # min :: Conditions -> Conditions -> Conditions #

conditionsJson :: Text -> Conditions -> [Pair] #

JSON encoding of conditions parameter in various contexts.

expectsJson :: Conditions -> [Pair] #

data Condition #

A condition used by mutation operations (`PutItem`, `UpdateItem`, etc.).

Constructors

Condition |
Fields condAttr :: Text Attribute to use as the basis for this conditional condOp :: CondOp Operation on the selected attribute

#### Instances

Instances details

Read Condition # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS Condition # readList :: ReadS [Condition] # readPrec :: ReadPrec Condition # readListPrec :: ReadPrec [Condition] #
Show Condition # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> Condition -> ShowS # show :: Condition -> String # showList :: [Condition] -> ShowS #
Eq Condition # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: Condition -> Condition -> Bool # (/=) :: Condition -> Condition -> Bool #
Ord Condition # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: Condition -> Condition -> Ordering # (<) :: Condition -> Condition -> Bool # (<=) :: Condition -> Condition -> Bool # (>) :: Condition -> Condition -> Bool # (>=) :: Condition -> Condition -> Bool # max :: Condition -> Condition -> Condition # min :: Condition -> Condition -> Condition #

conditionJson :: Condition -> Pair #

data CondOp #

Conditional operation to perform on a field.

Constructors

DEq DValue |
NotEq DValue |
DLE DValue |
DLT DValue |
DGE DValue |
DGT DValue |
NotNull |
IsNull |
Contains DValue |
NotContains DValue |
Begins DValue |
In [DValue] |
Between DValue DValue |

#### Instances

Instances details

ToJSON CondOp # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: CondOp -> Value # toEncoding :: CondOp -> Encoding # toJSONList :: [CondOp] -> Value # toEncodingList :: [CondOp] -> Encoding # omitField :: CondOp -> Bool #
Read CondOp # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS CondOp # readList :: ReadS [CondOp] # readPrec :: ReadPrec CondOp # readListPrec :: ReadPrec [CondOp] #
Show CondOp # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> CondOp -> ShowS # show :: CondOp -> String # showList :: [CondOp] -> ShowS #
Eq CondOp # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: CondOp -> CondOp -> Bool # (/=) :: CondOp -> CondOp -> Bool #
Ord CondOp # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: CondOp -> CondOp -> Ordering # (<) :: CondOp -> CondOp -> Bool # (<=) :: CondOp -> CondOp -> Bool # (>) :: CondOp -> CondOp -> Bool # (>=) :: CondOp -> CondOp -> Bool # max :: CondOp -> CondOp -> CondOp # min :: CondOp -> CondOp -> CondOp #

data CondMerge #

How to merge multiple conditions.

Constructors

CondAnd |
CondOr |

#### Instances

Instances details

Read CondMerge # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS CondMerge # readList :: ReadS [CondMerge] # readPrec :: ReadPrec CondMerge # readListPrec :: ReadPrec [CondMerge] #
Show CondMerge # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> CondMerge -> ShowS # show :: CondMerge -> String # showList :: [CondMerge] -> ShowS #
Eq CondMerge # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: CondMerge -> CondMerge -> Bool # (/=) :: CondMerge -> CondMerge -> Bool #
Ord CondMerge # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: CondMerge -> CondMerge -> Ordering # (<) :: CondMerge -> CondMerge -> Bool # (<=) :: CondMerge -> CondMerge -> Bool # (>) :: CondMerge -> CondMerge -> Bool # (>=) :: CondMerge -> CondMerge -> Bool # max :: CondMerge -> CondMerge -> CondMerge # min :: CondMerge -> CondMerge -> CondMerge #

data ConsumedCapacity #

The standard response metrics on capacity consumption.

Constructors

ConsumedCapacity |
Fields capacityUnits :: Int64 capacityGlobalIndex :: [(Text, Int64)] capacityLocalIndex :: [(Text, Int64)] capacityTableUnits :: Maybe Int64 capacityTable :: Text

#### Instances

Instances details

FromJSON ConsumedCapacity # |
Instance details Defined in Aws.DynamoDb.Core Methods parseJSON :: Value -> Parser ConsumedCapacity # parseJSONList :: Value -> Parser [ConsumedCapacity] # omittedField :: Maybe ConsumedCapacity #
Read ConsumedCapacity # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS ConsumedCapacity # readList :: ReadS [ConsumedCapacity] # readPrec :: ReadPrec ConsumedCapacity # readListPrec :: ReadPrec [ConsumedCapacity] #
Show ConsumedCapacity # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> ConsumedCapacity -> ShowS # show :: ConsumedCapacity -> String # showList :: [ConsumedCapacity] -> ShowS #
Eq ConsumedCapacity # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: ConsumedCapacity -> ConsumedCapacity -> Bool # (/=) :: ConsumedCapacity -> ConsumedCapacity -> Bool #
Ord ConsumedCapacity # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: ConsumedCapacity -> ConsumedCapacity -> Ordering # (<) :: ConsumedCapacity -> ConsumedCapacity -> Bool # (<=) :: ConsumedCapacity -> ConsumedCapacity -> Bool # (>) :: ConsumedCapacity -> ConsumedCapacity -> Bool # (>=) :: ConsumedCapacity -> ConsumedCapacity -> Bool # max :: ConsumedCapacity -> ConsumedCapacity -> ConsumedCapacity # min :: ConsumedCapacity -> ConsumedCapacity -> ConsumedCapacity #

data ReturnConsumption #

Constructors

RCIndexes |
RCTotal |
RCNone |

#### Instances

Instances details

ToJSON ReturnConsumption # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: ReturnConsumption -> Value # toEncoding :: ReturnConsumption -> Encoding # toJSONList :: [ReturnConsumption] -> Value # toEncodingList :: [ReturnConsumption] -> Encoding # omitField :: ReturnConsumption -> Bool #
Default ReturnConsumption # |
Instance details Defined in Aws.DynamoDb.Core Methods def :: ReturnConsumption #
Read ReturnConsumption # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS ReturnConsumption # readList :: ReadS [ReturnConsumption] # readPrec :: ReadPrec ReturnConsumption # readListPrec :: ReadPrec [ReturnConsumption] #
Show ReturnConsumption # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> ReturnConsumption -> ShowS # show :: ReturnConsumption -> String # showList :: [ReturnConsumption] -> ShowS #
Eq ReturnConsumption # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: ReturnConsumption -> ReturnConsumption -> Bool # (/=) :: ReturnConsumption -> ReturnConsumption -> Bool #
Ord ReturnConsumption # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: ReturnConsumption -> ReturnConsumption -> Ordering # (<) :: ReturnConsumption -> ReturnConsumption -> Bool # (<=) :: ReturnConsumption -> ReturnConsumption -> Bool # (>) :: ReturnConsumption -> ReturnConsumption -> Bool # (>=) :: ReturnConsumption -> ReturnConsumption -> Bool # max :: ReturnConsumption -> ReturnConsumption -> ReturnConsumption # min :: ReturnConsumption -> ReturnConsumption -> ReturnConsumption #

data ItemCollectionMetrics #

Constructors

ItemCollectionMetrics |
Fields icmKey :: (Text, DValue) icmEstimate :: [Double]

#### Instances

Instances details

FromJSON ItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods parseJSON :: Value -> Parser ItemCollectionMetrics # parseJSONList :: Value -> Parser [ItemCollectionMetrics] # omittedField :: Maybe ItemCollectionMetrics #
Read ItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS ItemCollectionMetrics # readList :: ReadS [ItemCollectionMetrics] # readPrec :: ReadPrec ItemCollectionMetrics # readListPrec :: ReadPrec [ItemCollectionMetrics] #
Show ItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> ItemCollectionMetrics -> ShowS # show :: ItemCollectionMetrics -> String # showList :: [ItemCollectionMetrics] -> ShowS #
Eq ItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool # (/=) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool #
Ord ItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: ItemCollectionMetrics -> ItemCollectionMetrics -> Ordering # (<) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool # (<=) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool # (>) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool # (>=) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool # max :: ItemCollectionMetrics -> ItemCollectionMetrics -> ItemCollectionMetrics # min :: ItemCollectionMetrics -> ItemCollectionMetrics -> ItemCollectionMetrics #

data ReturnItemCollectionMetrics #

Constructors

RICMSize |
RICMNone |

#### Instances

Instances details

ToJSON ReturnItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: ReturnItemCollectionMetrics -> Value # toEncoding :: ReturnItemCollectionMetrics -> Encoding # toJSONList :: [ReturnItemCollectionMetrics] -> Value # toEncodingList :: [ReturnItemCollectionMetrics] -> Encoding # omitField :: ReturnItemCollectionMetrics -> Bool #
Default ReturnItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods def :: ReturnItemCollectionMetrics #
Read ReturnItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS ReturnItemCollectionMetrics # readList :: ReadS [ReturnItemCollectionMetrics] # readPrec :: ReadPrec ReturnItemCollectionMetrics # readListPrec :: ReadPrec [ReturnItemCollectionMetrics] #
Show ReturnItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> ReturnItemCollectionMetrics -> ShowS # show :: ReturnItemCollectionMetrics -> String # showList :: [ReturnItemCollectionMetrics] -> ShowS #
Eq ReturnItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool # (/=) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool #
Ord ReturnItemCollectionMetrics # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Ordering # (<) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool # (<=) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool # (>) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool # (>=) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool # max :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics # min :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics #

data UpdateReturn #

What to return from the current update operation

Constructors

URNone | Return nothing
URAllOld | Return old values
URUpdatedOld | Return old values with a newer replacement
URAllNew | Return new values
URUpdatedNew | Return new values that were replacements

#### Instances

Instances details

ToJSON UpdateReturn # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: UpdateReturn -> Value # toEncoding :: UpdateReturn -> Encoding # toJSONList :: [UpdateReturn] -> Value # toEncodingList :: [UpdateReturn] -> Encoding # omitField :: UpdateReturn -> Bool #
Default UpdateReturn # |
Instance details Defined in Aws.DynamoDb.Core Methods def :: UpdateReturn #
Read UpdateReturn # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS UpdateReturn # readList :: ReadS [UpdateReturn] # readPrec :: ReadPrec UpdateReturn # readListPrec :: ReadPrec [UpdateReturn] #
Show UpdateReturn # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> UpdateReturn -> ShowS # show :: UpdateReturn -> String # showList :: [UpdateReturn] -> ShowS #
Eq UpdateReturn # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: UpdateReturn -> UpdateReturn -> Bool # (/=) :: UpdateReturn -> UpdateReturn -> Bool #
Ord UpdateReturn # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: UpdateReturn -> UpdateReturn -> Ordering # (<) :: UpdateReturn -> UpdateReturn -> Bool # (<=) :: UpdateReturn -> UpdateReturn -> Bool # (>) :: UpdateReturn -> UpdateReturn -> Bool # (>=) :: UpdateReturn -> UpdateReturn -> Bool # max :: UpdateReturn -> UpdateReturn -> UpdateReturn # min :: UpdateReturn -> UpdateReturn -> UpdateReturn #

data QuerySelect #

What to return from a `Query` or `Scan` query.

Constructors

SelectSpecific [Text] | Only return selected attributes
SelectCount | Return counts instead of attributes
SelectProjected | Return index-projected attributes
SelectAll | Default. Return everything.

#### Instances

Instances details

Default QuerySelect # |
Instance details Defined in Aws.DynamoDb.Core Methods def :: QuerySelect #
Read QuerySelect # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS QuerySelect # readList :: ReadS [QuerySelect] # readPrec :: ReadPrec QuerySelect # readListPrec :: ReadPrec [QuerySelect] #
Show QuerySelect # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> QuerySelect -> ShowS # show :: QuerySelect -> String # showList :: [QuerySelect] -> ShowS #
Eq QuerySelect # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: QuerySelect -> QuerySelect -> Bool # (/=) :: QuerySelect -> QuerySelect -> Bool #
Ord QuerySelect # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: QuerySelect -> QuerySelect -> Ordering # (<) :: QuerySelect -> QuerySelect -> Bool # (<=) :: QuerySelect -> QuerySelect -> Bool # (>) :: QuerySelect -> QuerySelect -> Bool # (>=) :: QuerySelect -> QuerySelect -> Bool # max :: QuerySelect -> QuerySelect -> QuerySelect # min :: QuerySelect -> QuerySelect -> QuerySelect #

querySelectJson :: KeyValue Value t => QuerySelect -> [t] #

# Size estimation

class DynSize a where #

A class to help predict DynamoDb size of values, attributes and entire items. The result is given in number of bytes.

Methods

dynSize :: a -> Int #

#### Instances

Instances details

DynSize AttributeUpdate # |
Instance details Defined in Aws.DynamoDb.Commands.UpdateItem Methods dynSize :: AttributeUpdate -> Int #
DynSize Attribute # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Attribute -> Int #
DynSize DValue # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: DValue -> Int #
DynSize Item # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Item -> Int #
DynSize a => DynSize (Maybe a) # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Maybe a -> Int #
DynSize a => DynSize [a] # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: [a] -> Int #
(DynSize a, DynSize b) => DynSize (Either a b) # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Either a b -> Int #

nullAttr :: Attribute -> Bool #

Will an attribute be considered empty by DynamoDb?

A `PutItem` (or similar) with empty attributes will be rejected with a `ValidationException`.

# Responses & Errors

data DdbResponse #

Response metadata that is present in every DynamoDB response.

Constructors

DdbResponse |
Fields ddbrCrc :: Maybe Text ddbrMsgId :: Maybe Text

#### Instances

Instances details

Loggable DdbResponse # |
Instance details Defined in Aws.DynamoDb.Core Methods toLogText :: DdbResponse -> Text #
Monoid DdbResponse # |
Instance details Defined in Aws.DynamoDb.Core Methods mempty :: DdbResponse # mappend :: DdbResponse -> DdbResponse -> DdbResponse # mconcat :: [DdbResponse] -> DdbResponse #
Semigroup DdbResponse # |
Instance details Defined in Aws.DynamoDb.Core Methods (<>) :: DdbResponse -> DdbResponse -> DdbResponse # sconcat :: NonEmpty DdbResponse -> DdbResponse # stimes :: Integral b => b -> DdbResponse -> DdbResponse #

data DdbErrCode #

Errors defined by AWS.

Constructors

AccessDeniedException |
ConditionalCheckFailedException |
IncompleteSignatureException |
InvalidSignatureException |
LimitExceededException |
MissingAuthenticationTokenException |
ProvisionedThroughputExceededException |
ResourceInUseException |
ResourceNotFoundException |
ThrottlingException |
ValidationException |
RequestTooLarge |
InternalFailure |
InternalServerError |
ServiceUnavailableException |
SerializationException | Raised by AWS when the request JSON is missing fields or is somehow malformed.

#### Instances

Instances details

Read DdbErrCode # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DdbErrCode # readList :: ReadS [DdbErrCode] # readPrec :: ReadPrec DdbErrCode # readListPrec :: ReadPrec [DdbErrCode] #
Show DdbErrCode # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DdbErrCode -> ShowS # show :: DdbErrCode -> String # showList :: [DdbErrCode] -> ShowS #
Eq DdbErrCode # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DdbErrCode -> DdbErrCode -> Bool # (/=) :: DdbErrCode -> DdbErrCode -> Bool #

shouldRetry :: DdbErrCode -> Bool #

Whether the action should be retried based on the received error.

data DdbError #

Potential errors raised by DynamoDB

Constructors

DdbError |
Fields ddbStatusCode :: Int 200 if successful, 400 for client errors and 500 for server-side errors. ddbErrCode :: DdbErrCode ddbErrMsg :: Text

#### Instances

Instances details

Exception DdbError # |
Instance details Defined in Aws.DynamoDb.Core Methods toException :: DdbError -> SomeException # fromException :: SomeException -> Maybe DdbError # displayException :: DdbError -> String # backtraceDesired :: DdbError -> Bool #
Show DdbError # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DdbError -> ShowS # show :: DdbError -> String # showList :: [DdbError] -> ShowS #
Eq DdbError # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DdbError -> DdbError -> Bool # (/=) :: DdbError -> DdbError -> Bool #

# Internal Helpers

ddbSignQuery :: ToJSON a => ByteString -> a -> DdbConfiguration qt -> SignatureData -> SignedQuery #

data AmazonError #

Constructors

AmazonError |
Fields aeType :: Text aeMessage :: Maybe Text

#### Instances

Instances details

FromJSON AmazonError # |
Instance details Defined in Aws.DynamoDb.Core Methods parseJSON :: Value -> Parser AmazonError # parseJSONList :: Value -> Parser [AmazonError] # omittedField :: Maybe AmazonError #

ddbResponseConsumer :: FromJSON a => IORef DdbResponse -> HTTPResponseConsumer a #

ddbHttp :: Region -> DdbConfiguration NormalQuery #

ddbHttps :: Region -> DdbConfiguration NormalQuery #