{-# 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.Lag
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DirectConnect.Types.Lag where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DirectConnect.Types.Connection
import Amazonka.DirectConnect.Types.HasLogicalRedundancy
import Amazonka.DirectConnect.Types.LagState
import Amazonka.DirectConnect.Types.MacSecKey
import Amazonka.DirectConnect.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | Information about a link aggregation group (LAG).
--
-- /See:/ 'newLag' smart constructor.
data Lag = Lag'
  { -- | Indicates whether the LAG can host other connections.
    Lag -> Maybe Bool
allowsHostedConnections :: Prelude.Maybe Prelude.Bool,
    -- | The Direct Connect endpoint that hosts the LAG.
    Lag -> Maybe Text
awsDevice :: Prelude.Maybe Prelude.Text,
    -- | The Direct Connect endpoint that hosts the LAG.
    Lag -> Maybe Text
awsDeviceV2 :: 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.
    Lag -> Maybe Text
awsLogicalDeviceId :: Prelude.Maybe Prelude.Text,
    -- | The connections bundled by the LAG.
    Lag -> Maybe [Connection]
connections :: Prelude.Maybe [Connection],
    -- | The individual bandwidth of the physical connections bundled by the LAG.
    -- The possible values are 1Gbps and 10Gbps.
    Lag -> Maybe Text
connectionsBandwidth :: Prelude.Maybe Prelude.Text,
    -- | The LAG MAC Security (MACsec) encryption mode.
    --
    -- The valid values are @no_encrypt@, @should_encrypt@, and @must_encrypt@.
    Lag -> Maybe Text
encryptionMode :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the LAG supports a secondary BGP peer in the same
    -- address family (IPv4\/IPv6).
    Lag -> Maybe HasLogicalRedundancy
hasLogicalRedundancy :: Prelude.Maybe HasLogicalRedundancy,
    -- | Indicates whether jumbo frames (9001 MTU) are supported.
    Lag -> Maybe Bool
jumboFrameCapable :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the LAG.
    Lag -> Maybe Text
lagId :: Prelude.Maybe Prelude.Text,
    -- | The name of the LAG.
    Lag -> Maybe Text
lagName :: Prelude.Maybe Prelude.Text,
    -- | The state of the LAG. The following are the possible values:
    --
    -- -   @requested@: The initial state of a LAG. The LAG stays in the
    --     requested state until the Letter of Authorization (LOA) is
    --     available.
    --
    -- -   @pending@: The LAG has been approved and is being initialized.
    --
    -- -   @available@: The network link is established and the LAG is ready
    --     for use.
    --
    -- -   @down@: The network link is down.
    --
    -- -   @deleting@: The LAG is being deleted.
    --
    -- -   @deleted@: The LAG is deleted.
    --
    -- -   @unknown@: The state of the LAG is not available.
    Lag -> Maybe LagState
lagState :: Prelude.Maybe LagState,
    -- | The location of the LAG.
    Lag -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the LAG supports MAC Security (MACsec).
    Lag -> Maybe Bool
macSecCapable :: Prelude.Maybe Prelude.Bool,
    -- | The MAC Security (MACsec) security keys associated with the LAG.
    Lag -> Maybe [MacSecKey]
macSecKeys :: Prelude.Maybe [MacSecKey],
    -- | The minimum number of physical dedicated connections that must be
    -- operational for the LAG itself to be operational.
    Lag -> Maybe Int
minimumLinks :: Prelude.Maybe Prelude.Int,
    -- | The number of physical dedicated connections bundled by the LAG, up to a
    -- maximum of 10.
    Lag -> Maybe Int
numberOfConnections :: Prelude.Maybe Prelude.Int,
    -- | The ID of the Amazon Web Services account that owns the LAG.
    Lag -> Maybe Text
ownerAccount :: Prelude.Maybe Prelude.Text,
    -- | The name of the service provider associated with the LAG.
    Lag -> Maybe Text
providerName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region where the connection is located.
    Lag -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the LAG.
    Lag -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag)
  }
  deriving (Lag -> Lag -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Lag -> Lag -> Bool
$c/= :: Lag -> Lag -> Bool
== :: Lag -> Lag -> Bool
$c== :: Lag -> Lag -> Bool
Prelude.Eq, ReadPrec [Lag]
ReadPrec Lag
Int -> ReadS Lag
ReadS [Lag]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Lag]
$creadListPrec :: ReadPrec [Lag]
readPrec :: ReadPrec Lag
$creadPrec :: ReadPrec Lag
readList :: ReadS [Lag]
$creadList :: ReadS [Lag]
readsPrec :: Int -> ReadS Lag
$creadsPrec :: Int -> ReadS Lag
Prelude.Read, Int -> Lag -> ShowS
[Lag] -> ShowS
Lag -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Lag] -> ShowS
$cshowList :: [Lag] -> ShowS
show :: Lag -> String
$cshow :: Lag -> String
showsPrec :: Int -> Lag -> ShowS
$cshowsPrec :: Int -> Lag -> ShowS
Prelude.Show, forall x. Rep Lag x -> Lag
forall x. Lag -> Rep Lag x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Lag x -> Lag
$cfrom :: forall x. Lag -> Rep Lag x
Prelude.Generic)

