{-# 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.InstanceIpv6Prefix
-- 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.InstanceIpv6Prefix 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 IPv6 prefix.
--
-- /See:/ 'newInstanceIpv6Prefix' smart constructor.
data InstanceIpv6Prefix = InstanceIpv6Prefix'
  { -- | One or more IPv6 prefixes assigned to the network interface.
    InstanceIpv6Prefix -> Maybe Text
ipv6Prefix :: Prelude.Maybe Prelude.Text
  }
  deriving (InstanceIpv6Prefix -> InstanceIpv6Prefix -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceIpv6Prefix -> InstanceIpv6Prefix -> Bool
$c/= :: InstanceIpv6Prefix -> InstanceIpv6Prefix -> Bool
== :: InstanceIpv6Prefix -> InstanceIpv6Prefix -> Bool
$c== :: InstanceIpv6Prefix -> InstanceIpv6Prefix -> Bool
Prelude.Eq, ReadPrec [InstanceIpv6Prefix]
ReadPrec InstanceIpv6Prefix
Int -> ReadS InstanceIpv6Prefix
ReadS [InstanceIpv6Prefix]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceIpv6Prefix]
$creadListPrec :: ReadPrec [InstanceIpv6Prefix]
readPrec :: ReadPrec InstanceIpv6Prefix
$creadPrec :: ReadPrec InstanceIpv6Prefix
readList :: ReadS [InstanceIpv6Prefix]
$creadList :: ReadS [InstanceIpv6Prefix]
readsPrec :: Int -> ReadS InstanceIpv6Prefix
$creadsPrec :: Int -> ReadS InstanceIpv6Prefix
Prelude.Read, Int -> InstanceIpv6Prefix -> ShowS
[InstanceIpv6Prefix] -> ShowS
InstanceIpv6Prefix -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceIpv6Prefix] -> ShowS
$cshowList :: [InstanceIpv6Prefix] -> ShowS
show :: InstanceIpv6Prefix -> String
$cshow :: InstanceIpv6Prefix -> String
showsPrec :: Int -> InstanceIpv6Prefix -> ShowS
$cshowsPrec :: Int -> InstanceIpv6Prefix -> ShowS
Prelude.Show, forall x. Rep InstanceIpv6Prefix x -> InstanceIpv6Prefix
forall x. InstanceIpv6Prefix -> Rep InstanceIpv6Prefix x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceIpv6Prefix x -> InstanceIpv6Prefix
$cfrom :: forall x. InstanceIpv6Prefix -> Rep InstanceIpv6Prefix x
Prelude.Generic)

-- |
-- Create a value of 'InstanceIpv6Prefix' 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:
--
-- 'ipv6Prefix', 'instanceIpv6Prefix_ipv6Prefix' - One or more IPv6 prefixes assigned to the network interface.
newInstanceIpv6Prefix ::
  InstanceIpv6Prefix
newInstanceIpv6Prefix :: InstanceIpv6Prefix
newInstanceIpv6Prefix =
  InstanceIpv6Prefix' {$sel:ipv6Prefix:InstanceIpv6Prefix' :: Maybe Text
ipv6Prefix = forall a. Maybe a
Prelude.Nothing}

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

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

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

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