{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ManagedBlockChain.Types.Proposal
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ManagedBlockChain.Types.Proposal where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ManagedBlockChain.Types.ProposalActions
import Amazonka.ManagedBlockChain.Types.ProposalStatus
import qualified Amazonka.Prelude as Prelude

-- | Properties of a proposal on a Managed Blockchain network.
--
-- Applies only to Hyperledger Fabric.
--
-- /See:/ 'newProposal' smart constructor.
data Proposal = Proposal'
  { -- | The actions to perform on the network if the proposal is @APPROVED@.
    Proposal -> Maybe ProposalActions
actions :: Prelude.Maybe ProposalActions,
    -- | The Amazon Resource Name (ARN) of the proposal. For more information
    -- about ARNs and their format, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /Amazon Web Services General Reference/.
    Proposal -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the proposal was created.
    Proposal -> Maybe ISO8601
creationDate :: Prelude.Maybe Data.ISO8601,
    -- | The description of the proposal.
    Proposal -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the proposal expires. This is the @CreationDate@
    -- plus the @ProposalDurationInHours@ that is specified in the
    -- @ProposalThresholdPolicy@. After this date and time, if members haven\'t
    -- cast enough votes to determine the outcome according to the voting
    -- policy, the proposal is @EXPIRED@ and @Actions@ aren\'t carried out.
    Proposal -> Maybe ISO8601
expirationDate :: Prelude.Maybe Data.ISO8601,
    -- | The unique identifier of the network for which the proposal is made.
    Proposal -> Maybe Text
networkId :: Prelude.Maybe Prelude.Text,
    -- | The current total of @NO@ votes cast on the proposal by members.
    Proposal -> Maybe Int
noVoteCount :: Prelude.Maybe Prelude.Int,
    -- | The number of votes remaining to be cast on the proposal by members. In
    -- other words, the number of members minus the sum of @YES@ votes and @NO@
    -- votes.
    Proposal -> Maybe Int
outstandingVoteCount :: Prelude.Maybe Prelude.Int,
    -- | The unique identifier of the proposal.
    Proposal -> Maybe Text
proposalId :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the member that created the proposal.
    Proposal -> Maybe Text
proposedByMemberId :: Prelude.Maybe Prelude.Text,
    -- | The name of the member that created the proposal.
    Proposal -> Maybe Text
proposedByMemberName :: Prelude.Maybe Prelude.Text,
    -- | The status of the proposal. Values are as follows:
    --
    -- -   @IN_PROGRESS@ - The proposal is active and open for member voting.
    --
    -- -   @APPROVED@ - The proposal was approved with sufficient @YES@ votes
    --     among members according to the @VotingPolicy@ specified for the
    --     @Network@. The specified proposal actions are carried out.
    --
    -- -   @REJECTED@ - The proposal was rejected with insufficient @YES@ votes
    --     among members according to the @VotingPolicy@ specified for the
    --     @Network@. The specified @ProposalActions@ aren\'t carried out.
    --
    -- -   @EXPIRED@ - Members didn\'t cast the number of votes required to
    --     determine the proposal outcome before the proposal expired. The
    --     specified @ProposalActions@ aren\'t carried out.
    --
    -- -   @ACTION_FAILED@ - One or more of the specified @ProposalActions@ in
    --     a proposal that was approved couldn\'t be completed because of an
    --     error. The @ACTION_FAILED@ status occurs even if only one
    --     ProposalAction fails and other actions are successful.
    Proposal -> Maybe ProposalStatus
status :: Prelude.Maybe ProposalStatus,
    -- | Tags assigned to the proposal. Each tag consists of a key and optional
    -- value.
    --
    -- For more information about tags, see
    -- <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html Tagging Resources>
    -- in the /Amazon Managed Blockchain Ethereum Developer Guide/, or
    -- <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html Tagging Resources>
    -- in the /Amazon Managed Blockchain Hyperledger Fabric Developer Guide/.
    Proposal -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The current total of @YES@ votes cast on the proposal by members.
    Proposal -> Maybe Int
yesVoteCount :: Prelude.Maybe Prelude.Int
  }
  deriving (Proposal -> Proposal -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Proposal -> Proposal -> Bool
$c/= :: Proposal -> Proposal -> Bool
== :: Proposal -> Proposal -> Bool
$c== :: Proposal -> Proposal -> Bool
Prelude.Eq, ReadPrec [Proposal]
ReadPrec Proposal
Int -> ReadS Proposal
ReadS [Proposal]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Proposal]
$creadListPrec :: ReadPrec [Proposal]
readPrec :: ReadPrec Proposal
$creadPrec :: ReadPrec Proposal
readList :: ReadS [Proposal]
$creadList :: ReadS [Proposal]
readsPrec :: Int -> ReadS Proposal
$creadsPrec :: Int -> ReadS Proposal
Prelude.Read, Int -> Proposal -> ShowS
[Proposal] -> ShowS
Proposal -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Proposal] -> ShowS
$cshowList :: [Proposal] -> ShowS
show :: Proposal -> String
$cshow :: Proposal -> String
showsPrec :: Int -> Proposal -> ShowS
$cshowsPrec :: Int -> Proposal -> ShowS
Prelude.Show, forall x. Rep Proposal x -> Proposal
forall x. Proposal -> Rep Proposal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Proposal x -> Proposal
$cfrom :: forall x. Proposal -> Rep Proposal x
Prelude.Generic)