-- |
-- Create a value of 'Lag' 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:
--
-- 'allowsHostedConnections', 'lag_allowsHostedConnections' - Indicates whether the LAG can host other connections.
--
-- 'awsDevice', 'lag_awsDevice' - The Direct Connect endpoint that hosts the LAG.
--
-- 'awsDeviceV2', 'lag_awsDeviceV2' - The Direct Connect endpoint that hosts the LAG.
--
-- 'awsLogicalDeviceId', 'lag_awsLogicalDeviceId' - The Direct Connect endpoint that terminates the logical connection. This
-- device might be different than the device that terminates the physical
-- connection.
--
-- 'connections', 'lag_connections' - The connections bundled by the LAG.
--
-- 'connectionsBandwidth', 'lag_connectionsBandwidth' - The individual bandwidth of the physical connections bundled by the LAG.
-- The possible values are 1Gbps and 10Gbps.
--
-- 'encryptionMode', 'lag_encryptionMode' - The LAG MAC Security (MACsec) encryption mode.
--
-- The valid values are @no_encrypt@, @should_encrypt@, and @must_encrypt@.
--
-- 'hasLogicalRedundancy', 'lag_hasLogicalRedundancy' - Indicates whether the LAG supports a secondary BGP peer in the same
-- address family (IPv4\/IPv6).
--
-- 'jumboFrameCapable', 'lag_jumboFrameCapable' - Indicates whether jumbo frames (9001 MTU) are supported.
--
-- 'lagId', 'lag_lagId' - The ID of the LAG.
--
-- 'lagName', 'lag_lagName' - The name of the LAG.
--
-- 'lagState', 'lag_lagState' - The state of the LAG. The following are the possible values:
--
-- -   @requested@: The initial state of a LAG. The LAG stays in the
--     requested state until the Letter of Authorization (LOA) is
--     available.
--
-- -   @pending@: The LAG has been approved and is being initialized.
--
-- -   @available@: The network link is established and the LAG is ready
--     for use.
--
-- -   @down@: The network link is down.
--
-- -   @deleting@: The LAG is being deleted.
--
-- -   @deleted@: The LAG is deleted.
--
-- -   @unknown@: The state of the LAG is not available.
--
-- 'location', 'lag_location' - The location of the LAG.
--
-- 'macSecCapable', 'lag_macSecCapable' - Indicates whether the LAG supports MAC Security (MACsec).
--
-- 'macSecKeys', 'lag_macSecKeys' - The MAC Security (MACsec) security keys associated with the LAG.
--
-- 'minimumLinks', 'lag_minimumLinks' - The minimum number of physical dedicated connections that must be
-- operational for the LAG itself to be operational.
--
-- 'numberOfConnections', 'lag_numberOfConnections' - The number of physical dedicated connections bundled by the LAG, up to a
-- maximum of 10.
--
-- 'ownerAccount', 'lag_ownerAccount' - The ID of the Amazon Web Services account that owns the LAG.
--
-- 'providerName', 'lag_providerName' - The name of the service provider associated with the LAG.
--
-- 'region', 'lag_region' - The Amazon Web Services Region where the connection is located.
--
-- 'tags', 'lag_tags' - The tags associated with the LAG.
newLag ::
  Lag
