{-# 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.DirectConnect.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.DirectConnect.Types.Connection where

import qualified Amazonka.Core as Core
import Amazonka.DirectConnect.Types.ConnectionState
import Amazonka.DirectConnect.Types.HasLogicalRedundancy
import Amazonka.DirectConnect.Types.MacSecKey
import Amazonka.DirectConnect.Types.Tag
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about an Direct Connect connection.
--
-- /See:/ 'newConnection' smart constructor.
data Connection = Connection'
  { -- | The ID of the LAG.
    Connection -> Maybe Text
lagId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the connection supports MAC Security (MACsec).
    Connection -> Maybe Bool
macSecCapable :: Prelude.Maybe Prelude.Bool,
    -- | The MAC Security (MACsec) port link status of the connection.
    --
    -- The valid values are @Encryption Up@, which means that there is an
    -- active Connection Key Name, or @Encryption Down@.
    Connection -> Maybe Text
portEncryptionStatus :: Prelude.Maybe Prelude.Text,
    -- | The ID of the VLAN.
    Connection -> Maybe Int
vlan :: Prelude.Maybe Prelude.Int,
    -- | The location of the connection.
    Connection -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The Direct Connect endpoint on which the physical connection terminates.
    Connection -> Maybe Text
awsDevice :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the connection supports a secondary BGP peer in the
    -- same address family (IPv4\/IPv6).
    Connection -> Maybe HasLogicalRedundancy
hasLogicalRedundancy :: Prelude.Maybe HasLogicalRedundancy,
    -- | The ID of the connection.
    Connection -> Maybe Text
connectionId :: Prelude.Maybe Prelude.Text,
    -- | The Direct Connect endpoint that terminates the logical connection. This
    -- device might be different than the device that terminates the physical
    -- connection.
    Connection -> Maybe Text
awsLogicalDeviceId :: Prelude.Maybe Prelude.Text,
    -- | The time of the most recent call to DescribeLoa for this connection.
    Connection -> Maybe POSIX
loaIssueTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the Direct Connect service provider associated with the
    -- connection.
    Connection -> Maybe Text
partnerName :: Prelude.Maybe Prelude.Text,
    -- | The name of the connection.
    Connection -> Maybe Text
connectionName :: Prelude.Maybe Prelude.Text,
    -- | The MAC Security (MACsec) connection encryption mode.
    --
    -- The valid values are @no_encrypt@, @should_encrypt@, and @must_encrypt@.
    Connection -> Maybe Text
encryptionMode :: Prelude.Maybe Prelude.Text,
    -- | The bandwidth of the connection.
    Connection -> Maybe Text
bandwidth :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether jumbo frames (9001 MTU) are supported.
    Connection -> Maybe Bool
jumboFrameCapable :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the Amazon Web Services account that owns the connection.
    Connection -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region where the connection is located.
    Connection -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The MAC Security (MACsec) security keys associated with the connection.
    Connection -> Maybe [MacSecKey]
macSecKeys :: Prelude.Maybe [MacSecKey],
    -- | The name of the service provider associated with the connection.
    Connection -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text,
    -- | The Direct Connect endpoint that terminates the physical connection.
    Connection -> Maybe Text
awsDeviceV2 :: Prelude.Maybe Prelude.Text,
    -- | The state of the connection. The following are the possible values:
    --
    -- -   @ordering@: The initial state of a hosted connection provisioned on
    --     an interconnect. The connection stays in the ordering state until
    --     the owner of the hosted connection confirms or declines the
    --     connection order.
    --
    -- -   @requested@: The initial state of a standard connection. The
    --     connection stays in the requested state until the Letter of
    --     Authorization (LOA) is sent to the customer.
    --
    -- -   @pending@: The connection has been approved and is being
    --     initialized.
    --
    -- -   @available@: The network link is up and the connection is ready for
    --     use.
    --
    -- -   @down@: The network link is down.
    --
    -- -   @deleting@: The connection is being deleted.
    --
    -- -   @deleted@: The connection has been deleted.
    --
    -- -   @rejected@: A hosted connection in the @ordering@ state enters the
    --     @rejected@ state if it is deleted by the customer.
    --
    -- -   @unknown@: The state of the connection is not available.
    Connection -> Maybe ConnectionState
connectionState :: Prelude.Maybe ConnectionState,
    -- | The tags associated with the connection.
    Connection -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty 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:
--
-- 'lagId', 'connection_lagId' - The ID of the LAG.
--
-- 'macSecCapable', 'connection_macSecCapable' - Indicates whether the connection supports MAC Security (MACsec).
--
-- 'portEncryptionStatus', 'connection_portEncryptionStatus' - The MAC Security (MACsec) port link status of the connection.
--
-- The valid values are @Encryption Up@, which means that there is an
-- active Connection Key Name, or @Encryption Down@.
--
-- 'vlan', 'connection_vlan' - The ID of the VLAN.
--
-- 'location', 'connection_location' - The location of the connection.
--
-- 'awsDevice', 'connection_awsDevice' - The Direct Connect endpoint on which the physical connection terminates.
--
-- 'hasLogicalRedundancy', 'connection_hasLogicalRedundancy' - Indicates whether the connection supports a secondary BGP peer in the
-- same address family (IPv4\/IPv6).
--
-- 'connectionId', 'connection_connectionId' - The ID of the connection.
--
-- 'awsLogicalDeviceId', 'connection_awsLogicalDeviceId' - The Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
--
-- 'loaIssueTime', 'connection_loaIssueTime' - The time of the most recent call to DescribeLoa for this connection.
--
-- 'partnerName', 'connection_partnerName' - The name of the Direct Connect service provider associated with the
-- connection.
--
-- 'connectionName', 'connection_connectionName' - The name of the connection.
--
-- 'encryptionMode', 'connection_encryptionMode' - The MAC Security (MACsec) connection encryption mode.
--
-- The valid values are @no_encrypt@, @should_encrypt@, and @must_encrypt@.
--
-- 'bandwidth', 'connection_bandwidth' - The bandwidth of the connection.
--
-- 'jumboFrameCapable', 'connection_jumboFrameCapable' - Indicates whether jumbo frames (9001 MTU) are supported.
--
-- 'ownerAccount', 'connection_ownerAccount' - The ID of the Amazon Web Services account that owns the connection.
--
-- 'region', 'connection_region' - The Amazon Web Services Region where the connection is located.
--
-- 'macSecKeys', 'connection_macSecKeys' - The MAC Security (MACsec) security keys associated with the connection.
--
-- 'providerName', 'connection_providerName' - The name of the service provider associated with the connection.
--
-- 'awsDeviceV2', 'connection_awsDeviceV2' - The Direct Connect endpoint that terminates the physical connection.
--
-- 'connectionState', 'connection_connectionState' - The state of the connection. The following are the possible values:
--
-- -   @ordering@: The initial state of a hosted connection provisioned on
--     an interconnect. The connection stays in the ordering state until
--     the owner of the hosted connection confirms or declines the
--     connection order.
--
-- -   @requested@: The initial state of a standard connection. The
--     connection stays in the requested state until the Letter of
--     Authorization (LOA) is sent to the customer.
--
-- -   @pending@: The connection has been approved and is being
--     initialized.
--
-- -   @available@: The network link is up and the connection is ready for
--     use.
--
-- -   @down@: The network link is down.
--
-- -   @deleting@: The connection is being deleted.
--
-- -   @deleted@: The connection has been deleted.
--
-- -   @rejected@: A hosted connection in the @ordering@ state enters the
--     @rejected@ state if it is deleted by the customer.
--
-- -   @unknown@: The state of the connection is not available.
--
-- 'tags', 'connection_tags' - The tags associated with the connection.
newConnection ::
  Connection
newConnection :: Connection
newConnection =
  Connection' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe HasLogicalRedundancy
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [MacSecKey]
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionState
-> Maybe (NonEmpty Tag)
-> Connection
Connection'
    { $sel:lagId:Connection' :: Maybe Text
lagId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:macSecCapable:Connection' :: Maybe Bool
macSecCapable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:portEncryptionStatus:Connection' :: Maybe Text
portEncryptionStatus = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:vlan:Connection' :: Maybe Int
vlan = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:location:Connection' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsDevice:Connection' :: Maybe Text
awsDevice = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hasLogicalRedundancy:Connection' :: Maybe HasLogicalRedundancy
hasLogicalRedundancy = Maybe HasLogicalRedundancy
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionId:Connection' :: Maybe Text
connectionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsLogicalDeviceId:Connection' :: Maybe Text
awsLogicalDeviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:loaIssueTime:Connection' :: Maybe POSIX
loaIssueTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:partnerName:Connection' :: Maybe Text
partnerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionName:Connection' :: Maybe Text
connectionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMode:Connection' :: Maybe Text
encryptionMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bandwidth:Connection' :: Maybe Text
bandwidth = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jumboFrameCapable:Connection' :: Maybe Bool
jumboFrameCapable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccount:Connection' :: Maybe Text
ownerAccount = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:region:Connection' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:macSecKeys:Connection' :: Maybe [MacSecKey]
macSecKeys = Maybe [MacSecKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:providerName:Connection' :: Maybe Text
providerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsDeviceV2:Connection' :: Maybe Text
awsDeviceV2 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionState:Connection' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Connection' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the LAG.
connection_lagId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_lagId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_lagId = (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
lagId :: Maybe Text
$sel:lagId:Connection' :: Connection -> Maybe Text
lagId} -> Maybe Text
lagId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:lagId:Connection' :: Maybe Text
lagId = Maybe Text
a} :: Connection)

-- | Indicates whether the connection supports MAC Security (MACsec).
connection_macSecCapable :: Lens.Lens' Connection (Prelude.Maybe Prelude.Bool)
connection_macSecCapable :: (Maybe Bool -> f (Maybe Bool)) -> Connection -> f Connection
connection_macSecCapable = (Connection -> Maybe Bool)
-> (Connection -> Maybe Bool -> Connection)
-> Lens Connection Connection (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Bool
macSecCapable :: Maybe Bool
$sel:macSecCapable:Connection' :: Connection -> Maybe Bool
macSecCapable} -> Maybe Bool
macSecCapable) (\s :: Connection
s@Connection' {} Maybe Bool
a -> Connection
s {$sel:macSecCapable:Connection' :: Maybe Bool
macSecCapable = Maybe Bool
a} :: Connection)

-- | The MAC Security (MACsec) port link status of the connection.
--
-- The valid values are @Encryption Up@, which means that there is an
-- active Connection Key Name, or @Encryption Down@.
connection_portEncryptionStatus :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_portEncryptionStatus :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_portEncryptionStatus = (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
portEncryptionStatus :: Maybe Text
$sel:portEncryptionStatus:Connection' :: Connection -> Maybe Text
portEncryptionStatus} -> Maybe Text
portEncryptionStatus) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:portEncryptionStatus:Connection' :: Maybe Text
portEncryptionStatus = Maybe Text
a} :: Connection)

