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 Source #

Constructors

Region |

Fields

- rUri :: ByteString
- rName :: ByteString

#### Instances

Instances details

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

ddbLocal :: Region Source #

DynamoDb local connection (for development)

ddbUsEast1 :: Region Source #

ddbUsWest1 :: Region Source #

ddbUsWest2 :: Region Source #

ddbEuWest1 :: Region Source #

ddbEuWest2 :: Region Source #

ddbEuCentral1 :: Region Source #

ddbApNe1 :: Region Source #

ddbApSe1 :: Region Source #

ddbApSe2 :: Region Source #

ddbSaEast1 :: Region Source #

data DdbConfiguration qt Source #

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

# DynamoDB values

data DValue Source #

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 Source # |
Instance details Defined in Aws.DynamoDb.Core Methods parseJSON :: Value -> Parser DValue Source # parseJSONList :: Value -> Parser [DValue] Source # omittedField :: Maybe DValue Source #
ToJSON DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods toJSON :: DValue -> Value Source # toEncoding :: DValue -> Encoding Source # toJSONList :: [DValue] -> Value Source # toEncodingList :: [DValue] -> Encoding Source # omitField :: DValue -> Bool Source #
DynData DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods fromData :: DValue -> DValue Source # toData :: DValue -> Maybe DValue Source #
DynSize DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: DValue -> Int Source #
DynSize Item Source # |
Instance details Defined in Aws.DynamoDb.Core Methods dynSize :: Item -> Int Source #
DynVal DValue Source # |

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 Source #

fromRep :: DynRep DValue -> Maybe DValue Source #

FromDynItem Item Source # |
Instance details Defined in Aws.DynamoDb.Core Methods parseItem :: Item -> Parser Item Source #
ToDynItem Item Source # |
Instance details Defined in Aws.DynamoDb.Core Methods toItem :: Item -> Item Source #
IsString DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods fromString :: String -> DValue Source #
Read DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS DValue Source # readList :: ReadS [DValue] Source # readPrec :: ReadPrec DValue Source # readListPrec :: ReadPrec [DValue] Source #
Show DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> DValue -> ShowS Source # show :: DValue -> String Source # showList :: [DValue] -> ShowS Source #
Eq DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: DValue -> DValue -> Bool Source # (/=) :: DValue -> DValue -> Bool Source #
Ord DValue Source # |
Instance details Defined in Aws.DynamoDb.Core Methods compare :: DValue -> DValue -> Ordering Source # (<) :: DValue -> DValue -> Bool Source # (<=) :: DValue -> DValue -> Bool Source # (>) :: DValue -> DValue -> Bool Source # (>=) :: DValue -> DValue -> Bool Source # max :: DValue -> DValue -> DValue Source # min :: DValue -> DValue -> DValue Source #
ListResponse QueryResponse Item Source # |
Instance details Defined in Aws.DynamoDb.Commands.Query Methods listResponse :: QueryResponse -> [Item] Source #
ListResponse ScanResponse Item Source # |
Instance details Defined in Aws.DynamoDb.Commands.Scan Methods listResponse :: ScanResponse -> [Item] Source #
type DynRep DValue Source # |
Instance details Defined in Aws.DynamoDb.Core type DynRep DValue = DValue

# Converting to/from `DValue`

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

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 Source #

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

Methods

toRep :: a -> DynRep a Source #

Convert to representation

fromRep :: DynRep a -> Maybe a Source #

Convert from representation

#### Instances

Instances details

DynVal DValue Source # |

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 Source #

fromRep :: DynRep DValue -> Maybe DValue Source #

DynVal OldBool Source # |

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 Source #

fromRep :: DynRep OldBool -> Maybe OldBool Source #

DynVal ByteString Source # |

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 Source #

fromRep :: DynRep ByteString -> Maybe ByteString Source #

DynVal Int16 Source # |

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 Source #

fromRep :: DynRep Int16 -> Maybe Int16 Source #

DynVal Int32 Source # |

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 Source #

fromRep :: DynRep Int32 -> Maybe Int32 Source #

DynVal Int64 Source # |

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 Source #

fromRep :: DynRep Int64 -> Maybe Int64 Source #

DynVal Int8 Source # |

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 Source #

fromRep :: DynRep Int8 -> Maybe Int8 Source #

DynVal Word16 Source # |

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 Source #

