{-# 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.Inspector2.Types.AmiAggregationResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector2.Types.SeverityCounts
import qualified Amazonka.Prelude as Prelude
data AmiAggregationResponse = AmiAggregationResponse'
{
AmiAggregationResponse -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
AmiAggregationResponse -> Maybe Integer
affectedInstances :: Prelude.Maybe Prelude.Integer,
AmiAggregationResponse -> Maybe SeverityCounts
severityCounts :: Prelude.Maybe SeverityCounts,
AmiAggregationResponse -> Text
ami :: Prelude.Text
}
deriving (AmiAggregationResponse -> AmiAggregationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AmiAggregationResponse -> AmiAggregationResponse -> Bool
$c/= :: AmiAggregationResponse -> AmiAggregationResponse -> Bool
== :: AmiAggregationResponse -> AmiAggregationResponse -> Bool
$c== :: AmiAggregationResponse -> AmiAggregationResponse -> Bool
Prelude.Eq, ReadPrec [AmiAggregationResponse]
ReadPrec AmiAggregationResponse
Int -> ReadS AmiAggregationResponse
ReadS [AmiAggregationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AmiAggregationResponse]
$creadListPrec :: ReadPrec [AmiAggregationResponse]
readPrec :: ReadPrec AmiAggregationResponse
$creadPrec :: ReadPrec AmiAggregationResponse
readList :: ReadS [AmiAggregationResponse]
$creadList :: ReadS [AmiAggregationResponse]
readsPrec :: Int -> ReadS AmiAggregationResponse
$creadsPrec :: Int -> ReadS AmiAggregationResponse
Prelude.Read, Int -> AmiAggregationResponse -> ShowS
[AmiAggregationResponse] -> ShowS
AmiAggregationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AmiAggregationResponse] -> ShowS
$cshowList :: [AmiAggregationResponse] -> ShowS
show :: AmiAggregationResponse -> String
$cshow :: AmiAggregationResponse -> String
showsPrec :: Int -> AmiAggregationResponse -> ShowS
$cshowsPrec :: Int -> AmiAggregationResponse -> ShowS
Prelude.Show, forall x. Rep AmiAggregationResponse x -> AmiAggregationResponse
forall x. AmiAggregationResponse -> Rep AmiAggregationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AmiAggregationResponse x -> AmiAggregationResponse
$cfrom :: forall x. AmiAggregationResponse -> Rep AmiAggregationResponse x
Prelude.Generic)
newAmiAggregationResponse ::
Prelude.Text ->
AmiAggregationResponse
newAmiAggregationResponse :: Text -> AmiAggregationResponse
newAmiAggregationResponse Text
pAmi_ =
AmiAggregationResponse'
{ $sel:accountId:AmiAggregationResponse' :: Maybe Text
accountId =
forall a. Maybe a
Prelude.Nothing,
$sel:affectedInstances:AmiAggregationResponse' :: Maybe Integer
affectedInstances = forall a. Maybe a
Prelude.Nothing,
$sel:severityCounts:AmiAggregationResponse' :: Maybe SeverityCounts
severityCounts = forall a. Maybe a
Prelude.Nothing,
$sel:ami:AmiAggregationResponse' :: Text
ami = Text
pAmi_
}
amiAggregationResponse_accountId :: Lens.Lens' AmiAggregationResponse (Prelude.Maybe Prelude.Text)
amiAggregationResponse_accountId :: Lens' AmiAggregationResponse (Maybe Text)
amiAggregationResponse_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmiAggregationResponse' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AmiAggregationResponse
s@AmiAggregationResponse' {} Maybe Text
a -> AmiAggregationResponse
s {$sel:accountId:AmiAggregationResponse' :: Maybe Text
accountId = Maybe Text
a} :: AmiAggregationResponse)
amiAggregationResponse_affectedInstances :: Lens.Lens' AmiAggregationResponse (Prelude.Maybe Prelude.Integer)
amiAggregationResponse_affectedInstances :: Lens' AmiAggregationResponse (Maybe Integer)
amiAggregationResponse_affectedInstances = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmiAggregationResponse' {Maybe Integer
affectedInstances :: Maybe Integer
$sel:affectedInstances:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe Integer
affectedInstances} -> Maybe Integer
affectedInstances) (\s :: AmiAggregationResponse
s@AmiAggregationResponse' {} Maybe Integer
a -> AmiAggregationResponse
s {$sel:affectedInstances:AmiAggregationResponse' :: Maybe Integer
affectedInstances = Maybe Integer
a} :: AmiAggregationResponse)
amiAggregationResponse_severityCounts :: Lens.Lens' AmiAggregationResponse (Prelude.Maybe SeverityCounts)
amiAggregationResponse_severityCounts :: Lens' AmiAggregationResponse (Maybe SeverityCounts)
amiAggregationResponse_severityCounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmiAggregationResponse' {Maybe SeverityCounts
severityCounts :: Maybe SeverityCounts
$sel:severityCounts:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe SeverityCounts
severityCounts} -> Maybe SeverityCounts
severityCounts) (\s :: AmiAggregationResponse
s@AmiAggregationResponse' {} Maybe SeverityCounts
a -> AmiAggregationResponse
s {$sel:severityCounts:AmiAggregationResponse' :: Maybe SeverityCounts
severityCounts = Maybe SeverityCounts
a} :: AmiAggregationResponse)
amiAggregationResponse_ami :: Lens.Lens' AmiAggregationResponse Prelude.Text
amiAggregationResponse_ami :: Lens' AmiAggregationResponse Text
amiAggregationResponse_ami = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmiAggregationResponse' {Text
ami :: Text
$sel:ami:AmiAggregationResponse' :: AmiAggregationResponse -> Text
ami} -> Text
ami) (\s :: AmiAggregationResponse
s@AmiAggregationResponse' {} Text
a -> AmiAggregationResponse
s {$sel:ami:AmiAggregationResponse' :: Text
ami = Text
a} :: AmiAggregationResponse)
instance Data.FromJSON AmiAggregationResponse where
parseJSON :: Value -> Parser AmiAggregationResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AmiAggregationResponse"
( \Object
x ->
Maybe Text
-> Maybe Integer
-> Maybe SeverityCounts
-> Text
-> AmiAggregationResponse
AmiAggregationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"accountId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"affectedInstances")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"severityCounts")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ami")
)
instance Prelude.Hashable AmiAggregationResponse where
hashWithSalt :: Int -> AmiAggregationResponse -> Int
hashWithSalt Int
_salt AmiAggregationResponse' {Maybe Integer
Maybe Text
Maybe SeverityCounts
Text
ami :: Text
severityCounts :: Maybe SeverityCounts
affectedInstances :: Maybe Integer
accountId :: Maybe Text
$sel:ami:AmiAggregationResponse' :: AmiAggregationResponse -> Text
$sel:severityCounts:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe SeverityCounts
$sel:affectedInstances:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe Integer
$sel:accountId:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
affectedInstances
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SeverityCounts
severityCounts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ami
instance Prelude.NFData AmiAggregationResponse where
rnf :: AmiAggregationResponse -> ()
rnf AmiAggregationResponse' {Maybe Integer
Maybe Text
Maybe SeverityCounts
Text
ami :: Text
severityCounts :: Maybe SeverityCounts
affectedInstances :: Maybe Integer
accountId :: Maybe Text
$sel:ami:AmiAggregationResponse' :: AmiAggregationResponse -> Text
$sel:severityCounts:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe SeverityCounts
$sel:affectedInstances:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe Integer
$sel:accountId:AmiAggregationResponse' :: AmiAggregationResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
affectedInstances
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SeverityCounts
severityCounts
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ami