-- | The ID of the VLAN.
connection_vlan :: Lens.Lens' Connection (Prelude.Maybe Prelude.Int)
connection_vlan :: (Maybe Int -> f (Maybe Int)) -> Connection -> f Connection
connection_vlan = (Connection -> Maybe Int)
-> (Connection -> Maybe Int -> Connection)
-> Lens Connection Connection (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Int
vlan :: Maybe Int
$sel:vlan:Connection' :: Connection -> Maybe Int
vlan} -> Maybe Int
vlan) (\s :: Connection
s@Connection' {} Maybe Int
a -> Connection
s {$sel:vlan:Connection' :: Maybe Int
vlan = Maybe Int
a} :: Connection)

-- | The location of the connection.
connection_location :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_location :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_location = (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
location :: Maybe Text
$sel:location:Connection' :: Connection -> Maybe Text
location} -> Maybe Text
location) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:location:Connection' :: Maybe Text
location = Maybe Text
a} :: Connection)

-- | The Direct Connect endpoint on which the physical connection terminates.
connection_awsDevice :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_awsDevice :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_awsDevice = (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
awsDevice :: Maybe Text
$sel:awsDevice:Connection' :: Connection -> Maybe Text
awsDevice} -> Maybe Text
awsDevice) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:awsDevice:Connection' :: Maybe Text
awsDevice = Maybe Text
a} :: Connection)

