{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.NetworkManager.Types.Connection
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.NetworkManager.Types.Connection where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkManager.Types.ConnectionState
import Amazonka.NetworkManager.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Describes a connection.
--
-- /See:/ 'newConnection' smart constructor.
data Connection = Connection'
  { -- | The state of the connection.
    Connection -> Maybe ConnectionState
state :: Prelude.Maybe ConnectionState,
    -- | The date and time that the connection was created.
    Connection -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The ID of the global network.
    Connection -> Maybe Text
globalNetworkId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the connection.
    Connection -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the second device in the connection.
    Connection -> Maybe Text
connectedDeviceId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the link for the second device in the connection.
    Connection -> Maybe Text
connectedLinkId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the link for the first device in the connection.
    Connection -> Maybe Text
linkId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the first device in the connection.
    Connection -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the connection.
    Connection -> Maybe Text
connectionArn :: Prelude.Maybe Prelude.Text,
    -- | The description of the connection.
    Connection -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags for the connection.
    Connection -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (Connection -> Connection -> Bool
(Connection -> Connection -> Bool)
-> (Connection -> Connection -> Bool) -> Eq Connection
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]
(Int -> ReadS Connection)
-> ReadS [Connection]
-> ReadPrec Connection
-> ReadPrec [Connection]
-> Read 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
(Int -> Connection -> ShowS)
-> (Connection -> String)
-> ([Connection] -> ShowS)
-> Show Connection
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. Connection -> Rep Connection x)
-> (forall x. Rep Connection x -> Connection) -> Generic Connection
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)

-- |
-- Create a value of 'Connection' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'state', 'connection_state' - The state of the connection.
--
-- 'createdAt', 'connection_createdAt' - The date and time that the connection was created.
--
-- 'globalNetworkId', 'connection_globalNetworkId' - The ID of the global network.
--
-- 'connectionId', 'connection_connectionId' - The ID of the connection.
--
-- 'connectedDeviceId', 'connection_connectedDeviceId' - The ID of the second device in the connection.
--
-- 'connectedLinkId', 'connection_connectedLinkId' - The ID of the link for the second device in the connection.
--
-- 'linkId', 'connection_linkId' - The ID of the link for the first device in the connection.
--
-- 'deviceId', 'connection_deviceId' - The ID of the first device in the connection.
--
-- 'connectionArn', 'connection_connectionArn' - The Amazon Resource Name (ARN) of the connection.
--
-- 'description', 'connection_description' - The description of the connection.
--
-- 'tags', 'connection_tags' - The tags for the connection.
newConnection ::
  Connection
newConnection :: Connection
newConnection =
  Connection' :: Maybe ConnectionState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Connection
Connection'
    { $sel:state:Connection' :: Maybe ConnectionState
state = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:Connection' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:Connection' :: Maybe Text
globalNetworkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionId:Connection' :: Maybe Text
connectionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectedDeviceId:Connection' :: Maybe Text
connectedDeviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectedLinkId:Connection' :: Maybe Text
connectedLinkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:linkId:Connection' :: Maybe Text
linkId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceId:Connection' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionArn:Connection' :: Maybe Text
connectionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Connection' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Connection' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The state of the connection.
connection_state :: Lens.Lens' Connection (Prelude.Maybe ConnectionState)
connection_state :: (Maybe ConnectionState -> f (Maybe ConnectionState))
-> Connection -> f Connection
connection_state = (Connection -> Maybe ConnectionState)
-> (Connection -> Maybe ConnectionState -> Connection)
-> Lens
     Connection
     Connection
     (Maybe ConnectionState)
     (Maybe ConnectionState)
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)

-- | The date and time that the connection was created.
connection_createdAt :: Lens.Lens' Connection (Prelude.Maybe Prelude.UTCTime)
connection_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Connection -> f Connection
connection_createdAt = (Connection -> Maybe POSIX)
-> (Connection -> Maybe POSIX -> Connection)
-> Lens Connection Connection (Maybe POSIX) (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX)) -> Connection -> f Connection)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Connection
-> f Connection
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

-- | The ID of the global network.
connection_globalNetworkId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_globalNetworkId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_globalNetworkId = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The ID of the connection.
connection_connectionId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_connectionId = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The ID of the second device in the connection.
connection_connectedDeviceId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectedDeviceId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_connectedDeviceId = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The ID of the link for the second device in the connection.
connection_connectedLinkId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectedLinkId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_connectedLinkId = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The ID of the link for the first device in the connection.
connection_linkId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_linkId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_linkId = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The ID of the first device in the connection.
connection_deviceId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_deviceId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_deviceId = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The Amazon Resource Name (ARN) of the connection.
connection_connectionArn :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionArn :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_connectionArn = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The description of the connection.
connection_description :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_description :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_description = (Connection -> Maybe Text)
-> (Connection -> Maybe Text -> Connection)
-> Lens Connection Connection (Maybe Text) (Maybe Text)
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)

-- | The tags for the connection.
connection_tags :: Lens.Lens' Connection (Prelude.Maybe [Tag])
connection_tags :: (Maybe [Tag] -> f (Maybe [Tag])) -> Connection -> f Connection
connection_tags = (Connection -> Maybe [Tag])
-> (Connection -> Maybe [Tag] -> Connection)
-> Lens Connection Connection (Maybe [Tag]) (Maybe [Tag])
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) ((Maybe [Tag] -> f (Maybe [Tag])) -> Connection -> f Connection)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> Connection
-> f Connection
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Connection where
  parseJSON :: Value -> Parser Connection
parseJSON =
    String
-> (Object -> Parser Connection) -> Value -> Parser Connection
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Connection"
      ( \Object
x ->
          Maybe ConnectionState
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Connection
Connection'
            (Maybe ConnectionState
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Tag]
 -> Connection)
-> Parser (Maybe ConnectionState)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Connection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ConnectionState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"State")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Connection)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Connection)
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
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Connection)
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
"GlobalNetworkId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Connection)
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
"ConnectionId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Connection)
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
"ConnectedDeviceId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Tag]
      -> Connection)
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
"ConnectedLinkId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Tag]
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Connection)
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
"LinkId")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe [Tag] -> Connection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Connection)
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
"DeviceId")
            Parser (Maybe Text -> Maybe Text -> Maybe [Tag] -> Connection)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe [Tag] -> Connection)
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
"ConnectionArn")
            Parser (Maybe Text -> Maybe [Tag] -> Connection)
-> Parser (Maybe Text) -> Parser (Maybe [Tag] -> Connection)
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")
            Parser (Maybe [Tag] -> Connection)
-> Parser (Maybe [Tag]) -> Parser Connection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Connection

instance Prelude.NFData Connection