{-# 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.Ipv6CidrAssociation
-- 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.Ipv6CidrAssociation 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 IPv6 CIDR block association.
--
-- /See:/ 'newIpv6CidrAssociation' smart constructor.
data Ipv6CidrAssociation = Ipv6CidrAssociation'
  { -- | The resource that\'s associated with the IPv6 CIDR block.
    Ipv6CidrAssociation -> Maybe Text
associatedResource :: Prelude.Maybe Prelude.Text,
    -- | The IPv6 CIDR block.
    Ipv6CidrAssociation -> Maybe Text
ipv6Cidr :: Prelude.Maybe Prelude.Text
  }
  deriving (Ipv6CidrAssociation -> Ipv6CidrAssociation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ipv6CidrAssociation -> Ipv6CidrAssociation -> Bool
$c/= :: Ipv6CidrAssociation -> Ipv6CidrAssociation -> Bool
== :: Ipv6CidrAssociation -> Ipv6CidrAssociation -> Bool
$c== :: Ipv6CidrAssociation -> Ipv6CidrAssociation -> Bool
Prelude.Eq, ReadPrec [Ipv6CidrAssociation]
ReadPrec Ipv6CidrAssociation
Int -> ReadS Ipv6CidrAssociation
ReadS [Ipv6CidrAssociation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Ipv6CidrAssociation]
$creadListPrec :: ReadPrec [Ipv6CidrAssociation]
readPrec :: ReadPrec Ipv6CidrAssociation
$creadPrec :: ReadPrec Ipv6CidrAssociation
readList :: ReadS [Ipv6CidrAssociation]
$creadList :: ReadS [Ipv6CidrAssociation]
readsPrec :: Int -> ReadS Ipv6CidrAssociation
$creadsPrec :: Int -> ReadS Ipv6CidrAssociation
Prelude.Read, Int -> Ipv6CidrAssociation -> ShowS
[Ipv6CidrAssociation] -> ShowS
Ipv6CidrAssociation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ipv6CidrAssociation] -> ShowS
$cshowList :: [Ipv6CidrAssociation] -> ShowS
show :: Ipv6CidrAssociation -> String
$cshow :: Ipv6CidrAssociation -> String
showsPrec :: Int -> Ipv6CidrAssociation -> ShowS
$cshowsPrec :: Int -> Ipv6CidrAssociation -> ShowS
Prelude.Show, forall x. Rep Ipv6CidrAssociation x -> Ipv6CidrAssociation
forall x. Ipv6CidrAssociation -> Rep Ipv6CidrAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ipv6CidrAssociation x -> Ipv6CidrAssociation
$cfrom :: forall x. Ipv6CidrAssociation -> Rep Ipv6CidrAssociation x
Prelude.Generic)

-- |
-- Create a value of 'Ipv6CidrAssociation' 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:
--
-- 'associatedResource', 'ipv6CidrAssociation_associatedResource' - The resource that\'s associated with the IPv6 CIDR block.
--
-- 'ipv6Cidr', 'ipv6CidrAssociation_ipv6Cidr' - The IPv6 CIDR block.
newIpv6CidrAssociation ::
  Ipv6CidrAssociation
newIpv6CidrAssociation :: Ipv6CidrAssociation
newIpv6CidrAssociation =
  Ipv6CidrAssociation'
    { $sel:associatedResource:Ipv6CidrAssociation' :: Maybe Text
associatedResource =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ipv6Cidr:Ipv6CidrAssociation' :: Maybe Text
ipv6Cidr = forall a. Maybe a
Prelude.Nothing
    }

-- | The resource that\'s associated with the IPv6 CIDR block.
ipv6CidrAssociation_associatedResource :: Lens.Lens' Ipv6CidrAssociation (Prelude.Maybe Prelude.Text)
ipv6CidrAssociation_associatedResource :: Lens' Ipv6CidrAssociation (Maybe Text)
ipv6CidrAssociation_associatedResource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv6CidrAssociation' {Maybe Text
associatedResource :: Maybe Text
$sel:associatedResource:Ipv6CidrAssociation' :: Ipv6CidrAssociation -> Maybe Text
associatedResource} -> Maybe Text
associatedResource) (\s :: Ipv6CidrAssociation
s@Ipv6CidrAssociation' {} Maybe Text
a -> Ipv6CidrAssociation
s {$sel:associatedResource:Ipv6CidrAssociation' :: Maybe Text
associatedResource = Maybe Text
a} :: Ipv6CidrAssociation)

-- | The IPv6 CIDR block.
ipv6CidrAssociation_ipv6Cidr :: Lens.Lens' Ipv6CidrAssociation (Prelude.Maybe Prelude.Text)
ipv6CidrAssociation_ipv6Cidr :: Lens' Ipv6CidrAssociation (Maybe Text)
ipv6CidrAssociation_ipv6Cidr = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Ipv6CidrAssociation' {Maybe Text
ipv6Cidr :: Maybe Text
$sel:ipv6Cidr:Ipv6CidrAssociation' :: Ipv6CidrAssociation -> Maybe Text
ipv6Cidr} -> Maybe Text
ipv6Cidr) (\s :: Ipv6CidrAssociation
s@Ipv6CidrAssociation' {} Maybe Text
a -> Ipv6CidrAssociation
s {$sel:ipv6Cidr:Ipv6CidrAssociation' :: Maybe Text
ipv6Cidr = Maybe Text
a} :: Ipv6CidrAssociation)

instance Data.FromXML Ipv6CidrAssociation where
  parseXML :: [Node] -> Either String Ipv6CidrAssociation
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> Ipv6CidrAssociation
Ipv6CidrAssociation'
      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
"associatedResource")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ipv6Cidr")

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

instance Prelude.NFData Ipv6CidrAssociation where
  rnf :: Ipv6CidrAssociation -> ()
rnf Ipv6CidrAssociation' {Maybe Text
ipv6Cidr :: Maybe Text
associatedResource :: Maybe Text
$sel:ipv6Cidr:Ipv6CidrAssociation' :: Ipv6CidrAssociation -> Maybe Text
$sel:associatedResource:Ipv6CidrAssociation' :: Ipv6CidrAssociation -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
associatedResource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipv6Cidr