{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.CloudTrail.Types.Product where
import Network.AWS.CloudTrail.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
data Event = Event'
{ _eUsername :: !(Maybe Text)
, _eResources :: !(Maybe [Resource])
, _eEventTime :: !(Maybe POSIX)
, _eCloudTrailEvent :: !(Maybe Text)
, _eEventName :: !(Maybe Text)
, _eEventId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
event
:: Event
event =
Event'
{ _eUsername = Nothing
, _eResources = Nothing
, _eEventTime = Nothing
, _eCloudTrailEvent = Nothing
, _eEventName = Nothing
, _eEventId = Nothing
}
eUsername :: Lens' Event (Maybe Text)
eUsername = lens _eUsername (\ s a -> s{_eUsername = a});
eResources :: Lens' Event [Resource]
eResources = lens _eResources (\ s a -> s{_eResources = a}) . _Default . _Coerce;
eEventTime :: Lens' Event (Maybe UTCTime)
eEventTime = lens _eEventTime (\ s a -> s{_eEventTime = a}) . mapping _Time;
eCloudTrailEvent :: Lens' Event (Maybe Text)
eCloudTrailEvent = lens _eCloudTrailEvent (\ s a -> s{_eCloudTrailEvent = a});
eEventName :: Lens' Event (Maybe Text)
eEventName = lens _eEventName (\ s a -> s{_eEventName = a});
eEventId :: Lens' Event (Maybe Text)
eEventId = lens _eEventId (\ s a -> s{_eEventId = a});
instance FromJSON Event where
parseJSON
= withObject "Event"
(\ x ->
Event' <$>
(x .:? "Username") <*> (x .:? "Resources" .!= mempty)
<*> (x .:? "EventTime")
<*> (x .:? "CloudTrailEvent")
<*> (x .:? "EventName")
<*> (x .:? "EventId"))
instance Hashable Event
instance NFData Event
data LookupAttribute = LookupAttribute'
{ _laAttributeKey :: !LookupAttributeKey
, _laAttributeValue :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
lookupAttribute
:: LookupAttributeKey
-> Text
-> LookupAttribute
lookupAttribute pAttributeKey_ pAttributeValue_ =
LookupAttribute'
{ _laAttributeKey = pAttributeKey_
, _laAttributeValue = pAttributeValue_
}
laAttributeKey :: Lens' LookupAttribute LookupAttributeKey
laAttributeKey = lens _laAttributeKey (\ s a -> s{_laAttributeKey = a});
laAttributeValue :: Lens' LookupAttribute Text
laAttributeValue = lens _laAttributeValue (\ s a -> s{_laAttributeValue = a});
instance Hashable LookupAttribute
instance NFData LookupAttribute
instance ToJSON LookupAttribute where
toJSON LookupAttribute'{..}
= object
(catMaybes
[Just ("AttributeKey" .= _laAttributeKey),
Just ("AttributeValue" .= _laAttributeValue)])
data PublicKey = PublicKey'
{ _pkFingerprint :: !(Maybe Text)
, _pkValidityEndTime :: !(Maybe POSIX)
, _pkValue :: !(Maybe Base64)
, _pkValidityStartTime :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
publicKey
:: PublicKey
publicKey =
PublicKey'
{ _pkFingerprint = Nothing
, _pkValidityEndTime = Nothing
, _pkValue = Nothing
, _pkValidityStartTime = Nothing
}
pkFingerprint :: Lens' PublicKey (Maybe Text)
pkFingerprint = lens _pkFingerprint (\ s a -> s{_pkFingerprint = a});
pkValidityEndTime :: Lens' PublicKey (Maybe UTCTime)
pkValidityEndTime = lens _pkValidityEndTime (\ s a -> s{_pkValidityEndTime = a}) . mapping _Time;
pkValue :: Lens' PublicKey (Maybe ByteString)
pkValue = lens _pkValue (\ s a -> s{_pkValue = a}) . mapping _Base64;
pkValidityStartTime :: Lens' PublicKey (Maybe UTCTime)
pkValidityStartTime = lens _pkValidityStartTime (\ s a -> s{_pkValidityStartTime = a}) . mapping _Time;
instance FromJSON PublicKey where
parseJSON
= withObject "PublicKey"
(\ x ->
PublicKey' <$>
(x .:? "Fingerprint") <*> (x .:? "ValidityEndTime")
<*> (x .:? "Value")
<*> (x .:? "ValidityStartTime"))
instance Hashable PublicKey
instance NFData PublicKey
data Resource = Resource'
{ _rResourceType :: !(Maybe Text)
, _rResourceName :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
resource
:: Resource
resource =
Resource'
{ _rResourceType = Nothing
, _rResourceName = Nothing
}
rResourceType :: Lens' Resource (Maybe Text)
rResourceType = lens _rResourceType (\ s a -> s{_rResourceType = a});
rResourceName :: Lens' Resource (Maybe Text)
rResourceName = lens _rResourceName (\ s a -> s{_rResourceName = a});
instance FromJSON Resource where
parseJSON
= withObject "Resource"
(\ x ->
Resource' <$>
(x .:? "ResourceType") <*> (x .:? "ResourceName"))
instance Hashable Resource
instance NFData Resource
data ResourceTag = ResourceTag'
{ _rResourceId :: !(Maybe Text)
, _rTagsList :: !(Maybe [Tag])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
resourceTag
:: ResourceTag
resourceTag =
ResourceTag'
{ _rResourceId = Nothing
, _rTagsList = Nothing
}
rResourceId :: Lens' ResourceTag (Maybe Text)
rResourceId = lens _rResourceId (\ s a -> s{_rResourceId = a});
rTagsList :: Lens' ResourceTag [Tag]
rTagsList = lens _rTagsList (\ s a -> s{_rTagsList = a}) . _Default . _Coerce;
instance FromJSON ResourceTag where
parseJSON
= withObject "ResourceTag"
(\ x ->
ResourceTag' <$>
(x .:? "ResourceId") <*>
(x .:? "TagsList" .!= mempty))
instance Hashable ResourceTag
instance NFData ResourceTag
data Tag = Tag'
{ _tagValue :: !(Maybe Text)
, _tagKey :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
tag
:: Text
-> Tag
tag pKey_ =
Tag'
{ _tagValue = Nothing
, _tagKey = pKey_
}
tagValue :: Lens' Tag (Maybe Text)
tagValue = lens _tagValue (\ s a -> s{_tagValue = a});
tagKey :: Lens' Tag Text
tagKey = lens _tagKey (\ s a -> s{_tagKey = a});
instance FromJSON Tag where
parseJSON
= withObject "Tag"
(\ x -> Tag' <$> (x .:? "Value") <*> (x .: "Key"))
instance Hashable Tag
instance NFData Tag
instance ToJSON Tag where
toJSON Tag'{..}
= object
(catMaybes
[("Value" .=) <$> _tagValue,
Just ("Key" .= _tagKey)])
data Trail = Trail'
{ _tLogFileValidationEnabled :: !(Maybe Bool)
, _tTrailARN :: !(Maybe Text)
, _tS3KeyPrefix :: !(Maybe Text)
, _tSNSTopicARN :: !(Maybe Text)
, _tSNSTopicName :: !(Maybe Text)
, _tCloudWatchLogsLogGroupARN :: !(Maybe Text)
, _tKMSKeyId :: !(Maybe Text)
, _tHomeRegion :: !(Maybe Text)
, _tName :: !(Maybe Text)
, _tIncludeGlobalServiceEvents :: !(Maybe Bool)
, _tCloudWatchLogsRoleARN :: !(Maybe Text)
, _tS3BucketName :: !(Maybe Text)
, _tIsMultiRegionTrail :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
trail
:: Trail
trail =
Trail'
{ _tLogFileValidationEnabled = Nothing
, _tTrailARN = Nothing
, _tS3KeyPrefix = Nothing
, _tSNSTopicARN = Nothing
, _tSNSTopicName = Nothing
, _tCloudWatchLogsLogGroupARN = Nothing
, _tKMSKeyId = Nothing
, _tHomeRegion = Nothing
, _tName = Nothing
, _tIncludeGlobalServiceEvents = Nothing
, _tCloudWatchLogsRoleARN = Nothing
, _tS3BucketName = Nothing
, _tIsMultiRegionTrail = Nothing
}
tLogFileValidationEnabled :: Lens' Trail (Maybe Bool)
tLogFileValidationEnabled = lens _tLogFileValidationEnabled (\ s a -> s{_tLogFileValidationEnabled = a});
tTrailARN :: Lens' Trail (Maybe Text)
tTrailARN = lens _tTrailARN (\ s a -> s{_tTrailARN = a});
tS3KeyPrefix :: Lens' Trail (Maybe Text)
tS3KeyPrefix = lens _tS3KeyPrefix (\ s a -> s{_tS3KeyPrefix = a});
tSNSTopicARN :: Lens' Trail (Maybe Text)
tSNSTopicARN = lens _tSNSTopicARN (\ s a -> s{_tSNSTopicARN = a});
tSNSTopicName :: Lens' Trail (Maybe Text)
tSNSTopicName = lens _tSNSTopicName (\ s a -> s{_tSNSTopicName = a});
tCloudWatchLogsLogGroupARN :: Lens' Trail (Maybe Text)
tCloudWatchLogsLogGroupARN = lens _tCloudWatchLogsLogGroupARN (\ s a -> s{_tCloudWatchLogsLogGroupARN = a});
tKMSKeyId :: Lens' Trail (Maybe Text)
tKMSKeyId = lens _tKMSKeyId (\ s a -> s{_tKMSKeyId = a});
tHomeRegion :: Lens' Trail (Maybe Text)
tHomeRegion = lens _tHomeRegion (\ s a -> s{_tHomeRegion = a});
tName :: Lens' Trail (Maybe Text)
tName = lens _tName (\ s a -> s{_tName = a});
tIncludeGlobalServiceEvents :: Lens' Trail (Maybe Bool)
tIncludeGlobalServiceEvents = lens _tIncludeGlobalServiceEvents (\ s a -> s{_tIncludeGlobalServiceEvents = a});
tCloudWatchLogsRoleARN :: Lens' Trail (Maybe Text)
tCloudWatchLogsRoleARN = lens _tCloudWatchLogsRoleARN (\ s a -> s{_tCloudWatchLogsRoleARN = a});
tS3BucketName :: Lens' Trail (Maybe Text)
tS3BucketName = lens _tS3BucketName (\ s a -> s{_tS3BucketName = a});
tIsMultiRegionTrail :: Lens' Trail (Maybe Bool)
tIsMultiRegionTrail = lens _tIsMultiRegionTrail (\ s a -> s{_tIsMultiRegionTrail = a});
instance FromJSON Trail where
parseJSON
= withObject "Trail"
(\ x ->
Trail' <$>
(x .:? "LogFileValidationEnabled") <*>
(x .:? "TrailARN")
<*> (x .:? "S3KeyPrefix")
<*> (x .:? "SnsTopicARN")
<*> (x .:? "SnsTopicName")
<*> (x .:? "CloudWatchLogsLogGroupArn")
<*> (x .:? "KmsKeyId")
<*> (x .:? "HomeRegion")
<*> (x .:? "Name")
<*> (x .:? "IncludeGlobalServiceEvents")
<*> (x .:? "CloudWatchLogsRoleArn")
<*> (x .:? "S3BucketName")
<*> (x .:? "IsMultiRegionTrail"))
instance Hashable Trail
instance NFData Trail