{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.GuardDuty.Types.ServiceInfo where
import qualified Amazonka.Core as Core
import Amazonka.GuardDuty.Types.Action
import Amazonka.GuardDuty.Types.Evidence
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ServiceInfo = ServiceInfo'
{
ServiceInfo -> Maybe Int
count :: Prelude.Maybe Prelude.Int,
ServiceInfo -> Maybe Text
eventFirstSeen :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Action
action :: Prelude.Maybe Action,
ServiceInfo -> Maybe Text
detectorId :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Text
userFeedback :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Evidence
evidence :: Prelude.Maybe Evidence,
ServiceInfo -> Maybe Text
eventLastSeen :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Text
resourceRole :: Prelude.Maybe Prelude.Text,
ServiceInfo -> Maybe Bool
archived :: Prelude.Maybe Prelude.Bool
}
deriving (ServiceInfo -> ServiceInfo -> Bool
(ServiceInfo -> ServiceInfo -> Bool)
-> (ServiceInfo -> ServiceInfo -> Bool) -> Eq ServiceInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceInfo -> ServiceInfo -> Bool
$c/= :: ServiceInfo -> ServiceInfo -> Bool
== :: ServiceInfo -> ServiceInfo -> Bool
$c== :: ServiceInfo -> ServiceInfo -> Bool
Prelude.Eq, ReadPrec [ServiceInfo]
ReadPrec ServiceInfo
Int -> ReadS ServiceInfo
ReadS [ServiceInfo]
(Int -> ReadS ServiceInfo)
-> ReadS [ServiceInfo]
-> ReadPrec ServiceInfo
-> ReadPrec [ServiceInfo]
-> Read ServiceInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceInfo]
$creadListPrec :: ReadPrec [ServiceInfo]
readPrec :: ReadPrec ServiceInfo
$creadPrec :: ReadPrec ServiceInfo
readList :: ReadS [ServiceInfo]
$creadList :: ReadS [ServiceInfo]
readsPrec :: Int -> ReadS ServiceInfo
$creadsPrec :: Int -> ReadS ServiceInfo
Prelude.Read, Int -> ServiceInfo -> ShowS
[ServiceInfo] -> ShowS
ServiceInfo -> String
(Int -> ServiceInfo -> ShowS)
-> (ServiceInfo -> String)
-> ([ServiceInfo] -> ShowS)
-> Show ServiceInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceInfo] -> ShowS
$cshowList :: [ServiceInfo] -> ShowS
show :: ServiceInfo -> String
$cshow :: ServiceInfo -> String
showsPrec :: Int -> ServiceInfo -> ShowS
$cshowsPrec :: Int -> ServiceInfo -> ShowS
Prelude.Show, (forall x. ServiceInfo -> Rep ServiceInfo x)
-> (forall x. Rep ServiceInfo x -> ServiceInfo)
-> Generic ServiceInfo
forall x. Rep ServiceInfo x -> ServiceInfo
forall x. ServiceInfo -> Rep ServiceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceInfo x -> ServiceInfo
$cfrom :: forall x. ServiceInfo -> Rep ServiceInfo x
Prelude.Generic)
newServiceInfo ::
ServiceInfo
newServiceInfo :: ServiceInfo
newServiceInfo =
ServiceInfo' :: Maybe Int
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo
ServiceInfo'
{ $sel:count:ServiceInfo' :: Maybe Int
count = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:eventFirstSeen:ServiceInfo' :: Maybe Text
eventFirstSeen = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:action:ServiceInfo' :: Maybe Action
action = Maybe Action
forall a. Maybe a
Prelude.Nothing,
$sel:detectorId:ServiceInfo' :: Maybe Text
detectorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:serviceName:ServiceInfo' :: Maybe Text
serviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:userFeedback:ServiceInfo' :: Maybe Text
userFeedback = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:evidence:ServiceInfo' :: Maybe Evidence
evidence = Maybe Evidence
forall a. Maybe a
Prelude.Nothing,
$sel:eventLastSeen:ServiceInfo' :: Maybe Text
eventLastSeen = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceRole:ServiceInfo' :: Maybe Text
resourceRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:archived:ServiceInfo' :: Maybe Bool
archived = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
serviceInfo_count :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Int)
serviceInfo_count :: (Maybe Int -> f (Maybe Int)) -> ServiceInfo -> f ServiceInfo
serviceInfo_count = (ServiceInfo -> Maybe Int)
-> (ServiceInfo -> Maybe Int -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Int
count :: Maybe Int
$sel:count:ServiceInfo' :: ServiceInfo -> Maybe Int
count} -> Maybe Int
count) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Int
a -> ServiceInfo
s {$sel:count:ServiceInfo' :: Maybe Int
count = Maybe Int
a} :: ServiceInfo)
serviceInfo_eventFirstSeen :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_eventFirstSeen :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_eventFirstSeen = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
eventFirstSeen :: Maybe Text
$sel:eventFirstSeen:ServiceInfo' :: ServiceInfo -> Maybe Text
eventFirstSeen} -> Maybe Text
eventFirstSeen) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:eventFirstSeen:ServiceInfo' :: Maybe Text
eventFirstSeen = Maybe Text
a} :: ServiceInfo)
serviceInfo_action :: Lens.Lens' ServiceInfo (Prelude.Maybe Action)
serviceInfo_action :: (Maybe Action -> f (Maybe Action)) -> ServiceInfo -> f ServiceInfo
serviceInfo_action = (ServiceInfo -> Maybe Action)
-> (ServiceInfo -> Maybe Action -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Action) (Maybe Action)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Action
action :: Maybe Action
$sel:action:ServiceInfo' :: ServiceInfo -> Maybe Action
action} -> Maybe Action
action) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Action
a -> ServiceInfo
s {$sel:action:ServiceInfo' :: Maybe Action
action = Maybe Action
a} :: ServiceInfo)
serviceInfo_detectorId :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_detectorId :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_detectorId = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
detectorId :: Maybe Text
$sel:detectorId:ServiceInfo' :: ServiceInfo -> Maybe Text
detectorId} -> Maybe Text
detectorId) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:detectorId:ServiceInfo' :: Maybe Text
detectorId = Maybe Text
a} :: ServiceInfo)
serviceInfo_serviceName :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_serviceName :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_serviceName = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:ServiceInfo' :: ServiceInfo -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:serviceName:ServiceInfo' :: Maybe Text
serviceName = Maybe Text
a} :: ServiceInfo)
serviceInfo_userFeedback :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_userFeedback :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_userFeedback = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
userFeedback :: Maybe Text
$sel:userFeedback:ServiceInfo' :: ServiceInfo -> Maybe Text
userFeedback} -> Maybe Text
userFeedback) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:userFeedback:ServiceInfo' :: Maybe Text
userFeedback = Maybe Text
a} :: ServiceInfo)
serviceInfo_evidence :: Lens.Lens' ServiceInfo (Prelude.Maybe Evidence)
serviceInfo_evidence :: (Maybe Evidence -> f (Maybe Evidence))
-> ServiceInfo -> f ServiceInfo
serviceInfo_evidence = (ServiceInfo -> Maybe Evidence)
-> (ServiceInfo -> Maybe Evidence -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Evidence) (Maybe Evidence)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Evidence
evidence :: Maybe Evidence
$sel:evidence:ServiceInfo' :: ServiceInfo -> Maybe Evidence
evidence} -> Maybe Evidence
evidence) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Evidence
a -> ServiceInfo
s {$sel:evidence:ServiceInfo' :: Maybe Evidence
evidence = Maybe Evidence
a} :: ServiceInfo)
serviceInfo_eventLastSeen :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_eventLastSeen :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_eventLastSeen = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
eventLastSeen :: Maybe Text
$sel:eventLastSeen:ServiceInfo' :: ServiceInfo -> Maybe Text
eventLastSeen} -> Maybe Text
eventLastSeen) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:eventLastSeen:ServiceInfo' :: Maybe Text
eventLastSeen = Maybe Text
a} :: ServiceInfo)
serviceInfo_resourceRole :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Text)
serviceInfo_resourceRole :: (Maybe Text -> f (Maybe Text)) -> ServiceInfo -> f ServiceInfo
serviceInfo_resourceRole = (ServiceInfo -> Maybe Text)
-> (ServiceInfo -> Maybe Text -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Text
resourceRole :: Maybe Text
$sel:resourceRole:ServiceInfo' :: ServiceInfo -> Maybe Text
resourceRole} -> Maybe Text
resourceRole) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Text
a -> ServiceInfo
s {$sel:resourceRole:ServiceInfo' :: Maybe Text
resourceRole = Maybe Text
a} :: ServiceInfo)
serviceInfo_archived :: Lens.Lens' ServiceInfo (Prelude.Maybe Prelude.Bool)
serviceInfo_archived :: (Maybe Bool -> f (Maybe Bool)) -> ServiceInfo -> f ServiceInfo
serviceInfo_archived = (ServiceInfo -> Maybe Bool)
-> (ServiceInfo -> Maybe Bool -> ServiceInfo)
-> Lens ServiceInfo ServiceInfo (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInfo' {Maybe Bool
archived :: Maybe Bool
$sel:archived:ServiceInfo' :: ServiceInfo -> Maybe Bool
archived} -> Maybe Bool
archived) (\s :: ServiceInfo
s@ServiceInfo' {} Maybe Bool
a -> ServiceInfo
s {$sel:archived:ServiceInfo' :: Maybe Bool
archived = Maybe Bool
a} :: ServiceInfo)
instance Core.FromJSON ServiceInfo where
parseJSON :: Value -> Parser ServiceInfo
parseJSON =
String
-> (Object -> Parser ServiceInfo) -> Value -> Parser ServiceInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ServiceInfo"
( \Object
x ->
Maybe Int
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo
ServiceInfo'
(Maybe Int
-> Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"count")
Parser
(Maybe Text
-> Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventFirstSeen")
Parser
(Maybe Action
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
-> Parser (Maybe Action)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Action)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"action")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"detectorId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceName")
Parser
(Maybe Text
-> Maybe Evidence
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ServiceInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe Evidence
-> Maybe Text -> Maybe Text -> Maybe Bool -> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"userFeedback")
Parser
(Maybe Evidence
-> Maybe Text -> Maybe Text -> Maybe Bool -> ServiceInfo)
-> Parser (Maybe Evidence)
-> Parser (Maybe Text -> Maybe Text -> Maybe Bool -> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Evidence)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"evidence")
Parser (Maybe Text -> Maybe Text -> Maybe Bool -> ServiceInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventLastSeen")
Parser (Maybe Text -> Maybe Bool -> ServiceInfo)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> ServiceInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceRole")
Parser (Maybe Bool -> ServiceInfo)
-> Parser (Maybe Bool) -> Parser ServiceInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"archived")
)
instance Prelude.Hashable ServiceInfo
instance Prelude.NFData ServiceInfo