-- |
-- Create a value of 'Proposal' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'actions', 'proposal_actions' - The actions to perform on the network if the proposal is @APPROVED@.
--
-- 'arn', 'proposal_arn' - The Amazon Resource Name (ARN) of the proposal. For more information
-- about ARNs and their format, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
--
-- 'creationDate', 'proposal_creationDate' - The date and time that the proposal was created.
--
-- 'description', 'proposal_description' - The description of the proposal.
--
-- 'expirationDate', 'proposal_expirationDate' - The date and time that the proposal expires. This is the @CreationDate@
-- plus the @ProposalDurationInHours@ that is specified in the
-- @ProposalThresholdPolicy@. After this date and time, if members haven\'t
-- cast enough votes to determine the outcome according to the voting
-- policy, the proposal is @EXPIRED@ and @Actions@ aren\'t carried out.
--
-- 'networkId', 'proposal_networkId' - The unique identifier of the network for which the proposal is made.
--
-- 'noVoteCount', 'proposal_noVoteCount' - The current total of @NO@ votes cast on the proposal by members.
--
-- 'outstandingVoteCount', 'proposal_outstandingVoteCount' - The number of votes remaining to be cast on the proposal by members. In
-- other words, the number of members minus the sum of @YES@ votes and @NO@
-- votes.
--
-- 'proposalId', 'proposal_proposalId' - The unique identifier of the proposal.
--
-- 'proposedByMemberId', 'proposal_proposedByMemberId' - The unique identifier of the member that created the proposal.
--
-- 'proposedByMemberName', 'proposal_proposedByMemberName' - The name of the member that created the proposal.
--
-- 'status', 'proposal_status' - The status of the proposal. Values are as follows:
--
-- -   @IN_PROGRESS@ - The proposal is active and open for member voting.
--
-- -   @APPROVED@ - The proposal was approved with sufficient @YES@ votes
--     among members according to the @VotingPolicy@ specified for the
--     @Network@. The specified proposal actions are carried out.
--
-- -   @REJECTED@ - The proposal was rejected with insufficient @YES@ votes
--     among members according to the @VotingPolicy@ specified for the
--     @Network@. The specified @ProposalActions@ aren\'t carried out.
--
-- -   @EXPIRED@ - Members didn\'t cast the number of votes required to
--     determine the proposal outcome before the proposal expired. The
--     specified @ProposalActions@ aren\'t carried out.
--
-- -   @ACTION_FAILED@ - One or more of the specified @ProposalActions@ in
--     a proposal that was approved couldn\'t be completed because of an
--     error. The @ACTION_FAILED@ status occurs even if only one
--     ProposalAction fails and other actions are successful.
--
-- 'tags', 'proposal_tags' - Tags assigned to the proposal. Each tag consists of a key and optional
-- value.
--
-- For more information about tags, see
-- <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Ethereum Developer Guide/, or
-- <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Hyperledger Fabric Developer Guide/.
--
-- 'yesVoteCount', 'proposal_yesVoteCount' - The current total of @YES@ votes cast on the proposal by members.
newProposal ::
  Proposal