fromRep :: DynRep Word16 -> Maybe Word16 Source #

DynVal Word32 Source # |

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 Source #

fromRep :: DynRep Word32 -> Maybe Word32 Source #

DynVal Word64 Source # |

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 Source #

fromRep :: DynRep Word64 -> Maybe Word64 Source #

DynVal Word8 Source # |

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 Source #

fromRep :: DynRep Word8 -> Maybe Word8 Source #

DynVal Text Source # |

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 Source #

fromRep :: DynRep Text -> Maybe Text Source #

DynVal Day Source # | 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 Source #

fromRep :: DynRep Day -> Maybe Day Source #

DynVal UTCTime Source # | 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 Source #

fromRep :: DynRep UTCTime -> Maybe UTCTime Source #

DynVal Integer Source # |

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 Source #

fromRep :: DynRep Integer -> Maybe Integer Source #

DynVal Bool Source # |

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 Source #

fromRep :: DynRep Bool -> Maybe Bool Source #

DynVal Double Source # |

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 Source #

fromRep :: DynRep Double -> Maybe Double Source #

DynVal Int Source # |

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 Source #

fromRep :: DynRep Int -> Maybe Int Source #

Serialize a => DynVal (Bin a) Source # |

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) Source #

fromRep :: DynRep (Bin a) -> Maybe (Bin a) Source #

(DynData (DynRep (Set a)), DynVal a, Ord a) => DynVal (Set a) Source # | 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) Source #

fromRep :: DynRep (Set a) -> Maybe (Set a) Source #

(DynData (DynRep [a]), DynVal a) => DynVal [a] Source # | 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] Source #

fromRep :: DynRep [a] -> Maybe [a] Source #

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

Encode a Haskell value.

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

Decode a Haskell value.

newtype Bin a Source #

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) Source # |

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) Source #

fromRep :: DynRep (Bin a) -> Maybe (Bin a) Source #

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

newtype OldBool Source #

Constructors

OldBool Bool |

#### Instances

Instances details

DynVal OldBool Source # |

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 Source #

fromRep :: DynRep OldBool -> Maybe OldBool Source #

type DynRep OldBool Source # |
Instance details Defined in Aws.DynamoDb.Core type DynRep OldBool = DynNumber

# Defining new `DynVal` instances

class Ord a => DynData a where Source #

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 Source #

toData :: DValue -> Maybe a Source #

#### Instances

Instances details

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

newtype DynBinary Source #

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

Constructors

DynBinary |

Fields

- unDynBinary :: ByteString

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: DynBinary -> DynBinary -> Ordering Source #

(<) :: DynBinary -> DynBinary -> Bool Source #

(<=) :: DynBinary -> DynBinary -> Bool Source #

(>) :: DynBinary -> DynBinary -> Bool Source #

(>=) :: DynBinary -> DynBinary -> Bool Source #

max :: DynBinary -> DynBinary -> DynBinary Source #

min :: DynBinary -> DynBinary -> DynBinary Source #

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

newtype DynNumber Source #

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

Constructors

DynNumber |

Fields

- unDynNumber :: Scientific

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: DynNumber -> DynNumber -> Ordering Source #

(<) :: DynNumber -> DynNumber -> Bool Source #

(<=) :: DynNumber -> DynNumber -> Bool Source #

(>) :: DynNumber -> DynNumber -> Bool Source #

(>=) :: DynNumber -> DynNumber -> Bool Source #

max :: DynNumber -> DynNumber -> DynNumber Source #

min :: DynNumber -> DynNumber -> DynNumber Source #

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

newtype DynString Source #

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

Constructors

DynString |

Fields

- unDynString :: Text

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: DynString -> DynString -> Ordering Source #

(<) :: DynString -> DynString -> Bool Source #

(<=) :: DynString -> DynString -> Bool Source #

(>) :: DynString -> DynString -> Bool Source #

(>=) :: DynString -> DynString -> Bool Source #

max :: DynString -> DynString -> DynString Source #

min :: DynString -> DynString -> DynString Source #

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

newtype DynBool Source #

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

Constructors

DynBool |

Fields

- unDynBool :: Bool

#### Instances

Instances details

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

# Working with key/value pairs

data Attribute Source #

A key-value pair

Constructors

Attribute |

Fields

- attrName :: Text
- attrVal :: DValue

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: Attribute -> Attribute -> Ordering Source #

