{-# 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.EC2.Types.VerifiedAccessEndpointLoadBalancerOptions
-- 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.EC2.Types.VerifiedAccessEndpointLoadBalancerOptions where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.VerifiedAccessEndpointProtocol
import qualified Amazonka.Prelude as Prelude

-- | Describes a load balancer when creating an Amazon Web Services Verified
-- Access endpoint using the @load-balancer@ type.
--
-- /See:/ 'newVerifiedAccessEndpointLoadBalancerOptions' smart constructor.
data VerifiedAccessEndpointLoadBalancerOptions = VerifiedAccessEndpointLoadBalancerOptions'
  { -- | The ARN of the load balancer.
    VerifiedAccessEndpointLoadBalancerOptions -> Maybe Text
loadBalancerArn :: Prelude.Maybe Prelude.Text,
    -- | The IP port number.
    VerifiedAccessEndpointLoadBalancerOptions -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural,
    -- | The IP protocol.
    VerifiedAccessEndpointLoadBalancerOptions
-> Maybe VerifiedAccessEndpointProtocol
protocol :: Prelude.Maybe VerifiedAccessEndpointProtocol,
    -- | The IDs of the subnets.
    VerifiedAccessEndpointLoadBalancerOptions -> Maybe [Text]
subnetIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (VerifiedAccessEndpointLoadBalancerOptions
-> VerifiedAccessEndpointLoadBalancerOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifiedAccessEndpointLoadBalancerOptions
-> VerifiedAccessEndpointLoadBalancerOptions -> Bool
$c/= :: VerifiedAccessEndpointLoadBalancerOptions
-> VerifiedAccessEndpointLoadBalancerOptions -> Bool
== :: VerifiedAccessEndpointLoadBalancerOptions
-> VerifiedAccessEndpointLoadBalancerOptions -> Bool
$c== :: VerifiedAccessEndpointLoadBalancerOptions
-> VerifiedAccessEndpointLoadBalancerOptions -> Bool
Prelude.Eq, ReadPrec [VerifiedAccessEndpointLoadBalancerOptions]
ReadPrec VerifiedAccessEndpointLoadBalancerOptions
Int -> ReadS VerifiedAccessEndpointLoadBalancerOptions
ReadS [VerifiedAccessEndpointLoadBalancerOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifiedAccessEndpointLoadBalancerOptions]
$creadListPrec :: ReadPrec [VerifiedAccessEndpointLoadBalancerOptions]
readPrec :: ReadPrec VerifiedAccessEndpointLoadBalancerOptions
$creadPrec :: ReadPrec VerifiedAccessEndpointLoadBalancerOptions
readList :: ReadS [VerifiedAccessEndpointLoadBalancerOptions]
$creadList :: ReadS [VerifiedAccessEndpointLoadBalancerOptions]
readsPrec :: Int -> ReadS VerifiedAccessEndpointLoadBalancerOptions
$creadsPrec :: Int -> ReadS VerifiedAccessEndpointLoadBalancerOptions
Prelude.Read, Int -> VerifiedAccessEndpointLoadBalancerOptions -> ShowS
[VerifiedAccessEndpointLoadBalancerOptions] -> ShowS
VerifiedAccessEndpointLoadBalancerOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifiedAccessEndpointLoadBalancerOptions] -> ShowS
$cshowList :: [VerifiedAccessEndpointLoadBalancerOptions] -> ShowS
show :: VerifiedAccessEndpointLoadBalancerOptions -> String
$cshow :: VerifiedAccessEndpointLoadBalancerOptions -> String
showsPrec :: Int -> VerifiedAccessEndpointLoadBalancerOptions -> ShowS
$cshowsPrec :: Int -> VerifiedAccessEndpointLoadBalancerOptions -> ShowS
Prelude.Show, forall x.
Rep VerifiedAccessEndpointLoadBalancerOptions x
-> VerifiedAccessEndpointLoadBalancerOptions
forall x.
VerifiedAccessEndpointLoadBalancerOptions
-> Rep VerifiedAccessEndpointLoadBalancerOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifiedAccessEndpointLoadBalancerOptions x
-> VerifiedAccessEndpointLoadBalancerOptions
$cfrom :: forall x.
VerifiedAccessEndpointLoadBalancerOptions
-> Rep VerifiedAccessEndpointLoadBalancerOptions x
Prelude.Generic)

-- |
-- Create a value of 'VerifiedAccessEndpointLoadBalancerOptions' 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:
--
-- 'loadBalancerArn', 'verifiedAccessEndpointLoadBalancerOptions_loadBalancerArn' - The ARN of the load balancer.
--
-- 'port', 'verifiedAccessEndpointLoadBalancerOptions_port' - The IP port number.
--
-- 'protocol', 'verifiedAccessEndpointLoadBalancerOptions_protocol' - The IP protocol.
--
-- 'subnetIds', 'verifiedAccessEndpointLoadBalancerOptions_subnetIds' - The IDs of the subnets.
newVerifiedAccessEndpointLoadBalancerOptions ::
  VerifiedAccessEndpointLoadBalancerOptions
newVerifiedAccessEndpointLoadBalancerOptions :: VerifiedAccessEndpointLoadBalancerOptions
newVerifiedAccessEndpointLoadBalancerOptions =
  VerifiedAccessEndpointLoadBalancerOptions'
    { $sel:loadBalancerArn:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe Text
loadBalancerArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:port:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe Natural
port = forall a. Maybe a
Prelude.Nothing,
      $sel:protocol:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe VerifiedAccessEndpointProtocol
protocol = forall a. Maybe a
Prelude.Nothing,
      $sel:subnetIds:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe [Text]
subnetIds = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the load balancer.
verifiedAccessEndpointLoadBalancerOptions_loadBalancerArn :: Lens.Lens' VerifiedAccessEndpointLoadBalancerOptions (Prelude.Maybe Prelude.Text)
verifiedAccessEndpointLoadBalancerOptions_loadBalancerArn :: Lens' VerifiedAccessEndpointLoadBalancerOptions (Maybe Text)
verifiedAccessEndpointLoadBalancerOptions_loadBalancerArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessEndpointLoadBalancerOptions' {Maybe Text
loadBalancerArn :: Maybe Text
$sel:loadBalancerArn:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe Text
loadBalancerArn} -> Maybe Text
loadBalancerArn) (\s :: VerifiedAccessEndpointLoadBalancerOptions
s@VerifiedAccessEndpointLoadBalancerOptions' {} Maybe Text
a -> VerifiedAccessEndpointLoadBalancerOptions
s {$sel:loadBalancerArn:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe Text
loadBalancerArn = Maybe Text
a} :: VerifiedAccessEndpointLoadBalancerOptions)