newProposal :: Proposal
newProposal =
  Proposal'
    { $sel:actions:Proposal' :: Maybe ProposalActions
actions = forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Proposal' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:Proposal' :: Maybe ISO8601
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:Proposal' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:expirationDate:Proposal' :: Maybe ISO8601
expirationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:networkId:Proposal' :: Maybe Text
networkId = forall a. Maybe a
Prelude.Nothing,
      $sel:noVoteCount:Proposal' :: Maybe Int
noVoteCount = forall a. Maybe a
Prelude.Nothing,
      $sel:outstandingVoteCount:Proposal' :: Maybe Int
outstandingVoteCount = forall a. Maybe a
Prelude.Nothing,
      $sel:proposalId:Proposal' :: Maybe Text
proposalId = forall a. Maybe a
Prelude.Nothing,
      $sel:proposedByMemberId:Proposal' :: Maybe Text
proposedByMemberId = forall a. Maybe a
Prelude.Nothing,
      $sel:proposedByMemberName:Proposal' :: Maybe Text
proposedByMemberName = forall a. Maybe a
Prelude.Nothing,
      $sel:status:Proposal' :: Maybe ProposalStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Proposal' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
      $sel:yesVoteCount:Proposal' :: Maybe Int
yesVoteCount = forall a. Maybe a
Prelude.Nothing
    }

-- | The actions to perform on the network if the proposal is @APPROVED@.
proposal_actions :: Lens.Lens' Proposal (Prelude.Maybe ProposalActions)
proposal_actions :: Lens' Proposal (Maybe ProposalActions)
proposal_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe ProposalActions
actions :: Maybe ProposalActions
$sel:actions:Proposal' :: Proposal -> Maybe ProposalActions
actions} -> Maybe ProposalActions
actions) (\s :: Proposal
s@Proposal' {} Maybe ProposalActions
a -> Proposal
s {$sel:actions:Proposal' :: Maybe ProposalActions
actions = Maybe ProposalActions
a} :: Proposal)

-- | The Amazon Resource Name (ARN) of the proposal. For more information
-- about ARNs and their format, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
proposal_arn :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Text)
proposal_arn :: Lens' Proposal (Maybe Text)
proposal_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Text
arn :: Maybe Text
$sel:arn:Proposal' :: Proposal -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Proposal
s@Proposal' {} Maybe Text
a -> Proposal
s {$sel:arn:Proposal' :: Maybe Text
arn = Maybe Text
a} :: Proposal)

-- | The date and time that the proposal was created.
proposal_creationDate :: Lens.Lens' Proposal (Prelude.Maybe Prelude.UTCTime)
proposal_creationDate :: Lens' Proposal (Maybe UTCTime)
proposal_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe ISO8601
creationDate :: Maybe ISO8601
$sel:creationDate:Proposal' :: Proposal -> Maybe ISO8601
creationDate} -> Maybe ISO8601
creationDate) (\s :: Proposal
s@Proposal' {} Maybe ISO8601
a -> Proposal
s {$sel:creationDate:Proposal' :: Maybe ISO8601
creationDate = Maybe ISO8601
a} :: Proposal) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The description of the proposal.
proposal_description :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Text)
proposal_description :: Lens' Proposal (Maybe Text)
proposal_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Text
description :: Maybe Text
$sel:description:Proposal' :: Proposal -> Maybe Text
description} -> Maybe Text
description) (\s :: Proposal
s@Proposal' {} Maybe Text
a -> Proposal
s {$sel:description:Proposal' :: Maybe Text
description = Maybe Text
a} :: Proposal)