-- | Indicates whether the connection supports a secondary BGP peer in the
-- same address family (IPv4\/IPv6).
connection_hasLogicalRedundancy :: Lens.Lens' Connection (Prelude.Maybe HasLogicalRedundancy)
connection_hasLogicalRedundancy :: (Maybe HasLogicalRedundancy -> f (Maybe HasLogicalRedundancy))
-> Connection -> f Connection
connection_hasLogicalRedundancy = (Connection -> Maybe HasLogicalRedundancy)
-> (Connection -> Maybe HasLogicalRedundancy -> Connection)
-> Lens
     Connection
     Connection
     (Maybe HasLogicalRedundancy)
     (Maybe HasLogicalRedundancy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe HasLogicalRedundancy
hasLogicalRedundancy :: Maybe HasLogicalRedundancy
$sel:hasLogicalRedundancy:Connection' :: Connection -> Maybe HasLogicalRedundancy
hasLogicalRedundancy} -> Maybe HasLogicalRedundancy
hasLogicalRedundancy) (\s :: Connection
s@Connection' {} Maybe HasLogicalRedundancy
a -> Connection
s {$sel:hasLogicalRedundancy:Connection' :: Maybe HasLogicalRedundancy
hasLogicalRedundancy = Maybe HasLogicalRedundancy
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 Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
connection_awsLogicalDeviceId :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_awsLogicalDeviceId :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_awsLogicalDeviceId = (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
awsLogicalDeviceId :: Maybe Text
$sel:awsLogicalDeviceId:Connection' :: Connection -> Maybe Text
awsLogicalDeviceId} -> Maybe Text
awsLogicalDeviceId) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:awsLogicalDeviceId:Connection' :: Maybe Text
awsLogicalDeviceId = Maybe Text
a} :: Connection)

