{-# 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.Interconnect
-- 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.Interconnect where

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

-- | Information about an interconnect.
--
-- /See:/ 'newInterconnect' smart constructor.
data Interconnect = Interconnect'
  { -- | The ID of the LAG.
    Interconnect -> Maybe Text
lagId :: Prelude.Maybe Prelude.Text,
    -- | The ID of the interconnect.
    Interconnect -> Maybe Text
interconnectId :: Prelude.Maybe Prelude.Text,
    -- | The location of the connection.
    Interconnect -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | The name of the interconnect.
    Interconnect -> Maybe Text
interconnectName :: Prelude.Maybe Prelude.Text,
    -- | The Direct Connect endpoint on which the physical connection terminates.
    Interconnect -> Maybe Text
awsDevice :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the interconnect supports a secondary BGP in the same
    -- address family (IPv4\/IPv6).
    Interconnect -> Maybe HasLogicalRedundancy
hasLogicalRedundancy :: Prelude.Maybe HasLogicalRedundancy,
    -- | The Direct Connect endpoint that terminates the logical connection. This
    -- device might be different than the device that terminates the physical
    -- connection.
    Interconnect -> Maybe Text
awsLogicalDeviceId :: Prelude.Maybe Prelude.Text,
    -- | The time of the most recent call to DescribeLoa for this connection.
    Interconnect -> Maybe POSIX
loaIssueTime :: Prelude.Maybe Core.POSIX,
    -- | The bandwidth of the connection.
    Interconnect -> Maybe Text
bandwidth :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether jumbo frames (9001 MTU) are supported.
    Interconnect -> Maybe Bool
jumboFrameCapable :: Prelude.Maybe Prelude.Bool,
    -- | The state of the interconnect. The following are the possible values:
    --
    -- -   @requested@: The initial state of an interconnect. The interconnect
    --     stays in the requested state until the Letter of Authorization (LOA)
    --     is sent to the customer.
    --
    -- -   @pending@: The interconnect is approved, and is being initialized.
    --
    -- -   @available@: The network link is up, and the interconnect is ready
    --     for use.
    --
    -- -   @down@: The network link is down.
    --
    -- -   @deleting@: The interconnect is being deleted.
    --
    -- -   @deleted@: The interconnect is deleted.
    --
    -- -   @unknown@: The state of the interconnect is not available.
    Interconnect -> Maybe InterconnectState
interconnectState :: Prelude.Maybe InterconnectState,
    -- | The Amazon Web Services Region where the connection is located.
    Interconnect -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The name of the service provider associated with the interconnect.
    Interconnect -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text,
    -- | The Direct Connect endpoint that terminates the physical connection.
    Interconnect -> Maybe Text
awsDeviceV2 :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the interconnect.
    Interconnect -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag)
  }
  deriving (Interconnect -> Interconnect -> Bool
(Interconnect -> Interconnect -> Bool)
-> (Interconnect -> Interconnect -> Bool) -> Eq Interconnect
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Interconnect -> Interconnect -> Bool
$c/= :: Interconnect -> Interconnect -> Bool
== :: Interconnect -> Interconnect -> Bool
$c== :: Interconnect -> Interconnect -> Bool
Prelude.Eq, ReadPrec [Interconnect]
ReadPrec Interconnect
Int -> ReadS Interconnect
ReadS [Interconnect]
(Int -> ReadS Interconnect)
-> ReadS [Interconnect]
-> ReadPrec Interconnect
-> ReadPrec [Interconnect]
-> Read Interconnect
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Interconnect]
$creadListPrec :: ReadPrec [Interconnect]
readPrec :: ReadPrec Interconnect
$creadPrec :: ReadPrec Interconnect
readList :: ReadS [Interconnect]
$creadList :: ReadS [Interconnect]
readsPrec :: Int -> ReadS Interconnect
$creadsPrec :: Int -> ReadS Interconnect
Prelude.Read, Int -> Interconnect -> ShowS
[Interconnect] -> ShowS
Interconnect -> String
(Int -> Interconnect -> ShowS)
-> (Interconnect -> String)
-> ([Interconnect] -> ShowS)
-> Show Interconnect
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Interconnect] -> ShowS
$cshowList :: [Interconnect] -> ShowS
show :: Interconnect -> String
$cshow :: Interconnect -> String
showsPrec :: Int -> Interconnect -> ShowS
$cshowsPrec :: Int -> Interconnect -> ShowS
Prelude.Show, (forall x. Interconnect -> Rep Interconnect x)
-> (forall x. Rep Interconnect x -> Interconnect)
-> Generic Interconnect
forall x. Rep Interconnect x -> Interconnect
forall x. Interconnect -> Rep Interconnect x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Interconnect x -> Interconnect
$cfrom :: forall x. Interconnect -> Rep Interconnect x
Prelude.Generic)