-- | The date and time that the proposal expires. This is the @CreationDate@
-- plus the @ProposalDurationInHours@ that is specified in the
-- @ProposalThresholdPolicy@. After this date and time, if members haven\'t
-- cast enough votes to determine the outcome according to the voting
-- policy, the proposal is @EXPIRED@ and @Actions@ aren\'t carried out.
proposal_expirationDate :: Lens.Lens' Proposal (Prelude.Maybe Prelude.UTCTime)
proposal_expirationDate :: Lens' Proposal (Maybe UTCTime)
proposal_expirationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe ISO8601
expirationDate :: Maybe ISO8601
$sel:expirationDate:Proposal' :: Proposal -> Maybe ISO8601
expirationDate} -> Maybe ISO8601
expirationDate) (\s :: Proposal
s@Proposal' {} Maybe ISO8601
a -> Proposal
s {$sel:expirationDate:Proposal' :: Maybe ISO8601
expirationDate = Maybe ISO8601
a} :: Proposal) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The unique identifier of the network for which the proposal is made.
proposal_networkId :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Text)
proposal_networkId :: Lens' Proposal (Maybe Text)
proposal_networkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Text
networkId :: Maybe Text
$sel:networkId:Proposal' :: Proposal -> Maybe Text
networkId} -> Maybe Text
networkId) (\s :: Proposal
s@Proposal' {} Maybe Text
a -> Proposal
s {$sel:networkId:Proposal' :: Maybe Text
networkId = Maybe Text
a} :: Proposal)

-- | The current total of @NO@ votes cast on the proposal by members.
proposal_noVoteCount :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Int)
proposal_noVoteCount :: Lens' Proposal (Maybe Int)
proposal_noVoteCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Int
noVoteCount :: Maybe Int
$sel:noVoteCount:Proposal' :: Proposal -> Maybe Int
noVoteCount} -> Maybe Int
noVoteCount) (\s :: Proposal
s@Proposal' {} Maybe Int
a -> Proposal
s {$sel:noVoteCount:Proposal' :: Maybe Int
noVoteCount = Maybe Int
a} :: Proposal)

-- | The number of votes remaining to be cast on the proposal by members. In
-- other words, the number of members minus the sum of @YES@ votes and @NO@
-- votes.
proposal_outstandingVoteCount :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Int)
proposal_outstandingVoteCount :: Lens' Proposal (Maybe Int)
proposal_outstandingVoteCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Int
outstandingVoteCount :: Maybe Int
$sel:outstandingVoteCount:Proposal' :: Proposal -> Maybe Int
outstandingVoteCount} -> Maybe Int
outstandingVoteCount) (\s :: Proposal
s@Proposal' {} Maybe Int
a -> Proposal
s {$sel:outstandingVoteCount:Proposal' :: Maybe Int
outstandingVoteCount = Maybe Int
a} :: Proposal)

-- | The unique identifier of the proposal.
proposal_proposalId :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Text)
proposal_proposalId :: Lens' Proposal (Maybe Text)
proposal_proposalId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Text
proposalId :: Maybe Text
$sel:proposalId:Proposal' :: Proposal -> Maybe Text
proposalId} -> Maybe Text
proposalId) (\s :: Proposal
s@Proposal' {} Maybe Text
a -> Proposal
s {$sel:proposalId:Proposal' :: Maybe Text
proposalId = Maybe Text
a} :: Proposal)

-- | The unique identifier of the member that created the proposal.
proposal_proposedByMemberId :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Text)
proposal_proposedByMemberId :: Lens' Proposal (Maybe Text)
proposal_proposedByMemberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Text
proposedByMemberId :: Maybe Text
$sel:proposedByMemberId:Proposal' :: Proposal -> Maybe Text
proposedByMemberId} -> Maybe Text
proposedByMemberId) (\s :: Proposal
s@Proposal' {} Maybe Text
a -> Proposal
s {$sel:proposedByMemberId:Proposal' :: Maybe Text
proposedByMemberId = Maybe Text
a} :: Proposal)