newLag :: Lag
newLag =
  Lag'
    { $sel:allowsHostedConnections:Lag' :: Maybe Bool
allowsHostedConnections = forall a. Maybe a
Prelude.Nothing,
      $sel:awsDevice:Lag' :: Maybe Text
awsDevice = forall a. Maybe a
Prelude.Nothing,
      $sel:awsDeviceV2:Lag' :: Maybe Text
awsDeviceV2 = forall a. Maybe a
Prelude.Nothing,
      $sel:awsLogicalDeviceId:Lag' :: Maybe Text
awsLogicalDeviceId = forall a. Maybe a
Prelude.Nothing,
      $sel:connections:Lag' :: Maybe [Connection]
connections = forall a. Maybe a
Prelude.Nothing,
      $sel:connectionsBandwidth:Lag' :: Maybe Text
connectionsBandwidth = forall a. Maybe a
Prelude.Nothing,
      $sel:encryptionMode:Lag' :: Maybe Text
encryptionMode = forall a. Maybe a
Prelude.Nothing,
      $sel:hasLogicalRedundancy:Lag' :: Maybe HasLogicalRedundancy
hasLogicalRedundancy = forall a. Maybe a
Prelude.Nothing,
      $sel:jumboFrameCapable:Lag' :: Maybe Bool
jumboFrameCapable = forall a. Maybe a
Prelude.Nothing,
      $sel:lagId:Lag' :: Maybe Text
lagId = forall a. Maybe a
Prelude.Nothing,
      $sel:lagName:Lag' :: Maybe Text
lagName = forall a. Maybe a
Prelude.Nothing,
      $sel:lagState:Lag' :: Maybe LagState
lagState = forall a. Maybe a
Prelude.Nothing,
      $sel:location:Lag' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
      $sel:macSecCapable:Lag' :: Maybe Bool
macSecCapable = forall a. Maybe a
Prelude.Nothing,
      $sel:macSecKeys:Lag' :: Maybe [MacSecKey]
macSecKeys = forall a. Maybe a
Prelude.Nothing,
      $sel:minimumLinks:Lag' :: Maybe Int
minimumLinks = forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfConnections:Lag' :: Maybe Int
numberOfConnections = forall a. Maybe a
Prelude.Nothing,
      $sel:ownerAccount:Lag' :: Maybe Text
ownerAccount = forall a. Maybe a
Prelude.Nothing,
      $sel:providerName:Lag' :: Maybe Text
providerName = forall a. Maybe a
Prelude.Nothing,
      $sel:region:Lag' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Lag' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether the LAG can host other connections.
lag_allowsHostedConnections :: Lens.Lens' Lag (Prelude.Maybe Prelude.Bool)
lag_allowsHostedConnections :: Lens' Lag (Maybe Bool)
lag_allowsHostedConnections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Bool
allowsHostedConnections :: Maybe Bool
$sel:allowsHostedConnections:Lag' :: Lag -> Maybe Bool
allowsHostedConnections} -> Maybe Bool
allowsHostedConnections) (\s :: Lag
s@Lag' {} Maybe Bool
a -> Lag
s {$sel:allowsHostedConnections:Lag' :: Maybe Bool
allowsHostedConnections = Maybe Bool
a} :: Lag)

-- | The Direct Connect endpoint that hosts the LAG.
lag_awsDevice :: Lens.Lens' Lag (Prelude.Maybe Prelude.Text)
lag_awsDevice :: Lens' Lag (Maybe Text)
lag_awsDevice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Text
awsDevice :: Maybe Text
$sel:awsDevice:Lag' :: Lag -> Maybe Text
awsDevice} -> Maybe Text
awsDevice) (\s :: Lag
s@Lag' {} Maybe Text
a -> Lag
s {$sel:awsDevice:Lag' :: Maybe Text
awsDevice = Maybe Text
a} :: Lag)

-- | The Direct Connect endpoint that hosts the LAG.
lag_awsDeviceV2 :: Lens.Lens' Lag (Prelude.Maybe Prelude.Text)
lag_awsDeviceV2 :: Lens' Lag (Maybe Text)
lag_awsDeviceV2 = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Text
awsDeviceV2 :: Maybe Text
$sel:awsDeviceV2:Lag' :: Lag -> Maybe Text
awsDeviceV2} -> Maybe Text
awsDeviceV2) (\s :: Lag
s@Lag' {} Maybe Text
a -> Lag
s {$sel:awsDeviceV2:Lag' :: Maybe Text
awsDeviceV2 = Maybe Text
a} :: Lag)

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

