{-# 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.RepositoryAggregationResponse 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 RepositoryAggregationResponse = RepositoryAggregationResponse'
{
RepositoryAggregationResponse -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
RepositoryAggregationResponse -> Maybe Integer
affectedImages :: Prelude.Maybe Prelude.Integer,
RepositoryAggregationResponse -> Maybe SeverityCounts
severityCounts :: Prelude.Maybe SeverityCounts,
RepositoryAggregationResponse -> Text
repository :: Prelude.Text
}
deriving (RepositoryAggregationResponse
-> RepositoryAggregationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositoryAggregationResponse
-> RepositoryAggregationResponse -> Bool
$c/= :: RepositoryAggregationResponse
-> RepositoryAggregationResponse -> Bool
== :: RepositoryAggregationResponse
-> RepositoryAggregationResponse -> Bool
$c== :: RepositoryAggregationResponse
-> RepositoryAggregationResponse -> Bool
Prelude.Eq, ReadPrec [RepositoryAggregationResponse]
ReadPrec RepositoryAggregationResponse
Int -> ReadS RepositoryAggregationResponse
ReadS [RepositoryAggregationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositoryAggregationResponse]
$creadListPrec :: ReadPrec [RepositoryAggregationResponse]
readPrec :: ReadPrec RepositoryAggregationResponse
$creadPrec :: ReadPrec RepositoryAggregationResponse
readList :: ReadS [RepositoryAggregationResponse]
$creadList :: ReadS [RepositoryAggregationResponse]
readsPrec :: Int -> ReadS RepositoryAggregationResponse
$creadsPrec :: Int -> ReadS RepositoryAggregationResponse
Prelude.Read, Int -> RepositoryAggregationResponse -> ShowS
[RepositoryAggregationResponse] -> ShowS
RepositoryAggregationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositoryAggregationResponse] -> ShowS
$cshowList :: [RepositoryAggregationResponse] -> ShowS
show :: RepositoryAggregationResponse -> String
$cshow :: RepositoryAggregationResponse -> String
showsPrec :: Int -> RepositoryAggregationResponse -> ShowS
$cshowsPrec :: Int -> RepositoryAggregationResponse -> ShowS
Prelude.Show, forall x.
Rep RepositoryAggregationResponse x
-> RepositoryAggregationResponse
forall x.
RepositoryAggregationResponse
-> Rep RepositoryAggregationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RepositoryAggregationResponse x
-> RepositoryAggregationResponse
$cfrom :: forall x.
RepositoryAggregationResponse
-> Rep RepositoryAggregationResponse x
Prelude.Generic)
newRepositoryAggregationResponse ::
Prelude.Text ->
RepositoryAggregationResponse
newRepositoryAggregationResponse :: Text -> RepositoryAggregationResponse
newRepositoryAggregationResponse Text
pRepository_ =
RepositoryAggregationResponse'
{ $sel:accountId:RepositoryAggregationResponse' :: Maybe Text
accountId =
forall a. Maybe a
Prelude.Nothing,
$sel:affectedImages:RepositoryAggregationResponse' :: Maybe Integer
affectedImages = forall a. Maybe a
Prelude.Nothing,
$sel:severityCounts:RepositoryAggregationResponse' :: Maybe SeverityCounts
severityCounts = forall a. Maybe a
Prelude.Nothing,
$sel:repository:RepositoryAggregationResponse' :: Text
repository = Text
pRepository_
}
repositoryAggregationResponse_accountId :: Lens.Lens' RepositoryAggregationResponse (Prelude.Maybe Prelude.Text)
repositoryAggregationResponse_accountId :: Lens' RepositoryAggregationResponse (Maybe Text)
repositoryAggregationResponse_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryAggregationResponse' {Maybe Text
accountId :: Maybe Text
$sel:accountId:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: RepositoryAggregationResponse
s@RepositoryAggregationResponse' {} Maybe Text
a -> RepositoryAggregationResponse
s {$sel:accountId:RepositoryAggregationResponse' :: Maybe Text
accountId = Maybe Text
a} :: RepositoryAggregationResponse)
repositoryAggregationResponse_affectedImages :: Lens.Lens' RepositoryAggregationResponse (Prelude.Maybe Prelude.Integer)
repositoryAggregationResponse_affectedImages :: Lens' RepositoryAggregationResponse (Maybe Integer)
repositoryAggregationResponse_affectedImages = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryAggregationResponse' {Maybe Integer
affectedImages :: Maybe Integer
$sel:affectedImages:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe Integer
affectedImages} -> Maybe Integer
affectedImages) (\s :: RepositoryAggregationResponse
s@RepositoryAggregationResponse' {} Maybe Integer
a -> RepositoryAggregationResponse
s {$sel:affectedImages:RepositoryAggregationResponse' :: Maybe Integer
affectedImages = Maybe Integer
a} :: RepositoryAggregationResponse)
repositoryAggregationResponse_severityCounts :: Lens.Lens' RepositoryAggregationResponse (Prelude.Maybe SeverityCounts)
repositoryAggregationResponse_severityCounts :: Lens' RepositoryAggregationResponse (Maybe SeverityCounts)
repositoryAggregationResponse_severityCounts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryAggregationResponse' {Maybe SeverityCounts
severityCounts :: Maybe SeverityCounts
$sel:severityCounts:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe SeverityCounts
severityCounts} -> Maybe SeverityCounts
severityCounts) (\s :: RepositoryAggregationResponse
s@RepositoryAggregationResponse' {} Maybe SeverityCounts
a -> RepositoryAggregationResponse
s {$sel:severityCounts:RepositoryAggregationResponse' :: Maybe SeverityCounts
severityCounts = Maybe SeverityCounts
a} :: RepositoryAggregationResponse)
repositoryAggregationResponse_repository :: Lens.Lens' RepositoryAggregationResponse Prelude.Text
repositoryAggregationResponse_repository :: Lens' RepositoryAggregationResponse Text
repositoryAggregationResponse_repository = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositoryAggregationResponse' {Text
repository :: Text
$sel:repository:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Text
repository} -> Text
repository) (\s :: RepositoryAggregationResponse
s@RepositoryAggregationResponse' {} Text
a -> RepositoryAggregationResponse
s {$sel:repository:RepositoryAggregationResponse' :: Text
repository = Text
a} :: RepositoryAggregationResponse)
instance Data.FromJSON RepositoryAggregationResponse where
parseJSON :: Value -> Parser RepositoryAggregationResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RepositoryAggregationResponse"
( \Object
x ->
Maybe Text
-> Maybe Integer
-> Maybe SeverityCounts
-> Text
-> RepositoryAggregationResponse
RepositoryAggregationResponse'
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
"affectedImages")
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
"repository")
)
instance
Prelude.Hashable
RepositoryAggregationResponse
where
hashWithSalt :: Int -> RepositoryAggregationResponse -> Int
hashWithSalt Int
_salt RepositoryAggregationResponse' {Maybe Integer
Maybe Text
Maybe SeverityCounts
Text
repository :: Text
severityCounts :: Maybe SeverityCounts
affectedImages :: Maybe Integer
accountId :: Maybe Text
$sel:repository:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Text
$sel:severityCounts:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe SeverityCounts
$sel:affectedImages:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe Integer
$sel:accountId:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> 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
affectedImages
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SeverityCounts
severityCounts
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
repository
instance Prelude.NFData RepositoryAggregationResponse where
rnf :: RepositoryAggregationResponse -> ()
rnf RepositoryAggregationResponse' {Maybe Integer
Maybe Text
Maybe SeverityCounts
Text
repository :: Text
severityCounts :: Maybe SeverityCounts
affectedImages :: Maybe Integer
accountId :: Maybe Text
$sel:repository:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Text
$sel:severityCounts:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe SeverityCounts
$sel:affectedImages:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> Maybe Integer
$sel:accountId:RepositoryAggregationResponse' :: RepositoryAggregationResponse -> 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
affectedImages
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
repository