-- | The time of the most recent call to DescribeLoa for this connection.
connection_loaIssueTime :: Lens.Lens' Connection (Prelude.Maybe Prelude.UTCTime)
connection_loaIssueTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Connection -> f Connection
connection_loaIssueTime = (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
loaIssueTime :: Maybe POSIX
$sel:loaIssueTime:Connection' :: Connection -> Maybe POSIX
loaIssueTime} -> Maybe POSIX
loaIssueTime) (\s :: Connection
s@Connection' {} Maybe POSIX
a -> Connection
s {$sel:loaIssueTime:Connection' :: Maybe POSIX
loaIssueTime = 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 name of the Direct Connect service provider associated with the
-- connection.
connection_partnerName :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_partnerName :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_partnerName = (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
partnerName :: Maybe Text
$sel:partnerName:Connection' :: Connection -> Maybe Text
partnerName} -> Maybe Text
partnerName) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:partnerName:Connection' :: Maybe Text
partnerName = Maybe Text
a} :: Connection)

-- | The name of the connection.
connection_connectionName :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_connectionName :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_connectionName = (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
connectionName :: Maybe Text
$sel:connectionName:Connection' :: Connection -> Maybe Text
connectionName} -> Maybe Text
connectionName) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:connectionName:Connection' :: Maybe Text
connectionName = Maybe Text
a} :: Connection)

-- | The MAC Security (MACsec) connection encryption mode.
--
-- The valid values are @no_encrypt@, @should_encrypt@, and @must_encrypt@.
connection_encryptionMode :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_encryptionMode :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_encryptionMode = (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
encryptionMode :: Maybe Text
$sel:encryptionMode:Connection' :: Connection -> Maybe Text
encryptionMode} -> Maybe Text
encryptionMode) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:encryptionMode:Connection' :: Maybe Text
encryptionMode = Maybe Text
a} :: Connection)

-- | The bandwidth of the connection.
connection_bandwidth :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_bandwidth :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_bandwidth = (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
bandwidth :: Maybe Text
$sel:bandwidth:Connection' :: Connection -> Maybe Text
bandwidth} -> Maybe Text
bandwidth) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:bandwidth:Connection' :: Maybe Text
bandwidth = Maybe Text
a} :: Connection)

