{-# 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.BucketState where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BucketState = BucketState'
{
BucketState -> Maybe Text
code :: Prelude.Maybe Prelude.Text,
BucketState -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (BucketState -> BucketState -> Bool
(BucketState -> BucketState -> Bool)
-> (BucketState -> BucketState -> Bool) -> Eq BucketState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketState -> BucketState -> Bool
$c/= :: BucketState -> BucketState -> Bool
== :: BucketState -> BucketState -> Bool
$c== :: BucketState -> BucketState -> Bool
Prelude.Eq, ReadPrec [BucketState]
ReadPrec BucketState
Int -> ReadS BucketState
ReadS [BucketState]
(Int -> ReadS BucketState)
-> ReadS [BucketState]
-> ReadPrec BucketState
-> ReadPrec [BucketState]
-> Read BucketState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketState]
$creadListPrec :: ReadPrec [BucketState]
readPrec :: ReadPrec BucketState
$creadPrec :: ReadPrec BucketState
readList :: ReadS [BucketState]
$creadList :: ReadS [BucketState]
readsPrec :: Int -> ReadS BucketState
$creadsPrec :: Int -> ReadS BucketState
Prelude.Read, Int -> BucketState -> ShowS
[BucketState] -> ShowS
BucketState -> String
(Int -> BucketState -> ShowS)
-> (BucketState -> String)
-> ([BucketState] -> ShowS)
-> Show BucketState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketState] -> ShowS
$cshowList :: [BucketState] -> ShowS
show :: BucketState -> String
$cshow :: BucketState -> String
showsPrec :: Int -> BucketState -> ShowS
$cshowsPrec :: Int -> BucketState -> ShowS
Prelude.Show, (forall x. BucketState -> Rep BucketState x)
-> (forall x. Rep BucketState x -> BucketState)
-> Generic BucketState
forall x. Rep BucketState x -> BucketState
forall x. BucketState -> Rep BucketState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BucketState x -> BucketState
$cfrom :: forall x. BucketState -> Rep BucketState x
Prelude.Generic)
newBucketState ::
BucketState
newBucketState :: BucketState
newBucketState =
BucketState' :: Maybe Text -> Maybe Text -> BucketState
BucketState'
{ $sel:code:BucketState' :: Maybe Text
code = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:BucketState' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
bucketState_code :: Lens.Lens' BucketState (Prelude.Maybe Prelude.Text)
bucketState_code :: (Maybe Text -> f (Maybe Text)) -> BucketState -> f BucketState
bucketState_code = (BucketState -> Maybe Text)
-> (BucketState -> Maybe Text -> BucketState)
-> Lens BucketState BucketState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketState' {Maybe Text
code :: Maybe Text
$sel:code:BucketState' :: BucketState -> Maybe Text
code} -> Maybe Text
code) (\s :: BucketState
s@BucketState' {} Maybe Text
a -> BucketState
s {$sel:code:BucketState' :: Maybe Text
code = Maybe Text
a} :: BucketState)
bucketState_message :: Lens.Lens' BucketState (Prelude.Maybe Prelude.Text)
bucketState_message :: (Maybe Text -> f (Maybe Text)) -> BucketState -> f BucketState
bucketState_message = (BucketState -> Maybe Text)
-> (BucketState -> Maybe Text -> BucketState)
-> Lens BucketState BucketState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketState' {Maybe Text
message :: Maybe Text
$sel:message:BucketState' :: BucketState -> Maybe Text
message} -> Maybe Text
message) (\s :: BucketState
s@BucketState' {} Maybe Text
a -> BucketState
s {$sel:message:BucketState' :: Maybe Text
message = Maybe Text
a} :: BucketState)
instance Core.FromJSON BucketState where
parseJSON :: Value -> Parser BucketState
parseJSON =
String
-> (Object -> Parser BucketState) -> Value -> Parser BucketState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BucketState"
( \Object
x ->
Maybe Text -> Maybe Text -> BucketState
BucketState'
(Maybe Text -> Maybe Text -> BucketState)
-> Parser (Maybe Text) -> Parser (Maybe Text -> BucketState)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"code")
Parser (Maybe Text -> BucketState)
-> Parser (Maybe Text) -> Parser BucketState
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"message")
)
instance Prelude.Hashable BucketState
instance Prelude.NFData BucketState