{-# 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.Inspector.Types.AssessmentTarget where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AssessmentTarget = AssessmentTarget'
{
AssessmentTarget -> Maybe Text
resourceGroupArn :: Prelude.Maybe Prelude.Text,
AssessmentTarget -> Text
arn :: Prelude.Text,
AssessmentTarget -> Text
name :: Prelude.Text,
AssessmentTarget -> POSIX
createdAt :: Core.POSIX,
AssessmentTarget -> POSIX
updatedAt :: Core.POSIX
}
deriving (AssessmentTarget -> AssessmentTarget -> Bool
(AssessmentTarget -> AssessmentTarget -> Bool)
-> (AssessmentTarget -> AssessmentTarget -> Bool)
-> Eq AssessmentTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssessmentTarget -> AssessmentTarget -> Bool
$c/= :: AssessmentTarget -> AssessmentTarget -> Bool
== :: AssessmentTarget -> AssessmentTarget -> Bool
$c== :: AssessmentTarget -> AssessmentTarget -> Bool
Prelude.Eq, ReadPrec [AssessmentTarget]
ReadPrec AssessmentTarget
Int -> ReadS AssessmentTarget
ReadS [AssessmentTarget]
(Int -> ReadS AssessmentTarget)
-> ReadS [AssessmentTarget]
-> ReadPrec AssessmentTarget
-> ReadPrec [AssessmentTarget]
-> Read AssessmentTarget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssessmentTarget]
$creadListPrec :: ReadPrec [AssessmentTarget]
readPrec :: ReadPrec AssessmentTarget
$creadPrec :: ReadPrec AssessmentTarget
readList :: ReadS [AssessmentTarget]
$creadList :: ReadS [AssessmentTarget]
readsPrec :: Int -> ReadS AssessmentTarget
$creadsPrec :: Int -> ReadS AssessmentTarget
Prelude.Read, Int -> AssessmentTarget -> ShowS
[AssessmentTarget] -> ShowS
AssessmentTarget -> String
(Int -> AssessmentTarget -> ShowS)
-> (AssessmentTarget -> String)
-> ([AssessmentTarget] -> ShowS)
-> Show AssessmentTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssessmentTarget] -> ShowS
$cshowList :: [AssessmentTarget] -> ShowS
show :: AssessmentTarget -> String
$cshow :: AssessmentTarget -> String
showsPrec :: Int -> AssessmentTarget -> ShowS
$cshowsPrec :: Int -> AssessmentTarget -> ShowS
Prelude.Show, (forall x. AssessmentTarget -> Rep AssessmentTarget x)
-> (forall x. Rep AssessmentTarget x -> AssessmentTarget)
-> Generic AssessmentTarget
forall x. Rep AssessmentTarget x -> AssessmentTarget
forall x. AssessmentTarget -> Rep AssessmentTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssessmentTarget x -> AssessmentTarget
$cfrom :: forall x. AssessmentTarget -> Rep AssessmentTarget x
Prelude.Generic)
newAssessmentTarget ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
AssessmentTarget
newAssessmentTarget :: Text -> Text -> UTCTime -> UTCTime -> AssessmentTarget
newAssessmentTarget
Text
pArn_
Text
pName_
UTCTime
pCreatedAt_
UTCTime
pUpdatedAt_ =
AssessmentTarget' :: Maybe Text -> Text -> Text -> POSIX -> POSIX -> AssessmentTarget
AssessmentTarget'
{ $sel:resourceGroupArn:AssessmentTarget' :: Maybe Text
resourceGroupArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:AssessmentTarget' :: Text
arn = Text
pArn_,
$sel:name:AssessmentTarget' :: Text
name = Text
pName_,
$sel:createdAt:AssessmentTarget' :: POSIX
createdAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pCreatedAt_,
$sel:updatedAt:AssessmentTarget' :: POSIX
updatedAt = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pUpdatedAt_
}
assessmentTarget_resourceGroupArn :: Lens.Lens' AssessmentTarget (Prelude.Maybe Prelude.Text)
assessmentTarget_resourceGroupArn :: (Maybe Text -> f (Maybe Text))
-> AssessmentTarget -> f AssessmentTarget
assessmentTarget_resourceGroupArn = (AssessmentTarget -> Maybe Text)
-> (AssessmentTarget -> Maybe Text -> AssessmentTarget)
-> Lens AssessmentTarget AssessmentTarget (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTarget' {Maybe Text
resourceGroupArn :: Maybe Text
$sel:resourceGroupArn:AssessmentTarget' :: AssessmentTarget -> Maybe Text
resourceGroupArn} -> Maybe Text
resourceGroupArn) (\s :: AssessmentTarget
s@AssessmentTarget' {} Maybe Text
a -> AssessmentTarget
s {$sel:resourceGroupArn:AssessmentTarget' :: Maybe Text
resourceGroupArn = Maybe Text
a} :: AssessmentTarget)
assessmentTarget_arn :: Lens.Lens' AssessmentTarget Prelude.Text
assessmentTarget_arn :: (Text -> f Text) -> AssessmentTarget -> f AssessmentTarget
assessmentTarget_arn = (AssessmentTarget -> Text)
-> (AssessmentTarget -> Text -> AssessmentTarget)
-> Lens AssessmentTarget AssessmentTarget Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTarget' {Text
arn :: Text
$sel:arn:AssessmentTarget' :: AssessmentTarget -> Text
arn} -> Text
arn) (\s :: AssessmentTarget
s@AssessmentTarget' {} Text
a -> AssessmentTarget
s {$sel:arn:AssessmentTarget' :: Text
arn = Text
a} :: AssessmentTarget)
assessmentTarget_name :: Lens.Lens' AssessmentTarget Prelude.Text
assessmentTarget_name :: (Text -> f Text) -> AssessmentTarget -> f AssessmentTarget
assessmentTarget_name = (AssessmentTarget -> Text)
-> (AssessmentTarget -> Text -> AssessmentTarget)
-> Lens AssessmentTarget AssessmentTarget Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTarget' {Text
name :: Text
$sel:name:AssessmentTarget' :: AssessmentTarget -> Text
name} -> Text
name) (\s :: AssessmentTarget
s@AssessmentTarget' {} Text
a -> AssessmentTarget
s {$sel:name:AssessmentTarget' :: Text
name = Text
a} :: AssessmentTarget)
assessmentTarget_createdAt :: Lens.Lens' AssessmentTarget Prelude.UTCTime
assessmentTarget_createdAt :: (UTCTime -> f UTCTime) -> AssessmentTarget -> f AssessmentTarget
assessmentTarget_createdAt = (AssessmentTarget -> POSIX)
-> (AssessmentTarget -> POSIX -> AssessmentTarget)
-> Lens AssessmentTarget AssessmentTarget POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTarget' {POSIX
createdAt :: POSIX
$sel:createdAt:AssessmentTarget' :: AssessmentTarget -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AssessmentTarget
s@AssessmentTarget' {} POSIX
a -> AssessmentTarget
s {$sel:createdAt:AssessmentTarget' :: POSIX
createdAt = POSIX
a} :: AssessmentTarget) ((POSIX -> f POSIX) -> AssessmentTarget -> f AssessmentTarget)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssessmentTarget
-> f AssessmentTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
assessmentTarget_updatedAt :: Lens.Lens' AssessmentTarget Prelude.UTCTime
assessmentTarget_updatedAt :: (UTCTime -> f UTCTime) -> AssessmentTarget -> f AssessmentTarget
assessmentTarget_updatedAt = (AssessmentTarget -> POSIX)
-> (AssessmentTarget -> POSIX -> AssessmentTarget)
-> Lens AssessmentTarget AssessmentTarget POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssessmentTarget' {POSIX
updatedAt :: POSIX
$sel:updatedAt:AssessmentTarget' :: AssessmentTarget -> POSIX
updatedAt} -> POSIX
updatedAt) (\s :: AssessmentTarget
s@AssessmentTarget' {} POSIX
a -> AssessmentTarget
s {$sel:updatedAt:AssessmentTarget' :: POSIX
updatedAt = POSIX
a} :: AssessmentTarget) ((POSIX -> f POSIX) -> AssessmentTarget -> f AssessmentTarget)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AssessmentTarget
-> f AssessmentTarget
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON AssessmentTarget where
parseJSON :: Value -> Parser AssessmentTarget
parseJSON =
String
-> (Object -> Parser AssessmentTarget)
-> Value
-> Parser AssessmentTarget
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AssessmentTarget"
( \Object
x ->
Maybe Text -> Text -> Text -> POSIX -> POSIX -> AssessmentTarget
AssessmentTarget'
(Maybe Text -> Text -> Text -> POSIX -> POSIX -> AssessmentTarget)
-> Parser (Maybe Text)
-> Parser (Text -> Text -> POSIX -> POSIX -> AssessmentTarget)
forall (f :: * -> *) a b. Functor 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
"resourceGroupArn")
Parser (Text -> Text -> POSIX -> POSIX -> AssessmentTarget)
-> Parser Text
-> Parser (Text -> POSIX -> POSIX -> AssessmentTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"arn")
Parser (Text -> POSIX -> POSIX -> AssessmentTarget)
-> Parser Text -> Parser (POSIX -> POSIX -> AssessmentTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
Parser (POSIX -> POSIX -> AssessmentTarget)
-> Parser POSIX -> Parser (POSIX -> AssessmentTarget)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"createdAt")
Parser (POSIX -> AssessmentTarget)
-> Parser POSIX -> Parser AssessmentTarget
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"updatedAt")
)
instance Prelude.Hashable AssessmentTarget
instance Prelude.NFData AssessmentTarget