-- | Indicates whether jumbo frames (9001 MTU) are supported.
connection_jumboFrameCapable :: Lens.Lens' Connection (Prelude.Maybe Prelude.Bool)
connection_jumboFrameCapable :: (Maybe Bool -> f (Maybe Bool)) -> Connection -> f Connection
connection_jumboFrameCapable = (Connection -> Maybe Bool)
-> (Connection -> Maybe Bool -> Connection)
-> Lens Connection Connection (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe Bool
jumboFrameCapable :: Maybe Bool
$sel:jumboFrameCapable:Connection' :: Connection -> Maybe Bool
jumboFrameCapable} -> Maybe Bool
jumboFrameCapable) (\s :: Connection
s@Connection' {} Maybe Bool
a -> Connection
s {$sel:jumboFrameCapable:Connection' :: Maybe Bool
jumboFrameCapable = Maybe Bool
a} :: Connection)

-- | The ID of the Amazon Web Services account that owns the connection.
connection_ownerAccount :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_ownerAccount :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_ownerAccount = (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
ownerAccount :: Maybe Text
$sel:ownerAccount:Connection' :: Connection -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:ownerAccount:Connection' :: Maybe Text
ownerAccount = Maybe Text
a} :: Connection)

-- | The Amazon Web Services Region where the connection is located.
connection_region :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_region :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_region = (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
region :: Maybe Text
$sel:region:Connection' :: Connection -> Maybe Text
region} -> Maybe Text
region) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:region:Connection' :: Maybe Text
region = Maybe Text
a} :: Connection)