-- | The IP port number.
verifiedAccessEndpointLoadBalancerOptions_port :: Lens.Lens' VerifiedAccessEndpointLoadBalancerOptions (Prelude.Maybe Prelude.Natural)
verifiedAccessEndpointLoadBalancerOptions_port :: Lens' VerifiedAccessEndpointLoadBalancerOptions (Maybe Natural)
verifiedAccessEndpointLoadBalancerOptions_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessEndpointLoadBalancerOptions' {Maybe Natural
port :: Maybe Natural
$sel:port:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe Natural
port} -> Maybe Natural
port) (\s :: VerifiedAccessEndpointLoadBalancerOptions
s@VerifiedAccessEndpointLoadBalancerOptions' {} Maybe Natural
a -> VerifiedAccessEndpointLoadBalancerOptions
s {$sel:port:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe Natural
port = Maybe Natural
a} :: VerifiedAccessEndpointLoadBalancerOptions)

-- | The IP protocol.
verifiedAccessEndpointLoadBalancerOptions_protocol :: Lens.Lens' VerifiedAccessEndpointLoadBalancerOptions (Prelude.Maybe VerifiedAccessEndpointProtocol)
verifiedAccessEndpointLoadBalancerOptions_protocol :: Lens'
  VerifiedAccessEndpointLoadBalancerOptions
  (Maybe VerifiedAccessEndpointProtocol)
