{-# 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.SecurityHub.Types.AwsEc2NetworkInterfaceIpV6AddressDetail
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsEc2NetworkInterfaceIpV6AddressDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information about an IPV6 address that is associated with the
-- network interface.
--
-- /See:/ 'newAwsEc2NetworkInterfaceIpV6AddressDetail' smart constructor.
data AwsEc2NetworkInterfaceIpV6AddressDetail = AwsEc2NetworkInterfaceIpV6AddressDetail'
  { -- | The IPV6 address.
    AwsEc2NetworkInterfaceIpV6AddressDetail -> Maybe Text
ipV6Address :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEc2NetworkInterfaceIpV6AddressDetail
-> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool
(AwsEc2NetworkInterfaceIpV6AddressDetail
 -> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool)
-> (AwsEc2NetworkInterfaceIpV6AddressDetail
    -> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool)
-> Eq AwsEc2NetworkInterfaceIpV6AddressDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEc2NetworkInterfaceIpV6AddressDetail
-> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool
$c/= :: AwsEc2NetworkInterfaceIpV6AddressDetail
-> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool
== :: AwsEc2NetworkInterfaceIpV6AddressDetail
-> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool
$c== :: AwsEc2NetworkInterfaceIpV6AddressDetail
-> AwsEc2NetworkInterfaceIpV6AddressDetail -> Bool
Prelude.Eq, ReadPrec [AwsEc2NetworkInterfaceIpV6AddressDetail]
ReadPrec AwsEc2NetworkInterfaceIpV6AddressDetail
Int -> ReadS AwsEc2NetworkInterfaceIpV6AddressDetail
ReadS [AwsEc2NetworkInterfaceIpV6AddressDetail]
(Int -> ReadS AwsEc2NetworkInterfaceIpV6AddressDetail)
-> ReadS [AwsEc2NetworkInterfaceIpV6AddressDetail]
-> ReadPrec AwsEc2NetworkInterfaceIpV6AddressDetail
-> ReadPrec [AwsEc2NetworkInterfaceIpV6AddressDetail]
-> Read AwsEc2NetworkInterfaceIpV6AddressDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEc2NetworkInterfaceIpV6AddressDetail]
$creadListPrec :: ReadPrec [AwsEc2NetworkInterfaceIpV6AddressDetail]
readPrec :: ReadPrec AwsEc2NetworkInterfaceIpV6AddressDetail
$creadPrec :: ReadPrec AwsEc2NetworkInterfaceIpV6AddressDetail
readList :: ReadS [AwsEc2NetworkInterfaceIpV6AddressDetail]
$creadList :: ReadS [AwsEc2NetworkInterfaceIpV6AddressDetail]
readsPrec :: Int -> ReadS AwsEc2NetworkInterfaceIpV6AddressDetail
$creadsPrec :: Int -> ReadS AwsEc2NetworkInterfaceIpV6AddressDetail
Prelude.Read, Int -> AwsEc2NetworkInterfaceIpV6AddressDetail -> ShowS
[AwsEc2NetworkInterfaceIpV6AddressDetail] -> ShowS
AwsEc2NetworkInterfaceIpV6AddressDetail -> String
(Int -> AwsEc2NetworkInterfaceIpV6AddressDetail -> ShowS)
-> (AwsEc2NetworkInterfaceIpV6AddressDetail -> String)
-> ([AwsEc2NetworkInterfaceIpV6AddressDetail] -> ShowS)
-> Show AwsEc2NetworkInterfaceIpV6AddressDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEc2NetworkInterfaceIpV6AddressDetail] -> ShowS
$cshowList :: [AwsEc2NetworkInterfaceIpV6AddressDetail] -> ShowS
show :: AwsEc2NetworkInterfaceIpV6AddressDetail -> String
$cshow :: AwsEc2NetworkInterfaceIpV6AddressDetail -> String
showsPrec :: Int -> AwsEc2NetworkInterfaceIpV6AddressDetail -> ShowS
$cshowsPrec :: Int -> AwsEc2NetworkInterfaceIpV6AddressDetail -> ShowS
Prelude.Show, (forall x.
 AwsEc2NetworkInterfaceIpV6AddressDetail
 -> Rep AwsEc2NetworkInterfaceIpV6AddressDetail x)
-> (forall x.
    Rep AwsEc2NetworkInterfaceIpV6AddressDetail x
    -> AwsEc2NetworkInterfaceIpV6AddressDetail)
-> Generic AwsEc2NetworkInterfaceIpV6AddressDetail
forall x.
Rep AwsEc2NetworkInterfaceIpV6AddressDetail x
-> AwsEc2NetworkInterfaceIpV6AddressDetail
forall x.
AwsEc2NetworkInterfaceIpV6AddressDetail
-> Rep AwsEc2NetworkInterfaceIpV6AddressDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEc2NetworkInterfaceIpV6AddressDetail x
-> AwsEc2NetworkInterfaceIpV6AddressDetail
$cfrom :: forall x.
AwsEc2NetworkInterfaceIpV6AddressDetail
-> Rep AwsEc2NetworkInterfaceIpV6AddressDetail x
Prelude.Generic)