-- | The name of the member that created the proposal.
proposal_proposedByMemberName :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Text)
proposal_proposedByMemberName :: Lens' Proposal (Maybe Text)
proposal_proposedByMemberName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Text
proposedByMemberName :: Maybe Text
$sel:proposedByMemberName:Proposal' :: Proposal -> Maybe Text
proposedByMemberName} -> Maybe Text
proposedByMemberName) (\s :: Proposal
s@Proposal' {} Maybe Text
a -> Proposal
s {$sel:proposedByMemberName:Proposal' :: Maybe Text
proposedByMemberName = Maybe Text
a} :: Proposal)

-- | The status of the proposal. Values are as follows:
--
-- -   @IN_PROGRESS@ - The proposal is active and open for member voting.
--
-- -   @APPROVED@ - The proposal was approved with sufficient @YES@ votes
--     among members according to the @VotingPolicy@ specified for the
--     @Network@. The specified proposal actions are carried out.
--
-- -   @REJECTED@ - The proposal was rejected with insufficient @YES@ votes
--     among members according to the @VotingPolicy@ specified for the
--     @Network@. The specified @ProposalActions@ aren\'t carried out.
--
-- -   @EXPIRED@ - Members didn\'t cast the number of votes required to
--     determine the proposal outcome before the proposal expired. The
--     specified @ProposalActions@ aren\'t carried out.
--
-- -   @ACTION_FAILED@ - One or more of the specified @ProposalActions@ in
--     a proposal that was approved couldn\'t be completed because of an
--     error. The @ACTION_FAILED@ status occurs even if only one
--     ProposalAction fails and other actions are successful.
proposal_status :: Lens.Lens' Proposal (Prelude.Maybe ProposalStatus)
proposal_status :: Lens' Proposal (Maybe ProposalStatus)
proposal_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe ProposalStatus
status :: Maybe ProposalStatus
$sel:status:Proposal' :: Proposal -> Maybe ProposalStatus
status} -> Maybe ProposalStatus
status) (\s :: Proposal
s@Proposal' {} Maybe ProposalStatus
a -> Proposal
s {$sel:status:Proposal' :: Maybe ProposalStatus
status = Maybe ProposalStatus
a} :: Proposal)

-- | Tags assigned to the proposal. Each tag consists of a key and optional
-- value.
--
-- For more information about tags, see
-- <https://docs.aws.amazon.com/managed-blockchain/latest/ethereum-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Ethereum Developer Guide/, or
-- <https://docs.aws.amazon.com/managed-blockchain/latest/hyperledger-fabric-dev/tagging-resources.html Tagging Resources>
-- in the /Amazon Managed Blockchain Hyperledger Fabric Developer Guide/.
proposal_tags :: Lens.Lens' Proposal (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
proposal_tags :: Lens' Proposal (Maybe (HashMap Text Text))
proposal_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Proposal' :: Proposal -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Proposal
s@Proposal' {} Maybe (HashMap Text Text)
a -> Proposal
s {$sel:tags:Proposal' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Proposal) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The current total of @YES@ votes cast on the proposal by members.
proposal_yesVoteCount :: Lens.Lens' Proposal (Prelude.Maybe Prelude.Int)
proposal_yesVoteCount :: Lens' Proposal (Maybe Int)
proposal_yesVoteCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Proposal' {Maybe Int
yesVoteCount :: Maybe Int
$sel:yesVoteCount:Proposal' :: Proposal -> Maybe Int
yesVoteCount} -> Maybe Int
yesVoteCount) (\s :: Proposal
s@Proposal' {} Maybe Int
a -> Proposal
s {$sel:yesVoteCount:Proposal' :: Maybe Int
yesVoteCount = Maybe Int
a} :: Proposal)

instance Data.FromJSON Proposal where
  parseJSON :: Value -> Parser Proposal
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Proposal"
      ( \Object
x ->
          Maybe ProposalActions
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ProposalStatus
-> Maybe (HashMap Text Text)
-> Maybe Int
-> Proposal
Proposal'
            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
"Actions")
            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
"Arn")
            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
"CreationDate")
            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
"Description")
            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
"ExpirationDate")
            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
"NetworkId")
            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
"NoVoteCount")
            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
"OutstandingVoteCount")
            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
"ProposalId")
            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
"ProposedByMemberId")
            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
"ProposedByMemberName")
            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
"Status")
            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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"YesVoteCount")
      )

