{-# 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.Route53.Types.DNSSECStatus
-- 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.Route53.Types.DNSSECStatus where

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

-- | A string repesenting the status of DNSSEC signing.
--
-- /See:/ 'newDNSSECStatus' smart constructor.
data DNSSECStatus = DNSSECStatus'
  { -- | A string that represents the current hosted zone signing status.
    --
    -- Status can have one of the following values:
    --
    -- [SIGNING]
    --     DNSSEC signing is enabled for the hosted zone.
    --
    -- [NOT_SIGNING]
    --     DNSSEC signing is not enabled for the hosted zone.
    --
    -- [DELETING]
    --     DNSSEC signing is in the process of being removed for the hosted
    --     zone.
    --
    -- [ACTION_NEEDED]
    --     There is a problem with signing in the hosted zone that requires you
    --     to take action to resolve. For example, the customer managed
    --     customer master key (CMK) might have been deleted, or the
    --     permissions for the customer managed CMK might have been changed.
    --
    -- [INTERNAL_FAILURE]
    --     There was an error during a request. Before you can continue to work
    --     with DNSSEC signing, including with key-signing keys (KSKs), you
    --     must correct the problem by enabling or disabling DNSSEC signing for
    --     the hosted zone.
    DNSSECStatus -> Maybe Text
serveSignature :: Prelude.Maybe Prelude.Text,
    -- | The status message provided for the following DNSSEC signing status:
    -- @INTERNAL_FAILURE@. The status message includes information about what
    -- the problem might be and steps that you can take to correct the issue.
    DNSSECStatus -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (DNSSECStatus -> DNSSECStatus -> Bool
(DNSSECStatus -> DNSSECStatus -> Bool)
-> (DNSSECStatus -> DNSSECStatus -> Bool) -> Eq DNSSECStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DNSSECStatus -> DNSSECStatus -> Bool
$c/= :: DNSSECStatus -> DNSSECStatus -> Bool
== :: DNSSECStatus -> DNSSECStatus -> Bool
$c== :: DNSSECStatus -> DNSSECStatus -> Bool
Prelude.Eq, ReadPrec [DNSSECStatus]
ReadPrec DNSSECStatus
Int -> ReadS DNSSECStatus
ReadS [DNSSECStatus]
(Int -> ReadS DNSSECStatus)
-> ReadS [DNSSECStatus]
-> ReadPrec DNSSECStatus
-> ReadPrec [DNSSECStatus]
-> Read DNSSECStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DNSSECStatus]
$creadListPrec :: ReadPrec [DNSSECStatus]
readPrec :: ReadPrec DNSSECStatus
$creadPrec :: ReadPrec DNSSECStatus
readList :: ReadS [DNSSECStatus]
$creadList :: ReadS [DNSSECStatus]
readsPrec :: Int -> ReadS DNSSECStatus
$creadsPrec :: Int -> ReadS DNSSECStatus
Prelude.Read, Int -> DNSSECStatus -> ShowS
[DNSSECStatus] -> ShowS
DNSSECStatus -> String
(Int -> DNSSECStatus -> ShowS)
-> (DNSSECStatus -> String)
-> ([DNSSECStatus] -> ShowS)
-> Show DNSSECStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DNSSECStatus] -> ShowS
$cshowList :: [DNSSECStatus] -> ShowS
show :: DNSSECStatus -> String
$cshow :: DNSSECStatus -> String
showsPrec :: Int -> DNSSECStatus -> ShowS
$cshowsPrec :: Int -> DNSSECStatus -> ShowS
Prelude.Show, (forall x. DNSSECStatus -> Rep DNSSECStatus x)
-> (forall x. Rep DNSSECStatus x -> DNSSECStatus)
-> Generic DNSSECStatus
forall x. Rep DNSSECStatus x -> DNSSECStatus
forall x. DNSSECStatus -> Rep DNSSECStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DNSSECStatus x -> DNSSECStatus
$cfrom :: forall x. DNSSECStatus -> Rep DNSSECStatus x
Prelude.Generic)