-- |
-- Create a value of 'Interconnect' 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', 'interconnect_lagId' - The ID of the LAG.
--
-- 'interconnectId', 'interconnect_interconnectId' - The ID of the interconnect.
--
-- 'location', 'interconnect_location' - The location of the connection.
--
-- 'interconnectName', 'interconnect_interconnectName' - The name of the interconnect.
--
-- 'awsDevice', 'interconnect_awsDevice' - The Direct Connect endpoint on which the physical connection terminates.
--
-- 'hasLogicalRedundancy', 'interconnect_hasLogicalRedundancy' - Indicates whether the interconnect supports a secondary BGP in the same
-- address family (IPv4\/IPv6).
--
-- 'awsLogicalDeviceId', 'interconnect_awsLogicalDeviceId' - The Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
--
-- 'loaIssueTime', 'interconnect_loaIssueTime' - The time of the most recent call to DescribeLoa for this connection.
--
-- 'bandwidth', 'interconnect_bandwidth' - The bandwidth of the connection.
--
-- 'jumboFrameCapable', 'interconnect_jumboFrameCapable' - Indicates whether jumbo frames (9001 MTU) are supported.
--
-- 'interconnectState', 'interconnect_interconnectState' - The state of the interconnect. The following are the possible values:
--
-- -   @requested@: The initial state of an interconnect. The interconnect
--     stays in the requested state until the Letter of Authorization (LOA)
--     is sent to the customer.
--
-- -   @pending@: The interconnect is approved, and is being initialized.
--
-- -   @available@: The network link is up, and the interconnect is ready
--     for use.
--
-- -   @down@: The network link is down.
--
-- -   @deleting@: The interconnect is being deleted.
--
-- -   @deleted@: The interconnect is deleted.
--
-- -   @unknown@: The state of the interconnect is not available.
--
-- 'region', 'interconnect_region' - The Amazon Web Services Region where the connection is located.
--
-- 'providerName', 'interconnect_providerName' - The name of the service provider associated with the interconnect.
--
-- 'awsDeviceV2', 'interconnect_awsDeviceV2' - The Direct Connect endpoint that terminates the physical connection.
--
-- 'tags', 'interconnect_tags' - The tags associated with the interconnect.
newInterconnect ::
  Interconnect
newInterconnect :: Interconnect
newInterconnect =
  Interconnect' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe HasLogicalRedundancy
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe InterconnectState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Interconnect
Interconnect'
    { $sel:lagId:Interconnect' :: Maybe Text
lagId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:interconnectId:Interconnect' :: Maybe Text
interconnectId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:Interconnect' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:interconnectName:Interconnect' :: Maybe Text
interconnectName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsDevice:Interconnect' :: Maybe Text
awsDevice = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hasLogicalRedundancy:Interconnect' :: Maybe HasLogicalRedundancy
hasLogicalRedundancy = Maybe HasLogicalRedundancy
forall a. Maybe a
Prelude.Nothing,
      $sel:awsLogicalDeviceId:Interconnect' :: Maybe Text
awsLogicalDeviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:loaIssueTime:Interconnect' :: Maybe POSIX
loaIssueTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:bandwidth:Interconnect' :: Maybe Text
bandwidth = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:jumboFrameCapable:Interconnect' :: Maybe Bool
jumboFrameCapable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:interconnectState:Interconnect' :: Maybe InterconnectState
interconnectState = Maybe InterconnectState
forall a. Maybe a
Prelude.Nothing,
      $sel:region:Interconnect' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:providerName:Interconnect' :: Maybe Text
providerName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:awsDeviceV2:Interconnect' :: Maybe Text
awsDeviceV2 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Interconnect' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the LAG.
interconnect_lagId :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_lagId :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_lagId = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
lagId :: Maybe Text
$sel:lagId:Interconnect' :: Interconnect -> Maybe Text
lagId} -> Maybe Text
lagId) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:lagId:Interconnect' :: Maybe Text
lagId = Maybe Text
a} :: Interconnect)

-- | The ID of the interconnect.
interconnect_interconnectId :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_interconnectId :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_interconnectId = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
interconnectId :: Maybe Text
$sel:interconnectId:Interconnect' :: Interconnect -> Maybe Text
interconnectId} -> Maybe Text
interconnectId) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:interconnectId:Interconnect' :: Maybe Text
interconnectId = Maybe Text
a} :: Interconnect)

-- | The location of the connection.
interconnect_location :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_location :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_location = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
location :: Maybe Text
$sel:location:Interconnect' :: Interconnect -> Maybe Text
location} -> Maybe Text
location) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:location:Interconnect' :: Maybe Text
location = Maybe Text
a} :: Interconnect)

