{-# 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.Lightsail.Types.R53HostedZoneDeletionState
-- 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.Lightsail.Types.R53HostedZoneDeletionState where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.R53HostedZoneDeletionStateCode
import qualified Amazonka.Prelude as Prelude

-- | Describes the deletion state of an Amazon Route 53 hosted zone for a
-- domain that is being automatically delegated to an Amazon Lightsail DNS
-- zone.
--
-- /See:/ 'newR53HostedZoneDeletionState' smart constructor.
data R53HostedZoneDeletionState = R53HostedZoneDeletionState'
  { -- | The status code for the deletion state.
    --
    -- Following are the possible values:
    --
    -- -   @SUCCEEDED@ - The hosted zone was successfully deleted.
    --
    -- -   @PENDING@ - The hosted zone deletion is in progress.
    --
    -- -   @FAILED@ - The hosted zone deletion failed.
    --
    -- -   @STARTED@ - The hosted zone deletion started.
    R53HostedZoneDeletionState -> Maybe R53HostedZoneDeletionStateCode
code :: Prelude.Maybe R53HostedZoneDeletionStateCode,
    -- | The message that describes the reason for the status code.
    R53HostedZoneDeletionState -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (R53HostedZoneDeletionState -> R53HostedZoneDeletionState -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: R53HostedZoneDeletionState -> R53HostedZoneDeletionState -> Bool
$c/= :: R53HostedZoneDeletionState -> R53HostedZoneDeletionState -> Bool
== :: R53HostedZoneDeletionState -> R53HostedZoneDeletionState -> Bool
$c== :: R53HostedZoneDeletionState -> R53HostedZoneDeletionState -> Bool
Prelude.Eq, ReadPrec [R53HostedZoneDeletionState]
ReadPrec R53HostedZoneDeletionState
Int -> ReadS R53HostedZoneDeletionState
ReadS [R53HostedZoneDeletionState]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [R53HostedZoneDeletionState]
$creadListPrec :: ReadPrec [R53HostedZoneDeletionState]
readPrec :: ReadPrec R53HostedZoneDeletionState
$creadPrec :: ReadPrec R53HostedZoneDeletionState
readList :: ReadS [R53HostedZoneDeletionState]
$creadList :: ReadS [R53HostedZoneDeletionState]
readsPrec :: Int -> ReadS R53HostedZoneDeletionState
$creadsPrec :: Int -> ReadS R53HostedZoneDeletionState
Prelude.Read, Int -> R53HostedZoneDeletionState -> ShowS
[R53HostedZoneDeletionState] -> ShowS
R53HostedZoneDeletionState -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [R53HostedZoneDeletionState] -> ShowS
$cshowList :: [R53HostedZoneDeletionState] -> ShowS
show :: R53HostedZoneDeletionState -> String
$cshow :: R53HostedZoneDeletionState -> String
showsPrec :: Int -> R53HostedZoneDeletionState -> ShowS
$cshowsPrec :: Int -> R53HostedZoneDeletionState -> ShowS
Prelude.Show, forall x.
Rep R53HostedZoneDeletionState x -> R53HostedZoneDeletionState
forall x.
R53HostedZoneDeletionState -> Rep R53HostedZoneDeletionState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep R53HostedZoneDeletionState x -> R53HostedZoneDeletionState
$cfrom :: forall x.
R53HostedZoneDeletionState -> Rep R53HostedZoneDeletionState x
Prelude.Generic)

-- |
-- Create a value of 'R53HostedZoneDeletionState' 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:
--
-- 'code', 'r53HostedZoneDeletionState_code' - The status code for the deletion state.
--
-- Following are the possible values:
--
-- -   @SUCCEEDED@ - The hosted zone was successfully deleted.
--
-- -   @PENDING@ - The hosted zone deletion is in progress.
--
-- -   @FAILED@ - The hosted zone deletion failed.
--
-- -   @STARTED@ - The hosted zone deletion started.
--
-- 'message', 'r53HostedZoneDeletionState_message' - The message that describes the reason for the status code.
newR53HostedZoneDeletionState ::
  R53HostedZoneDeletionState
newR53HostedZoneDeletionState :: R53HostedZoneDeletionState
newR53HostedZoneDeletionState =
  R53HostedZoneDeletionState'
    { $sel:code:R53HostedZoneDeletionState' :: Maybe R53HostedZoneDeletionStateCode
code = forall a. Maybe a
Prelude.Nothing,
      $sel:message:R53HostedZoneDeletionState' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
    }

-- | The status code for the deletion state.
--
-- Following are the possible values:
--
-- -   @SUCCEEDED@ - The hosted zone was successfully deleted.
--
-- -   @PENDING@ - The hosted zone deletion is in progress.
--
-- -   @FAILED@ - The hosted zone deletion failed.
--
-- -   @STARTED@ - The hosted zone deletion started.
r53HostedZoneDeletionState_code :: Lens.Lens' R53HostedZoneDeletionState (Prelude.Maybe R53HostedZoneDeletionStateCode)
r53HostedZoneDeletionState_code :: Lens'
  R53HostedZoneDeletionState (Maybe R53HostedZoneDeletionStateCode)
r53HostedZoneDeletionState_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\R53HostedZoneDeletionState' {Maybe R53HostedZoneDeletionStateCode
code :: Maybe R53HostedZoneDeletionStateCode
$sel:code:R53HostedZoneDeletionState' :: R53HostedZoneDeletionState -> Maybe R53HostedZoneDeletionStateCode
code} -> Maybe R53HostedZoneDeletionStateCode
code) (\s :: R53HostedZoneDeletionState
s@R53HostedZoneDeletionState' {} Maybe R53HostedZoneDeletionStateCode
a -> R53HostedZoneDeletionState
s {$sel:code:R53HostedZoneDeletionState' :: Maybe R53HostedZoneDeletionStateCode
code = Maybe R53HostedZoneDeletionStateCode
a} :: R53HostedZoneDeletionState)