-- | The connections bundled by the LAG.
lag_connections :: Lens.Lens' Lag (Prelude.Maybe [Connection])
lag_connections :: Lens' Lag (Maybe [Connection])
lag_connections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe [Connection]
connections :: Maybe [Connection]
$sel:connections:Lag' :: Lag -> Maybe [Connection]
connections} -> Maybe [Connection]
connections) (\s :: Lag
s@Lag' {} Maybe [Connection]
a -> Lag
s {$sel:connections:Lag' :: Maybe [Connection]
connections = Maybe [Connection]
a} :: Lag) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The individual bandwidth of the physical connections bundled by the LAG.
-- The possible values are 1Gbps and 10Gbps.
lag_connectionsBandwidth :: Lens.Lens' Lag (Prelude.Maybe Prelude.Text)
lag_connectionsBandwidth :: Lens' Lag (Maybe Text)
lag_connectionsBandwidth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Text
connectionsBandwidth :: Maybe Text
$sel:connectionsBandwidth:Lag' :: Lag -> Maybe Text
connectionsBandwidth} -> Maybe Text
connectionsBandwidth) (\s :: Lag
s@Lag' {} Maybe Text
a -> Lag
s {$sel:connectionsBandwidth:Lag' :: Maybe Text
connectionsBandwidth = Maybe Text
a} :: Lag)

-- | The LAG MAC Security (MACsec) encryption mode.
--
-- The valid values are @no_encrypt@, @should_encrypt@, and @must_encrypt@.
lag_encryptionMode :: Lens.Lens' Lag (Prelude.Maybe Prelude.Text)
lag_encryptionMode :: Lens' Lag (Maybe Text)
lag_encryptionMode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Text
encryptionMode :: Maybe Text
$sel:encryptionMode:Lag' :: Lag -> Maybe Text
encryptionMode} -> Maybe Text
encryptionMode) (\s :: Lag
s@Lag' {} Maybe Text
a -> Lag
s {$sel:encryptionMode:Lag' :: Maybe Text
encryptionMode = Maybe Text
a} :: Lag)

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

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

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

-- | The name of the LAG.
lag_lagName :: Lens.Lens' Lag (Prelude.Maybe Prelude.Text)
lag_lagName :: Lens' Lag (Maybe Text)
lag_lagName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Text
lagName :: Maybe Text
$sel:lagName:Lag' :: Lag -> Maybe Text
lagName} -> Maybe Text
lagName) (\s :: Lag
s@Lag' {} Maybe Text
a -> Lag
s {$sel:lagName:Lag' :: Maybe Text
lagName = Maybe Text
a} :: Lag)

-- | The state of the LAG. The following are the possible values:
--
-- -   @requested@: The initial state of a LAG. The LAG stays in the
--     requested state until the Letter of Authorization (LOA) is
--     available.
--
-- -   @pending@: The LAG has been approved and is being initialized.
--
-- -   @available@: The network link is established and the LAG is ready
--     for use.
--
-- -   @down@: The network link is down.
--
-- -   @deleting@: The LAG is being deleted.
--
-- -   @deleted@: The LAG is deleted.
--
-- -   @unknown@: The state of the LAG is not available.
lag_lagState :: Lens.Lens' Lag (Prelude.Maybe LagState)
lag_lagState :: Lens' Lag (Maybe LagState)
lag_lagState = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe LagState
lagState :: Maybe LagState
$sel:lagState:Lag' :: Lag -> Maybe LagState
lagState} -> Maybe LagState
lagState) (\s :: Lag
s@Lag' {} Maybe LagState
a -> Lag
s {$sel:lagState:Lag' :: Maybe LagState
lagState = Maybe LagState
a} :: Lag)

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

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

-- | The MAC Security (MACsec) security keys associated with the LAG.
lag_macSecKeys :: Lens.Lens' Lag (Prelude.Maybe [MacSecKey])
lag_macSecKeys :: Lens' Lag (Maybe [MacSecKey])
lag_macSecKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe [MacSecKey]
macSecKeys :: Maybe [MacSecKey]
$sel:macSecKeys:Lag' :: Lag -> Maybe [MacSecKey]
macSecKeys} -> Maybe [MacSecKey]
macSecKeys) (\s :: Lag
s@Lag' {} Maybe [MacSecKey]
a -> Lag
s {$sel:macSecKeys:Lag' :: Maybe [MacSecKey]
macSecKeys = Maybe [MacSecKey]
a} :: Lag) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The minimum number of physical dedicated connections that must be
-- operational for the LAG itself to be operational.
lag_minimumLinks :: Lens.Lens' Lag (Prelude.Maybe Prelude.Int)
lag_minimumLinks :: Lens' Lag (Maybe Int)
lag_minimumLinks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Int
minimumLinks :: Maybe Int
$sel:minimumLinks:Lag' :: Lag -> Maybe Int
minimumLinks} -> Maybe Int
minimumLinks) (\s :: Lag
s@Lag' {} Maybe Int
a -> Lag
s {$sel:minimumLinks:Lag' :: Maybe Int
minimumLinks = Maybe Int
a} :: Lag)

