{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.Inspector.Types.Product where
import Network.AWS.Inspector.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
data AgentFilter = AgentFilter'
{ _afAgentHealths :: ![AgentHealth]
, _afAgentHealthCodes :: ![AgentHealthCode]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
agentFilter
:: AgentFilter
agentFilter =
AgentFilter'
{ _afAgentHealths = mempty
, _afAgentHealthCodes = mempty
}
afAgentHealths :: Lens' AgentFilter [AgentHealth]
afAgentHealths = lens _afAgentHealths (\ s a -> s{_afAgentHealths = a}) . _Coerce;
afAgentHealthCodes :: Lens' AgentFilter [AgentHealthCode]
afAgentHealthCodes = lens _afAgentHealthCodes (\ s a -> s{_afAgentHealthCodes = a}) . _Coerce;
instance Hashable AgentFilter
instance NFData AgentFilter
instance ToJSON AgentFilter where
toJSON AgentFilter'{..}
= object
(catMaybes
[Just ("agentHealths" .= _afAgentHealths),
Just ("agentHealthCodes" .= _afAgentHealthCodes)])
data AgentPreview = AgentPreview'
{ _apAutoScalingGroup :: !(Maybe Text)
, _apAgentId :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
agentPreview
:: Text
-> AgentPreview
agentPreview pAgentId_ =
AgentPreview'
{ _apAutoScalingGroup = Nothing
, _apAgentId = pAgentId_
}
apAutoScalingGroup :: Lens' AgentPreview (Maybe Text)
apAutoScalingGroup = lens _apAutoScalingGroup (\ s a -> s{_apAutoScalingGroup = a});
apAgentId :: Lens' AgentPreview Text
apAgentId = lens _apAgentId (\ s a -> s{_apAgentId = a});
instance FromJSON AgentPreview where
parseJSON
= withObject "AgentPreview"
(\ x ->
AgentPreview' <$>
(x .:? "autoScalingGroup") <*> (x .: "agentId"))
instance Hashable AgentPreview
instance NFData AgentPreview
data AssessmentRun = AssessmentRun'
{ _arStartedAt :: !(Maybe POSIX)
, _arCompletedAt :: !(Maybe POSIX)
, _arArn :: !Text
, _arName :: !Text
, _arAssessmentTemplateARN :: !Text
, _arState :: !AssessmentRunState
, _arDurationInSeconds :: !Nat
, _arRulesPackageARNs :: !(List1 Text)
, _arUserAttributesForFindings :: ![Attribute]
, _arCreatedAt :: !POSIX
, _arStateChangedAt :: !POSIX
, _arDataCollected :: !Bool
, _arStateChanges :: ![AssessmentRunStateChange]
, _arNotifications :: ![AssessmentRunNotification]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentRun
:: Text
-> Text
-> Text
-> AssessmentRunState
-> Natural
-> NonEmpty Text
-> UTCTime
-> UTCTime
-> Bool
-> AssessmentRun
assessmentRun pArn_ pName_ pAssessmentTemplateARN_ pState_ pDurationInSeconds_ pRulesPackageARNs_ pCreatedAt_ pStateChangedAt_ pDataCollected_ =
AssessmentRun'
{ _arStartedAt = Nothing
, _arCompletedAt = Nothing
, _arArn = pArn_
, _arName = pName_
, _arAssessmentTemplateARN = pAssessmentTemplateARN_
, _arState = pState_
, _arDurationInSeconds = _Nat # pDurationInSeconds_
, _arRulesPackageARNs = _List1 # pRulesPackageARNs_
, _arUserAttributesForFindings = mempty
, _arCreatedAt = _Time # pCreatedAt_
, _arStateChangedAt = _Time # pStateChangedAt_
, _arDataCollected = pDataCollected_
, _arStateChanges = mempty
, _arNotifications = mempty
}
arStartedAt :: Lens' AssessmentRun (Maybe UTCTime)
arStartedAt = lens _arStartedAt (\ s a -> s{_arStartedAt = a}) . mapping _Time;
arCompletedAt :: Lens' AssessmentRun (Maybe UTCTime)
arCompletedAt = lens _arCompletedAt (\ s a -> s{_arCompletedAt = a}) . mapping _Time;
arArn :: Lens' AssessmentRun Text
arArn = lens _arArn (\ s a -> s{_arArn = a});
arName :: Lens' AssessmentRun Text
arName = lens _arName (\ s a -> s{_arName = a});
arAssessmentTemplateARN :: Lens' AssessmentRun Text
arAssessmentTemplateARN = lens _arAssessmentTemplateARN (\ s a -> s{_arAssessmentTemplateARN = a});
arState :: Lens' AssessmentRun AssessmentRunState
arState = lens _arState (\ s a -> s{_arState = a});
arDurationInSeconds :: Lens' AssessmentRun Natural
arDurationInSeconds = lens _arDurationInSeconds (\ s a -> s{_arDurationInSeconds = a}) . _Nat;
arRulesPackageARNs :: Lens' AssessmentRun (NonEmpty Text)
arRulesPackageARNs = lens _arRulesPackageARNs (\ s a -> s{_arRulesPackageARNs = a}) . _List1;
arUserAttributesForFindings :: Lens' AssessmentRun [Attribute]
arUserAttributesForFindings = lens _arUserAttributesForFindings (\ s a -> s{_arUserAttributesForFindings = a}) . _Coerce;
arCreatedAt :: Lens' AssessmentRun UTCTime
arCreatedAt = lens _arCreatedAt (\ s a -> s{_arCreatedAt = a}) . _Time;
arStateChangedAt :: Lens' AssessmentRun UTCTime
arStateChangedAt = lens _arStateChangedAt (\ s a -> s{_arStateChangedAt = a}) . _Time;
arDataCollected :: Lens' AssessmentRun Bool
arDataCollected = lens _arDataCollected (\ s a -> s{_arDataCollected = a});
arStateChanges :: Lens' AssessmentRun [AssessmentRunStateChange]
arStateChanges = lens _arStateChanges (\ s a -> s{_arStateChanges = a}) . _Coerce;
arNotifications :: Lens' AssessmentRun [AssessmentRunNotification]
arNotifications = lens _arNotifications (\ s a -> s{_arNotifications = a}) . _Coerce;
instance FromJSON AssessmentRun where
parseJSON
= withObject "AssessmentRun"
(\ x ->
AssessmentRun' <$>
(x .:? "startedAt") <*> (x .:? "completedAt") <*>
(x .: "arn")
<*> (x .: "name")
<*> (x .: "assessmentTemplateArn")
<*> (x .: "state")
<*> (x .: "durationInSeconds")
<*> (x .: "rulesPackageArns")
<*> (x .:? "userAttributesForFindings" .!= mempty)
<*> (x .: "createdAt")
<*> (x .: "stateChangedAt")
<*> (x .: "dataCollected")
<*> (x .:? "stateChanges" .!= mempty)
<*> (x .:? "notifications" .!= mempty))
instance Hashable AssessmentRun
instance NFData AssessmentRun
data AssessmentRunAgent = AssessmentRunAgent'
{ _araAutoScalingGroup :: !(Maybe Text)
, _araAgentHealthDetails :: !(Maybe Text)
, _araAgentId :: !Text
, _araAssessmentRunARN :: !Text
, _araAgentHealth :: !AgentHealth
, _araAgentHealthCode :: !AgentHealthCode
, _araTelemetryMetadata :: ![TelemetryMetadata]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentRunAgent
:: Text
-> Text
-> AgentHealth
-> AgentHealthCode
-> AssessmentRunAgent
assessmentRunAgent pAgentId_ pAssessmentRunARN_ pAgentHealth_ pAgentHealthCode_ =
AssessmentRunAgent'
{ _araAutoScalingGroup = Nothing
, _araAgentHealthDetails = Nothing
, _araAgentId = pAgentId_
, _araAssessmentRunARN = pAssessmentRunARN_
, _araAgentHealth = pAgentHealth_
, _araAgentHealthCode = pAgentHealthCode_
, _araTelemetryMetadata = mempty
}
araAutoScalingGroup :: Lens' AssessmentRunAgent (Maybe Text)
araAutoScalingGroup = lens _araAutoScalingGroup (\ s a -> s{_araAutoScalingGroup = a});
araAgentHealthDetails :: Lens' AssessmentRunAgent (Maybe Text)
araAgentHealthDetails = lens _araAgentHealthDetails (\ s a -> s{_araAgentHealthDetails = a});
araAgentId :: Lens' AssessmentRunAgent Text
araAgentId = lens _araAgentId (\ s a -> s{_araAgentId = a});
araAssessmentRunARN :: Lens' AssessmentRunAgent Text
araAssessmentRunARN = lens _araAssessmentRunARN (\ s a -> s{_araAssessmentRunARN = a});
araAgentHealth :: Lens' AssessmentRunAgent AgentHealth
araAgentHealth = lens _araAgentHealth (\ s a -> s{_araAgentHealth = a});
araAgentHealthCode :: Lens' AssessmentRunAgent AgentHealthCode
araAgentHealthCode = lens _araAgentHealthCode (\ s a -> s{_araAgentHealthCode = a});
araTelemetryMetadata :: Lens' AssessmentRunAgent [TelemetryMetadata]
araTelemetryMetadata = lens _araTelemetryMetadata (\ s a -> s{_araTelemetryMetadata = a}) . _Coerce;
instance FromJSON AssessmentRunAgent where
parseJSON
= withObject "AssessmentRunAgent"
(\ x ->
AssessmentRunAgent' <$>
(x .:? "autoScalingGroup") <*>
(x .:? "agentHealthDetails")
<*> (x .: "agentId")
<*> (x .: "assessmentRunArn")
<*> (x .: "agentHealth")
<*> (x .: "agentHealthCode")
<*> (x .:? "telemetryMetadata" .!= mempty))
instance Hashable AssessmentRunAgent
instance NFData AssessmentRunAgent
data AssessmentRunFilter = AssessmentRunFilter'
{ _arfStates :: !(Maybe [AssessmentRunState])
, _arfNamePattern :: !(Maybe Text)
, _arfStartTimeRange :: !(Maybe TimestampRange)
, _arfStateChangeTimeRange :: !(Maybe TimestampRange)
, _arfRulesPackageARNs :: !(Maybe [Text])
, _arfCompletionTimeRange :: !(Maybe TimestampRange)
, _arfDurationRange :: !(Maybe DurationRange)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentRunFilter
:: AssessmentRunFilter
assessmentRunFilter =
AssessmentRunFilter'
{ _arfStates = Nothing
, _arfNamePattern = Nothing
, _arfStartTimeRange = Nothing
, _arfStateChangeTimeRange = Nothing
, _arfRulesPackageARNs = Nothing
, _arfCompletionTimeRange = Nothing
, _arfDurationRange = Nothing
}
arfStates :: Lens' AssessmentRunFilter [AssessmentRunState]
arfStates = lens _arfStates (\ s a -> s{_arfStates = a}) . _Default . _Coerce;
arfNamePattern :: Lens' AssessmentRunFilter (Maybe Text)
arfNamePattern = lens _arfNamePattern (\ s a -> s{_arfNamePattern = a});
arfStartTimeRange :: Lens' AssessmentRunFilter (Maybe TimestampRange)
arfStartTimeRange = lens _arfStartTimeRange (\ s a -> s{_arfStartTimeRange = a});
arfStateChangeTimeRange :: Lens' AssessmentRunFilter (Maybe TimestampRange)
arfStateChangeTimeRange = lens _arfStateChangeTimeRange (\ s a -> s{_arfStateChangeTimeRange = a});
arfRulesPackageARNs :: Lens' AssessmentRunFilter [Text]
arfRulesPackageARNs = lens _arfRulesPackageARNs (\ s a -> s{_arfRulesPackageARNs = a}) . _Default . _Coerce;
arfCompletionTimeRange :: Lens' AssessmentRunFilter (Maybe TimestampRange)
arfCompletionTimeRange = lens _arfCompletionTimeRange (\ s a -> s{_arfCompletionTimeRange = a});
arfDurationRange :: Lens' AssessmentRunFilter (Maybe DurationRange)
arfDurationRange = lens _arfDurationRange (\ s a -> s{_arfDurationRange = a});
instance Hashable AssessmentRunFilter
instance NFData AssessmentRunFilter
instance ToJSON AssessmentRunFilter where
toJSON AssessmentRunFilter'{..}
= object
(catMaybes
[("states" .=) <$> _arfStates,
("namePattern" .=) <$> _arfNamePattern,
("startTimeRange" .=) <$> _arfStartTimeRange,
("stateChangeTimeRange" .=) <$>
_arfStateChangeTimeRange,
("rulesPackageArns" .=) <$> _arfRulesPackageARNs,
("completionTimeRange" .=) <$>
_arfCompletionTimeRange,
("durationRange" .=) <$> _arfDurationRange])
data AssessmentRunNotification = AssessmentRunNotification'
{ _arnSnsTopicARN :: !(Maybe Text)
, _arnSnsPublishStatusCode :: !(Maybe AssessmentRunNotificationSNSStatusCode)
, _arnMessage :: !(Maybe Text)
, _arnDate :: !POSIX
, _arnEvent :: !InspectorEvent
, _arnError :: !Bool
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentRunNotification
:: UTCTime
-> InspectorEvent
-> Bool
-> AssessmentRunNotification
assessmentRunNotification pDate_ pEvent_ pError_ =
AssessmentRunNotification'
{ _arnSnsTopicARN = Nothing
, _arnSnsPublishStatusCode = Nothing
, _arnMessage = Nothing
, _arnDate = _Time # pDate_
, _arnEvent = pEvent_
, _arnError = pError_
}
arnSnsTopicARN :: Lens' AssessmentRunNotification (Maybe Text)
arnSnsTopicARN = lens _arnSnsTopicARN (\ s a -> s{_arnSnsTopicARN = a});
arnSnsPublishStatusCode :: Lens' AssessmentRunNotification (Maybe AssessmentRunNotificationSNSStatusCode)
arnSnsPublishStatusCode = lens _arnSnsPublishStatusCode (\ s a -> s{_arnSnsPublishStatusCode = a});
arnMessage :: Lens' AssessmentRunNotification (Maybe Text)
arnMessage = lens _arnMessage (\ s a -> s{_arnMessage = a});
arnDate :: Lens' AssessmentRunNotification UTCTime
arnDate = lens _arnDate (\ s a -> s{_arnDate = a}) . _Time;
arnEvent :: Lens' AssessmentRunNotification InspectorEvent
arnEvent = lens _arnEvent (\ s a -> s{_arnEvent = a});
arnError :: Lens' AssessmentRunNotification Bool
arnError = lens _arnError (\ s a -> s{_arnError = a});
instance FromJSON AssessmentRunNotification where
parseJSON
= withObject "AssessmentRunNotification"
(\ x ->
AssessmentRunNotification' <$>
(x .:? "snsTopicArn") <*>
(x .:? "snsPublishStatusCode")
<*> (x .:? "message")
<*> (x .: "date")
<*> (x .: "event")
<*> (x .: "error"))
instance Hashable AssessmentRunNotification
instance NFData AssessmentRunNotification
data AssessmentRunStateChange = AssessmentRunStateChange'
{ _arscStateChangedAt :: !POSIX
, _arscState :: !AssessmentRunState
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentRunStateChange
:: UTCTime
-> AssessmentRunState
-> AssessmentRunStateChange
assessmentRunStateChange pStateChangedAt_ pState_ =
AssessmentRunStateChange'
{ _arscStateChangedAt = _Time # pStateChangedAt_
, _arscState = pState_
}
arscStateChangedAt :: Lens' AssessmentRunStateChange UTCTime
arscStateChangedAt = lens _arscStateChangedAt (\ s a -> s{_arscStateChangedAt = a}) . _Time;
arscState :: Lens' AssessmentRunStateChange AssessmentRunState
arscState = lens _arscState (\ s a -> s{_arscState = a});
instance FromJSON AssessmentRunStateChange where
parseJSON
= withObject "AssessmentRunStateChange"
(\ x ->
AssessmentRunStateChange' <$>
(x .: "stateChangedAt") <*> (x .: "state"))
instance Hashable AssessmentRunStateChange
instance NFData AssessmentRunStateChange
data AssessmentTarget = AssessmentTarget'
{ _aArn :: !Text
, _aName :: !Text
, _aResourceGroupARN :: !Text
, _aCreatedAt :: !POSIX
, _aUpdatedAt :: !POSIX
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentTarget
:: Text
-> Text
-> Text
-> UTCTime
-> UTCTime
-> AssessmentTarget
assessmentTarget pArn_ pName_ pResourceGroupARN_ pCreatedAt_ pUpdatedAt_ =
AssessmentTarget'
{ _aArn = pArn_
, _aName = pName_
, _aResourceGroupARN = pResourceGroupARN_
, _aCreatedAt = _Time # pCreatedAt_
, _aUpdatedAt = _Time # pUpdatedAt_
}
aArn :: Lens' AssessmentTarget Text
aArn = lens _aArn (\ s a -> s{_aArn = a});
aName :: Lens' AssessmentTarget Text
aName = lens _aName (\ s a -> s{_aName = a});
aResourceGroupARN :: Lens' AssessmentTarget Text
aResourceGroupARN = lens _aResourceGroupARN (\ s a -> s{_aResourceGroupARN = a});
aCreatedAt :: Lens' AssessmentTarget UTCTime
aCreatedAt = lens _aCreatedAt (\ s a -> s{_aCreatedAt = a}) . _Time;
aUpdatedAt :: Lens' AssessmentTarget UTCTime
aUpdatedAt = lens _aUpdatedAt (\ s a -> s{_aUpdatedAt = a}) . _Time;
instance FromJSON AssessmentTarget where
parseJSON
= withObject "AssessmentTarget"
(\ x ->
AssessmentTarget' <$>
(x .: "arn") <*> (x .: "name") <*>
(x .: "resourceGroupArn")
<*> (x .: "createdAt")
<*> (x .: "updatedAt"))
instance Hashable AssessmentTarget
instance NFData AssessmentTarget
newtype AssessmentTargetFilter = AssessmentTargetFilter'
{ _atfAssessmentTargetNamePattern :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentTargetFilter
:: AssessmentTargetFilter
assessmentTargetFilter =
AssessmentTargetFilter'
{ _atfAssessmentTargetNamePattern = Nothing
}
atfAssessmentTargetNamePattern :: Lens' AssessmentTargetFilter (Maybe Text)
atfAssessmentTargetNamePattern = lens _atfAssessmentTargetNamePattern (\ s a -> s{_atfAssessmentTargetNamePattern = a});
instance Hashable AssessmentTargetFilter
instance NFData AssessmentTargetFilter
instance ToJSON AssessmentTargetFilter where
toJSON AssessmentTargetFilter'{..}
= object
(catMaybes
[("assessmentTargetNamePattern" .=) <$>
_atfAssessmentTargetNamePattern])
data AssessmentTemplate = AssessmentTemplate'
{ _atArn :: !Text
, _atName :: !Text
, _atAssessmentTargetARN :: !Text
, _atDurationInSeconds :: !Nat
, _atRulesPackageARNs :: ![Text]
, _atUserAttributesForFindings :: ![Attribute]
, _atCreatedAt :: !POSIX
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentTemplate
:: Text
-> Text
-> Text
-> Natural
-> UTCTime
-> AssessmentTemplate
assessmentTemplate pArn_ pName_ pAssessmentTargetARN_ pDurationInSeconds_ pCreatedAt_ =
AssessmentTemplate'
{ _atArn = pArn_
, _atName = pName_
, _atAssessmentTargetARN = pAssessmentTargetARN_
, _atDurationInSeconds = _Nat # pDurationInSeconds_
, _atRulesPackageARNs = mempty
, _atUserAttributesForFindings = mempty
, _atCreatedAt = _Time # pCreatedAt_
}
atArn :: Lens' AssessmentTemplate Text
atArn = lens _atArn (\ s a -> s{_atArn = a});
atName :: Lens' AssessmentTemplate Text
atName = lens _atName (\ s a -> s{_atName = a});
atAssessmentTargetARN :: Lens' AssessmentTemplate Text
atAssessmentTargetARN = lens _atAssessmentTargetARN (\ s a -> s{_atAssessmentTargetARN = a});
atDurationInSeconds :: Lens' AssessmentTemplate Natural
atDurationInSeconds = lens _atDurationInSeconds (\ s a -> s{_atDurationInSeconds = a}) . _Nat;
atRulesPackageARNs :: Lens' AssessmentTemplate [Text]
atRulesPackageARNs = lens _atRulesPackageARNs (\ s a -> s{_atRulesPackageARNs = a}) . _Coerce;
atUserAttributesForFindings :: Lens' AssessmentTemplate [Attribute]
atUserAttributesForFindings = lens _atUserAttributesForFindings (\ s a -> s{_atUserAttributesForFindings = a}) . _Coerce;
atCreatedAt :: Lens' AssessmentTemplate UTCTime
atCreatedAt = lens _atCreatedAt (\ s a -> s{_atCreatedAt = a}) . _Time;
instance FromJSON AssessmentTemplate where
parseJSON
= withObject "AssessmentTemplate"
(\ x ->
AssessmentTemplate' <$>
(x .: "arn") <*> (x .: "name") <*>
(x .: "assessmentTargetArn")
<*> (x .: "durationInSeconds")
<*> (x .:? "rulesPackageArns" .!= mempty)
<*> (x .:? "userAttributesForFindings" .!= mempty)
<*> (x .: "createdAt"))
instance Hashable AssessmentTemplate
instance NFData AssessmentTemplate
data AssessmentTemplateFilter = AssessmentTemplateFilter'
{ _atfNamePattern :: !(Maybe Text)
, _atfRulesPackageARNs :: !(Maybe [Text])
, _atfDurationRange :: !(Maybe DurationRange)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assessmentTemplateFilter
:: AssessmentTemplateFilter
assessmentTemplateFilter =
AssessmentTemplateFilter'
{ _atfNamePattern = Nothing
, _atfRulesPackageARNs = Nothing
, _atfDurationRange = Nothing
}
atfNamePattern :: Lens' AssessmentTemplateFilter (Maybe Text)
atfNamePattern = lens _atfNamePattern (\ s a -> s{_atfNamePattern = a});
atfRulesPackageARNs :: Lens' AssessmentTemplateFilter [Text]
atfRulesPackageARNs = lens _atfRulesPackageARNs (\ s a -> s{_atfRulesPackageARNs = a}) . _Default . _Coerce;
atfDurationRange :: Lens' AssessmentTemplateFilter (Maybe DurationRange)
atfDurationRange = lens _atfDurationRange (\ s a -> s{_atfDurationRange = a});
instance Hashable AssessmentTemplateFilter
instance NFData AssessmentTemplateFilter
instance ToJSON AssessmentTemplateFilter where
toJSON AssessmentTemplateFilter'{..}
= object
(catMaybes
[("namePattern" .=) <$> _atfNamePattern,
("rulesPackageArns" .=) <$> _atfRulesPackageARNs,
("durationRange" .=) <$> _atfDurationRange])
data AssetAttributes = AssetAttributes'
{ _aaHostname :: !(Maybe Text)
, _aaAutoScalingGroup :: !(Maybe Text)
, _aaIpv4Addresses :: !(Maybe [Text])
, _aaAgentId :: !(Maybe Text)
, _aaAmiId :: !(Maybe Text)
, _aaSchemaVersion :: !Nat
} deriving (Eq,Read,Show,Data,Typeable,Generic)
assetAttributes
:: Natural
-> AssetAttributes
assetAttributes pSchemaVersion_ =
AssetAttributes'
{ _aaHostname = Nothing
, _aaAutoScalingGroup = Nothing
, _aaIpv4Addresses = Nothing
, _aaAgentId = Nothing
, _aaAmiId = Nothing
, _aaSchemaVersion = _Nat # pSchemaVersion_
}
aaHostname :: Lens' AssetAttributes (Maybe Text)
aaHostname = lens _aaHostname (\ s a -> s{_aaHostname = a});
aaAutoScalingGroup :: Lens' AssetAttributes (Maybe Text)
aaAutoScalingGroup = lens _aaAutoScalingGroup (\ s a -> s{_aaAutoScalingGroup = a});
aaIpv4Addresses :: Lens' AssetAttributes [Text]
aaIpv4Addresses = lens _aaIpv4Addresses (\ s a -> s{_aaIpv4Addresses = a}) . _Default . _Coerce;
aaAgentId :: Lens' AssetAttributes (Maybe Text)
aaAgentId = lens _aaAgentId (\ s a -> s{_aaAgentId = a});
aaAmiId :: Lens' AssetAttributes (Maybe Text)
aaAmiId = lens _aaAmiId (\ s a -> s{_aaAmiId = a});
aaSchemaVersion :: Lens' AssetAttributes Natural
aaSchemaVersion = lens _aaSchemaVersion (\ s a -> s{_aaSchemaVersion = a}) . _Nat;
instance FromJSON AssetAttributes where
parseJSON
= withObject "AssetAttributes"
(\ x ->
AssetAttributes' <$>
(x .:? "hostname") <*> (x .:? "autoScalingGroup") <*>
(x .:? "ipv4Addresses" .!= mempty)
<*> (x .:? "agentId")
<*> (x .:? "amiId")
<*> (x .: "schemaVersion"))
instance Hashable AssetAttributes
instance NFData AssetAttributes
data Attribute = Attribute'
{ _aValue :: !(Maybe Text)
, _aKey :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
attribute
:: Text
-> Attribute
attribute pKey_ =
Attribute'
{ _aValue = Nothing
, _aKey = pKey_
}
aValue :: Lens' Attribute (Maybe Text)
aValue = lens _aValue (\ s a -> s{_aValue = a});
aKey :: Lens' Attribute Text
aKey = lens _aKey (\ s a -> s{_aKey = a});
instance FromJSON Attribute where
parseJSON
= withObject "Attribute"
(\ x ->
Attribute' <$> (x .:? "value") <*> (x .: "key"))
instance Hashable Attribute
instance NFData Attribute
instance ToJSON Attribute where
toJSON Attribute'{..}
= object
(catMaybes
[("value" .=) <$> _aValue, Just ("key" .= _aKey)])
data DurationRange = DurationRange'
{ _drMinSeconds :: !(Maybe Nat)
, _drMaxSeconds :: !(Maybe Nat)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
durationRange
:: DurationRange
durationRange =
DurationRange'
{ _drMinSeconds = Nothing
, _drMaxSeconds = Nothing
}
drMinSeconds :: Lens' DurationRange (Maybe Natural)
drMinSeconds = lens _drMinSeconds (\ s a -> s{_drMinSeconds = a}) . mapping _Nat;
drMaxSeconds :: Lens' DurationRange (Maybe Natural)
drMaxSeconds = lens _drMaxSeconds (\ s a -> s{_drMaxSeconds = a}) . mapping _Nat;
instance Hashable DurationRange
instance NFData DurationRange
instance ToJSON DurationRange where
toJSON DurationRange'{..}
= object
(catMaybes
[("minSeconds" .=) <$> _drMinSeconds,
("maxSeconds" .=) <$> _drMaxSeconds])
data EventSubscription = EventSubscription'
{ _esEvent :: !InspectorEvent
, _esSubscribedAt :: !POSIX
} deriving (Eq,Read,Show,Data,Typeable,Generic)
eventSubscription
:: InspectorEvent
-> UTCTime
-> EventSubscription
eventSubscription pEvent_ pSubscribedAt_ =
EventSubscription'
{ _esEvent = pEvent_
, _esSubscribedAt = _Time # pSubscribedAt_
}
esEvent :: Lens' EventSubscription InspectorEvent
esEvent = lens _esEvent (\ s a -> s{_esEvent = a});
esSubscribedAt :: Lens' EventSubscription UTCTime
esSubscribedAt = lens _esSubscribedAt (\ s a -> s{_esSubscribedAt = a}) . _Time;
instance FromJSON EventSubscription where
parseJSON
= withObject "EventSubscription"
(\ x ->
EventSubscription' <$>
(x .: "event") <*> (x .: "subscribedAt"))
instance Hashable EventSubscription
instance NFData EventSubscription
data FailedItemDetails = FailedItemDetails'
{ _fidFailureCode :: !FailedItemErrorCode
, _fidRetryable :: !Bool
} deriving (Eq,Read,Show,Data,Typeable,Generic)
failedItemDetails
:: FailedItemErrorCode
-> Bool
-> FailedItemDetails
failedItemDetails pFailureCode_ pRetryable_ =
FailedItemDetails'
{ _fidFailureCode = pFailureCode_
, _fidRetryable = pRetryable_
}
fidFailureCode :: Lens' FailedItemDetails FailedItemErrorCode
fidFailureCode = lens _fidFailureCode (\ s a -> s{_fidFailureCode = a});
fidRetryable :: Lens' FailedItemDetails Bool
fidRetryable = lens _fidRetryable (\ s a -> s{_fidRetryable = a});
instance FromJSON FailedItemDetails where
parseJSON
= withObject "FailedItemDetails"
(\ x ->
FailedItemDetails' <$>
(x .: "failureCode") <*> (x .: "retryable"))
instance Hashable FailedItemDetails
instance NFData FailedItemDetails
data Finding = Finding'
{ _fService :: !(Maybe Text)
, _fSeverity :: !(Maybe Severity)
, _fSchemaVersion :: !(Maybe Nat)
, _fConfidence :: !(Maybe Nat)
, _fAssetAttributes :: !(Maybe AssetAttributes)
, _fServiceAttributes :: !(Maybe InspectorServiceAttributes)
, _fId :: !(Maybe Text)
, _fNumericSeverity :: !(Maybe Double)
, _fAssetType :: !(Maybe AssetType)
, _fTitle :: !(Maybe Text)
, _fIndicatorOfCompromise :: !(Maybe Bool)
, _fDescription :: !(Maybe Text)
, _fRecommendation :: !(Maybe Text)
, _fArn :: !Text
, _fAttributes :: ![Attribute]
, _fUserAttributes :: ![Attribute]
, _fCreatedAt :: !POSIX
, _fUpdatedAt :: !POSIX
} deriving (Eq,Read,Show,Data,Typeable,Generic)
finding
:: Text
-> UTCTime
-> UTCTime
-> Finding
finding pArn_ pCreatedAt_ pUpdatedAt_ =
Finding'
{ _fService = Nothing
, _fSeverity = Nothing
, _fSchemaVersion = Nothing
, _fConfidence = Nothing
, _fAssetAttributes = Nothing
, _fServiceAttributes = Nothing
, _fId = Nothing
, _fNumericSeverity = Nothing
, _fAssetType = Nothing
, _fTitle = Nothing
, _fIndicatorOfCompromise = Nothing
, _fDescription = Nothing
, _fRecommendation = Nothing
, _fArn = pArn_
, _fAttributes = mempty
, _fUserAttributes = mempty
, _fCreatedAt = _Time # pCreatedAt_
, _fUpdatedAt = _Time # pUpdatedAt_
}
fService :: Lens' Finding (Maybe Text)
fService = lens _fService (\ s a -> s{_fService = a});
fSeverity :: Lens' Finding (Maybe Severity)
fSeverity = lens _fSeverity (\ s a -> s{_fSeverity = a});
fSchemaVersion :: Lens' Finding (Maybe Natural)
fSchemaVersion = lens _fSchemaVersion (\ s a -> s{_fSchemaVersion = a}) . mapping _Nat;
fConfidence :: Lens' Finding (Maybe Natural)
fConfidence = lens _fConfidence (\ s a -> s{_fConfidence = a}) . mapping _Nat;
fAssetAttributes :: Lens' Finding (Maybe AssetAttributes)
fAssetAttributes = lens _fAssetAttributes (\ s a -> s{_fAssetAttributes = a});
fServiceAttributes :: Lens' Finding (Maybe InspectorServiceAttributes)
fServiceAttributes = lens _fServiceAttributes (\ s a -> s{_fServiceAttributes = a});
fId :: Lens' Finding (Maybe Text)
fId = lens _fId (\ s a -> s{_fId = a});
fNumericSeverity :: Lens' Finding (Maybe Double)
fNumericSeverity = lens _fNumericSeverity (\ s a -> s{_fNumericSeverity = a});
fAssetType :: Lens' Finding (Maybe AssetType)
fAssetType = lens _fAssetType (\ s a -> s{_fAssetType = a});
fTitle :: Lens' Finding (Maybe Text)
fTitle = lens _fTitle (\ s a -> s{_fTitle = a});
fIndicatorOfCompromise :: Lens' Finding (Maybe Bool)
fIndicatorOfCompromise = lens _fIndicatorOfCompromise (\ s a -> s{_fIndicatorOfCompromise = a});
fDescription :: Lens' Finding (Maybe Text)
fDescription = lens _fDescription (\ s a -> s{_fDescription = a});
fRecommendation :: Lens' Finding (Maybe Text)
fRecommendation = lens _fRecommendation (\ s a -> s{_fRecommendation = a});
fArn :: Lens' Finding Text
fArn = lens _fArn (\ s a -> s{_fArn = a});
fAttributes :: Lens' Finding [Attribute]
fAttributes = lens _fAttributes (\ s a -> s{_fAttributes = a}) . _Coerce;
fUserAttributes :: Lens' Finding [Attribute]
fUserAttributes = lens _fUserAttributes (\ s a -> s{_fUserAttributes = a}) . _Coerce;
fCreatedAt :: Lens' Finding UTCTime
fCreatedAt = lens _fCreatedAt (\ s a -> s{_fCreatedAt = a}) . _Time;
fUpdatedAt :: Lens' Finding UTCTime
fUpdatedAt = lens _fUpdatedAt (\ s a -> s{_fUpdatedAt = a}) . _Time;
instance FromJSON Finding where
parseJSON
= withObject "Finding"
(\ x ->
Finding' <$>
(x .:? "service") <*> (x .:? "severity") <*>
(x .:? "schemaVersion")
<*> (x .:? "confidence")
<*> (x .:? "assetAttributes")
<*> (x .:? "serviceAttributes")
<*> (x .:? "id")
<*> (x .:? "numericSeverity")
<*> (x .:? "assetType")
<*> (x .:? "title")
<*> (x .:? "indicatorOfCompromise")
<*> (x .:? "description")
<*> (x .:? "recommendation")
<*> (x .: "arn")
<*> (x .:? "attributes" .!= mempty)
<*> (x .:? "userAttributes" .!= mempty)
<*> (x .: "createdAt")
<*> (x .: "updatedAt"))
instance Hashable Finding
instance NFData Finding
data FindingFilter = FindingFilter'
{ _ffAgentIds :: !(Maybe [Text])
, _ffRuleNames :: !(Maybe [Text])
, _ffUserAttributes :: !(Maybe [Attribute])
, _ffRulesPackageARNs :: !(Maybe [Text])
, _ffAttributes :: !(Maybe [Attribute])
, _ffSeverities :: !(Maybe [Severity])
, _ffCreationTimeRange :: !(Maybe TimestampRange)
, _ffAutoScalingGroups :: !(Maybe [Text])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
findingFilter
:: FindingFilter
findingFilter =
FindingFilter'
{ _ffAgentIds = Nothing
, _ffRuleNames = Nothing
, _ffUserAttributes = Nothing
, _ffRulesPackageARNs = Nothing
, _ffAttributes = Nothing
, _ffSeverities = Nothing
, _ffCreationTimeRange = Nothing
, _ffAutoScalingGroups = Nothing
}
ffAgentIds :: Lens' FindingFilter [Text]
ffAgentIds = lens _ffAgentIds (\ s a -> s{_ffAgentIds = a}) . _Default . _Coerce;
ffRuleNames :: Lens' FindingFilter [Text]
ffRuleNames = lens _ffRuleNames (\ s a -> s{_ffRuleNames = a}) . _Default . _Coerce;
ffUserAttributes :: Lens' FindingFilter [Attribute]
ffUserAttributes = lens _ffUserAttributes (\ s a -> s{_ffUserAttributes = a}) . _Default . _Coerce;
ffRulesPackageARNs :: Lens' FindingFilter [Text]
ffRulesPackageARNs = lens _ffRulesPackageARNs (\ s a -> s{_ffRulesPackageARNs = a}) . _Default . _Coerce;
ffAttributes :: Lens' FindingFilter [Attribute]
ffAttributes = lens _ffAttributes (\ s a -> s{_ffAttributes = a}) . _Default . _Coerce;
ffSeverities :: Lens' FindingFilter [Severity]
ffSeverities = lens _ffSeverities (\ s a -> s{_ffSeverities = a}) . _Default . _Coerce;
ffCreationTimeRange :: Lens' FindingFilter (Maybe TimestampRange)
ffCreationTimeRange = lens _ffCreationTimeRange (\ s a -> s{_ffCreationTimeRange = a});
ffAutoScalingGroups :: Lens' FindingFilter [Text]
ffAutoScalingGroups = lens _ffAutoScalingGroups (\ s a -> s{_ffAutoScalingGroups = a}) . _Default . _Coerce;
instance Hashable FindingFilter
instance NFData FindingFilter
instance ToJSON FindingFilter where
toJSON FindingFilter'{..}
= object
(catMaybes
[("agentIds" .=) <$> _ffAgentIds,
("ruleNames" .=) <$> _ffRuleNames,
("userAttributes" .=) <$> _ffUserAttributes,
("rulesPackageArns" .=) <$> _ffRulesPackageARNs,
("attributes" .=) <$> _ffAttributes,
("severities" .=) <$> _ffSeverities,
("creationTimeRange" .=) <$> _ffCreationTimeRange,
("autoScalingGroups" .=) <$> _ffAutoScalingGroups])
data InspectorServiceAttributes = InspectorServiceAttributes'
{ _isaRulesPackageARN :: !(Maybe Text)
, _isaAssessmentRunARN :: !(Maybe Text)
, _isaSchemaVersion :: !Nat
} deriving (Eq,Read,Show,Data,Typeable,Generic)
inspectorServiceAttributes
:: Natural
-> InspectorServiceAttributes
inspectorServiceAttributes pSchemaVersion_ =
InspectorServiceAttributes'
{ _isaRulesPackageARN = Nothing
, _isaAssessmentRunARN = Nothing
, _isaSchemaVersion = _Nat # pSchemaVersion_
}
isaRulesPackageARN :: Lens' InspectorServiceAttributes (Maybe Text)
isaRulesPackageARN = lens _isaRulesPackageARN (\ s a -> s{_isaRulesPackageARN = a});
isaAssessmentRunARN :: Lens' InspectorServiceAttributes (Maybe Text)
isaAssessmentRunARN = lens _isaAssessmentRunARN (\ s a -> s{_isaAssessmentRunARN = a});
isaSchemaVersion :: Lens' InspectorServiceAttributes Natural
isaSchemaVersion = lens _isaSchemaVersion (\ s a -> s{_isaSchemaVersion = a}) . _Nat;
instance FromJSON InspectorServiceAttributes where
parseJSON
= withObject "InspectorServiceAttributes"
(\ x ->
InspectorServiceAttributes' <$>
(x .:? "rulesPackageArn") <*>
(x .:? "assessmentRunArn")
<*> (x .: "schemaVersion"))
instance Hashable InspectorServiceAttributes
instance NFData InspectorServiceAttributes
data ResourceGroup = ResourceGroup'
{ _rgArn :: !Text
, _rgTags :: !(List1 ResourceGroupTag)
, _rgCreatedAt :: !POSIX
} deriving (Eq,Read,Show,Data,Typeable,Generic)
resourceGroup
:: Text
-> NonEmpty ResourceGroupTag
-> UTCTime
-> ResourceGroup
resourceGroup pArn_ pTags_ pCreatedAt_ =
ResourceGroup'
{ _rgArn = pArn_
, _rgTags = _List1 # pTags_
, _rgCreatedAt = _Time # pCreatedAt_
}
rgArn :: Lens' ResourceGroup Text
rgArn = lens _rgArn (\ s a -> s{_rgArn = a});
rgTags :: Lens' ResourceGroup (NonEmpty ResourceGroupTag)
rgTags = lens _rgTags (\ s a -> s{_rgTags = a}) . _List1;
rgCreatedAt :: Lens' ResourceGroup UTCTime
rgCreatedAt = lens _rgCreatedAt (\ s a -> s{_rgCreatedAt = a}) . _Time;
instance FromJSON ResourceGroup where
parseJSON
= withObject "ResourceGroup"
(\ x ->
ResourceGroup' <$>
(x .: "arn") <*> (x .: "tags") <*>
(x .: "createdAt"))
instance Hashable ResourceGroup
instance NFData ResourceGroup
data ResourceGroupTag = ResourceGroupTag'
{ _rgtValue :: !(Maybe Text)
, _rgtKey :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
resourceGroupTag
:: Text
-> ResourceGroupTag
resourceGroupTag pKey_ =
ResourceGroupTag'
{ _rgtValue = Nothing
, _rgtKey = pKey_
}
rgtValue :: Lens' ResourceGroupTag (Maybe Text)
rgtValue = lens _rgtValue (\ s a -> s{_rgtValue = a});
rgtKey :: Lens' ResourceGroupTag Text
rgtKey = lens _rgtKey (\ s a -> s{_rgtKey = a});
instance FromJSON ResourceGroupTag where
parseJSON
= withObject "ResourceGroupTag"
(\ x ->
ResourceGroupTag' <$>
(x .:? "value") <*> (x .: "key"))
instance Hashable ResourceGroupTag
instance NFData ResourceGroupTag
instance ToJSON ResourceGroupTag where
toJSON ResourceGroupTag'{..}
= object
(catMaybes
[("value" .=) <$> _rgtValue,
Just ("key" .= _rgtKey)])
data RulesPackage = RulesPackage'
{ _rpDescription :: !(Maybe Text)
, _rpArn :: !Text
, _rpName :: !Text
, _rpVersion :: !Text
, _rpProvider :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
rulesPackage
:: Text
-> Text
-> Text
-> Text
-> RulesPackage
rulesPackage pArn_ pName_ pVersion_ pProvider_ =
RulesPackage'
{ _rpDescription = Nothing
, _rpArn = pArn_
, _rpName = pName_
, _rpVersion = pVersion_
, _rpProvider = pProvider_
}
rpDescription :: Lens' RulesPackage (Maybe Text)
rpDescription = lens _rpDescription (\ s a -> s{_rpDescription = a});
rpArn :: Lens' RulesPackage Text
rpArn = lens _rpArn (\ s a -> s{_rpArn = a});
rpName :: Lens' RulesPackage Text
rpName = lens _rpName (\ s a -> s{_rpName = a});
rpVersion :: Lens' RulesPackage Text
rpVersion = lens _rpVersion (\ s a -> s{_rpVersion = a});
rpProvider :: Lens' RulesPackage Text
rpProvider = lens _rpProvider (\ s a -> s{_rpProvider = a});
instance FromJSON RulesPackage where
parseJSON
= withObject "RulesPackage"
(\ x ->
RulesPackage' <$>
(x .:? "description") <*> (x .: "arn") <*>
(x .: "name")
<*> (x .: "version")
<*> (x .: "provider"))
instance Hashable RulesPackage
instance NFData RulesPackage
data Subscription = Subscription'
{ _sResourceARN :: !Text
, _sTopicARN :: !Text
, _sEventSubscriptions :: !(List1 EventSubscription)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
subscription
:: Text
-> Text
-> NonEmpty EventSubscription
-> Subscription
subscription pResourceARN_ pTopicARN_ pEventSubscriptions_ =
Subscription'
{ _sResourceARN = pResourceARN_
, _sTopicARN = pTopicARN_
, _sEventSubscriptions = _List1 # pEventSubscriptions_
}
sResourceARN :: Lens' Subscription Text
sResourceARN = lens _sResourceARN (\ s a -> s{_sResourceARN = a});
sTopicARN :: Lens' Subscription Text
sTopicARN = lens _sTopicARN (\ s a -> s{_sTopicARN = a});
sEventSubscriptions :: Lens' Subscription (NonEmpty EventSubscription)
sEventSubscriptions = lens _sEventSubscriptions (\ s a -> s{_sEventSubscriptions = a}) . _List1;
instance FromJSON Subscription where
parseJSON
= withObject "Subscription"
(\ x ->
Subscription' <$>
(x .: "resourceArn") <*> (x .: "topicArn") <*>
(x .: "eventSubscriptions"))
instance Hashable Subscription
instance NFData Subscription
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 TelemetryMetadata = TelemetryMetadata'
{ _tmDataSize :: !(Maybe Integer)
, _tmMessageType :: !Text
, _tmCount :: !Integer
} deriving (Eq,Read,Show,Data,Typeable,Generic)
telemetryMetadata
:: Text
-> Integer
-> TelemetryMetadata
telemetryMetadata pMessageType_ pCount_ =
TelemetryMetadata'
{ _tmDataSize = Nothing
, _tmMessageType = pMessageType_
, _tmCount = pCount_
}
tmDataSize :: Lens' TelemetryMetadata (Maybe Integer)
tmDataSize = lens _tmDataSize (\ s a -> s{_tmDataSize = a});
tmMessageType :: Lens' TelemetryMetadata Text
tmMessageType = lens _tmMessageType (\ s a -> s{_tmMessageType = a});
tmCount :: Lens' TelemetryMetadata Integer
tmCount = lens _tmCount (\ s a -> s{_tmCount = a});
instance FromJSON TelemetryMetadata where
parseJSON
= withObject "TelemetryMetadata"
(\ x ->
TelemetryMetadata' <$>
(x .:? "dataSize") <*> (x .: "messageType") <*>
(x .: "count"))
instance Hashable TelemetryMetadata
instance NFData TelemetryMetadata
data TimestampRange = TimestampRange'
{ _trEndDate :: !(Maybe POSIX)
, _trBeginDate :: !(Maybe POSIX)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
timestampRange
:: TimestampRange
timestampRange =
TimestampRange'
{ _trEndDate = Nothing
, _trBeginDate = Nothing
}
trEndDate :: Lens' TimestampRange (Maybe UTCTime)
trEndDate = lens _trEndDate (\ s a -> s{_trEndDate = a}) . mapping _Time;
trBeginDate :: Lens' TimestampRange (Maybe UTCTime)
trBeginDate = lens _trBeginDate (\ s a -> s{_trBeginDate = a}) . mapping _Time;
instance Hashable TimestampRange
instance NFData TimestampRange
instance ToJSON TimestampRange where
toJSON TimestampRange'{..}
= object
(catMaybes
[("endDate" .=) <$> _trEndDate,
("beginDate" .=) <$> _trBeginDate])