{-# 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.Ipv4PrefixSpecification
-- 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.Ipv4PrefixSpecification 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 an IPv4 prefix.
--
-- /See:/ 'newIpv4PrefixSpecification' smart constructor.
data Ipv4PrefixSpecification = Ipv4PrefixSpecification'
  { -- | The IPv4 prefix. For information, see
    -- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html Assigning prefixes to Amazon EC2 network interfaces>
    -- in the /Amazon Elastic Compute Cloud User Guide/.
    Ipv4PrefixSpecification -> Maybe Text
ipv4Prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (Ipv4PrefixSpecification -> Ipv4PrefixSpecification -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ipv4PrefixSpecification -> Ipv4PrefixSpecification -> Bool
$c/= :: Ipv4PrefixSpecification -> Ipv4PrefixSpecification -> Bool
== :: Ipv4PrefixSpecification -> Ipv4PrefixSpecification -> Bool
$c== :: Ipv4PrefixSpecification -> Ipv4PrefixSpecification -> Bool
Prelude.Eq, ReadPrec [Ipv4PrefixSpecification]
ReadPrec Ipv4PrefixSpecification
Int -> ReadS Ipv4PrefixSpecification
ReadS [Ipv4PrefixSpecification]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ipv4PrefixSpecification]
$creadListPrec :: ReadPrec [Ipv4PrefixSpecification]
readPrec :: ReadPrec Ipv4PrefixSpecification
$creadPrec :: ReadPrec Ipv4PrefixSpecification
readList :: ReadS [Ipv4PrefixSpecification]
$creadList :: ReadS [Ipv4PrefixSpecification]
readsPrec :: Int -> ReadS Ipv4PrefixSpecification
$creadsPrec :: Int -> ReadS Ipv4PrefixSpecification
Prelude.Read, Int -> Ipv4PrefixSpecification -> ShowS
[Ipv4PrefixSpecification] -> ShowS
Ipv4PrefixSpecification -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ipv4PrefixSpecification] -> ShowS
$cshowList :: [Ipv4PrefixSpecification] -> ShowS
show :: Ipv4PrefixSpecification -> String
$cshow :: Ipv4PrefixSpecification -> String
showsPrec :: Int -> Ipv4PrefixSpecification -> ShowS
$cshowsPrec :: Int -> Ipv4PrefixSpecification -> ShowS
Prelude.Show, forall x. Rep Ipv4PrefixSpecification x -> Ipv4PrefixSpecification
forall x. Ipv4PrefixSpecification -> Rep Ipv4PrefixSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ipv4PrefixSpecification x -> Ipv4PrefixSpecification
$cfrom :: forall x. Ipv4PrefixSpecification -> Rep Ipv4PrefixSpecification x
Prelude.Generic)

-- |
-- Create a value of 'Ipv4PrefixSpecification' 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:
--
-- 'ipv4Prefix', 'ipv4PrefixSpecification_ipv4Prefix' - The IPv4 prefix. For information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html Assigning prefixes to Amazon EC2 network interfaces>
-- in the /Amazon Elastic Compute Cloud User Guide/.
newIpv4PrefixSpecification ::
  Ipv4PrefixSpecification
newIpv4PrefixSpecification :: Ipv4PrefixSpecification
newIpv4PrefixSpecification =
  Ipv4PrefixSpecification'
    { $sel:ipv4Prefix:Ipv4PrefixSpecification' :: Maybe Text
ipv4Prefix =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The IPv4 prefix. For information, see
-- <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-prefix-eni.html Assigning prefixes to Amazon EC2 network interfaces>
-- in the /Amazon Elastic Compute Cloud User Guide/.
ipv4PrefixSpecification_ipv4Prefix :: Lens.Lens' Ipv4PrefixSpecification (Prelude.Maybe Prelude.Text)
ipv4PrefixSpecification_ipv4Prefix :: Lens' Ipv4PrefixSpecification (Maybe Text)
ipv4PrefixSpecification_ipv4Prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv4PrefixSpecification' {Maybe Text
ipv4Prefix :: Maybe Text
$sel:ipv4Prefix:Ipv4PrefixSpecification' :: Ipv4PrefixSpecification -> Maybe Text
ipv4Prefix} -> Maybe Text
ipv4Prefix) (\s :: Ipv4PrefixSpecification
s@Ipv4PrefixSpecification' {} Maybe Text
a -> Ipv4PrefixSpecification
s {$sel:ipv4Prefix:Ipv4PrefixSpecification' :: Maybe Text
ipv4Prefix = Maybe Text
a} :: Ipv4PrefixSpecification)

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

instance Prelude.Hashable Ipv4PrefixSpecification where
  hashWithSalt :: Int -> Ipv4PrefixSpecification -> Int
hashWithSalt Int
_salt Ipv4PrefixSpecification' {Maybe Text
ipv4Prefix :: Maybe Text
$sel:ipv4Prefix:Ipv4PrefixSpecification' :: Ipv4PrefixSpecification -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipv4Prefix

instance Prelude.NFData Ipv4PrefixSpecification where
  rnf :: Ipv4PrefixSpecification -> ()
rnf Ipv4PrefixSpecification' {Maybe Text
ipv4Prefix :: Maybe Text
$sel:ipv4Prefix:Ipv4PrefixSpecification' :: Ipv4PrefixSpecification -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipv4Prefix