{-# 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.NetworkManager.Types.Connection where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkManager.Types.ConnectionState
import Amazonka.NetworkManager.Types.Tag
import qualified Amazonka.Prelude as Prelude
data Connection = Connection'
{
Connection -> Maybe Text
connectedDeviceId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
connectedLinkId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
Connection -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
globalNetworkId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe Text
linkId :: Prelude.Maybe Prelude.Text,
Connection -> Maybe ConnectionState
state :: Prelude.Maybe ConnectionState,
Connection -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
}
deriving (Connection -> Connection -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Connection -> Connection -> Bool
$c/= :: Connection -> Connection -> Bool
== :: Connection -> Connection -> Bool
$c== :: Connection -> Connection -> Bool
Prelude.Eq, ReadPrec [Connection]
ReadPrec Connection
Int -> ReadS Connection
ReadS [Connection]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Connection]
$creadListPrec :: ReadPrec [Connection]
readPrec :: ReadPrec Connection
$creadPrec :: ReadPrec Connection
readList :: ReadS [Connection]
$creadList :: ReadS [Connection]
readsPrec :: Int -> ReadS Connection
$creadsPrec :: Int -> ReadS Connection
Prelude.Read, Int -> Connection -> ShowS
[Connection] -> ShowS
Connection -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Connection] -> ShowS
$cshowList :: [Connection] -> ShowS
show :: Connection -> String
$cshow :: Connection -> String
showsPrec :: Int -> Connection -> ShowS
$cshowsPrec :: Int -> Connection -> ShowS
Prelude.Show, forall x. Rep Connection x -> Connection
forall x. Connection -> Rep Connection x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Connection x -> Connection
$cfrom :: forall x. Connection -> Rep Connection x
Prelude.Generic)
newConnection ::
Connection
newConnection :: Connection
newConnection =
Connection'
{ $sel:connectedDeviceId:Connection' :: Maybe Text
connectedDeviceId = forall a. Maybe a
Prelude.Nothing,
$sel:connectedLinkId:Connection' :: Maybe Text
connectedLinkId = forall a. Maybe a
Prelude.Nothing,
$sel:connectionArn:Connection' :: Maybe Text
connectionArn = forall a. Maybe a
Prelude.Nothing,
$sel:connectionId:Connection' :: Maybe Text
connectionId = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:Connection' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:description:Connection' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
$sel:deviceId:Connection' :: Maybe Text
deviceId = forall a. Maybe a
Prelude.Nothing,
$sel:globalNetworkId:Connection' :: Maybe Text
globalNetworkId = forall a. Maybe a
Prelude.Nothing,
$sel:linkId:Connection' :: Maybe Text
linkId = forall a. Maybe a
Prelude.Nothing,
$sel:state:Connection' :: Maybe ConnectionState
state = forall a. Maybe a
Prelude.Nothing,
$sel:tags:Connection' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing
}
connection_connectedDeviceId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectedDeviceId :: Lens' Connection (Maybe Text)
connection_connectedDeviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
connectedDeviceId :: Maybe Text
$sel:connectedDeviceId:Connection' :: Connection -> Maybe Text
connectedDeviceId} -> Maybe Text
connectedDeviceId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectedDeviceId:Connection' :: Maybe Text
connectedDeviceId = Maybe Text
a} :: Connection)
connection_connectedLinkId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectedLinkId :: Lens' Connection (Maybe Text)
connection_connectedLinkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
connectedLinkId :: Maybe Text
$sel:connectedLinkId:Connection' :: Connection -> Maybe Text
connectedLinkId} -> Maybe Text
connectedLinkId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectedLinkId:Connection' :: Maybe Text
connectedLinkId = Maybe Text
a} :: Connection)
connection_connectionArn :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionArn :: Lens' Connection (Maybe Text)
connection_connectionArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
connectionArn :: Maybe Text
$sel:connectionArn:Connection' :: Connection -> Maybe Text
connectionArn} -> Maybe Text
connectionArn) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectionArn:Connection' :: Maybe Text
connectionArn = Maybe Text
a} :: Connection)
connection_connectionId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionId :: Lens' Connection (Maybe Text)
connection_connectionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
connectionId :: Maybe Text
$sel:connectionId:Connection' :: Connection -> Maybe Text
connectionId} -> Maybe Text
connectionId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectionId:Connection' :: Maybe Text
connectionId = Maybe Text
a} :: Connection)
connection_createdAt :: Lens.Lens' Connection (Prelude.Maybe Prelude.UTCTime)
connection_createdAt :: Lens' Connection (Maybe UTCTime)
connection_createdAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:Connection' :: Connection -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: Connection
s@Connection' {} Maybe POSIX
a -> Connection
s {$sel:createdAt:Connection' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: Connection) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
connection_description :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_description :: Lens' Connection (Maybe Text)
connection_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
description :: Maybe Text
$sel:description:Connection' :: Connection -> Maybe Text
description} -> Maybe Text
description) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:description:Connection' :: Maybe Text
description = Maybe Text
a} :: Connection)
connection_deviceId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_deviceId :: Lens' Connection (Maybe Text)
connection_deviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:Connection' :: Connection -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:deviceId:Connection' :: Maybe Text
deviceId = Maybe Text
a} :: Connection)
connection_globalNetworkId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_globalNetworkId :: Lens' Connection (Maybe Text)
connection_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
globalNetworkId :: Maybe Text
$sel:globalNetworkId:Connection' :: Connection -> Maybe Text
globalNetworkId} -> Maybe Text
globalNetworkId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:globalNetworkId:Connection' :: Maybe Text
globalNetworkId = Maybe Text
a} :: Connection)
connection_linkId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_linkId :: Lens' Connection (Maybe Text)
connection_linkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Text
linkId :: Maybe Text
$sel:linkId:Connection' :: Connection -> Maybe Text
linkId} -> Maybe Text
linkId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:linkId:Connection' :: Maybe Text
linkId = Maybe Text
a} :: Connection)
connection_state :: Lens.Lens' Connection (Prelude.Maybe ConnectionState)
connection_state :: Lens' Connection (Maybe ConnectionState)
connection_state = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe ConnectionState
state :: Maybe ConnectionState
$sel:state:Connection' :: Connection -> Maybe ConnectionState
state} -> Maybe ConnectionState
state) (\s :: Connection
s@Connection' {} Maybe ConnectionState
a -> Connection
s {$sel:state:Connection' :: Maybe ConnectionState
state = Maybe ConnectionState
a} :: Connection)
connection_tags :: Lens.Lens' Connection (Prelude.Maybe [Tag])
connection_tags :: Lens' Connection (Maybe [Tag])
connection_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:Connection' :: Connection -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: Connection
s@Connection' {} Maybe [Tag]
a -> Connection
s {$sel:tags:Connection' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: Connection) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON Connection where
parseJSON :: Value -> Parser Connection
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Connection"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionState
-> Maybe [Tag]
-> Connection
Connection'
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
"ConnectedDeviceId")
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
"ConnectedLinkId")
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
"ConnectionArn")
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
"ConnectionId")
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
"CreatedAt")
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
"Description")
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
"DeviceId")
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
"GlobalNetworkId")
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
"LinkId")
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
"State")
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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Connection where
hashWithSalt :: Int -> Connection -> Int
hashWithSalt Int
_salt Connection' {Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe ConnectionState
tags :: Maybe [Tag]
state :: Maybe ConnectionState
linkId :: Maybe Text
globalNetworkId :: Maybe Text
deviceId :: Maybe Text
description :: Maybe Text
createdAt :: Maybe POSIX
connectionId :: Maybe Text
connectionArn :: Maybe Text
connectedLinkId :: Maybe Text
connectedDeviceId :: Maybe Text
$sel:tags:Connection' :: Connection -> Maybe [Tag]
$sel:state:Connection' :: Connection -> Maybe ConnectionState
$sel:linkId:Connection' :: Connection -> Maybe Text
$sel:globalNetworkId:Connection' :: Connection -> Maybe Text
$sel:deviceId:Connection' :: Connection -> Maybe Text
$sel:description:Connection' :: Connection -> Maybe Text
$sel:createdAt:Connection' :: Connection -> Maybe POSIX
$sel:connectionId:Connection' :: Connection -> Maybe Text
$sel:connectionArn:Connection' :: Connection -> Maybe Text
$sel:connectedLinkId:Connection' :: Connection -> Maybe Text
$sel:connectedDeviceId:Connection' :: Connection -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectedDeviceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectedLinkId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
globalNetworkId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
linkId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConnectionState
state
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
instance Prelude.NFData Connection where
rnf :: Connection -> ()
rnf Connection' {Maybe [Tag]
Maybe Text
Maybe POSIX
Maybe ConnectionState
tags :: Maybe [Tag]
state :: Maybe ConnectionState
linkId :: Maybe Text
globalNetworkId :: Maybe Text
deviceId :: Maybe Text
description :: Maybe Text
createdAt :: Maybe POSIX
connectionId :: Maybe Text
connectionArn :: Maybe Text
connectedLinkId :: Maybe Text
connectedDeviceId :: Maybe Text
$sel:tags:Connection' :: Connection -> Maybe [Tag]
$sel:state:Connection' :: Connection -> Maybe ConnectionState
$sel:linkId:Connection' :: Connection -> Maybe Text
$sel:globalNetworkId:Connection' :: Connection -> Maybe Text
$sel:deviceId:Connection' :: Connection -> Maybe Text
$sel:description:Connection' :: Connection -> Maybe Text
$sel:createdAt:Connection' :: Connection -> Maybe POSIX
$sel:connectionId:Connection' :: Connection -> Maybe Text
$sel:connectionArn:Connection' :: Connection -> Maybe Text
$sel:connectedLinkId:Connection' :: Connection -> Maybe Text
$sel:connectedDeviceId:Connection' :: Connection -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectedDeviceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectedLinkId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
globalNetworkId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
linkId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConnectionState
state
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Tag]
tags