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

-- | Information about an IPv4 prefix.
--
-- /See:/ 'newInstanceIpv4Prefix' smart constructor.
data InstanceIpv4Prefix = InstanceIpv4Prefix'
  { -- | One or more IPv4 prefixes assigned to the network interface.
    InstanceIpv4Prefix -> Maybe Text
ipv4Prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceIpv4Prefix -> InstanceIpv4Prefix -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceIpv4Prefix -> InstanceIpv4Prefix -> Bool
$c/= :: InstanceIpv4Prefix -> InstanceIpv4Prefix -> Bool
== :: InstanceIpv4Prefix -> InstanceIpv4Prefix -> Bool
$c== :: InstanceIpv4Prefix -> InstanceIpv4Prefix -> Bool
Prelude.Eq, ReadPrec [InstanceIpv4Prefix]
ReadPrec InstanceIpv4Prefix
Int -> ReadS InstanceIpv4Prefix
ReadS [InstanceIpv4Prefix]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceIpv4Prefix]
$creadListPrec :: ReadPrec [InstanceIpv4Prefix]
readPrec :: ReadPrec InstanceIpv4Prefix
$creadPrec :: ReadPrec InstanceIpv4Prefix
readList :: ReadS [InstanceIpv4Prefix]
$creadList :: ReadS [InstanceIpv4Prefix]
readsPrec :: Int -> ReadS InstanceIpv4Prefix
$creadsPrec :: Int -> ReadS InstanceIpv4Prefix
Prelude.Read, Int -> InstanceIpv4Prefix -> ShowS
[InstanceIpv4Prefix] -> ShowS
InstanceIpv4Prefix -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceIpv4Prefix] -> ShowS
$cshowList :: [InstanceIpv4Prefix] -> ShowS
show :: InstanceIpv4Prefix -> String
$cshow :: InstanceIpv4Prefix -> String
showsPrec :: Int -> InstanceIpv4Prefix -> ShowS
$cshowsPrec :: Int -> InstanceIpv4Prefix -> ShowS
Prelude.Show, forall x. Rep InstanceIpv4Prefix x -> InstanceIpv4Prefix
forall x. InstanceIpv4Prefix -> Rep InstanceIpv4Prefix x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceIpv4Prefix x -> InstanceIpv4Prefix
$cfrom :: forall x. InstanceIpv4Prefix -> Rep InstanceIpv4Prefix x
Prelude.Generic)

-- |
-- Create a value of 'InstanceIpv4Prefix' 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', 'instanceIpv4Prefix_ipv4Prefix' - One or more IPv4 prefixes assigned to the network interface.
newInstanceIpv4Prefix ::
  InstanceIpv4Prefix
newInstanceIpv4Prefix :: InstanceIpv4Prefix
newInstanceIpv4Prefix =
  InstanceIpv4Prefix' {$sel:ipv4Prefix:InstanceIpv4Prefix' :: Maybe Text
ipv4Prefix = forall a. Maybe a
Prelude.Nothing}

-- | One or more IPv4 prefixes assigned to the network interface.
instanceIpv4Prefix_ipv4Prefix :: Lens.Lens' InstanceIpv4Prefix (Prelude.Maybe Prelude.Text)
instanceIpv4Prefix_ipv4Prefix :: Lens' InstanceIpv4Prefix (Maybe Text)
instanceIpv4Prefix_ipv4Prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceIpv4Prefix' {Maybe Text
ipv4Prefix :: Maybe Text
$sel:ipv4Prefix:InstanceIpv4Prefix' :: InstanceIpv4Prefix -> Maybe Text
ipv4Prefix} -> Maybe Text
ipv4Prefix) (\s :: InstanceIpv4Prefix
s@InstanceIpv4Prefix' {} Maybe Text
a -> InstanceIpv4Prefix
s {$sel:ipv4Prefix:InstanceIpv4Prefix' :: Maybe Text
ipv4Prefix = Maybe Text
a} :: InstanceIpv4Prefix)

instance Data.FromXML InstanceIpv4Prefix where
  parseXML :: [Node] -> Either String InstanceIpv4Prefix
parseXML [Node]
x =
    Maybe Text -> InstanceIpv4Prefix
InstanceIpv4Prefix'
      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 InstanceIpv4Prefix where
  hashWithSalt :: Int -> InstanceIpv4Prefix -> Int
hashWithSalt Int
_salt InstanceIpv4Prefix' {Maybe Text
ipv4Prefix :: Maybe Text
$sel:ipv4Prefix:InstanceIpv4Prefix' :: InstanceIpv4Prefix -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipv4Prefix

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