instance Prelude.Hashable Proposal where
  hashWithSalt :: Int -> Proposal -> Int
hashWithSalt Int
_salt Proposal' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe ProposalStatus
Maybe ProposalActions
yesVoteCount :: Maybe Int
tags :: Maybe (HashMap Text Text)
status :: Maybe ProposalStatus
proposedByMemberName :: Maybe Text
proposedByMemberId :: Maybe Text
proposalId :: Maybe Text
outstandingVoteCount :: Maybe Int
noVoteCount :: Maybe Int
networkId :: Maybe Text
expirationDate :: Maybe ISO8601
description :: Maybe Text
creationDate :: Maybe ISO8601
arn :: Maybe Text
actions :: Maybe ProposalActions
$sel:yesVoteCount:Proposal' :: Proposal -> Maybe Int
$sel:tags:Proposal' :: Proposal -> Maybe (HashMap Text Text)
$sel:status:Proposal' :: Proposal -> Maybe ProposalStatus
$sel:proposedByMemberName:Proposal' :: Proposal -> Maybe Text
$sel:proposedByMemberId:Proposal' :: Proposal -> Maybe Text
$sel:proposalId:Proposal' :: Proposal -> Maybe Text
$sel:outstandingVoteCount:Proposal' :: Proposal -> Maybe Int
$sel:noVoteCount:Proposal' :: Proposal -> Maybe Int
$sel:networkId:Proposal' :: Proposal -> Maybe Text
$sel:expirationDate:Proposal' :: Proposal -> Maybe ISO8601
$sel:description:Proposal' :: Proposal -> Maybe Text
$sel:creationDate:Proposal' :: Proposal -> Maybe ISO8601
$sel:arn:Proposal' :: Proposal -> Maybe Text
$sel:actions:Proposal' :: Proposal -> Maybe ProposalActions
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProposalActions
actions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
expirationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
networkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
noVoteCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
outstandingVoteCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
proposalId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
proposedByMemberId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
proposedByMemberName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProposalStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
yesVoteCount

instance Prelude.NFData Proposal where
  rnf :: Proposal -> ()
rnf Proposal' {Maybe Int
Maybe Text
Maybe (HashMap Text Text)
Maybe ISO8601
Maybe ProposalStatus
Maybe ProposalActions
yesVoteCount :: Maybe Int
tags :: Maybe (HashMap Text Text)
status :: Maybe ProposalStatus
proposedByMemberName :: Maybe Text
proposedByMemberId :: Maybe Text
proposalId :: Maybe Text
outstandingVoteCount :: Maybe Int
noVoteCount :: Maybe Int
networkId :: Maybe Text
expirationDate :: Maybe ISO8601
description :: Maybe Text
creationDate :: Maybe ISO8601
arn :: Maybe Text
actions :: Maybe ProposalActions
$sel:yesVoteCount:Proposal' :: Proposal -> Maybe Int
$sel:tags:Proposal' :: Proposal -> Maybe (HashMap Text Text)
$sel:status:Proposal' :: Proposal -> Maybe ProposalStatus
$sel:proposedByMemberName:Proposal' :: Proposal -> Maybe Text
$sel:proposedByMemberId:Proposal' :: Proposal -> Maybe Text
$sel:proposalId:Proposal' :: Proposal -> Maybe Text
$sel:outstandingVoteCount:Proposal' :: Proposal -> Maybe Int
$sel:noVoteCount:Proposal' :: Proposal -> Maybe Int
$sel:networkId:Proposal' :: Proposal -> Maybe Text
$sel:expirationDate:Proposal' :: Proposal -> Maybe ISO8601
$sel:description:Proposal' :: Proposal -> Maybe Text
$sel:creationDate:Proposal' :: Proposal -> Maybe ISO8601
$sel:arn:Proposal' :: Proposal -> Maybe Text
$sel:actions:Proposal' :: Proposal -> Maybe ProposalActions
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ProposalActions
actions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
expirationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
networkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
noVoteCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
outstandingVoteCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
proposalId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
proposedByMemberId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
proposedByMemberName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ProposalStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
yesVoteCount