{-# 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.PtrUpdateStatus
-- 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.PtrUpdateStatus 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

-- | The status of an updated pointer (PTR) record for an Elastic IP address.
--
-- /See:/ 'newPtrUpdateStatus' smart constructor.
data PtrUpdateStatus = PtrUpdateStatus'
  { -- | The reason for the PTR record update.
    PtrUpdateStatus -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
    -- | The status of the PTR record update.
    PtrUpdateStatus -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The value for the PTR record update.
    PtrUpdateStatus -> Maybe Text
value :: Prelude.Maybe Prelude.Text
  }
  deriving (PtrUpdateStatus -> PtrUpdateStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PtrUpdateStatus -> PtrUpdateStatus -> Bool
$c/= :: PtrUpdateStatus -> PtrUpdateStatus -> Bool
== :: PtrUpdateStatus -> PtrUpdateStatus -> Bool
$c== :: PtrUpdateStatus -> PtrUpdateStatus -> Bool
Prelude.Eq, ReadPrec [PtrUpdateStatus]
ReadPrec PtrUpdateStatus
Int -> ReadS PtrUpdateStatus
ReadS [PtrUpdateStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PtrUpdateStatus]
$creadListPrec :: ReadPrec [PtrUpdateStatus]
readPrec :: ReadPrec PtrUpdateStatus
$creadPrec :: ReadPrec PtrUpdateStatus
readList :: ReadS [PtrUpdateStatus]
$creadList :: ReadS [PtrUpdateStatus]
readsPrec :: Int -> ReadS PtrUpdateStatus
$creadsPrec :: Int -> ReadS PtrUpdateStatus
Prelude.Read, Int -> PtrUpdateStatus -> ShowS
[PtrUpdateStatus] -> ShowS
PtrUpdateStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PtrUpdateStatus] -> ShowS
$cshowList :: [PtrUpdateStatus] -> ShowS
show :: PtrUpdateStatus -> String
$cshow :: PtrUpdateStatus -> String
showsPrec :: Int -> PtrUpdateStatus -> ShowS
$cshowsPrec :: Int -> PtrUpdateStatus -> ShowS
Prelude.Show, forall x. Rep PtrUpdateStatus x -> PtrUpdateStatus
forall x. PtrUpdateStatus -> Rep PtrUpdateStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PtrUpdateStatus x -> PtrUpdateStatus
$cfrom :: forall x. PtrUpdateStatus -> Rep PtrUpdateStatus x
Prelude.Generic)

-- |
-- Create a value of 'PtrUpdateStatus' 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:
--
-- 'reason', 'ptrUpdateStatus_reason' - The reason for the PTR record update.
--
-- 'status', 'ptrUpdateStatus_status' - The status of the PTR record update.
--
-- 'value', 'ptrUpdateStatus_value' - The value for the PTR record update.
newPtrUpdateStatus ::
  PtrUpdateStatus
newPtrUpdateStatus :: PtrUpdateStatus
newPtrUpdateStatus =
  PtrUpdateStatus'
    { $sel:reason:PtrUpdateStatus' :: Maybe Text
reason = forall a. Maybe a
Prelude.Nothing,
      $sel:status:PtrUpdateStatus' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
      $sel:value:PtrUpdateStatus' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
    }

-- | The reason for the PTR record update.
ptrUpdateStatus_reason :: Lens.Lens' PtrUpdateStatus (Prelude.Maybe Prelude.Text)
ptrUpdateStatus_reason :: Lens' PtrUpdateStatus (Maybe Text)
ptrUpdateStatus_reason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PtrUpdateStatus' {Maybe Text
reason :: Maybe Text
$sel:reason:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
reason} -> Maybe Text
reason) (\s :: PtrUpdateStatus
s@PtrUpdateStatus' {} Maybe Text
a -> PtrUpdateStatus
s {$sel:reason:PtrUpdateStatus' :: Maybe Text
reason = Maybe Text
a} :: PtrUpdateStatus)

-- | The status of the PTR record update.
ptrUpdateStatus_status :: Lens.Lens' PtrUpdateStatus (Prelude.Maybe Prelude.Text)
ptrUpdateStatus_status :: Lens' PtrUpdateStatus (Maybe Text)
ptrUpdateStatus_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PtrUpdateStatus' {Maybe Text
status :: Maybe Text
$sel:status:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
status} -> Maybe Text
status) (\s :: PtrUpdateStatus
s@PtrUpdateStatus' {} Maybe Text
a -> PtrUpdateStatus
s {$sel:status:PtrUpdateStatus' :: Maybe Text
status = Maybe Text
a} :: PtrUpdateStatus)

-- | The value for the PTR record update.
ptrUpdateStatus_value :: Lens.Lens' PtrUpdateStatus (Prelude.Maybe Prelude.Text)
ptrUpdateStatus_value :: Lens' PtrUpdateStatus (Maybe Text)
ptrUpdateStatus_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PtrUpdateStatus' {Maybe Text
value :: Maybe Text
$sel:value:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
value} -> Maybe Text
value) (\s :: PtrUpdateStatus
s@PtrUpdateStatus' {} Maybe Text
a -> PtrUpdateStatus
s {$sel:value:PtrUpdateStatus' :: Maybe Text
value = Maybe Text
a} :: PtrUpdateStatus)

instance Data.FromXML PtrUpdateStatus where
  parseXML :: [Node] -> Either String PtrUpdateStatus
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> Maybe Text -> PtrUpdateStatus
PtrUpdateStatus'
      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
"reason")
      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
"status")
      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
"value")

instance Prelude.Hashable PtrUpdateStatus where
  hashWithSalt :: Int -> PtrUpdateStatus -> Int
hashWithSalt Int
_salt PtrUpdateStatus' {Maybe Text
value :: Maybe Text
status :: Maybe Text
reason :: Maybe Text
$sel:value:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
$sel:status:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
$sel:reason:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
reason
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value

instance Prelude.NFData PtrUpdateStatus where
  rnf :: PtrUpdateStatus -> ()
rnf PtrUpdateStatus' {Maybe Text
value :: Maybe Text
status :: Maybe Text
reason :: Maybe Text
$sel:value:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
$sel:status:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
$sel:reason:PtrUpdateStatus' :: PtrUpdateStatus -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
reason
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value