{-# 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.ClassicLinkDnsSupport
-- 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.ClassicLinkDnsSupport 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 ClassicLink DNS support status of a VPC.
--
-- /See:/ 'newClassicLinkDnsSupport' smart constructor.
data ClassicLinkDnsSupport = ClassicLinkDnsSupport'
  { -- | Indicates whether ClassicLink DNS support is enabled for the VPC.
    ClassicLinkDnsSupport -> Maybe Bool
classicLinkDnsSupported :: Prelude.Maybe Prelude.Bool,
    -- | The ID of the VPC.
    ClassicLinkDnsSupport -> Maybe Text
vpcId :: Prelude.Maybe Prelude.Text
  }
  deriving (ClassicLinkDnsSupport -> ClassicLinkDnsSupport -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClassicLinkDnsSupport -> ClassicLinkDnsSupport -> Bool
$c/= :: ClassicLinkDnsSupport -> ClassicLinkDnsSupport -> Bool
== :: ClassicLinkDnsSupport -> ClassicLinkDnsSupport -> Bool
$c== :: ClassicLinkDnsSupport -> ClassicLinkDnsSupport -> Bool
Prelude.Eq, ReadPrec [ClassicLinkDnsSupport]
ReadPrec ClassicLinkDnsSupport
Int -> ReadS ClassicLinkDnsSupport
ReadS [ClassicLinkDnsSupport]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClassicLinkDnsSupport]
$creadListPrec :: ReadPrec [ClassicLinkDnsSupport]
readPrec :: ReadPrec ClassicLinkDnsSupport
$creadPrec :: ReadPrec ClassicLinkDnsSupport
readList :: ReadS [ClassicLinkDnsSupport]
$creadList :: ReadS [ClassicLinkDnsSupport]
readsPrec :: Int -> ReadS ClassicLinkDnsSupport
$creadsPrec :: Int -> ReadS ClassicLinkDnsSupport
Prelude.Read, Int -> ClassicLinkDnsSupport -> ShowS
[ClassicLinkDnsSupport] -> ShowS
ClassicLinkDnsSupport -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClassicLinkDnsSupport] -> ShowS
$cshowList :: [ClassicLinkDnsSupport] -> ShowS
show :: ClassicLinkDnsSupport -> String
$cshow :: ClassicLinkDnsSupport -> String
showsPrec :: Int -> ClassicLinkDnsSupport -> ShowS
$cshowsPrec :: Int -> ClassicLinkDnsSupport -> ShowS
Prelude.Show, forall x. Rep ClassicLinkDnsSupport x -> ClassicLinkDnsSupport
forall x. ClassicLinkDnsSupport -> Rep ClassicLinkDnsSupport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClassicLinkDnsSupport x -> ClassicLinkDnsSupport
$cfrom :: forall x. ClassicLinkDnsSupport -> Rep ClassicLinkDnsSupport x
Prelude.Generic)

-- |
-- Create a value of 'ClassicLinkDnsSupport' 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:
--
-- 'classicLinkDnsSupported', 'classicLinkDnsSupport_classicLinkDnsSupported' - Indicates whether ClassicLink DNS support is enabled for the VPC.
--
-- 'vpcId', 'classicLinkDnsSupport_vpcId' - The ID of the VPC.
newClassicLinkDnsSupport ::
  ClassicLinkDnsSupport
newClassicLinkDnsSupport :: ClassicLinkDnsSupport
newClassicLinkDnsSupport =
  ClassicLinkDnsSupport'
    { $sel:classicLinkDnsSupported:ClassicLinkDnsSupport' :: Maybe Bool
classicLinkDnsSupported =
        forall a. Maybe a
Prelude.Nothing,
      $sel:vpcId:ClassicLinkDnsSupport' :: Maybe Text
vpcId = forall a. Maybe a
Prelude.Nothing
    }

-- | Indicates whether ClassicLink DNS support is enabled for the VPC.
classicLinkDnsSupport_classicLinkDnsSupported :: Lens.Lens' ClassicLinkDnsSupport (Prelude.Maybe Prelude.Bool)
classicLinkDnsSupport_classicLinkDnsSupported :: Lens' ClassicLinkDnsSupport (Maybe Bool)
classicLinkDnsSupport_classicLinkDnsSupported = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassicLinkDnsSupport' {Maybe Bool
classicLinkDnsSupported :: Maybe Bool
$sel:classicLinkDnsSupported:ClassicLinkDnsSupport' :: ClassicLinkDnsSupport -> Maybe Bool
classicLinkDnsSupported} -> Maybe Bool
classicLinkDnsSupported) (\s :: ClassicLinkDnsSupport
s@ClassicLinkDnsSupport' {} Maybe Bool
a -> ClassicLinkDnsSupport
s {$sel:classicLinkDnsSupported:ClassicLinkDnsSupport' :: Maybe Bool
classicLinkDnsSupported = Maybe Bool
a} :: ClassicLinkDnsSupport)

-- | The ID of the VPC.
classicLinkDnsSupport_vpcId :: Lens.Lens' ClassicLinkDnsSupport (Prelude.Maybe Prelude.Text)
classicLinkDnsSupport_vpcId :: Lens' ClassicLinkDnsSupport (Maybe Text)
classicLinkDnsSupport_vpcId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClassicLinkDnsSupport' {Maybe Text
vpcId :: Maybe Text
$sel:vpcId:ClassicLinkDnsSupport' :: ClassicLinkDnsSupport -> Maybe Text
vpcId} -> Maybe Text
vpcId) (\s :: ClassicLinkDnsSupport
s@ClassicLinkDnsSupport' {} Maybe Text
a -> ClassicLinkDnsSupport
s {$sel:vpcId:ClassicLinkDnsSupport' :: Maybe Text
vpcId = Maybe Text
a} :: ClassicLinkDnsSupport)

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

instance Prelude.Hashable ClassicLinkDnsSupport where
  hashWithSalt :: Int -> ClassicLinkDnsSupport -> Int
hashWithSalt Int
_salt ClassicLinkDnsSupport' {Maybe Bool
Maybe Text
vpcId :: Maybe Text
classicLinkDnsSupported :: Maybe Bool
$sel:vpcId:ClassicLinkDnsSupport' :: ClassicLinkDnsSupport -> Maybe Text
$sel:classicLinkDnsSupported:ClassicLinkDnsSupport' :: ClassicLinkDnsSupport -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
classicLinkDnsSupported
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vpcId

instance Prelude.NFData ClassicLinkDnsSupport where
  rnf :: ClassicLinkDnsSupport -> ()
rnf ClassicLinkDnsSupport' {Maybe Bool
Maybe Text
vpcId :: Maybe Text
classicLinkDnsSupported :: Maybe Bool
$sel:vpcId:ClassicLinkDnsSupport' :: ClassicLinkDnsSupport -> Maybe Text
$sel:classicLinkDnsSupported:ClassicLinkDnsSupport' :: ClassicLinkDnsSupport -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
classicLinkDnsSupported
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vpcId