{-# 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.Route53Resolver.Types.ResolverDnssecConfig
-- 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.Route53Resolver.Types.ResolverDnssecConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.ResolverDNSSECValidationStatus

-- | A complex type that contains information about a configuration for
-- DNSSEC validation.
--
-- /See:/ 'newResolverDnssecConfig' smart constructor.
data ResolverDnssecConfig = ResolverDnssecConfig'
  { -- | The ID of the virtual private cloud (VPC) that you\'re configuring the
    -- DNSSEC validation status for.
    ResolverDnssecConfig -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | The owner account ID of the virtual private cloud (VPC) for a
    -- configuration for DNSSEC validation.
    ResolverDnssecConfig -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
    -- | The validation status for a DNSSEC configuration. The status can be one
    -- of the following:
    --
    -- -   __ENABLING:__ DNSSEC validation is being enabled but is not
    --     complete.
    --
    -- -   __ENABLED:__ DNSSEC validation is enabled.
    --
    -- -   __DISABLING:__ DNSSEC validation is being disabled but is not
    --     complete.
    --
    -- -   __DISABLED__ DNSSEC validation is disabled.
    ResolverDnssecConfig -> Maybe ResolverDNSSECValidationStatus
validationStatus :: Prelude.Maybe ResolverDNSSECValidationStatus,
    -- | The ID for a configuration for DNSSEC validation.
    ResolverDnssecConfig -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (ResolverDnssecConfig -> ResolverDnssecConfig -> Bool
(ResolverDnssecConfig -> ResolverDnssecConfig -> Bool)
-> (ResolverDnssecConfig -> ResolverDnssecConfig -> Bool)
-> Eq ResolverDnssecConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResolverDnssecConfig -> ResolverDnssecConfig -> Bool
$c/= :: ResolverDnssecConfig -> ResolverDnssecConfig -> Bool
== :: ResolverDnssecConfig -> ResolverDnssecConfig -> Bool
$c== :: ResolverDnssecConfig -> ResolverDnssecConfig -> Bool
Prelude.Eq, ReadPrec [ResolverDnssecConfig]
ReadPrec ResolverDnssecConfig
Int -> ReadS ResolverDnssecConfig
ReadS [ResolverDnssecConfig]
(Int -> ReadS ResolverDnssecConfig)
-> ReadS [ResolverDnssecConfig]
-> ReadPrec ResolverDnssecConfig
-> ReadPrec [ResolverDnssecConfig]
-> Read ResolverDnssecConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResolverDnssecConfig]
$creadListPrec :: ReadPrec [ResolverDnssecConfig]
readPrec :: ReadPrec ResolverDnssecConfig
$creadPrec :: ReadPrec ResolverDnssecConfig
readList :: ReadS [ResolverDnssecConfig]
$creadList :: ReadS [ResolverDnssecConfig]
readsPrec :: Int -> ReadS ResolverDnssecConfig
$creadsPrec :: Int -> ReadS ResolverDnssecConfig
Prelude.Read, Int -> ResolverDnssecConfig -> ShowS
[ResolverDnssecConfig] -> ShowS
ResolverDnssecConfig -> String
(Int -> ResolverDnssecConfig -> ShowS)
-> (ResolverDnssecConfig -> String)
-> ([ResolverDnssecConfig] -> ShowS)
-> Show ResolverDnssecConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResolverDnssecConfig] -> ShowS
$cshowList :: [ResolverDnssecConfig] -> ShowS
show :: ResolverDnssecConfig -> String
$cshow :: ResolverDnssecConfig -> String
showsPrec :: Int -> ResolverDnssecConfig -> ShowS
$cshowsPrec :: Int -> ResolverDnssecConfig -> ShowS
Prelude.Show, (forall x. ResolverDnssecConfig -> Rep ResolverDnssecConfig x)
-> (forall x. Rep ResolverDnssecConfig x -> ResolverDnssecConfig)
-> Generic ResolverDnssecConfig
forall x. Rep ResolverDnssecConfig x -> ResolverDnssecConfig
forall x. ResolverDnssecConfig -> Rep ResolverDnssecConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResolverDnssecConfig x -> ResolverDnssecConfig
$cfrom :: forall x. ResolverDnssecConfig -> Rep ResolverDnssecConfig x
Prelude.Generic)