-- | The MAC Security (MACsec) security keys associated with the connection.
connection_macSecKeys :: Lens.Lens' Connection (Prelude.Maybe [MacSecKey])
connection_macSecKeys :: (Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> Connection -> f Connection
connection_macSecKeys = (Connection -> Maybe [MacSecKey])
-> (Connection -> Maybe [MacSecKey] -> Connection)
-> Lens
     Connection Connection (Maybe [MacSecKey]) (Maybe [MacSecKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe [MacSecKey]
macSecKeys :: Maybe [MacSecKey]
$sel:macSecKeys:Connection' :: Connection -> Maybe [MacSecKey]
macSecKeys} -> Maybe [MacSecKey]
macSecKeys) (\s :: Connection
s@Connection' {} Maybe [MacSecKey]
a -> Connection
s {$sel:macSecKeys:Connection' :: Maybe [MacSecKey]
macSecKeys = Maybe [MacSecKey]
a} :: Connection) ((Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
 -> Connection -> f Connection)
-> ((Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
    -> Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> (Maybe [MacSecKey] -> f (Maybe [MacSecKey]))
-> Connection
-> f Connection
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [MacSecKey] [MacSecKey] [MacSecKey] [MacSecKey]
-> Iso
     (Maybe [MacSecKey])
     (Maybe [MacSecKey])
     (Maybe [MacSecKey])
     (Maybe [MacSecKey])
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 [MacSecKey] [MacSecKey] [MacSecKey] [MacSecKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the service provider associated with the connection.
connection_providerName :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_providerName :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_providerName = (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
providerName :: Maybe Text
$sel:providerName:Connection' :: Connection -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:providerName:Connection' :: Maybe Text
providerName = Maybe Text
a} :: Connection)

-- | The Direct Connect endpoint that terminates the physical connection.
connection_awsDeviceV2 :: Lens.Lens' Connection (Prelude.Maybe Prelude.Text)
connection_awsDeviceV2 :: (Maybe Text -> f (Maybe Text)) -> Connection -> f Connection
connection_awsDeviceV2 = (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
awsDeviceV2 :: Maybe Text
$sel:awsDeviceV2:Connection' :: Connection -> Maybe Text
awsDeviceV2} -> Maybe Text
awsDeviceV2) (\s :: Connection
s@Connection' {} Maybe Text
a -> Connection
s {$sel:awsDeviceV2:Connection' :: Maybe Text
awsDeviceV2 = Maybe Text
a} :: Connection)

-- | The state of the connection. The following are the possible values:
--
-- -   @ordering@: The initial state of a hosted connection provisioned on
--     an interconnect. The connection stays in the ordering state until
--     the owner of the hosted connection confirms or declines the
--     connection order.
--
-- -   @requested@: The initial state of a standard connection. The
--     connection stays in the requested state until the Letter of
--     Authorization (LOA) is sent to the customer.
--
-- -   @pending@: The connection has been approved and is being
--     initialized.
--
-- -   @available@: The network link is up and the connection is ready for
--     use.
--
-- -   @down@: The network link is down.
--
-- -   @deleting@: The connection is being deleted.
--
-- -   @deleted@: The connection has been deleted.
--
-- -   @rejected@: A hosted connection in the @ordering@ state enters the
--     @rejected@ state if it is deleted by the customer.
--
-- -   @unknown@: The state of the connection is not available.
connection_connectionState :: Lens.Lens' Connection (Prelude.Maybe ConnectionState)
connection_connectionState :: (Maybe ConnectionState -> f (Maybe ConnectionState))
-> Connection -> f Connection
connection_connectionState = (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
connectionState :: Maybe ConnectionState
$sel:connectionState:Connection' :: Connection -> Maybe ConnectionState
connectionState} -> Maybe ConnectionState
connectionState) (\s :: Connection
s@Connection' {} Maybe ConnectionState
a -> Connection
s {$sel:connectionState:Connection' :: Maybe ConnectionState
connectionState = Maybe ConnectionState
a} :: Connection)

-- | The tags associated with the connection.
connection_tags :: Lens.Lens' Connection (Prelude.Maybe (Prelude.NonEmpty Tag))
connection_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Connection -> f Connection
connection_tags = (Connection -> Maybe (NonEmpty Tag))
-> (Connection -> Maybe (NonEmpty Tag) -> Connection)
-> Lens
     Connection Connection (Maybe (NonEmpty Tag)) (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Connection' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:Connection' :: Connection -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: Connection
s@Connection' {} Maybe (NonEmpty Tag)
a -> Connection
s {$sel:tags:Connection' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: Connection) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> Connection -> f Connection)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Connection
-> f Connection
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty 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 (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty 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 Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe HasLogicalRedundancy
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe [MacSecKey]
-> Maybe Text
-> Maybe Text
-> Maybe ConnectionState
-> Maybe (NonEmpty Tag)
-> Connection
Connection'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe HasLogicalRedundancy
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe [MacSecKey]
 -> Maybe Text
 -> Maybe Text
 -> Maybe ConnectionState
 -> Maybe (NonEmpty Tag)
 -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty Tag)
      -> Connection)
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
"lagId")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty Tag)
      -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"macSecCapable")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"portEncryptionStatus")
            Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty Tag)
      -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"vlan")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"location")
            Parser
  (Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"awsDevice")
            Parser
  (Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe HasLogicalRedundancy)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty Tag)
      -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HasLogicalRedundancy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hasLogicalRedundancy")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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 POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"awsLogicalDeviceId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"loaIssueTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"partnerName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"connectionName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"encryptionMode")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"bandwidth")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty Tag)
      -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jumboFrameCapable")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"ownerAccount")
            Parser
  (Maybe Text
   -> Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe [MacSecKey]
      -> Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty 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
"region")
            Parser
  (Maybe [MacSecKey]
   -> Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe [MacSecKey])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ConnectionState
      -> Maybe (NonEmpty Tag)
      -> Connection)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [MacSecKey]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"macSecKeys" Parser (Maybe (Maybe [MacSecKey]))
-> Maybe [MacSecKey] -> Parser (Maybe [MacSecKey])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [MacSecKey]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ConnectionState
   -> Maybe (NonEmpty Tag)
   -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ConnectionState -> Maybe (NonEmpty 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
"providerName")
            Parser
  (Maybe Text
   -> Maybe ConnectionState -> Maybe (NonEmpty Tag) -> Connection)
-> Parser (Maybe Text)
-> Parser
     (Maybe ConnectionState -> Maybe (NonEmpty 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
"awsDeviceV2")
            Parser
  (Maybe ConnectionState -> Maybe (NonEmpty Tag) -> Connection)
-> Parser (Maybe ConnectionState)
-> Parser (Maybe (NonEmpty Tag) -> Connection)
forall (f :: * -> *) a b. Applicative f => 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
"connectionState")
            Parser (Maybe (NonEmpty Tag) -> Connection)
-> Parser (Maybe (NonEmpty Tag)) -> Parser Connection
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags")
      )

instance Prelude.Hashable Connection

instance Prelude.NFData Connection