{-# 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.AttachmentEnaSrdUdpSpecification
-- 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.AttachmentEnaSrdUdpSpecification 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 qualified Amazonka.Prelude as Prelude

-- | Describes the ENA Express configuration for UDP traffic on the network
-- interface that\'s attached to the instance.
--
-- /See:/ 'newAttachmentEnaSrdUdpSpecification' smart constructor.
data AttachmentEnaSrdUdpSpecification = AttachmentEnaSrdUdpSpecification'
  { -- | Indicates whether UDP traffic to and from the instance uses ENA Express.
    -- To specify this setting, you must first enable ENA Express.
    AttachmentEnaSrdUdpSpecification -> Maybe Bool
enaSrdUdpEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (AttachmentEnaSrdUdpSpecification
-> AttachmentEnaSrdUdpSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachmentEnaSrdUdpSpecification
-> AttachmentEnaSrdUdpSpecification -> Bool
$c/= :: AttachmentEnaSrdUdpSpecification
-> AttachmentEnaSrdUdpSpecification -> Bool
== :: AttachmentEnaSrdUdpSpecification
-> AttachmentEnaSrdUdpSpecification -> Bool
$c== :: AttachmentEnaSrdUdpSpecification
-> AttachmentEnaSrdUdpSpecification -> Bool
Prelude.Eq, ReadPrec [AttachmentEnaSrdUdpSpecification]
ReadPrec AttachmentEnaSrdUdpSpecification
Int -> ReadS AttachmentEnaSrdUdpSpecification
ReadS [AttachmentEnaSrdUdpSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachmentEnaSrdUdpSpecification]
$creadListPrec :: ReadPrec [AttachmentEnaSrdUdpSpecification]
readPrec :: ReadPrec AttachmentEnaSrdUdpSpecification
$creadPrec :: ReadPrec AttachmentEnaSrdUdpSpecification
readList :: ReadS [AttachmentEnaSrdUdpSpecification]
$creadList :: ReadS [AttachmentEnaSrdUdpSpecification]
readsPrec :: Int -> ReadS AttachmentEnaSrdUdpSpecification
$creadsPrec :: Int -> ReadS AttachmentEnaSrdUdpSpecification
Prelude.Read, Int -> AttachmentEnaSrdUdpSpecification -> ShowS
[AttachmentEnaSrdUdpSpecification] -> ShowS
AttachmentEnaSrdUdpSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachmentEnaSrdUdpSpecification] -> ShowS
$cshowList :: [AttachmentEnaSrdUdpSpecification] -> ShowS
show :: AttachmentEnaSrdUdpSpecification -> String
$cshow :: AttachmentEnaSrdUdpSpecification -> String
showsPrec :: Int -> AttachmentEnaSrdUdpSpecification -> ShowS
$cshowsPrec :: Int -> AttachmentEnaSrdUdpSpecification -> ShowS
Prelude.Show, forall x.
Rep AttachmentEnaSrdUdpSpecification x
-> AttachmentEnaSrdUdpSpecification
forall x.
AttachmentEnaSrdUdpSpecification
-> Rep AttachmentEnaSrdUdpSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AttachmentEnaSrdUdpSpecification x
-> AttachmentEnaSrdUdpSpecification
$cfrom :: forall x.
AttachmentEnaSrdUdpSpecification
-> Rep AttachmentEnaSrdUdpSpecification x
Prelude.Generic)

-- |
-- Create a value of 'AttachmentEnaSrdUdpSpecification' 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:
--
-- 'enaSrdUdpEnabled', 'attachmentEnaSrdUdpSpecification_enaSrdUdpEnabled' - Indicates whether UDP traffic to and from the instance uses ENA Express.
-- To specify this setting, you must first enable ENA Express.
newAttachmentEnaSrdUdpSpecification ::
  AttachmentEnaSrdUdpSpecification
newAttachmentEnaSrdUdpSpecification :: AttachmentEnaSrdUdpSpecification
newAttachmentEnaSrdUdpSpecification =
  AttachmentEnaSrdUdpSpecification'
    { $sel:enaSrdUdpEnabled:AttachmentEnaSrdUdpSpecification' :: Maybe Bool
enaSrdUdpEnabled =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether UDP traffic to and from the instance uses ENA Express.
-- To specify this setting, you must first enable ENA Express.
attachmentEnaSrdUdpSpecification_enaSrdUdpEnabled :: Lens.Lens' AttachmentEnaSrdUdpSpecification (Prelude.Maybe Prelude.Bool)
attachmentEnaSrdUdpSpecification_enaSrdUdpEnabled :: Lens' AttachmentEnaSrdUdpSpecification (Maybe Bool)
attachmentEnaSrdUdpSpecification_enaSrdUdpEnabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentEnaSrdUdpSpecification' {Maybe Bool
enaSrdUdpEnabled :: Maybe Bool
$sel:enaSrdUdpEnabled:AttachmentEnaSrdUdpSpecification' :: AttachmentEnaSrdUdpSpecification -> Maybe Bool
enaSrdUdpEnabled} -> Maybe Bool
enaSrdUdpEnabled) (\s :: AttachmentEnaSrdUdpSpecification
s@AttachmentEnaSrdUdpSpecification' {} Maybe Bool
a -> AttachmentEnaSrdUdpSpecification
s {$sel:enaSrdUdpEnabled:AttachmentEnaSrdUdpSpecification' :: Maybe Bool
enaSrdUdpEnabled = Maybe Bool
a} :: AttachmentEnaSrdUdpSpecification)

instance
  Data.FromXML
    AttachmentEnaSrdUdpSpecification
  where
  parseXML :: [Node] -> Either String AttachmentEnaSrdUdpSpecification
parseXML [Node]
x =
    Maybe Bool -> AttachmentEnaSrdUdpSpecification
AttachmentEnaSrdUdpSpecification'
      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
"enaSrdUdpEnabled")

instance
  Prelude.Hashable
    AttachmentEnaSrdUdpSpecification
  where
  hashWithSalt :: Int -> AttachmentEnaSrdUdpSpecification -> Int
hashWithSalt
    Int
_salt
    AttachmentEnaSrdUdpSpecification' {Maybe Bool
enaSrdUdpEnabled :: Maybe Bool
$sel:enaSrdUdpEnabled:AttachmentEnaSrdUdpSpecification' :: AttachmentEnaSrdUdpSpecification -> Maybe Bool
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
enaSrdUdpEnabled

instance
  Prelude.NFData
    AttachmentEnaSrdUdpSpecification
  where
  rnf :: AttachmentEnaSrdUdpSpecification -> ()
rnf AttachmentEnaSrdUdpSpecification' {Maybe Bool
enaSrdUdpEnabled :: Maybe Bool
$sel:enaSrdUdpEnabled:AttachmentEnaSrdUdpSpecification' :: AttachmentEnaSrdUdpSpecification -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
enaSrdUdpEnabled