-- |
-- Create a value of 'ResolverDnssecConfig' 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:
--
-- 'resourceId', 'resolverDnssecConfig_resourceId' - The ID of the virtual private cloud (VPC) that you\'re configuring the
-- DNSSEC validation status for.
--
-- 'ownerId', 'resolverDnssecConfig_ownerId' - The owner account ID of the virtual private cloud (VPC) for a
-- configuration for DNSSEC validation.
--
-- 'validationStatus', 'resolverDnssecConfig_validationStatus' - The validation status for a DNSSEC configuration. The status can be one
-- of the following:
--
-- -   __ENABLING:__ DNSSEC validation is being enabled but is not
--     complete.
--
-- -   __ENABLED:__ DNSSEC validation is enabled.
--
-- -   __DISABLING:__ DNSSEC validation is being disabled but is not
--     complete.
--
-- -   __DISABLED__ DNSSEC validation is disabled.
--
-- 'id', 'resolverDnssecConfig_id' - The ID for a configuration for DNSSEC validation.
newResolverDnssecConfig ::
  ResolverDnssecConfig
newResolverDnssecConfig :: ResolverDnssecConfig
newResolverDnssecConfig =
  ResolverDnssecConfig' :: Maybe Text
-> Maybe Text
-> Maybe ResolverDNSSECValidationStatus
-> Maybe Text
-> ResolverDnssecConfig
ResolverDnssecConfig'
    { $sel:resourceId:ResolverDnssecConfig' :: Maybe Text
resourceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerId:ResolverDnssecConfig' :: Maybe Text
ownerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:validationStatus:ResolverDnssecConfig' :: Maybe ResolverDNSSECValidationStatus
validationStatus = Maybe ResolverDNSSECValidationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:id:ResolverDnssecConfig' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the virtual private cloud (VPC) that you\'re configuring the
-- DNSSEC validation status for.
resolverDnssecConfig_resourceId :: Lens.Lens' ResolverDnssecConfig (Prelude.Maybe Prelude.Text)
resolverDnssecConfig_resourceId :: (Maybe Text -> f (Maybe Text))
-> ResolverDnssecConfig -> f ResolverDnssecConfig
resolverDnssecConfig_resourceId = (ResolverDnssecConfig -> Maybe Text)
-> (ResolverDnssecConfig -> Maybe Text -> ResolverDnssecConfig)
-> Lens
     ResolverDnssecConfig ResolverDnssecConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverDnssecConfig' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:ResolverDnssecConfig' :: ResolverDnssecConfig -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: ResolverDnssecConfig
s@ResolverDnssecConfig' {} Maybe Text
a -> ResolverDnssecConfig
s {$sel:resourceId:ResolverDnssecConfig' :: Maybe Text
resourceId = Maybe Text
a} :: ResolverDnssecConfig)

-- | The owner account ID of the virtual private cloud (VPC) for a
-- configuration for DNSSEC validation.
resolverDnssecConfig_ownerId :: Lens.Lens' ResolverDnssecConfig (Prelude.Maybe Prelude.Text)
resolverDnssecConfig_ownerId :: (Maybe Text -> f (Maybe Text))
-> ResolverDnssecConfig -> f ResolverDnssecConfig
resolverDnssecConfig_ownerId = (ResolverDnssecConfig -> Maybe Text)
-> (ResolverDnssecConfig -> Maybe Text -> ResolverDnssecConfig)
-> Lens
     ResolverDnssecConfig ResolverDnssecConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverDnssecConfig' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:ResolverDnssecConfig' :: ResolverDnssecConfig -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: ResolverDnssecConfig
s@ResolverDnssecConfig' {} Maybe Text
a -> ResolverDnssecConfig
s {$sel:ownerId:ResolverDnssecConfig' :: Maybe Text
ownerId = Maybe Text
a} :: ResolverDnssecConfig)

-- | The validation status for a DNSSEC configuration. The status can be one
-- of the following:
--
-- -   __ENABLING:__ DNSSEC validation is being enabled but is not
--     complete.
--
-- -   __ENABLED:__ DNSSEC validation is enabled.
--
-- -   __DISABLING:__ DNSSEC validation is being disabled but is not
--     complete.
--
-- -   __DISABLED__ DNSSEC validation is disabled.
resolverDnssecConfig_validationStatus :: Lens.Lens' ResolverDnssecConfig (Prelude.Maybe ResolverDNSSECValidationStatus)
resolverDnssecConfig_validationStatus :: (Maybe ResolverDNSSECValidationStatus
 -> f (Maybe ResolverDNSSECValidationStatus))
