{-# 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.EBS.Types.ChangedBlock where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ChangedBlock = ChangedBlock'
{
ChangedBlock -> Maybe Natural
blockIndex :: Prelude.Maybe Prelude.Natural,
ChangedBlock -> Maybe Text
secondBlockToken :: Prelude.Maybe Prelude.Text,
ChangedBlock -> Maybe Text
firstBlockToken :: Prelude.Maybe Prelude.Text
}
deriving (ChangedBlock -> ChangedBlock -> Bool
(ChangedBlock -> ChangedBlock -> Bool)
-> (ChangedBlock -> ChangedBlock -> Bool) -> Eq ChangedBlock
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChangedBlock -> ChangedBlock -> Bool
$c/= :: ChangedBlock -> ChangedBlock -> Bool
== :: ChangedBlock -> ChangedBlock -> Bool
$c== :: ChangedBlock -> ChangedBlock -> Bool
Prelude.Eq, Int -> ChangedBlock -> ShowS
[ChangedBlock] -> ShowS
ChangedBlock -> String
(Int -> ChangedBlock -> ShowS)
-> (ChangedBlock -> String)
-> ([ChangedBlock] -> ShowS)
-> Show ChangedBlock
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChangedBlock] -> ShowS
$cshowList :: [ChangedBlock] -> ShowS
show :: ChangedBlock -> String
$cshow :: ChangedBlock -> String
showsPrec :: Int -> ChangedBlock -> ShowS
$cshowsPrec :: Int -> ChangedBlock -> ShowS
Prelude.Show, (forall x. ChangedBlock -> Rep ChangedBlock x)
-> (forall x. Rep ChangedBlock x -> ChangedBlock)
-> Generic ChangedBlock
forall x. Rep ChangedBlock x -> ChangedBlock
forall x. ChangedBlock -> Rep ChangedBlock x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ChangedBlock x -> ChangedBlock
$cfrom :: forall x. ChangedBlock -> Rep ChangedBlock x
Prelude.Generic)
newChangedBlock ::
ChangedBlock
newChangedBlock :: ChangedBlock
newChangedBlock =
ChangedBlock' :: Maybe Natural -> Maybe Text -> Maybe Text -> ChangedBlock
ChangedBlock'
{ $sel:blockIndex:ChangedBlock' :: Maybe Natural
blockIndex = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:secondBlockToken:ChangedBlock' :: Maybe Text
secondBlockToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:firstBlockToken:ChangedBlock' :: Maybe Text
firstBlockToken = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
changedBlock_blockIndex :: Lens.Lens' ChangedBlock (Prelude.Maybe Prelude.Natural)
changedBlock_blockIndex :: (Maybe Natural -> f (Maybe Natural))
-> ChangedBlock -> f ChangedBlock
changedBlock_blockIndex = (ChangedBlock -> Maybe Natural)
-> (ChangedBlock -> Maybe Natural -> ChangedBlock)
-> Lens ChangedBlock ChangedBlock (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangedBlock' {Maybe Natural
blockIndex :: Maybe Natural
$sel:blockIndex:ChangedBlock' :: ChangedBlock -> Maybe Natural
blockIndex} -> Maybe Natural
blockIndex) (\s :: ChangedBlock
s@ChangedBlock' {} Maybe Natural
a -> ChangedBlock
s {$sel:blockIndex:ChangedBlock' :: Maybe Natural
blockIndex = Maybe Natural
a} :: ChangedBlock)
changedBlock_secondBlockToken :: Lens.Lens' ChangedBlock (Prelude.Maybe Prelude.Text)
changedBlock_secondBlockToken :: (Maybe Text -> f (Maybe Text)) -> ChangedBlock -> f ChangedBlock
changedBlock_secondBlockToken = (ChangedBlock -> Maybe Text)
-> (ChangedBlock -> Maybe Text -> ChangedBlock)
-> Lens ChangedBlock ChangedBlock (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangedBlock' {Maybe Text
secondBlockToken :: Maybe Text
$sel:secondBlockToken:ChangedBlock' :: ChangedBlock -> Maybe Text
secondBlockToken} -> Maybe Text
secondBlockToken) (\s :: ChangedBlock
s@ChangedBlock' {} Maybe Text
a -> ChangedBlock
s {$sel:secondBlockToken:ChangedBlock' :: Maybe Text
secondBlockToken = Maybe Text
a} :: ChangedBlock)
changedBlock_firstBlockToken :: Lens.Lens' ChangedBlock (Prelude.Maybe Prelude.Text)
changedBlock_firstBlockToken :: (Maybe Text -> f (Maybe Text)) -> ChangedBlock -> f ChangedBlock
changedBlock_firstBlockToken = (ChangedBlock -> Maybe Text)
-> (ChangedBlock -> Maybe Text -> ChangedBlock)
-> Lens ChangedBlock ChangedBlock (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChangedBlock' {Maybe Text
firstBlockToken :: Maybe Text
$sel:firstBlockToken:ChangedBlock' :: ChangedBlock -> Maybe Text
firstBlockToken} -> Maybe Text
firstBlockToken) (\s :: ChangedBlock
s@ChangedBlock' {} Maybe Text
a -> ChangedBlock
s {$sel:firstBlockToken:ChangedBlock' :: Maybe Text
firstBlockToken = Maybe Text
a} :: ChangedBlock)
instance Core.FromJSON ChangedBlock where
parseJSON :: Value -> Parser ChangedBlock
parseJSON =
String
-> (Object -> Parser ChangedBlock) -> Value -> Parser ChangedBlock
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ChangedBlock"
( \Object
x ->
Maybe Natural -> Maybe Text -> Maybe Text -> ChangedBlock
ChangedBlock'
(Maybe Natural -> Maybe Text -> Maybe Text -> ChangedBlock)
-> Parser (Maybe Natural)
-> Parser (Maybe Text -> Maybe Text -> ChangedBlock)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BlockIndex")
Parser (Maybe Text -> Maybe Text -> ChangedBlock)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ChangedBlock)
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
"SecondBlockToken")
Parser (Maybe Text -> ChangedBlock)
-> Parser (Maybe Text) -> Parser ChangedBlock
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
"FirstBlockToken")
)
instance Prelude.Hashable ChangedBlock
instance Prelude.NFData ChangedBlock