-- | The number of physical dedicated connections bundled by the LAG, up to a
-- maximum of 10.
lag_numberOfConnections :: Lens.Lens' Lag (Prelude.Maybe Prelude.Int)
lag_numberOfConnections :: Lens' Lag (Maybe Int)
lag_numberOfConnections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Int
numberOfConnections :: Maybe Int
$sel:numberOfConnections:Lag' :: Lag -> Maybe Int
numberOfConnections} -> Maybe Int
numberOfConnections) (\s :: Lag
s@Lag' {} Maybe Int
a -> Lag
s {$sel:numberOfConnections:Lag' :: Maybe Int
numberOfConnections = Maybe Int
a} :: Lag)

-- | The ID of the Amazon Web Services account that owns the LAG.
lag_ownerAccount :: Lens.Lens' Lag (Prelude.Maybe Prelude.Text)
lag_ownerAccount :: Lens' Lag (Maybe Text)
lag_ownerAccount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe Text
ownerAccount :: Maybe Text
$sel:ownerAccount:Lag' :: Lag -> Maybe Text
ownerAccount} -> Maybe Text
ownerAccount) (\s :: Lag
s@Lag' {} Maybe Text
a -> Lag
s {$sel:ownerAccount:Lag' :: Maybe Text
ownerAccount = Maybe Text
a} :: Lag)

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

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

-- | The tags associated with the LAG.
lag_tags :: Lens.Lens' Lag (Prelude.Maybe (Prelude.NonEmpty Tag))
lag_tags :: Lens' Lag (Maybe (NonEmpty Tag))
lag_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Lag' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:Lag' :: Lag -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: Lag
s@Lag' {} Maybe (NonEmpty Tag)
a -> Lag
s {$sel:tags:Lag' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: Lag) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON Lag where
  parseJSON :: Value -> Parser Lag
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Lag"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Connection]
-> Maybe Text
-> Maybe Text
-> Maybe HasLogicalRedundancy
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe LagState
-> Maybe Text
-> Maybe Bool
-> Maybe [MacSecKey]
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Lag
Lag'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"allowsHostedConnections")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"awsDevice")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"awsDeviceV2")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"awsLogicalDeviceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"connections" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"connectionsBandwidth")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"encryptionMode")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"hasLogicalRedundancy")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"jumboFrameCapable")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lagId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lagName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lagState")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"location")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"macSecCapable")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"macSecKeys" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"minimumLinks")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"numberOfConnections")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ownerAccount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"providerName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"region")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"tags")
      )

instance Prelude.Hashable Lag where
  hashWithSalt :: Int -> Lag -> Int
hashWithSalt Int
_salt Lag' {Maybe Bool
Maybe Int
Maybe [MacSecKey]
Maybe [Connection]
Maybe (NonEmpty Tag)
Maybe Text
Maybe HasLogicalRedundancy
Maybe LagState
tags :: Maybe (NonEmpty Tag)
region :: Maybe Text
providerName :: Maybe Text
ownerAccount :: Maybe Text
numberOfConnections :: Maybe Int
minimumLinks :: Maybe Int
macSecKeys :: Maybe [MacSecKey]
macSecCapable :: Maybe Bool
location :: Maybe Text
lagState :: Maybe LagState
lagName :: Maybe Text
lagId :: Maybe Text
jumboFrameCapable :: Maybe Bool
hasLogicalRedundancy :: Maybe HasLogicalRedundancy
encryptionMode :: Maybe Text
connectionsBandwidth :: Maybe Text
connections :: Maybe [Connection]
awsLogicalDeviceId :: Maybe Text
awsDeviceV2 :: Maybe Text
awsDevice :: Maybe Text
allowsHostedConnections :: Maybe Bool
$sel:tags:Lag' :: Lag -> Maybe (NonEmpty Tag)
$sel:region:Lag' :: Lag -> Maybe Text
$sel:providerName:Lag' :: Lag -> Maybe Text
$sel:ownerAccount:Lag' :: Lag -> Maybe Text
$sel:numberOfConnections:Lag' :: Lag -> Maybe Int
$sel:minimumLinks:Lag' :: Lag -> Maybe Int
$sel:macSecKeys:Lag' :: Lag -> Maybe [MacSecKey]
$sel:macSecCapable:Lag' :: Lag -> Maybe Bool
$sel:location:Lag' :: Lag -> Maybe Text
$sel:lagState:Lag' :: Lag -> Maybe LagState
$sel:lagName:Lag' :: Lag -> Maybe Text
$sel:lagId:Lag' :: Lag -> Maybe Text
$sel:jumboFrameCapable:Lag' :: Lag -> Maybe Bool
$sel:hasLogicalRedundancy:Lag' :: Lag -> Maybe HasLogicalRedundancy
$sel:encryptionMode:Lag' :: Lag -> Maybe Text
$sel:connectionsBandwidth:Lag' :: Lag -> Maybe Text
$sel:connections:Lag' :: Lag -> Maybe [Connection]
$sel:awsLogicalDeviceId:Lag' :: Lag -> Maybe Text
$sel:awsDeviceV2:Lag' :: Lag -> Maybe Text
$sel:awsDevice:Lag' :: Lag -> Maybe Text
$sel:allowsHostedConnections:Lag' :: Lag -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
allowsHostedConnections
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
awsDevice
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
awsDeviceV2
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
awsLogicalDeviceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Connection]
connections
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionsBandwidth
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
encryptionMode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HasLogicalRedundancy
hasLogicalRedundancy
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
jumboFrameCapable
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lagId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lagName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LagState
lagState
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
macSecCapable
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [MacSecKey]
macSecKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
minimumLinks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfConnections
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ownerAccount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
providerName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags

