{-# 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.ProposalSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types.ProposalStatus
import qualified Amazonka.Prelude as Prelude
data ProposalSummary = ProposalSummary'
{
ProposalSummary -> Maybe ProposalStatus
status :: Prelude.Maybe ProposalStatus,
ProposalSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ProposalSummary -> Maybe Text
proposedByMemberId :: Prelude.Maybe Prelude.Text,
ProposalSummary -> Maybe Text
proposalId :: Prelude.Maybe Prelude.Text,
ProposalSummary -> Maybe Text
proposedByMemberName :: Prelude.Maybe Prelude.Text,
ProposalSummary -> Maybe POSIX
expirationDate :: Prelude.Maybe Core.POSIX,
ProposalSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
ProposalSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ProposalSummary -> ProposalSummary -> Bool
(ProposalSummary -> ProposalSummary -> Bool)
-> (ProposalSummary -> ProposalSummary -> Bool)
-> Eq ProposalSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProposalSummary -> ProposalSummary -> Bool
$c/= :: ProposalSummary -> ProposalSummary -> Bool
== :: ProposalSummary -> ProposalSummary -> Bool
$c== :: ProposalSummary -> ProposalSummary -> Bool
Prelude.Eq, ReadPrec [ProposalSummary]
ReadPrec ProposalSummary
Int -> ReadS ProposalSummary
ReadS [ProposalSummary]
(Int -> ReadS ProposalSummary)
-> ReadS [ProposalSummary]
-> ReadPrec ProposalSummary
-> ReadPrec [ProposalSummary]
-> Read ProposalSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProposalSummary]
$creadListPrec :: ReadPrec [ProposalSummary]
readPrec :: ReadPrec ProposalSummary
$creadPrec :: ReadPrec ProposalSummary
readList :: ReadS [ProposalSummary]
$creadList :: ReadS [ProposalSummary]
readsPrec :: Int -> ReadS ProposalSummary
$creadsPrec :: Int -> ReadS ProposalSummary
Prelude.Read, Int -> ProposalSummary -> ShowS
[ProposalSummary] -> ShowS
ProposalSummary -> String
(Int -> ProposalSummary -> ShowS)
-> (ProposalSummary -> String)
-> ([ProposalSummary] -> ShowS)
-> Show ProposalSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProposalSummary] -> ShowS
$cshowList :: [ProposalSummary] -> ShowS
show :: ProposalSummary -> String
$cshow :: ProposalSummary -> String
showsPrec :: Int -> ProposalSummary -> ShowS
$cshowsPrec :: Int -> ProposalSummary -> ShowS
Prelude.Show, (forall x. ProposalSummary -> Rep ProposalSummary x)
-> (forall x. Rep ProposalSummary x -> ProposalSummary)
-> Generic ProposalSummary
forall x. Rep ProposalSummary x -> ProposalSummary
forall x. ProposalSummary -> Rep ProposalSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProposalSummary x -> ProposalSummary
$cfrom :: forall x. ProposalSummary -> Rep ProposalSummary x
Prelude.Generic)
newProposalSummary ::
ProposalSummary
newProposalSummary :: ProposalSummary
newProposalSummary =
ProposalSummary' :: Maybe ProposalStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary
ProposalSummary'
{ $sel:status:ProposalSummary' :: Maybe ProposalStatus
status = Maybe ProposalStatus
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ProposalSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:proposedByMemberId:ProposalSummary' :: Maybe Text
proposedByMemberId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:proposalId:ProposalSummary' :: Maybe Text
proposalId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:proposedByMemberName:ProposalSummary' :: Maybe Text
proposedByMemberName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expirationDate:ProposalSummary' :: Maybe POSIX
expirationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:creationDate:ProposalSummary' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:description:ProposalSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
proposalSummary_status :: Lens.Lens' ProposalSummary (Prelude.Maybe ProposalStatus)
proposalSummary_status :: (Maybe ProposalStatus -> f (Maybe ProposalStatus))
-> ProposalSummary -> f ProposalSummary
proposalSummary_status = (ProposalSummary -> Maybe ProposalStatus)
-> (ProposalSummary -> Maybe ProposalStatus -> ProposalSummary)
-> Lens
ProposalSummary
ProposalSummary
(Maybe ProposalStatus)
(Maybe ProposalStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe ProposalStatus
status :: Maybe ProposalStatus
$sel:status:ProposalSummary' :: ProposalSummary -> Maybe ProposalStatus
status} -> Maybe ProposalStatus
status) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe ProposalStatus
a -> ProposalSummary
s {$sel:status:ProposalSummary' :: Maybe ProposalStatus
status = Maybe ProposalStatus
a} :: ProposalSummary)
proposalSummary_arn :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.Text)
proposalSummary_arn :: (Maybe Text -> f (Maybe Text))
-> ProposalSummary -> f ProposalSummary
proposalSummary_arn = (ProposalSummary -> Maybe Text)
-> (ProposalSummary -> Maybe Text -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:ProposalSummary' :: ProposalSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe Text
a -> ProposalSummary
s {$sel:arn:ProposalSummary' :: Maybe Text
arn = Maybe Text
a} :: ProposalSummary)
proposalSummary_proposedByMemberId :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.Text)
proposalSummary_proposedByMemberId :: (Maybe Text -> f (Maybe Text))
-> ProposalSummary -> f ProposalSummary
proposalSummary_proposedByMemberId = (ProposalSummary -> Maybe Text)
-> (ProposalSummary -> Maybe Text -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe Text
proposedByMemberId :: Maybe Text
$sel:proposedByMemberId:ProposalSummary' :: ProposalSummary -> Maybe Text
proposedByMemberId} -> Maybe Text
proposedByMemberId) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe Text
a -> ProposalSummary
s {$sel:proposedByMemberId:ProposalSummary' :: Maybe Text
proposedByMemberId = Maybe Text
a} :: ProposalSummary)
proposalSummary_proposalId :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.Text)
proposalSummary_proposalId :: (Maybe Text -> f (Maybe Text))
-> ProposalSummary -> f ProposalSummary
proposalSummary_proposalId = (ProposalSummary -> Maybe Text)
-> (ProposalSummary -> Maybe Text -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe Text
proposalId :: Maybe Text
$sel:proposalId:ProposalSummary' :: ProposalSummary -> Maybe Text
proposalId} -> Maybe Text
proposalId) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe Text
a -> ProposalSummary
s {$sel:proposalId:ProposalSummary' :: Maybe Text
proposalId = Maybe Text
a} :: ProposalSummary)
proposalSummary_proposedByMemberName :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.Text)
proposalSummary_proposedByMemberName :: (Maybe Text -> f (Maybe Text))
-> ProposalSummary -> f ProposalSummary
proposalSummary_proposedByMemberName = (ProposalSummary -> Maybe Text)
-> (ProposalSummary -> Maybe Text -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe Text
proposedByMemberName :: Maybe Text
$sel:proposedByMemberName:ProposalSummary' :: ProposalSummary -> Maybe Text
proposedByMemberName} -> Maybe Text
proposedByMemberName) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe Text
a -> ProposalSummary
s {$sel:proposedByMemberName:ProposalSummary' :: Maybe Text
proposedByMemberName = Maybe Text
a} :: ProposalSummary)
proposalSummary_expirationDate :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.UTCTime)
proposalSummary_expirationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProposalSummary -> f ProposalSummary
proposalSummary_expirationDate = (ProposalSummary -> Maybe POSIX)
-> (ProposalSummary -> Maybe POSIX -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe POSIX
expirationDate :: Maybe POSIX
$sel:expirationDate:ProposalSummary' :: ProposalSummary -> Maybe POSIX
expirationDate} -> Maybe POSIX
expirationDate) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe POSIX
a -> ProposalSummary
s {$sel:expirationDate:ProposalSummary' :: Maybe POSIX
expirationDate = Maybe POSIX
a} :: ProposalSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> ProposalSummary -> f ProposalSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProposalSummary
-> f ProposalSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
proposalSummary_creationDate :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.UTCTime)
proposalSummary_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProposalSummary -> f ProposalSummary
proposalSummary_creationDate = (ProposalSummary -> Maybe POSIX)
-> (ProposalSummary -> Maybe POSIX -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:ProposalSummary' :: ProposalSummary -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe POSIX
a -> ProposalSummary
s {$sel:creationDate:ProposalSummary' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: ProposalSummary) ((Maybe POSIX -> f (Maybe POSIX))
-> ProposalSummary -> f ProposalSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProposalSummary
-> f ProposalSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
proposalSummary_description :: Lens.Lens' ProposalSummary (Prelude.Maybe Prelude.Text)
proposalSummary_description :: (Maybe Text -> f (Maybe Text))
-> ProposalSummary -> f ProposalSummary
proposalSummary_description = (ProposalSummary -> Maybe Text)
-> (ProposalSummary -> Maybe Text -> ProposalSummary)
-> Lens ProposalSummary ProposalSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProposalSummary' {Maybe Text
description :: Maybe Text
$sel:description:ProposalSummary' :: ProposalSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ProposalSummary
s@ProposalSummary' {} Maybe Text
a -> ProposalSummary
s {$sel:description:ProposalSummary' :: Maybe Text
description = Maybe Text
a} :: ProposalSummary)
instance Core.FromJSON ProposalSummary where
parseJSON :: Value -> Parser ProposalSummary
parseJSON =
String
-> (Object -> Parser ProposalSummary)
-> Value
-> Parser ProposalSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProposalSummary"
( \Object
x ->
Maybe ProposalStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary
ProposalSummary'
(Maybe ProposalStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
-> Parser (Maybe ProposalStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ProposalStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
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
"Arn")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
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
"ProposedByMemberId")
Parser
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> ProposalSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX -> Maybe POSIX -> Maybe Text -> ProposalSummary)
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
"ProposalId")
Parser
(Maybe Text
-> Maybe POSIX -> Maybe POSIX -> Maybe Text -> ProposalSummary)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX -> Maybe POSIX -> Maybe Text -> ProposalSummary)
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
"ProposedByMemberName")
Parser
(Maybe POSIX -> Maybe POSIX -> Maybe Text -> ProposalSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe Text -> ProposalSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExpirationDate")
Parser (Maybe POSIX -> Maybe Text -> ProposalSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> ProposalSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
Parser (Maybe Text -> ProposalSummary)
-> Parser (Maybe Text) -> Parser ProposalSummary
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
"Description")
)
instance Prelude.Hashable ProposalSummary
instance Prelude.NFData ProposalSummary