{-# 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.IoTSecureTunneling.Types.TunnelSummary where
import qualified Amazonka.Core as Core
import Amazonka.IoTSecureTunneling.Types.TunnelStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TunnelSummary = TunnelSummary'
{
TunnelSummary -> Maybe TunnelStatus
status :: Prelude.Maybe TunnelStatus,
TunnelSummary -> Maybe POSIX
lastUpdatedAt :: Prelude.Maybe Core.POSIX,
TunnelSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
TunnelSummary -> Maybe Text
tunnelArn :: Prelude.Maybe Prelude.Text,
TunnelSummary -> Maybe Text
tunnelId :: Prelude.Maybe Prelude.Text,
TunnelSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (TunnelSummary -> TunnelSummary -> Bool
(TunnelSummary -> TunnelSummary -> Bool)
-> (TunnelSummary -> TunnelSummary -> Bool) -> Eq TunnelSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TunnelSummary -> TunnelSummary -> Bool
$c/= :: TunnelSummary -> TunnelSummary -> Bool
== :: TunnelSummary -> TunnelSummary -> Bool
$c== :: TunnelSummary -> TunnelSummary -> Bool
Prelude.Eq, ReadPrec [TunnelSummary]
ReadPrec TunnelSummary
Int -> ReadS TunnelSummary
ReadS [TunnelSummary]
(Int -> ReadS TunnelSummary)
-> ReadS [TunnelSummary]
-> ReadPrec TunnelSummary
-> ReadPrec [TunnelSummary]
-> Read TunnelSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TunnelSummary]
$creadListPrec :: ReadPrec [TunnelSummary]
readPrec :: ReadPrec TunnelSummary
$creadPrec :: ReadPrec TunnelSummary
readList :: ReadS [TunnelSummary]
$creadList :: ReadS [TunnelSummary]
readsPrec :: Int -> ReadS TunnelSummary
$creadsPrec :: Int -> ReadS TunnelSummary
Prelude.Read, Int -> TunnelSummary -> ShowS
[TunnelSummary] -> ShowS
TunnelSummary -> String
(Int -> TunnelSummary -> ShowS)
-> (TunnelSummary -> String)
-> ([TunnelSummary] -> ShowS)
-> Show TunnelSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TunnelSummary] -> ShowS
$cshowList :: [TunnelSummary] -> ShowS
show :: TunnelSummary -> String
$cshow :: TunnelSummary -> String
showsPrec :: Int -> TunnelSummary -> ShowS
$cshowsPrec :: Int -> TunnelSummary -> ShowS
Prelude.Show, (forall x. TunnelSummary -> Rep TunnelSummary x)
-> (forall x. Rep TunnelSummary x -> TunnelSummary)
-> Generic TunnelSummary
forall x. Rep TunnelSummary x -> TunnelSummary
forall x. TunnelSummary -> Rep TunnelSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TunnelSummary x -> TunnelSummary
$cfrom :: forall x. TunnelSummary -> Rep TunnelSummary x
Prelude.Generic)
newTunnelSummary ::
TunnelSummary
newTunnelSummary :: TunnelSummary
newTunnelSummary =
TunnelSummary' :: Maybe TunnelStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TunnelSummary
TunnelSummary'
{ $sel:status:TunnelSummary' :: Maybe TunnelStatus
status = Maybe TunnelStatus
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedAt:TunnelSummary' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:TunnelSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:tunnelArn:TunnelSummary' :: Maybe Text
tunnelArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tunnelId:TunnelSummary' :: Maybe Text
tunnelId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:TunnelSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
tunnelSummary_status :: Lens.Lens' TunnelSummary (Prelude.Maybe TunnelStatus)
tunnelSummary_status :: (Maybe TunnelStatus -> f (Maybe TunnelStatus))
-> TunnelSummary -> f TunnelSummary
tunnelSummary_status = (TunnelSummary -> Maybe TunnelStatus)
-> (TunnelSummary -> Maybe TunnelStatus -> TunnelSummary)
-> Lens
TunnelSummary
TunnelSummary
(Maybe TunnelStatus)
(Maybe TunnelStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TunnelSummary' {Maybe TunnelStatus
status :: Maybe TunnelStatus
$sel:status:TunnelSummary' :: TunnelSummary -> Maybe TunnelStatus
status} -> Maybe TunnelStatus
status) (\s :: TunnelSummary
s@TunnelSummary' {} Maybe TunnelStatus
a -> TunnelSummary
s {$sel:status:TunnelSummary' :: Maybe TunnelStatus
status = Maybe TunnelStatus
a} :: TunnelSummary)
tunnelSummary_lastUpdatedAt :: Lens.Lens' TunnelSummary (Prelude.Maybe Prelude.UTCTime)
tunnelSummary_lastUpdatedAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TunnelSummary -> f TunnelSummary
tunnelSummary_lastUpdatedAt = (TunnelSummary -> Maybe POSIX)
-> (TunnelSummary -> Maybe POSIX -> TunnelSummary)
-> Lens TunnelSummary TunnelSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TunnelSummary' {Maybe POSIX
lastUpdatedAt :: Maybe POSIX
$sel:lastUpdatedAt:TunnelSummary' :: TunnelSummary -> Maybe POSIX
lastUpdatedAt} -> Maybe POSIX
lastUpdatedAt) (\s :: TunnelSummary
s@TunnelSummary' {} Maybe POSIX
a -> TunnelSummary
s {$sel:lastUpdatedAt:TunnelSummary' :: Maybe POSIX
lastUpdatedAt = Maybe POSIX
a} :: TunnelSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> TunnelSummary -> f TunnelSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TunnelSummary
-> f TunnelSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
tunnelSummary_createdAt :: Lens.Lens' TunnelSummary (Prelude.Maybe Prelude.UTCTime)
tunnelSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> TunnelSummary -> f TunnelSummary
tunnelSummary_createdAt = (TunnelSummary -> Maybe POSIX)
-> (TunnelSummary -> Maybe POSIX -> TunnelSummary)
-> Lens TunnelSummary TunnelSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TunnelSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:TunnelSummary' :: TunnelSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: TunnelSummary
s@TunnelSummary' {} Maybe POSIX
a -> TunnelSummary
s {$sel:createdAt:TunnelSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: TunnelSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> TunnelSummary -> f TunnelSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> TunnelSummary
-> f TunnelSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
tunnelSummary_tunnelArn :: Lens.Lens' TunnelSummary (Prelude.Maybe Prelude.Text)
tunnelSummary_tunnelArn :: (Maybe Text -> f (Maybe Text)) -> TunnelSummary -> f TunnelSummary
tunnelSummary_tunnelArn = (TunnelSummary -> Maybe Text)
-> (TunnelSummary -> Maybe Text -> TunnelSummary)
-> Lens TunnelSummary TunnelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TunnelSummary' {Maybe Text
tunnelArn :: Maybe Text
$sel:tunnelArn:TunnelSummary' :: TunnelSummary -> Maybe Text
tunnelArn} -> Maybe Text
tunnelArn) (\s :: TunnelSummary
s@TunnelSummary' {} Maybe Text
a -> TunnelSummary
s {$sel:tunnelArn:TunnelSummary' :: Maybe Text
tunnelArn = Maybe Text
a} :: TunnelSummary)
tunnelSummary_tunnelId :: Lens.Lens' TunnelSummary (Prelude.Maybe Prelude.Text)
tunnelSummary_tunnelId :: (Maybe Text -> f (Maybe Text)) -> TunnelSummary -> f TunnelSummary
tunnelSummary_tunnelId = (TunnelSummary -> Maybe Text)
-> (TunnelSummary -> Maybe Text -> TunnelSummary)
-> Lens TunnelSummary TunnelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TunnelSummary' {Maybe Text
tunnelId :: Maybe Text
$sel:tunnelId:TunnelSummary' :: TunnelSummary -> Maybe Text
tunnelId} -> Maybe Text
tunnelId) (\s :: TunnelSummary
s@TunnelSummary' {} Maybe Text
a -> TunnelSummary
s {$sel:tunnelId:TunnelSummary' :: Maybe Text
tunnelId = Maybe Text
a} :: TunnelSummary)
tunnelSummary_description :: Lens.Lens' TunnelSummary (Prelude.Maybe Prelude.Text)
tunnelSummary_description :: (Maybe Text -> f (Maybe Text)) -> TunnelSummary -> f TunnelSummary
tunnelSummary_description = (TunnelSummary -> Maybe Text)
-> (TunnelSummary -> Maybe Text -> TunnelSummary)
-> Lens TunnelSummary TunnelSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TunnelSummary' {Maybe Text
description :: Maybe Text
$sel:description:TunnelSummary' :: TunnelSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: TunnelSummary
s@TunnelSummary' {} Maybe Text
a -> TunnelSummary
s {$sel:description:TunnelSummary' :: Maybe Text
description = Maybe Text
a} :: TunnelSummary)
instance Core.FromJSON TunnelSummary where
parseJSON :: Value -> Parser TunnelSummary
parseJSON =
String
-> (Object -> Parser TunnelSummary)
-> Value
-> Parser TunnelSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TunnelSummary"
( \Object
x ->
Maybe TunnelStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TunnelSummary
TunnelSummary'
(Maybe TunnelStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TunnelSummary)
-> Parser (Maybe TunnelStatus)
-> Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TunnelSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TunnelStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> TunnelSummary)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> TunnelSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"lastUpdatedAt")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> TunnelSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> TunnelSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> TunnelSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> TunnelSummary)
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
"tunnelArn")
Parser (Maybe Text -> Maybe Text -> TunnelSummary)
-> Parser (Maybe Text) -> Parser (Maybe Text -> TunnelSummary)
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
"tunnelId")
Parser (Maybe Text -> TunnelSummary)
-> Parser (Maybe Text) -> Parser TunnelSummary
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
"description")
)
instance Prelude.Hashable TunnelSummary
instance Prelude.NFData TunnelSummary