-- | The name of the interconnect.
interconnect_interconnectName :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_interconnectName :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_interconnectName = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
interconnectName :: Maybe Text
$sel:interconnectName:Interconnect' :: Interconnect -> Maybe Text
interconnectName} -> Maybe Text
interconnectName) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:interconnectName:Interconnect' :: Maybe Text
interconnectName = Maybe Text
a} :: Interconnect)

-- | The Direct Connect endpoint on which the physical connection terminates.
interconnect_awsDevice :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_awsDevice :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_awsDevice = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
awsDevice :: Maybe Text
$sel:awsDevice:Interconnect' :: Interconnect -> Maybe Text
awsDevice} -> Maybe Text
awsDevice) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:awsDevice:Interconnect' :: Maybe Text
awsDevice = Maybe Text
a} :: Interconnect)

-- | Indicates whether the interconnect supports a secondary BGP in the same
-- address family (IPv4\/IPv6).
interconnect_hasLogicalRedundancy :: Lens.Lens' Interconnect (Prelude.Maybe HasLogicalRedundancy)
interconnect_hasLogicalRedundancy :: (Maybe HasLogicalRedundancy -> f (Maybe HasLogicalRedundancy))
-> Interconnect -> f Interconnect
interconnect_hasLogicalRedundancy = (Interconnect -> Maybe HasLogicalRedundancy)
-> (Interconnect -> Maybe HasLogicalRedundancy -> Interconnect)
-> Lens
     Interconnect
     Interconnect
     (Maybe HasLogicalRedundancy)
     (Maybe HasLogicalRedundancy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe HasLogicalRedundancy
hasLogicalRedundancy :: Maybe HasLogicalRedundancy
$sel:hasLogicalRedundancy:Interconnect' :: Interconnect -> Maybe HasLogicalRedundancy
hasLogicalRedundancy} -> Maybe HasLogicalRedundancy
hasLogicalRedundancy) (\s :: Interconnect
s@Interconnect' {} Maybe HasLogicalRedundancy
a -> Interconnect
s {$sel:hasLogicalRedundancy:Interconnect' :: Maybe HasLogicalRedundancy
hasLogicalRedundancy = Maybe HasLogicalRedundancy
a} :: Interconnect)

-- | The Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
interconnect_awsLogicalDeviceId :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_awsLogicalDeviceId :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_awsLogicalDeviceId = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
awsLogicalDeviceId :: Maybe Text
$sel:awsLogicalDeviceId:Interconnect' :: Interconnect -> Maybe Text
awsLogicalDeviceId} -> Maybe Text
awsLogicalDeviceId) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:awsLogicalDeviceId:Interconnect' :: Maybe Text
awsLogicalDeviceId = Maybe Text
a} :: Interconnect)

-- | The time of the most recent call to DescribeLoa for this connection.
interconnect_loaIssueTime :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.UTCTime)
interconnect_loaIssueTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> Interconnect -> f Interconnect
interconnect_loaIssueTime = (Interconnect -> Maybe POSIX)
-> (Interconnect -> Maybe POSIX -> Interconnect)
-> Lens Interconnect Interconnect (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe POSIX
loaIssueTime :: Maybe POSIX
$sel:loaIssueTime:Interconnect' :: Interconnect -> Maybe POSIX
loaIssueTime} -> Maybe POSIX
loaIssueTime) (\s :: Interconnect
s@Interconnect' {} Maybe POSIX
a -> Interconnect
s {$sel:loaIssueTime:Interconnect' :: Maybe POSIX
loaIssueTime = Maybe POSIX
a} :: Interconnect) ((Maybe POSIX -> f (Maybe POSIX))
 -> Interconnect -> f Interconnect)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Interconnect
-> f Interconnect
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 bandwidth of the connection.
interconnect_bandwidth :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_bandwidth :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_bandwidth = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
bandwidth :: Maybe Text
$sel:bandwidth:Interconnect' :: Interconnect -> Maybe Text
bandwidth} -> Maybe Text
bandwidth) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:bandwidth:Interconnect' :: Maybe Text
bandwidth = Maybe Text
a} :: Interconnect)

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