-- |
-- Create a value of 'AwsEc2NetworkInterfaceIpV6AddressDetail' 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:
--
-- 'ipV6Address', 'awsEc2NetworkInterfaceIpV6AddressDetail_ipV6Address' - The IPV6 address.
newAwsEc2NetworkInterfaceIpV6AddressDetail ::
  AwsEc2NetworkInterfaceIpV6AddressDetail
newAwsEc2NetworkInterfaceIpV6AddressDetail :: AwsEc2NetworkInterfaceIpV6AddressDetail
newAwsEc2NetworkInterfaceIpV6AddressDetail =
  AwsEc2NetworkInterfaceIpV6AddressDetail' :: Maybe Text -> AwsEc2NetworkInterfaceIpV6AddressDetail
AwsEc2NetworkInterfaceIpV6AddressDetail'
    { $sel:ipV6Address:AwsEc2NetworkInterfaceIpV6AddressDetail' :: Maybe Text
ipV6Address =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The IPV6 address.
awsEc2NetworkInterfaceIpV6AddressDetail_ipV6Address :: Lens.Lens' AwsEc2NetworkInterfaceIpV6AddressDetail (Prelude.Maybe Prelude.Text)
awsEc2NetworkInterfaceIpV6AddressDetail_ipV6Address :: (Maybe Text -> f (Maybe Text))
-> AwsEc2NetworkInterfaceIpV6AddressDetail
-> f AwsEc2NetworkInterfaceIpV6AddressDetail
awsEc2NetworkInterfaceIpV6AddressDetail_ipV6Address = (AwsEc2NetworkInterfaceIpV6AddressDetail -> Maybe Text)
-> (AwsEc2NetworkInterfaceIpV6AddressDetail
    -> Maybe Text -> AwsEc2NetworkInterfaceIpV6AddressDetail)
-> Lens
     AwsEc2NetworkInterfaceIpV6AddressDetail
     AwsEc2NetworkInterfaceIpV6AddressDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEc2NetworkInterfaceIpV6AddressDetail' {Maybe Text
ipV6Address :: Maybe Text
$sel:ipV6Address:AwsEc2NetworkInterfaceIpV6AddressDetail' :: AwsEc2NetworkInterfaceIpV6AddressDetail -> Maybe Text
ipV6Address} -> Maybe Text
ipV6Address) (\s :: AwsEc2NetworkInterfaceIpV6AddressDetail
s@AwsEc2NetworkInterfaceIpV6AddressDetail' {} Maybe Text
a -> AwsEc2NetworkInterfaceIpV6AddressDetail
s {$sel:ipV6Address:AwsEc2NetworkInterfaceIpV6AddressDetail' :: Maybe Text
ipV6Address = Maybe Text
a} :: AwsEc2NetworkInterfaceIpV6AddressDetail)

instance
  Core.FromJSON
    AwsEc2NetworkInterfaceIpV6AddressDetail
  where
  parseJSON :: Value -> Parser AwsEc2NetworkInterfaceIpV6AddressDetail
parseJSON =
    String
-> (Object -> Parser AwsEc2NetworkInterfaceIpV6AddressDetail)
-> Value
-> Parser AwsEc2NetworkInterfaceIpV6AddressDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEc2NetworkInterfaceIpV6AddressDetail"
      ( \Object
x ->
          Maybe Text -> AwsEc2NetworkInterfaceIpV6AddressDetail
AwsEc2NetworkInterfaceIpV6AddressDetail'
            (Maybe Text -> AwsEc2NetworkInterfaceIpV6AddressDetail)
-> Parser (Maybe Text)
-> Parser AwsEc2NetworkInterfaceIpV6AddressDetail
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpV6Address")
      )

instance
  Prelude.Hashable
    AwsEc2NetworkInterfaceIpV6AddressDetail

instance
  Prelude.NFData
    AwsEc2NetworkInterfaceIpV6AddressDetail

instance
  Core.ToJSON
    AwsEc2NetworkInterfaceIpV6AddressDetail
  where
  toJSON :: AwsEc2NetworkInterfaceIpV6AddressDetail -> Value
toJSON AwsEc2NetworkInterfaceIpV6AddressDetail' {Maybe Text
ipV6Address :: Maybe Text
$sel:ipV6Address:AwsEc2NetworkInterfaceIpV6AddressDetail' :: AwsEc2NetworkInterfaceIpV6AddressDetail -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"IpV6Address" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ipV6Address]
      )