(<) :: Attribute -> Attribute -> Bool Source #

(<=) :: Attribute -> Attribute -> Bool Source #

(>) :: Attribute -> Attribute -> Bool Source #

(>=) :: Attribute -> Attribute -> Bool Source #

max :: Attribute -> Attribute -> Attribute Source #

min :: Attribute -> Attribute -> Attribute Source #

parseAttributeJson :: Value -> Parser [Attribute] Source #

Parse a JSON object that contains attributes

attributeJson :: Attribute -> Pair Source #

Convert into JSON pair

attributesJson :: [Attribute] -> Value Source #

Convert into JSON object for AWS.

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

Convert attribute to a tuple representation

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

Convenience function for constructing key-value pairs

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

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

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

text :: Proxy Text Source #

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

int :: Proxy Integer Source #

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

double :: Proxy Double Source #

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

data PrimaryKey Source #

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: PrimaryKey -> PrimaryKey -> Ordering Source #

(<) :: PrimaryKey -> PrimaryKey -> Bool Source #

(<=) :: PrimaryKey -> PrimaryKey -> Bool Source #

(>) :: PrimaryKey -> PrimaryKey -> Bool Source #

(>=) :: PrimaryKey -> PrimaryKey -> Bool Source #

max :: PrimaryKey -> PrimaryKey -> PrimaryKey Source #

min :: PrimaryKey -> PrimaryKey -> PrimaryKey Source #

hk :: Text -> DValue -> PrimaryKey Source #

Construct a hash-only primary key.

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

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

hrk Source #

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 Source #

A DynamoDb object is simply a key-value dictionary.

item :: [Attribute] -> Item Source #

Pack a list of attributes into an Item.

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

Unpack an `Item` into a list of attributes.

class ToDynItem a where Source #

Types convertible to DynamoDb `Item` collections.

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

Methods

toItem :: a -> Item Source #

#### Instances

Instances details

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

class FromDynItem a where Source #

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 Source #

#### Instances

Instances details

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

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

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

newtype Parser a Source #

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

getAttr Source #

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' Source #

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 Source #

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 Source #

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: Conditions -> Conditions -> Ordering Source #

(<) :: Conditions -> Conditions -> Bool Source #

(<=) :: Conditions -> Conditions -> Bool Source #

(>) :: Conditions -> Conditions -> Bool Source #

(>=) :: Conditions -> Conditions -> Bool Source #

max :: Conditions -> Conditions -> Conditions Source #

min :: Conditions -> Conditions -> Conditions Source #

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

JSON encoding of conditions parameter in various contexts.

expectsJson :: Conditions -> [Pair] Source #

data Condition Source #

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 Source # |
Instance details Defined in Aws.DynamoDb.Core Methods readsPrec :: Int -> ReadS Condition Source # readList :: ReadS [Condition] Source # readPrec :: ReadPrec Condition Source # readListPrec :: ReadPrec [Condition] Source #
Show Condition Source # |
Instance details Defined in Aws.DynamoDb.Core Methods showsPrec :: Int -> Condition -> ShowS Source # show :: Condition -> String Source # showList :: [Condition] -> ShowS Source #
Eq Condition Source # |
Instance details Defined in Aws.DynamoDb.Core Methods (==) :: Condition -> Condition -> Bool Source # (/=) :: Condition -> Condition -> Bool Source #
Ord Condition Source # |

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: Condition -> Condition -> Ordering Source #

(<) :: Condition -> Condition -> Bool Source #

(<=) :: Condition -> Condition -> Bool Source #

(>) :: Condition -> Condition -> Bool Source #

(>=) :: Condition -> Condition -> Bool Source #

max :: Condition -> Condition -> Condition Source #

min :: Condition -> Condition -> Condition Source #

conditionJson :: Condition -> Pair Source #

data CondOp Source #

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

data CondMerge Source #

How to merge multiple conditions.

Constructors

CondAnd |
CondOr |

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: CondMerge -> CondMerge -> Ordering Source #

(<) :: CondMerge -> CondMerge -> Bool Source #

(<=) :: CondMerge -> CondMerge -> Bool Source #

(>) :: CondMerge -> CondMerge -> Bool Source #

(>=) :: CondMerge -> CondMerge -> Bool Source #

max :: CondMerge -> CondMerge -> CondMerge Source #

