{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53.Types.DNSSECStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 key
    --     might have been deleted, or the permissions for the customer managed
    --     key 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
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]
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
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. 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 key
--     might have been deleted, or the permissions for the customer managed
--     key 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'
    { $sel:serveSignature:DNSSECStatus' :: Maybe Text
serveSignature = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:DNSSECStatus' :: Maybe Text
statusMessage = 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 key
--     might have been deleted, or the permissions for the customer managed
--     key 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 :: Lens' DNSSECStatus (Maybe Text)
dNSSECStatus_serveSignature = 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 :: Lens' DNSSECStatus (Maybe Text)
dNSSECStatus_statusMessage = 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 Data.FromXML DNSSECStatus where
  parseXML :: [Node] -> Either String DNSSECStatus
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> DNSSECStatus
DNSSECStatus'
      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
"ServeSignature")
      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
"StatusMessage")

instance Prelude.Hashable DNSSECStatus where
  hashWithSalt :: Int -> DNSSECStatus -> Int
hashWithSalt Int
_salt DNSSECStatus' {Maybe Text
statusMessage :: Maybe Text
serveSignature :: Maybe Text
$sel:statusMessage:DNSSECStatus' :: DNSSECStatus -> Maybe Text
$sel:serveSignature:DNSSECStatus' :: DNSSECStatus -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serveSignature
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage

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