{-# 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 #-}
module Amazonka.Lightsail.Types.NameServersUpdateState 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.NameServersUpdateStateCode
import qualified Amazonka.Prelude as Prelude
data NameServersUpdateState = NameServersUpdateState'
{
NameServersUpdateState -> Maybe NameServersUpdateStateCode
code :: Prelude.Maybe NameServersUpdateStateCode,
NameServersUpdateState -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (NameServersUpdateState -> NameServersUpdateState -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NameServersUpdateState -> NameServersUpdateState -> Bool
$c/= :: NameServersUpdateState -> NameServersUpdateState -> Bool
== :: NameServersUpdateState -> NameServersUpdateState -> Bool
$c== :: NameServersUpdateState -> NameServersUpdateState -> Bool
Prelude.Eq, ReadPrec [NameServersUpdateState]
ReadPrec NameServersUpdateState
Int -> ReadS NameServersUpdateState
ReadS [NameServersUpdateState]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NameServersUpdateState]
$creadListPrec :: ReadPrec [NameServersUpdateState]
readPrec :: ReadPrec NameServersUpdateState
$creadPrec :: ReadPrec NameServersUpdateState
readList :: ReadS [NameServersUpdateState]
$creadList :: ReadS [NameServersUpdateState]
readsPrec :: Int -> ReadS NameServersUpdateState
$creadsPrec :: Int -> ReadS NameServersUpdateState
Prelude.Read, Int -> NameServersUpdateState -> ShowS
[NameServersUpdateState] -> ShowS
NameServersUpdateState -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NameServersUpdateState] -> ShowS
$cshowList :: [NameServersUpdateState] -> ShowS
show :: NameServersUpdateState -> String
$cshow :: NameServersUpdateState -> String
showsPrec :: Int -> NameServersUpdateState -> ShowS
$cshowsPrec :: Int -> NameServersUpdateState -> ShowS
Prelude.Show, forall x. Rep NameServersUpdateState x -> NameServersUpdateState
forall x. NameServersUpdateState -> Rep NameServersUpdateState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NameServersUpdateState x -> NameServersUpdateState
$cfrom :: forall x. NameServersUpdateState -> Rep NameServersUpdateState x
Prelude.Generic)
newNameServersUpdateState ::
NameServersUpdateState
newNameServersUpdateState :: NameServersUpdateState
newNameServersUpdateState =
NameServersUpdateState'
{ $sel:code:NameServersUpdateState' :: Maybe NameServersUpdateStateCode
code = forall a. Maybe a
Prelude.Nothing,
$sel:message:NameServersUpdateState' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing
}
nameServersUpdateState_code :: Lens.Lens' NameServersUpdateState (Prelude.Maybe NameServersUpdateStateCode)
nameServersUpdateState_code :: Lens' NameServersUpdateState (Maybe NameServersUpdateStateCode)
nameServersUpdateState_code = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NameServersUpdateState' {Maybe NameServersUpdateStateCode
code :: Maybe NameServersUpdateStateCode
$sel:code:NameServersUpdateState' :: NameServersUpdateState -> Maybe NameServersUpdateStateCode
code} -> Maybe NameServersUpdateStateCode
code) (\s :: NameServersUpdateState
s@NameServersUpdateState' {} Maybe NameServersUpdateStateCode
a -> NameServersUpdateState
s {$sel:code:NameServersUpdateState' :: Maybe NameServersUpdateStateCode
code = Maybe NameServersUpdateStateCode
a} :: NameServersUpdateState)
nameServersUpdateState_message :: Lens.Lens' NameServersUpdateState (Prelude.Maybe Prelude.Text)
nameServersUpdateState_message :: Lens' NameServersUpdateState (Maybe Text)
nameServersUpdateState_message = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NameServersUpdateState' {Maybe Text
message :: Maybe Text
$sel:message:NameServersUpdateState' :: NameServersUpdateState -> Maybe Text
message} -> Maybe Text
message) (\s :: NameServersUpdateState
s@NameServersUpdateState' {} Maybe Text
a -> NameServersUpdateState
s {$sel:message:NameServersUpdateState' :: Maybe Text
message = Maybe Text
a} :: NameServersUpdateState)
instance Data.FromJSON NameServersUpdateState where
parseJSON :: Value -> Parser NameServersUpdateState
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NameServersUpdateState"
( \Object
x ->
Maybe NameServersUpdateStateCode
-> Maybe Text -> NameServersUpdateState
NameServersUpdateState'
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 NameServersUpdateState where
hashWithSalt :: Int -> NameServersUpdateState -> Int
hashWithSalt Int
_salt NameServersUpdateState' {Maybe Text
Maybe NameServersUpdateStateCode
message :: Maybe Text
code :: Maybe NameServersUpdateStateCode
$sel:message:NameServersUpdateState' :: NameServersUpdateState -> Maybe Text
$sel:code:NameServersUpdateState' :: NameServersUpdateState -> Maybe NameServersUpdateStateCode
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NameServersUpdateStateCode
code
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
instance Prelude.NFData NameServersUpdateState where
rnf :: NameServersUpdateState -> ()
rnf NameServersUpdateState' {Maybe Text
Maybe NameServersUpdateStateCode
message :: Maybe Text
code :: Maybe NameServersUpdateStateCode
$sel:message:NameServersUpdateState' :: NameServersUpdateState -> Maybe Text
$sel:code:NameServersUpdateState' :: NameServersUpdateState -> Maybe NameServersUpdateStateCode
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe NameServersUpdateStateCode
code seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message