-- | The message that describes the reason for the status code.
r53HostedZoneDeletionState_message :: Lens.Lens' R53HostedZoneDeletionState (Prelude.Maybe Prelude.Text)
r53HostedZoneDeletionState_message :: Lens' R53HostedZoneDeletionState (Maybe Text)
r53HostedZoneDeletionState_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\R53HostedZoneDeletionState' {Maybe Text
message :: Maybe Text
$sel:message:R53HostedZoneDeletionState' :: R53HostedZoneDeletionState -> Maybe Text
message} -> Maybe Text
message) (\s :: R53HostedZoneDeletionState
s@R53HostedZoneDeletionState' {} Maybe Text
a -> R53HostedZoneDeletionState
s {$sel:message:R53HostedZoneDeletionState' :: Maybe Text
message = Maybe Text
a} :: R53HostedZoneDeletionState)

instance Data.FromJSON R53HostedZoneDeletionState where
  parseJSON :: Value -> Parser R53HostedZoneDeletionState
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"R53HostedZoneDeletionState"
      ( \Object
x ->
          Maybe R53HostedZoneDeletionStateCode
-> Maybe Text -> R53HostedZoneDeletionState
R53HostedZoneDeletionState'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"code")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"message")
      )

instance Prelude.Hashable R53HostedZoneDeletionState where
  hashWithSalt :: Int -> R53HostedZoneDeletionState -> Int
hashWithSalt Int
_salt R53HostedZoneDeletionState' {Maybe Text
Maybe R53HostedZoneDeletionStateCode
message :: Maybe Text
code :: Maybe R53HostedZoneDeletionStateCode
$sel:message:R53HostedZoneDeletionState' :: R53HostedZoneDeletionState -> Maybe Text
$sel:code:R53HostedZoneDeletionState' :: R53HostedZoneDeletionState -> Maybe R53HostedZoneDeletionStateCode
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe R53HostedZoneDeletionStateCode
code
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message

instance Prelude.NFData R53HostedZoneDeletionState where
  rnf :: R53HostedZoneDeletionState -> ()
rnf R53HostedZoneDeletionState' {Maybe Text
Maybe R53HostedZoneDeletionStateCode
message :: Maybe Text
code :: Maybe R53HostedZoneDeletionStateCode
$sel:message:R53HostedZoneDeletionState' :: R53HostedZoneDeletionState -> Maybe Text
$sel:code:R53HostedZoneDeletionState' :: R53HostedZoneDeletionState -> Maybe R53HostedZoneDeletionStateCode
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe R53HostedZoneDeletionStateCode
code seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message