-- |
-- Create a value of 'DNSSECStatus' 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:
--
-- 'serveSignature', 'dNSSECStatus_serveSignature' - A string that represents the current hosted zone signing status.
--
-- Status can have one of the following values:
--
-- [SIGNING]
--     DNSSEC signing is enabled for the hosted zone.
--
-- [NOT_SIGNING]
--     DNSSEC signing is not enabled for the hosted zone.
--
-- [DELETING]
--     DNSSEC signing is in the process of being removed for the hosted
--     zone.
--
-- [ACTION_NEEDED]
--     There is a problem with signing in the hosted zone that requires you
--     to take action to resolve. For example, the customer managed
--     customer master key (CMK) might have been deleted, or the
--     permissions for the customer managed CMK might have been changed.
--
-- [INTERNAL_FAILURE]
--     There was an error during a request. Before you can continue to work
--     with DNSSEC signing, including with key-signing keys (KSKs), you
--     must correct the problem by enabling or disabling DNSSEC signing for
--     the hosted zone.
--
-- 'statusMessage', 'dNSSECStatus_statusMessage' - The status message provided for the following DNSSEC signing status:
-- @INTERNAL_FAILURE@. The status message includes information about what
-- the problem might be and steps that you can take to correct the issue.
newDNSSECStatus ::
  DNSSECStatus
newDNSSECStatus :: DNSSECStatus
newDNSSECStatus =
  DNSSECStatus' :: Maybe Text -> Maybe Text -> DNSSECStatus
DNSSECStatus'
    { $sel:serveSignature:DNSSECStatus' :: Maybe Text
serveSignature = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:DNSSECStatus' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A string that represents the current hosted zone signing status.
--
-- Status can have one of the following values:
--
-- [SIGNING]
--     DNSSEC signing is enabled for the hosted zone.
--
-- [NOT_SIGNING]
--     DNSSEC signing is not enabled for the hosted zone.
--
-- [DELETING]
--     DNSSEC signing is in the process of being removed for the hosted
--     zone.
--
-- [ACTION_NEEDED]
--     There is a problem with signing in the hosted zone that requires you
--     to take action to resolve. For example, the customer managed
--     customer master key (CMK) might have been deleted, or the
--     permissions for the customer managed CMK might have been changed.
--
-- [INTERNAL_FAILURE]
--     There was an error during a request. Before you can continue to work
--     with DNSSEC signing, including with key-signing keys (KSKs), you
--     must correct the problem by enabling or disabling DNSSEC signing for
--     the hosted zone.
dNSSECStatus_serveSignature :: Lens.Lens' DNSSECStatus (Prelude.Maybe Prelude.Text)
dNSSECStatus_serveSignature :: (Maybe Text -> f (Maybe Text)) -> DNSSECStatus -> f DNSSECStatus
dNSSECStatus_serveSignature = (DNSSECStatus -> Maybe Text)
-> (DNSSECStatus -> Maybe Text -> DNSSECStatus)
-> Lens DNSSECStatus DNSSECStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DNSSECStatus' {Maybe Text
serveSignature :: Maybe Text
$sel:serveSignature:DNSSECStatus' :: DNSSECStatus -> Maybe Text
serveSignature} -> Maybe Text
serveSignature) (\s :: DNSSECStatus
s@DNSSECStatus' {} Maybe Text
a -> DNSSECStatus
s {$sel:serveSignature:DNSSECStatus' :: Maybe Text
serveSignature = Maybe Text
a} :: DNSSECStatus)

-- | The status message provided for the following DNSSEC signing status:
-- @INTERNAL_FAILURE@. The status message includes information about what
-- the problem might be and steps that you can take to correct the issue.
dNSSECStatus_statusMessage :: Lens.Lens' DNSSECStatus (Prelude.Maybe Prelude.Text)
dNSSECStatus_statusMessage :: (Maybe Text -> f (Maybe Text)) -> DNSSECStatus -> f DNSSECStatus
dNSSECStatus_statusMessage = (DNSSECStatus -> Maybe Text)
-> (DNSSECStatus -> Maybe Text -> DNSSECStatus)
-> Lens DNSSECStatus DNSSECStatus (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DNSSECStatus' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:DNSSECStatus' :: DNSSECStatus -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: DNSSECStatus
s@DNSSECStatus' {} Maybe Text
a -> DNSSECStatus
s {$sel:statusMessage:DNSSECStatus' :: Maybe Text
statusMessage = Maybe Text
a} :: DNSSECStatus)

instance Core.FromXML DNSSECStatus where
  parseXML :: [Node] -> Either String DNSSECStatus
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> DNSSECStatus
DNSSECStatus'
      (Maybe Text -> Maybe Text -> DNSSECStatus)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> DNSSECStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ServeSignature")
      Either String (Maybe Text -> DNSSECStatus)
-> Either String (Maybe Text) -> Either String DNSSECStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"StatusMessage")

instance Prelude.Hashable DNSSECStatus

instance Prelude.NFData DNSSECStatus