{-# 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.CloudTrail.Types.TrailInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TrailInfo = TrailInfo'
{
TrailInfo -> Maybe Text
trailARN :: Prelude.Maybe Prelude.Text,
TrailInfo -> Maybe Text
homeRegion :: Prelude.Maybe Prelude.Text,
TrailInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (TrailInfo -> TrailInfo -> Bool
(TrailInfo -> TrailInfo -> Bool)
-> (TrailInfo -> TrailInfo -> Bool) -> Eq TrailInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TrailInfo -> TrailInfo -> Bool
$c/= :: TrailInfo -> TrailInfo -> Bool
== :: TrailInfo -> TrailInfo -> Bool
$c== :: TrailInfo -> TrailInfo -> Bool
Prelude.Eq, ReadPrec [TrailInfo]
ReadPrec TrailInfo
Int -> ReadS TrailInfo
ReadS [TrailInfo]
(Int -> ReadS TrailInfo)
-> ReadS [TrailInfo]
-> ReadPrec TrailInfo
-> ReadPrec [TrailInfo]
-> Read TrailInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TrailInfo]
$creadListPrec :: ReadPrec [TrailInfo]
readPrec :: ReadPrec TrailInfo
$creadPrec :: ReadPrec TrailInfo
readList :: ReadS [TrailInfo]
$creadList :: ReadS [TrailInfo]
readsPrec :: Int -> ReadS TrailInfo
$creadsPrec :: Int -> ReadS TrailInfo
Prelude.Read, Int -> TrailInfo -> ShowS
[TrailInfo] -> ShowS
TrailInfo -> String
(Int -> TrailInfo -> ShowS)
-> (TrailInfo -> String)
-> ([TrailInfo] -> ShowS)
-> Show TrailInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TrailInfo] -> ShowS
$cshowList :: [TrailInfo] -> ShowS
show :: TrailInfo -> String
$cshow :: TrailInfo -> String
showsPrec :: Int -> TrailInfo -> ShowS
$cshowsPrec :: Int -> TrailInfo -> ShowS
Prelude.Show, (forall x. TrailInfo -> Rep TrailInfo x)
-> (forall x. Rep TrailInfo x -> TrailInfo) -> Generic TrailInfo
forall x. Rep TrailInfo x -> TrailInfo
forall x. TrailInfo -> Rep TrailInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TrailInfo x -> TrailInfo
$cfrom :: forall x. TrailInfo -> Rep TrailInfo x
Prelude.Generic)
newTrailInfo ::
TrailInfo
newTrailInfo :: TrailInfo
newTrailInfo =
TrailInfo' :: Maybe Text -> Maybe Text -> Maybe Text -> TrailInfo
TrailInfo'
{ $sel:trailARN:TrailInfo' :: Maybe Text
trailARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:homeRegion:TrailInfo' :: Maybe Text
homeRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:TrailInfo' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
trailInfo_trailARN :: Lens.Lens' TrailInfo (Prelude.Maybe Prelude.Text)
trailInfo_trailARN :: (Maybe Text -> f (Maybe Text)) -> TrailInfo -> f TrailInfo
trailInfo_trailARN = (TrailInfo -> Maybe Text)
-> (TrailInfo -> Maybe Text -> TrailInfo)
-> Lens TrailInfo TrailInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrailInfo' {Maybe Text
trailARN :: Maybe Text
$sel:trailARN:TrailInfo' :: TrailInfo -> Maybe Text
trailARN} -> Maybe Text
trailARN) (\s :: TrailInfo
s@TrailInfo' {} Maybe Text
a -> TrailInfo
s {$sel:trailARN:TrailInfo' :: Maybe Text
trailARN = Maybe Text
a} :: TrailInfo)
trailInfo_homeRegion :: Lens.Lens' TrailInfo (Prelude.Maybe Prelude.Text)
trailInfo_homeRegion :: (Maybe Text -> f (Maybe Text)) -> TrailInfo -> f TrailInfo
trailInfo_homeRegion = (TrailInfo -> Maybe Text)
-> (TrailInfo -> Maybe Text -> TrailInfo)
-> Lens TrailInfo TrailInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrailInfo' {Maybe Text
homeRegion :: Maybe Text
$sel:homeRegion:TrailInfo' :: TrailInfo -> Maybe Text
homeRegion} -> Maybe Text
homeRegion) (\s :: TrailInfo
s@TrailInfo' {} Maybe Text
a -> TrailInfo
s {$sel:homeRegion:TrailInfo' :: Maybe Text
homeRegion = Maybe Text
a} :: TrailInfo)
trailInfo_name :: Lens.Lens' TrailInfo (Prelude.Maybe Prelude.Text)
trailInfo_name :: (Maybe Text -> f (Maybe Text)) -> TrailInfo -> f TrailInfo
trailInfo_name = (TrailInfo -> Maybe Text)
-> (TrailInfo -> Maybe Text -> TrailInfo)
-> Lens TrailInfo TrailInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TrailInfo' {Maybe Text
name :: Maybe Text
$sel:name:TrailInfo' :: TrailInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: TrailInfo
s@TrailInfo' {} Maybe Text
a -> TrailInfo
s {$sel:name:TrailInfo' :: Maybe Text
name = Maybe Text
a} :: TrailInfo)
instance Core.FromJSON TrailInfo where
parseJSON :: Value -> Parser TrailInfo
parseJSON =
String -> (Object -> Parser TrailInfo) -> Value -> Parser TrailInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TrailInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> TrailInfo
TrailInfo'
(Maybe Text -> Maybe Text -> Maybe Text -> TrailInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> TrailInfo)
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
"TrailARN")
Parser (Maybe Text -> Maybe Text -> TrailInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> TrailInfo)
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
"HomeRegion")
Parser (Maybe Text -> TrailInfo)
-> Parser (Maybe Text) -> Parser TrailInfo
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
"Name")
)
instance Prelude.Hashable TrailInfo
instance Prelude.NFData TrailInfo