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

-- |
-- Create a value of 'Ipv6PrefixSpecificationRequest' 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', 'ipv6PrefixSpecificationRequest_ipv6Prefix' - The IPv6 prefix.
newIpv6PrefixSpecificationRequest ::
  Ipv6PrefixSpecificationRequest
newIpv6PrefixSpecificationRequest :: Ipv6PrefixSpecificationRequest
newIpv6PrefixSpecificationRequest =
  Ipv6PrefixSpecificationRequest'
    { $sel:ipv6Prefix:Ipv6PrefixSpecificationRequest' :: Maybe Text
ipv6Prefix =
        forall a. Maybe a
Prelude.Nothing
    }

-- | The IPv6 prefix.
ipv6PrefixSpecificationRequest_ipv6Prefix :: Lens.Lens' Ipv6PrefixSpecificationRequest (Prelude.Maybe Prelude.Text)
ipv6PrefixSpecificationRequest_ipv6Prefix :: Lens' Ipv6PrefixSpecificationRequest (Maybe Text)
ipv6PrefixSpecificationRequest_ipv6Prefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv6PrefixSpecificationRequest' {Maybe Text
ipv6Prefix :: Maybe Text
$sel:ipv6Prefix:Ipv6PrefixSpecificationRequest' :: Ipv6PrefixSpecificationRequest -> Maybe Text
ipv6Prefix} -> Maybe Text
ipv6Prefix) (\s :: Ipv6PrefixSpecificationRequest
s@Ipv6PrefixSpecificationRequest' {} Maybe Text
a -> Ipv6PrefixSpecificationRequest
s {$sel:ipv6Prefix:Ipv6PrefixSpecificationRequest' :: Maybe Text
ipv6Prefix = Maybe Text
a} :: Ipv6PrefixSpecificationRequest)

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

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

instance Data.ToQuery Ipv6PrefixSpecificationRequest where
  toQuery :: Ipv6PrefixSpecificationRequest -> QueryString
toQuery Ipv6PrefixSpecificationRequest' {Maybe Text
ipv6Prefix :: Maybe Text
$sel:ipv6Prefix:Ipv6PrefixSpecificationRequest' :: Ipv6PrefixSpecificationRequest -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"Ipv6Prefix" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
ipv6Prefix]