min :: CondMerge -> CondMerge -> CondMerge Source #

data ConsumedCapacity Source #

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: ConsumedCapacity -> ConsumedCapacity -> Ordering Source #

(<) :: ConsumedCapacity -> ConsumedCapacity -> Bool Source #

(<=) :: ConsumedCapacity -> ConsumedCapacity -> Bool Source #

(>) :: ConsumedCapacity -> ConsumedCapacity -> Bool Source #

(>=) :: ConsumedCapacity -> ConsumedCapacity -> Bool Source #

max :: ConsumedCapacity -> ConsumedCapacity -> ConsumedCapacity Source #

min :: ConsumedCapacity -> ConsumedCapacity -> ConsumedCapacity Source #

data ReturnConsumption Source #

Constructors

RCIndexes |
RCTotal |
RCNone |

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: ReturnConsumption -> ReturnConsumption -> Ordering Source #

(<) :: ReturnConsumption -> ReturnConsumption -> Bool Source #

(<=) :: ReturnConsumption -> ReturnConsumption -> Bool Source #

(>) :: ReturnConsumption -> ReturnConsumption -> Bool Source #

(>=) :: ReturnConsumption -> ReturnConsumption -> Bool Source #

max :: ReturnConsumption -> ReturnConsumption -> ReturnConsumption Source #

min :: ReturnConsumption -> ReturnConsumption -> ReturnConsumption Source #

data ItemCollectionMetrics Source #

Constructors

ItemCollectionMetrics |

Fields

- icmKey :: (Text, DValue)
- icmEstimate :: [Double]

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: ItemCollectionMetrics -> ItemCollectionMetrics -> Ordering Source #

(<) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool Source #

(<=) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool Source #

(>) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool Source #

(>=) :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool Source #

max :: ItemCollectionMetrics -> ItemCollectionMetrics -> ItemCollectionMetrics Source #

min :: ItemCollectionMetrics -> ItemCollectionMetrics -> ItemCollectionMetrics Source #

data ReturnItemCollectionMetrics Source #

Constructors

RICMSize |
RICMNone |

#### Instances

Instances details

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Ordering Source #

(<) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool Source #

(<=) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool Source #

(>) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool Source #

(>=) :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> Bool Source #

max :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics Source #

min :: ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics -> ReturnItemCollectionMetrics Source #

data UpdateReturn Source #

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: UpdateReturn -> UpdateReturn -> Ordering Source #

(<) :: UpdateReturn -> UpdateReturn -> Bool Source #

(<=) :: UpdateReturn -> UpdateReturn -> Bool Source #

(>) :: UpdateReturn -> UpdateReturn -> Bool Source #

(>=) :: UpdateReturn -> UpdateReturn -> Bool Source #

max :: UpdateReturn -> UpdateReturn -> UpdateReturn Source #

min :: UpdateReturn -> UpdateReturn -> UpdateReturn Source #

data QuerySelect Source #

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

Instance details

Defined in Aws.DynamoDb.Core

Methods

compare :: QuerySelect -> QuerySelect -> Ordering Source #

(<) :: QuerySelect -> QuerySelect -> Bool Source #

(<=) :: QuerySelect -> QuerySelect -> Bool Source #

(>) :: QuerySelect -> QuerySelect -> Bool Source #

(>=) :: QuerySelect -> QuerySelect -> Bool Source #

max :: QuerySelect -> QuerySelect -> QuerySelect Source #

min :: QuerySelect -> QuerySelect -> QuerySelect Source #

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

# Size estimation

class DynSize a where Source #

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 Source #

#### Instances

Instances details

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

nullAttr :: Attribute -> Bool Source #

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 Source #

Response metadata that is present in every DynamoDB response.

Constructors

DdbResponse |

Fields

- ddbrCrc :: Maybe Text
- ddbrMsgId :: Maybe Text

#### Instances

Instances details

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

data DdbErrCode Source #

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

shouldRetry :: DdbErrCode -> Bool Source #

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

data DdbError Source #

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

# Internal Helpers

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

data AmazonError Source #

Constructors

AmazonError |

Fields

- aeType :: Text
- aeMessage :: Maybe Text

#### Instances

Instances details

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

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

ddbHttp :: Region -> DdbConfiguration NormalQuery Source #

ddbHttps :: Region -> DdbConfiguration NormalQuery Source #