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