-- | The state of the interconnect. The following are the possible values:
--
-- -   @requested@: The initial state of an interconnect. The interconnect
--     stays in the requested state until the Letter of Authorization (LOA)
--     is sent to the customer.
--
-- -   @pending@: The interconnect is approved, and is being initialized.
--
-- -   @available@: The network link is up, and the interconnect is ready
--     for use.
--
-- -   @down@: The network link is down.
--
-- -   @deleting@: The interconnect is being deleted.
--
-- -   @deleted@: The interconnect is deleted.
--
-- -   @unknown@: The state of the interconnect is not available.
interconnect_interconnectState :: Lens.Lens' Interconnect (Prelude.Maybe InterconnectState)
interconnect_interconnectState :: (Maybe InterconnectState -> f (Maybe InterconnectState))
-> Interconnect -> f Interconnect
interconnect_interconnectState = (Interconnect -> Maybe InterconnectState)
-> (Interconnect -> Maybe InterconnectState -> Interconnect)
-> Lens
     Interconnect
     Interconnect
     (Maybe InterconnectState)
     (Maybe InterconnectState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe InterconnectState
interconnectState :: Maybe InterconnectState
$sel:interconnectState:Interconnect' :: Interconnect -> Maybe InterconnectState
interconnectState} -> Maybe InterconnectState
interconnectState) (\s :: Interconnect
s@Interconnect' {} Maybe InterconnectState
a -> Interconnect
s {$sel:interconnectState:Interconnect' :: Maybe InterconnectState
interconnectState = Maybe InterconnectState
a} :: Interconnect)

-- | The Amazon Web Services Region where the connection is located.
interconnect_region :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_region :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_region = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
region :: Maybe Text
$sel:region:Interconnect' :: Interconnect -> Maybe Text
region} -> Maybe Text
region) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:region:Interconnect' :: Maybe Text
region = Maybe Text
a} :: Interconnect)

-- | The name of the service provider associated with the interconnect.
interconnect_providerName :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_providerName :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_providerName = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
providerName :: Maybe Text
$sel:providerName:Interconnect' :: Interconnect -> Maybe Text
providerName} -> Maybe Text
providerName) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:providerName:Interconnect' :: Maybe Text
providerName = Maybe Text
a} :: Interconnect)

-- | The Direct Connect endpoint that terminates the physical connection.
interconnect_awsDeviceV2 :: Lens.Lens' Interconnect (Prelude.Maybe Prelude.Text)
interconnect_awsDeviceV2 :: (Maybe Text -> f (Maybe Text)) -> Interconnect -> f Interconnect
interconnect_awsDeviceV2 = (Interconnect -> Maybe Text)
-> (Interconnect -> Maybe Text -> Interconnect)
-> Lens Interconnect Interconnect (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe Text
awsDeviceV2 :: Maybe Text
$sel:awsDeviceV2:Interconnect' :: Interconnect -> Maybe Text
awsDeviceV2} -> Maybe Text
awsDeviceV2) (\s :: Interconnect
s@Interconnect' {} Maybe Text
a -> Interconnect
s {$sel:awsDeviceV2:Interconnect' :: Maybe Text
awsDeviceV2 = Maybe Text
a} :: Interconnect)

-- | The tags associated with the interconnect.
interconnect_tags :: Lens.Lens' Interconnect (Prelude.Maybe (Prelude.NonEmpty Tag))
interconnect_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Interconnect -> f Interconnect
interconnect_tags = (Interconnect -> Maybe (NonEmpty Tag))
-> (Interconnect -> Maybe (NonEmpty Tag) -> Interconnect)
-> Lens
     Interconnect
     Interconnect
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Interconnect' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:Interconnect' :: Interconnect -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: Interconnect
s@Interconnect' {} Maybe (NonEmpty Tag)
a -> Interconnect
s {$sel:tags:Interconnect' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: Interconnect) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> Interconnect -> f Interconnect)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> Interconnect
-> f Interconnect
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 Interconnect where
  parseJSON :: Value -> Parser Interconnect
parseJSON =
    String
-> (Object -> Parser Interconnect) -> Value -> Parser Interconnect
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Interconnect"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe HasLogicalRedundancy
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Bool
-> Maybe InterconnectState
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Interconnect
Interconnect'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe HasLogicalRedundancy
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Bool
 -> Maybe InterconnectState
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty Tag)
 -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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
"interconnectId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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
"interconnectName")
            Parser
  (Maybe Text
   -> Maybe HasLogicalRedundancy
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe HasLogicalRedundancy
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe HasLogicalRedundancy)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 POSIX
   -> Maybe Text
   -> Maybe Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 Bool
   -> Maybe InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Bool)
-> Parser
     (Maybe InterconnectState
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
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 InterconnectState
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe InterconnectState)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Interconnect)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InterconnectState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"interconnectState")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Interconnect)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe (NonEmpty Tag) -> Interconnect)
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 Text -> Maybe Text -> Maybe (NonEmpty Tag) -> Interconnect)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe (NonEmpty Tag) -> Interconnect)
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 (NonEmpty Tag) -> Interconnect)
-> Parser (Maybe Text)
-> Parser (Maybe (NonEmpty Tag) -> Interconnect)
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 (NonEmpty Tag) -> Interconnect)
-> Parser (Maybe (NonEmpty Tag)) -> Parser Interconnect
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 Interconnect

instance Prelude.NFData Interconnect