-> ResolverDnssecConfig -> f ResolverDnssecConfig
resolverDnssecConfig_validationStatus = (ResolverDnssecConfig -> Maybe ResolverDNSSECValidationStatus)
-> (ResolverDnssecConfig
    -> Maybe ResolverDNSSECValidationStatus -> ResolverDnssecConfig)
-> Lens
     ResolverDnssecConfig
     ResolverDnssecConfig
     (Maybe ResolverDNSSECValidationStatus)
     (Maybe ResolverDNSSECValidationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverDnssecConfig' {Maybe ResolverDNSSECValidationStatus
validationStatus :: Maybe ResolverDNSSECValidationStatus
$sel:validationStatus:ResolverDnssecConfig' :: ResolverDnssecConfig -> Maybe ResolverDNSSECValidationStatus
validationStatus} -> Maybe ResolverDNSSECValidationStatus
validationStatus) (\s :: ResolverDnssecConfig
s@ResolverDnssecConfig' {} Maybe ResolverDNSSECValidationStatus
a -> ResolverDnssecConfig
s {$sel:validationStatus:ResolverDnssecConfig' :: Maybe ResolverDNSSECValidationStatus
validationStatus = Maybe ResolverDNSSECValidationStatus
a} :: ResolverDnssecConfig)

-- | The ID for a configuration for DNSSEC validation.
resolverDnssecConfig_id :: Lens.Lens' ResolverDnssecConfig (Prelude.Maybe Prelude.Text)
resolverDnssecConfig_id :: (Maybe Text -> f (Maybe Text))
-> ResolverDnssecConfig -> f ResolverDnssecConfig
resolverDnssecConfig_id = (ResolverDnssecConfig -> Maybe Text)
-> (ResolverDnssecConfig -> Maybe Text -> ResolverDnssecConfig)
-> Lens
     ResolverDnssecConfig ResolverDnssecConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResolverDnssecConfig' {Maybe Text
id :: Maybe Text
$sel:id:ResolverDnssecConfig' :: ResolverDnssecConfig -> Maybe Text
id} -> Maybe Text
id) (\s :: ResolverDnssecConfig
s@ResolverDnssecConfig' {} Maybe Text
a -> ResolverDnssecConfig
s {$sel:id:ResolverDnssecConfig' :: Maybe Text
id = Maybe Text
a} :: ResolverDnssecConfig)

instance Core.FromJSON ResolverDnssecConfig where
  parseJSON :: Value -> Parser ResolverDnssecConfig
parseJSON =
    String
-> (Object -> Parser ResolverDnssecConfig)
-> Value
-> Parser ResolverDnssecConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResolverDnssecConfig"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ResolverDNSSECValidationStatus
-> Maybe Text
-> ResolverDnssecConfig
ResolverDnssecConfig'
            (Maybe Text
 -> Maybe Text
 -> Maybe ResolverDNSSECValidationStatus
 -> Maybe Text
 -> ResolverDnssecConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ResolverDNSSECValidationStatus
      -> Maybe Text
      -> ResolverDnssecConfig)
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
"ResourceId")
            Parser
  (Maybe Text
   -> Maybe ResolverDNSSECValidationStatus
   -> Maybe Text
   -> ResolverDnssecConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResolverDNSSECValidationStatus
      -> Maybe Text -> ResolverDnssecConfig)
forall (f :: * -> *) a b. Applicative f => 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
"OwnerId")
            Parser
  (Maybe ResolverDNSSECValidationStatus
   -> Maybe Text -> ResolverDnssecConfig)
-> Parser (Maybe ResolverDNSSECValidationStatus)
-> Parser (Maybe Text -> ResolverDnssecConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResolverDNSSECValidationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ValidationStatus")
            Parser (Maybe Text -> ResolverDnssecConfig)
-> Parser (Maybe Text) -> Parser ResolverDnssecConfig
forall (f :: * -> *) a b. Applicative f => 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
"Id")
      )

instance Prelude.Hashable ResolverDnssecConfig

instance Prelude.NFData ResolverDnssecConfig