instance Prelude.NFData Lag where
  rnf :: Lag -> ()
rnf Lag' {Maybe Bool
Maybe Int
Maybe [MacSecKey]
Maybe [Connection]
Maybe (NonEmpty Tag)
Maybe Text
Maybe HasLogicalRedundancy
Maybe LagState
tags :: Maybe (NonEmpty Tag)
region :: Maybe Text
providerName :: Maybe Text
ownerAccount :: Maybe Text
numberOfConnections :: Maybe Int
minimumLinks :: Maybe Int
macSecKeys :: Maybe [MacSecKey]
macSecCapable :: Maybe Bool
location :: Maybe Text
lagState :: Maybe LagState
lagName :: Maybe Text
lagId :: Maybe Text
jumboFrameCapable :: Maybe Bool
hasLogicalRedundancy :: Maybe HasLogicalRedundancy
encryptionMode :: Maybe Text
connectionsBandwidth :: Maybe Text
connections :: Maybe [Connection]
awsLogicalDeviceId :: Maybe Text
awsDeviceV2 :: Maybe Text
awsDevice :: Maybe Text
allowsHostedConnections :: Maybe Bool
$sel:tags:Lag' :: Lag -> Maybe (NonEmpty Tag)
$sel:region:Lag' :: Lag -> Maybe Text
$sel:providerName:Lag' :: Lag -> Maybe Text
$sel:ownerAccount:Lag' :: Lag -> Maybe Text
$sel:numberOfConnections:Lag' :: Lag -> Maybe Int
$sel:minimumLinks:Lag' :: Lag -> Maybe Int
$sel:macSecKeys:Lag' :: Lag -> Maybe [MacSecKey]
$sel:macSecCapable:Lag' :: Lag -> Maybe Bool
$sel:location:Lag' :: Lag -> Maybe Text
$sel:lagState:Lag' :: Lag -> Maybe LagState
$sel:lagName:Lag' :: Lag -> Maybe Text
$sel:lagId:Lag' :: Lag -> Maybe Text
$sel:jumboFrameCapable:Lag' :: Lag -> Maybe Bool
$sel:hasLogicalRedundancy:Lag' :: Lag -> Maybe HasLogicalRedundancy
$sel:encryptionMode:Lag' :: Lag -> Maybe Text
$sel:connectionsBandwidth:Lag' :: Lag -> Maybe Text
$sel:connections:Lag' :: Lag -> Maybe [Connection]
$sel:awsLogicalDeviceId:Lag' :: Lag -> Maybe Text
$sel:awsDeviceV2:Lag' :: Lag -> Maybe Text
$sel:awsDevice:Lag' :: Lag -> Maybe Text
$sel:allowsHostedConnections:Lag' :: Lag -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
allowsHostedConnections
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
awsDevice
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
awsDeviceV2
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
awsLogicalDeviceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Connection]
connections
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionsBandwidth
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
encryptionMode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HasLogicalRedundancy
hasLogicalRedundancy
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
jumboFrameCapable
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lagId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lagName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LagState
lagState
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
macSecCapable
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [MacSecKey]
macSecKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
minimumLinks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfConnections
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ownerAccount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
providerName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags