module Network.AWS.DynamoDBStreams.Types.Product where
import Network.AWS.DynamoDBStreams.Types.Sum
import Network.AWS.Prelude
data AttributeValue = AttributeValue'
{ _avL :: !(Maybe [AttributeValue])
, _avM :: !(Maybe (Map Text AttributeValue))
, _avNS :: !(Maybe [Text])
, _avNULL :: !(Maybe Bool)
, _avN :: !(Maybe Text)
, _avBS :: !(Maybe [Base64])
, _avB :: !(Maybe Base64)
, _avSS :: !(Maybe [Text])
, _avS :: !(Maybe Text)
, _avBOOL :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attributeValue
:: AttributeValue
attributeValue =
AttributeValue'
{ _avL = Nothing
, _avM = Nothing
, _avNS = Nothing
, _avNULL = Nothing
, _avN = Nothing
, _avBS = Nothing
, _avB = Nothing
, _avSS = Nothing
, _avS = Nothing
, _avBOOL = Nothing
}
avL :: Lens' AttributeValue [AttributeValue]
avL = lens _avL (\ s a -> s{_avL = a}) . _Default . _Coerce;
avM :: Lens' AttributeValue (HashMap Text AttributeValue)
avM = lens _avM (\ s a -> s{_avM = a}) . _Default . _Map;
avNS :: Lens' AttributeValue [Text]
avNS = lens _avNS (\ s a -> s{_avNS = a}) . _Default . _Coerce;
avNULL :: Lens' AttributeValue (Maybe Bool)
avNULL = lens _avNULL (\ s a -> s{_avNULL = a});
avN :: Lens' AttributeValue (Maybe Text)
avN = lens _avN (\ s a -> s{_avN = a});
avBS :: Lens' AttributeValue [ByteString]
avBS = lens _avBS (\ s a -> s{_avBS = a}) . _Default . _Coerce;
avB :: Lens' AttributeValue (Maybe ByteString)
avB = lens _avB (\ s a -> s{_avB = a}) . mapping _Base64;
avSS :: Lens' AttributeValue [Text]
avSS = lens _avSS (\ s a -> s{_avSS = a}) . _Default . _Coerce;
avS :: Lens' AttributeValue (Maybe Text)
avS = lens _avS (\ s a -> s{_avS = a});
avBOOL :: Lens' AttributeValue (Maybe Bool)
avBOOL = lens _avBOOL (\ s a -> s{_avBOOL = a});
instance FromJSON AttributeValue where
parseJSON
= withObject "AttributeValue"
(\ x ->
AttributeValue' <$>
(x .:? "L" .!= mempty) <*> (x .:? "M" .!= mempty) <*>
(x .:? "NS" .!= mempty)
<*> (x .:? "NULL")
<*> (x .:? "N")
<*> (x .:? "BS" .!= mempty)
<*> (x .:? "B")
<*> (x .:? "SS" .!= mempty)
<*> (x .:? "S")
<*> (x .:? "BOOL"))
data KeySchemaElement = KeySchemaElement'
{ _kseAttributeName :: !Text
, _kseKeyType :: !KeyType
} deriving (Eq,Read,Show,Data,Typeable,Generic)
keySchemaElement
:: Text
-> KeyType
-> KeySchemaElement
keySchemaElement pAttributeName_ pKeyType_ =
KeySchemaElement'
{ _kseAttributeName = pAttributeName_
, _kseKeyType = pKeyType_
}
kseAttributeName :: Lens' KeySchemaElement Text
kseAttributeName = lens _kseAttributeName (\ s a -> s{_kseAttributeName = a});
kseKeyType :: Lens' KeySchemaElement KeyType
kseKeyType = lens _kseKeyType (\ s a -> s{_kseKeyType = a});
instance FromJSON KeySchemaElement where
parseJSON
= withObject "KeySchemaElement"
(\ x ->
KeySchemaElement' <$>
(x .: "AttributeName") <*> (x .: "KeyType"))
data Record = Record'
{ _rEventVersion :: !(Maybe Text)
, _rDynamodb :: !(Maybe StreamRecord)
, _rAwsRegion :: !(Maybe Text)
, _rEventName :: !(Maybe OperationType)
, _rEventSource :: !(Maybe Text)
, _rEventId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
record
:: Record
record =
Record'
{ _rEventVersion = Nothing
, _rDynamodb = Nothing
, _rAwsRegion = Nothing
, _rEventName = Nothing
, _rEventSource = Nothing
, _rEventId = Nothing
}
rEventVersion :: Lens' Record (Maybe Text)
rEventVersion = lens _rEventVersion (\ s a -> s{_rEventVersion = a});
rDynamodb :: Lens' Record (Maybe StreamRecord)
rDynamodb = lens _rDynamodb (\ s a -> s{_rDynamodb = a});
rAwsRegion :: Lens' Record (Maybe Text)
rAwsRegion = lens _rAwsRegion (\ s a -> s{_rAwsRegion = a});
rEventName :: Lens' Record (Maybe OperationType)
rEventName = lens _rEventName (\ s a -> s{_rEventName = a});
rEventSource :: Lens' Record (Maybe Text)
rEventSource = lens _rEventSource (\ s a -> s{_rEventSource = a});
rEventId :: Lens' Record (Maybe Text)
rEventId = lens _rEventId (\ s a -> s{_rEventId = a});
instance FromJSON Record where
parseJSON
= withObject "Record"
(\ x ->
Record' <$>
(x .:? "eventVersion") <*> (x .:? "dynamodb") <*>
(x .:? "awsRegion")
<*> (x .:? "eventName")
<*> (x .:? "eventSource")
<*> (x .:? "eventID"))
data SequenceNumberRange = SequenceNumberRange'
{ _snrStartingSequenceNumber :: !(Maybe Text)
, _snrEndingSequenceNumber :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
sequenceNumberRange
:: SequenceNumberRange
sequenceNumberRange =
SequenceNumberRange'
{ _snrStartingSequenceNumber = Nothing
, _snrEndingSequenceNumber = Nothing
}
snrStartingSequenceNumber :: Lens' SequenceNumberRange (Maybe Text)
snrStartingSequenceNumber = lens _snrStartingSequenceNumber (\ s a -> s{_snrStartingSequenceNumber = a});
snrEndingSequenceNumber :: Lens' SequenceNumberRange (Maybe Text)
snrEndingSequenceNumber = lens _snrEndingSequenceNumber (\ s a -> s{_snrEndingSequenceNumber = a});
instance FromJSON SequenceNumberRange where
parseJSON
= withObject "SequenceNumberRange"
(\ x ->
SequenceNumberRange' <$>
(x .:? "StartingSequenceNumber") <*>
(x .:? "EndingSequenceNumber"))
data Shard = Shard'
{ _sParentShardId :: !(Maybe Text)
, _sSequenceNumberRange :: !(Maybe SequenceNumberRange)
, _sShardId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
shard
:: Shard
shard =
Shard'
{ _sParentShardId = Nothing
, _sSequenceNumberRange = Nothing
, _sShardId = Nothing
}
sParentShardId :: Lens' Shard (Maybe Text)
sParentShardId = lens _sParentShardId (\ s a -> s{_sParentShardId = a});
sSequenceNumberRange :: Lens' Shard (Maybe SequenceNumberRange)
sSequenceNumberRange = lens _sSequenceNumberRange (\ s a -> s{_sSequenceNumberRange = a});
sShardId :: Lens' Shard (Maybe Text)
sShardId = lens _sShardId (\ s a -> s{_sShardId = a});
instance FromJSON Shard where
parseJSON
= withObject "Shard"
(\ x ->
Shard' <$>
(x .:? "ParentShardId") <*>
(x .:? "SequenceNumberRange")
<*> (x .:? "ShardId"))
data Stream = Stream'
{ _sStreamLabel :: !(Maybe Text)
, _sStreamARN :: !(Maybe Text)
, _sTableName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
stream
:: Stream
stream =
Stream'
{ _sStreamLabel = Nothing
, _sStreamARN = Nothing
, _sTableName = Nothing
}
sStreamLabel :: Lens' Stream (Maybe Text)
sStreamLabel = lens _sStreamLabel (\ s a -> s{_sStreamLabel = a});
sStreamARN :: Lens' Stream (Maybe Text)
sStreamARN = lens _sStreamARN (\ s a -> s{_sStreamARN = a});
sTableName :: Lens' Stream (Maybe Text)
sTableName = lens _sTableName (\ s a -> s{_sTableName = a});
instance FromJSON Stream where
parseJSON
= withObject "Stream"
(\ x ->
Stream' <$>
(x .:? "StreamLabel") <*> (x .:? "StreamArn") <*>
(x .:? "TableName"))
data StreamDescription = StreamDescription'
{ _sdLastEvaluatedShardId :: !(Maybe Text)
, _sdStreamLabel :: !(Maybe Text)
, _sdStreamStatus :: !(Maybe StreamStatus)
, _sdKeySchema :: !(Maybe (List1 KeySchemaElement))
, _sdStreamARN :: !(Maybe Text)
, _sdStreamViewType :: !(Maybe StreamViewType)
, _sdShards :: !(Maybe [Shard])
, _sdTableName :: !(Maybe Text)
, _sdCreationRequestDateTime :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
streamDescription
:: StreamDescription
streamDescription =
StreamDescription'
{ _sdLastEvaluatedShardId = Nothing
, _sdStreamLabel = Nothing
, _sdStreamStatus = Nothing
, _sdKeySchema = Nothing
, _sdStreamARN = Nothing
, _sdStreamViewType = Nothing
, _sdShards = Nothing
, _sdTableName = Nothing
, _sdCreationRequestDateTime = Nothing
}
sdLastEvaluatedShardId :: Lens' StreamDescription (Maybe Text)
sdLastEvaluatedShardId = lens _sdLastEvaluatedShardId (\ s a -> s{_sdLastEvaluatedShardId = a});
sdStreamLabel :: Lens' StreamDescription (Maybe Text)
sdStreamLabel = lens _sdStreamLabel (\ s a -> s{_sdStreamLabel = a});
sdStreamStatus :: Lens' StreamDescription (Maybe StreamStatus)
sdStreamStatus = lens _sdStreamStatus (\ s a -> s{_sdStreamStatus = a});
sdKeySchema :: Lens' StreamDescription (Maybe (NonEmpty KeySchemaElement))
sdKeySchema = lens _sdKeySchema (\ s a -> s{_sdKeySchema = a}) . mapping _List1;
sdStreamARN :: Lens' StreamDescription (Maybe Text)
sdStreamARN = lens _sdStreamARN (\ s a -> s{_sdStreamARN = a});
sdStreamViewType :: Lens' StreamDescription (Maybe StreamViewType)
sdStreamViewType = lens _sdStreamViewType (\ s a -> s{_sdStreamViewType = a});
sdShards :: Lens' StreamDescription [Shard]
sdShards = lens _sdShards (\ s a -> s{_sdShards = a}) . _Default . _Coerce;
sdTableName :: Lens' StreamDescription (Maybe Text)
sdTableName = lens _sdTableName (\ s a -> s{_sdTableName = a});
sdCreationRequestDateTime :: Lens' StreamDescription (Maybe UTCTime)
sdCreationRequestDateTime = lens _sdCreationRequestDateTime (\ s a -> s{_sdCreationRequestDateTime = a}) . mapping _Time;
instance FromJSON StreamDescription where
parseJSON
= withObject "StreamDescription"
(\ x ->
StreamDescription' <$>
(x .:? "LastEvaluatedShardId") <*>
(x .:? "StreamLabel")
<*> (x .:? "StreamStatus")
<*> (x .:? "KeySchema")
<*> (x .:? "StreamArn")
<*> (x .:? "StreamViewType")
<*> (x .:? "Shards" .!= mempty)
<*> (x .:? "TableName")
<*> (x .:? "CreationRequestDateTime"))
data StreamRecord = StreamRecord'
{ _srSequenceNumber :: !(Maybe Text)
, _srSizeBytes :: !(Maybe Nat)
, _srStreamViewType :: !(Maybe StreamViewType)
, _srKeys :: !(Maybe (Map Text AttributeValue))
, _srOldImage :: !(Maybe (Map Text AttributeValue))
, _srNewImage :: !(Maybe (Map Text AttributeValue))
} deriving (Eq,Read,Show,Data,Typeable,Generic)
streamRecord
:: StreamRecord
streamRecord =
StreamRecord'
{ _srSequenceNumber = Nothing
, _srSizeBytes = Nothing
, _srStreamViewType = Nothing
, _srKeys = Nothing
, _srOldImage = Nothing
, _srNewImage = Nothing
}
srSequenceNumber :: Lens' StreamRecord (Maybe Text)
srSequenceNumber = lens _srSequenceNumber (\ s a -> s{_srSequenceNumber = a});
srSizeBytes :: Lens' StreamRecord (Maybe Natural)
srSizeBytes = lens _srSizeBytes (\ s a -> s{_srSizeBytes = a}) . mapping _Nat;
srStreamViewType :: Lens' StreamRecord (Maybe StreamViewType)
srStreamViewType = lens _srStreamViewType (\ s a -> s{_srStreamViewType = a});
srKeys :: Lens' StreamRecord (HashMap Text AttributeValue)
srKeys = lens _srKeys (\ s a -> s{_srKeys = a}) . _Default . _Map;
srOldImage :: Lens' StreamRecord (HashMap Text AttributeValue)
srOldImage = lens _srOldImage (\ s a -> s{_srOldImage = a}) . _Default . _Map;
srNewImage :: Lens' StreamRecord (HashMap Text AttributeValue)
srNewImage = lens _srNewImage (\ s a -> s{_srNewImage = a}) . _Default . _Map;
instance FromJSON StreamRecord where
parseJSON
= withObject "StreamRecord"
(\ x ->
StreamRecord' <$>
(x .:? "SequenceNumber") <*> (x .:? "SizeBytes") <*>
(x .:? "StreamViewType")
<*> (x .:? "Keys" .!= mempty)
<*> (x .:? "OldImage" .!= mempty)
<*> (x .:? "NewImage" .!= mempty))