verifiedAccessEndpointLoadBalancerOptions_protocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessEndpointLoadBalancerOptions' {Maybe VerifiedAccessEndpointProtocol
protocol :: Maybe VerifiedAccessEndpointProtocol
$sel:protocol:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions
-> Maybe VerifiedAccessEndpointProtocol
protocol} -> Maybe VerifiedAccessEndpointProtocol
protocol) (\s :: VerifiedAccessEndpointLoadBalancerOptions
s@VerifiedAccessEndpointLoadBalancerOptions' {} Maybe VerifiedAccessEndpointProtocol
a -> VerifiedAccessEndpointLoadBalancerOptions
s {$sel:protocol:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe VerifiedAccessEndpointProtocol
protocol = Maybe VerifiedAccessEndpointProtocol
a} :: VerifiedAccessEndpointLoadBalancerOptions)

-- | The IDs of the subnets.
verifiedAccessEndpointLoadBalancerOptions_subnetIds :: Lens.Lens' VerifiedAccessEndpointLoadBalancerOptions (Prelude.Maybe [Prelude.Text])
verifiedAccessEndpointLoadBalancerOptions_subnetIds :: Lens' VerifiedAccessEndpointLoadBalancerOptions (Maybe [Text])
verifiedAccessEndpointLoadBalancerOptions_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessEndpointLoadBalancerOptions' {Maybe [Text]
subnetIds :: Maybe [Text]
$sel:subnetIds:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe [Text]
subnetIds} -> Maybe [Text]
subnetIds) (\s :: VerifiedAccessEndpointLoadBalancerOptions
s@VerifiedAccessEndpointLoadBalancerOptions' {} Maybe [Text]
a -> VerifiedAccessEndpointLoadBalancerOptions
s {$sel:subnetIds:VerifiedAccessEndpointLoadBalancerOptions' :: Maybe [Text]
subnetIds = Maybe [Text]
a} :: VerifiedAccessEndpointLoadBalancerOptions) 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.FromXML
    VerifiedAccessEndpointLoadBalancerOptions
  where
  parseXML :: [Node] -> Either String VerifiedAccessEndpointLoadBalancerOptions
parseXML [Node]
x =
    Maybe Text
-> Maybe Natural
-> Maybe VerifiedAccessEndpointProtocol
-> Maybe [Text]
-> VerifiedAccessEndpointLoadBalancerOptions
VerifiedAccessEndpointLoadBalancerOptions'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"loadBalancerArn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"port")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"protocol")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x
                      forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"subnetIdSet"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"item")
                  )

instance
  Prelude.Hashable
    VerifiedAccessEndpointLoadBalancerOptions
  where
  hashWithSalt :: Int -> VerifiedAccessEndpointLoadBalancerOptions -> Int
hashWithSalt
    Int
_salt
    VerifiedAccessEndpointLoadBalancerOptions' {Maybe Natural
Maybe [Text]
Maybe Text
Maybe VerifiedAccessEndpointProtocol
subnetIds :: Maybe [Text]
protocol :: Maybe VerifiedAccessEndpointProtocol
port :: Maybe Natural
loadBalancerArn :: Maybe Text
$sel:subnetIds:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe [Text]
$sel:protocol:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions
-> Maybe VerifiedAccessEndpointProtocol
$sel:port:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe Natural
$sel:loadBalancerArn:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
loadBalancerArn
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
port
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessEndpointProtocol
protocol
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
subnetIds

instance
  Prelude.NFData
    VerifiedAccessEndpointLoadBalancerOptions
  where
  rnf :: VerifiedAccessEndpointLoadBalancerOptions -> ()
rnf VerifiedAccessEndpointLoadBalancerOptions' {Maybe Natural
Maybe [Text]
Maybe Text
Maybe VerifiedAccessEndpointProtocol
subnetIds :: Maybe [Text]
protocol :: Maybe VerifiedAccessEndpointProtocol
port :: Maybe Natural
loadBalancerArn :: Maybe Text
$sel:subnetIds:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe [Text]
$sel:protocol:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions
-> Maybe VerifiedAccessEndpointProtocol
$sel:port:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe Natural
$sel:loadBalancerArn:VerifiedAccessEndpointLoadBalancerOptions' :: VerifiedAccessEndpointLoadBalancerOptions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
loadBalancerArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
port
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe VerifiedAccessEndpointProtocol
protocol
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
subnetIds