{-# 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.VerifiedAccessEndpointEniOptions
-- 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.VerifiedAccessEndpointEniOptions 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

-- | Options for a network-interface type endpoint.
--
-- /See:/ 'newVerifiedAccessEndpointEniOptions' smart constructor.
data VerifiedAccessEndpointEniOptions = VerifiedAccessEndpointEniOptions'
  { -- | The ID of the network interface.
    VerifiedAccessEndpointEniOptions -> Maybe Text
networkInterfaceId :: Prelude.Maybe Prelude.Text,
    -- | The IP port number.
    VerifiedAccessEndpointEniOptions -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural,
    -- | The IP protocol.
    VerifiedAccessEndpointEniOptions
-> Maybe VerifiedAccessEndpointProtocol
protocol :: Prelude.Maybe VerifiedAccessEndpointProtocol
  }
  deriving (VerifiedAccessEndpointEniOptions
-> VerifiedAccessEndpointEniOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VerifiedAccessEndpointEniOptions
-> VerifiedAccessEndpointEniOptions -> Bool
$c/= :: VerifiedAccessEndpointEniOptions
-> VerifiedAccessEndpointEniOptions -> Bool
== :: VerifiedAccessEndpointEniOptions
-> VerifiedAccessEndpointEniOptions -> Bool
$c== :: VerifiedAccessEndpointEniOptions
-> VerifiedAccessEndpointEniOptions -> Bool
Prelude.Eq, ReadPrec [VerifiedAccessEndpointEniOptions]
ReadPrec VerifiedAccessEndpointEniOptions
Int -> ReadS VerifiedAccessEndpointEniOptions
ReadS [VerifiedAccessEndpointEniOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VerifiedAccessEndpointEniOptions]
$creadListPrec :: ReadPrec [VerifiedAccessEndpointEniOptions]
readPrec :: ReadPrec VerifiedAccessEndpointEniOptions
$creadPrec :: ReadPrec VerifiedAccessEndpointEniOptions
readList :: ReadS [VerifiedAccessEndpointEniOptions]
$creadList :: ReadS [VerifiedAccessEndpointEniOptions]
readsPrec :: Int -> ReadS VerifiedAccessEndpointEniOptions
$creadsPrec :: Int -> ReadS VerifiedAccessEndpointEniOptions
Prelude.Read, Int -> VerifiedAccessEndpointEniOptions -> ShowS
[VerifiedAccessEndpointEniOptions] -> ShowS
VerifiedAccessEndpointEniOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VerifiedAccessEndpointEniOptions] -> ShowS
$cshowList :: [VerifiedAccessEndpointEniOptions] -> ShowS
show :: VerifiedAccessEndpointEniOptions -> String
$cshow :: VerifiedAccessEndpointEniOptions -> String
showsPrec :: Int -> VerifiedAccessEndpointEniOptions -> ShowS
$cshowsPrec :: Int -> VerifiedAccessEndpointEniOptions -> ShowS
Prelude.Show, forall x.
Rep VerifiedAccessEndpointEniOptions x
-> VerifiedAccessEndpointEniOptions
forall x.
VerifiedAccessEndpointEniOptions
-> Rep VerifiedAccessEndpointEniOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep VerifiedAccessEndpointEniOptions x
-> VerifiedAccessEndpointEniOptions
$cfrom :: forall x.
VerifiedAccessEndpointEniOptions
-> Rep VerifiedAccessEndpointEniOptions x
Prelude.Generic)

-- |
-- Create a value of 'VerifiedAccessEndpointEniOptions' 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:
--
-- 'networkInterfaceId', 'verifiedAccessEndpointEniOptions_networkInterfaceId' - The ID of the network interface.
--
-- 'port', 'verifiedAccessEndpointEniOptions_port' - The IP port number.
--
-- 'protocol', 'verifiedAccessEndpointEniOptions_protocol' - The IP protocol.
newVerifiedAccessEndpointEniOptions ::
  VerifiedAccessEndpointEniOptions
newVerifiedAccessEndpointEniOptions :: VerifiedAccessEndpointEniOptions
newVerifiedAccessEndpointEniOptions =
  VerifiedAccessEndpointEniOptions'
    { $sel:networkInterfaceId:VerifiedAccessEndpointEniOptions' :: Maybe Text
networkInterfaceId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:port:VerifiedAccessEndpointEniOptions' :: Maybe Natural
port = forall a. Maybe a
Prelude.Nothing,
      $sel:protocol:VerifiedAccessEndpointEniOptions' :: Maybe VerifiedAccessEndpointProtocol
protocol = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the network interface.
verifiedAccessEndpointEniOptions_networkInterfaceId :: Lens.Lens' VerifiedAccessEndpointEniOptions (Prelude.Maybe Prelude.Text)
verifiedAccessEndpointEniOptions_networkInterfaceId :: Lens' VerifiedAccessEndpointEniOptions (Maybe Text)
verifiedAccessEndpointEniOptions_networkInterfaceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VerifiedAccessEndpointEniOptions' {Maybe Text
networkInterfaceId :: Maybe Text
$sel:networkInterfaceId:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions -> Maybe Text
networkInterfaceId} -> Maybe Text
networkInterfaceId) (\s :: VerifiedAccessEndpointEniOptions
s@VerifiedAccessEndpointEniOptions' {} Maybe Text
a -> VerifiedAccessEndpointEniOptions
s {$sel:networkInterfaceId:VerifiedAccessEndpointEniOptions' :: Maybe Text
networkInterfaceId = Maybe Text
a} :: VerifiedAccessEndpointEniOptions)

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

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

instance
  Data.FromXML
    VerifiedAccessEndpointEniOptions
  where
  parseXML :: [Node] -> Either String VerifiedAccessEndpointEniOptions
parseXML [Node]
x =
    Maybe Text
-> Maybe Natural
-> Maybe VerifiedAccessEndpointProtocol
-> VerifiedAccessEndpointEniOptions
VerifiedAccessEndpointEniOptions'
      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
"networkInterfaceId")
      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")

instance
  Prelude.Hashable
    VerifiedAccessEndpointEniOptions
  where
  hashWithSalt :: Int -> VerifiedAccessEndpointEniOptions -> Int
hashWithSalt
    Int
_salt
    VerifiedAccessEndpointEniOptions' {Maybe Natural
Maybe Text
Maybe VerifiedAccessEndpointProtocol
protocol :: Maybe VerifiedAccessEndpointProtocol
port :: Maybe Natural
networkInterfaceId :: Maybe Text
$sel:protocol:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions
-> Maybe VerifiedAccessEndpointProtocol
$sel:port:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions -> Maybe Natural
$sel:networkInterfaceId:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkInterfaceId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
port
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe VerifiedAccessEndpointProtocol
protocol

instance
  Prelude.NFData
    VerifiedAccessEndpointEniOptions
  where
  rnf :: VerifiedAccessEndpointEniOptions -> ()
rnf VerifiedAccessEndpointEniOptions' {Maybe Natural
Maybe Text
Maybe VerifiedAccessEndpointProtocol
protocol :: Maybe VerifiedAccessEndpointProtocol
port :: Maybe Natural
networkInterfaceId :: Maybe Text
$sel:protocol:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions
-> Maybe VerifiedAccessEndpointProtocol
$sel:port:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions -> Maybe Natural
$sel:networkInterfaceId:VerifiedAccessEndpointEniOptions' :: VerifiedAccessEndpointEniOptions -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkInterfaceId
      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