{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.ListProposalVotes
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the list of votes for a specified proposal, including the value
-- of each vote and the unique identifier of the member that cast the vote.
--
-- Applies only to Hyperledger Fabric.
module Amazonka.ManagedBlockChain.ListProposalVotes
  ( -- * Creating a Request
    ListProposalVotes (..),
    newListProposalVotes,

    -- * Request Lenses
    listProposalVotes_nextToken,
    listProposalVotes_maxResults,
    listProposalVotes_networkId,
    listProposalVotes_proposalId,

    -- * Destructuring the Response
    ListProposalVotesResponse (..),
    newListProposalVotesResponse,

    -- * Response Lenses
    listProposalVotesResponse_nextToken,
    listProposalVotesResponse_proposalVotes,
    listProposalVotesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.ManagedBlockChain.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListProposalVotes' smart constructor.
data ListProposalVotes = ListProposalVotes'
  { -- | The pagination token that indicates the next set of results to retrieve.
    ListProposalVotes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of votes to return.
    ListProposalVotes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The unique identifier of the network.
    ListProposalVotes -> Text
networkId :: Prelude.Text,
    -- | The unique identifier of the proposal.
    ListProposalVotes -> Text
proposalId :: Prelude.Text
  }
  deriving (ListProposalVotes -> ListProposalVotes -> Bool
(ListProposalVotes -> ListProposalVotes -> Bool)
-> (ListProposalVotes -> ListProposalVotes -> Bool)
-> Eq ListProposalVotes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProposalVotes -> ListProposalVotes -> Bool
$c/= :: ListProposalVotes -> ListProposalVotes -> Bool
== :: ListProposalVotes -> ListProposalVotes -> Bool
$c== :: ListProposalVotes -> ListProposalVotes -> Bool
Prelude.Eq, ReadPrec [ListProposalVotes]
ReadPrec ListProposalVotes
Int -> ReadS ListProposalVotes
ReadS [ListProposalVotes]
(Int -> ReadS ListProposalVotes)
-> ReadS [ListProposalVotes]
-> ReadPrec ListProposalVotes
-> ReadPrec [ListProposalVotes]
-> Read ListProposalVotes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProposalVotes]
$creadListPrec :: ReadPrec [ListProposalVotes]
readPrec :: ReadPrec ListProposalVotes
$creadPrec :: ReadPrec ListProposalVotes
readList :: ReadS [ListProposalVotes]
$creadList :: ReadS [ListProposalVotes]
readsPrec :: Int -> ReadS ListProposalVotes
$creadsPrec :: Int -> ReadS ListProposalVotes
Prelude.Read, Int -> ListProposalVotes -> ShowS
[ListProposalVotes] -> ShowS
ListProposalVotes -> String
(Int -> ListProposalVotes -> ShowS)
-> (ListProposalVotes -> String)
-> ([ListProposalVotes] -> ShowS)
-> Show ListProposalVotes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProposalVotes] -> ShowS
$cshowList :: [ListProposalVotes] -> ShowS
show :: ListProposalVotes -> String
$cshow :: ListProposalVotes -> String
showsPrec :: Int -> ListProposalVotes -> ShowS
$cshowsPrec :: Int -> ListProposalVotes -> ShowS
Prelude.Show, (forall x. ListProposalVotes -> Rep ListProposalVotes x)
-> (forall x. Rep ListProposalVotes x -> ListProposalVotes)
-> Generic ListProposalVotes
forall x. Rep ListProposalVotes x -> ListProposalVotes
forall x. ListProposalVotes -> Rep ListProposalVotes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListProposalVotes x -> ListProposalVotes
$cfrom :: forall x. ListProposalVotes -> Rep ListProposalVotes x
Prelude.Generic)

-- |
-- Create a value of 'ListProposalVotes' 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:
--
-- 'nextToken', 'listProposalVotes_nextToken' - The pagination token that indicates the next set of results to retrieve.
--
-- 'maxResults', 'listProposalVotes_maxResults' - The maximum number of votes to return.
--
-- 'networkId', 'listProposalVotes_networkId' - The unique identifier of the network.
--
-- 'proposalId', 'listProposalVotes_proposalId' - The unique identifier of the proposal.
newListProposalVotes ::
  -- | 'networkId'
  Prelude.Text ->
  -- | 'proposalId'
  Prelude.Text ->
  ListProposalVotes
newListProposalVotes :: Text -> Text -> ListProposalVotes
newListProposalVotes Text
pNetworkId_ Text
pProposalId_ =
  ListProposalVotes' :: Maybe Text -> Maybe Natural -> Text -> Text -> ListProposalVotes
ListProposalVotes'
    { $sel:nextToken:ListProposalVotes' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListProposalVotes' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:networkId:ListProposalVotes' :: Text
networkId = Text
pNetworkId_,
      $sel:proposalId:ListProposalVotes' :: Text
proposalId = Text
pProposalId_
    }

-- | The pagination token that indicates the next set of results to retrieve.
listProposalVotes_nextToken :: Lens.Lens' ListProposalVotes (Prelude.Maybe Prelude.Text)
listProposalVotes_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListProposalVotes -> f ListProposalVotes
listProposalVotes_nextToken = (ListProposalVotes -> Maybe Text)
-> (ListProposalVotes -> Maybe Text -> ListProposalVotes)
-> Lens
     ListProposalVotes ListProposalVotes (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProposalVotes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProposalVotes' :: ListProposalVotes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProposalVotes
s@ListProposalVotes' {} Maybe Text
a -> ListProposalVotes
s {$sel:nextToken:ListProposalVotes' :: Maybe Text
nextToken = Maybe Text
a} :: ListProposalVotes)

-- | The maximum number of votes to return.
listProposalVotes_maxResults :: Lens.Lens' ListProposalVotes (Prelude.Maybe Prelude.Natural)
listProposalVotes_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListProposalVotes -> f ListProposalVotes
listProposalVotes_maxResults = (ListProposalVotes -> Maybe Natural)
-> (ListProposalVotes -> Maybe Natural -> ListProposalVotes)
-> Lens
     ListProposalVotes ListProposalVotes (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProposalVotes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListProposalVotes' :: ListProposalVotes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListProposalVotes
s@ListProposalVotes' {} Maybe Natural
a -> ListProposalVotes
s {$sel:maxResults:ListProposalVotes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListProposalVotes)

-- | The unique identifier of the network.
listProposalVotes_networkId :: Lens.Lens' ListProposalVotes Prelude.Text
listProposalVotes_networkId :: (Text -> f Text) -> ListProposalVotes -> f ListProposalVotes
listProposalVotes_networkId = (ListProposalVotes -> Text)
-> (ListProposalVotes -> Text -> ListProposalVotes)
-> Lens ListProposalVotes ListProposalVotes Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProposalVotes' {Text
networkId :: Text
$sel:networkId:ListProposalVotes' :: ListProposalVotes -> Text
networkId} -> Text
networkId) (\s :: ListProposalVotes
s@ListProposalVotes' {} Text
a -> ListProposalVotes
s {$sel:networkId:ListProposalVotes' :: Text
networkId = Text
a} :: ListProposalVotes)

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

instance Core.AWSRequest ListProposalVotes where
  type
    AWSResponse ListProposalVotes =
      ListProposalVotesResponse
  request :: ListProposalVotes -> Request ListProposalVotes
request = Service -> ListProposalVotes -> Request ListProposalVotes
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListProposalVotes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListProposalVotes)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListProposalVotes))
-> Logger
-> Service
-> Proxy ListProposalVotes
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListProposalVotes)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [VoteSummary] -> Int -> ListProposalVotesResponse
ListProposalVotesResponse'
            (Maybe Text
 -> Maybe [VoteSummary] -> Int -> ListProposalVotesResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [VoteSummary] -> Int -> ListProposalVotesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String (Maybe [VoteSummary] -> Int -> ListProposalVotesResponse)
-> Either String (Maybe [VoteSummary])
-> Either String (Int -> ListProposalVotesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [VoteSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProposalVotes" Either String (Maybe (Maybe [VoteSummary]))
-> Maybe [VoteSummary] -> Either String (Maybe [VoteSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [VoteSummary]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListProposalVotesResponse)
-> Either String Int -> Either String ListProposalVotesResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListProposalVotes

instance Prelude.NFData ListProposalVotes

instance Core.ToHeaders ListProposalVotes where
  toHeaders :: ListProposalVotes -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListProposalVotes -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListProposalVotes where
  toPath :: ListProposalVotes -> ByteString
toPath ListProposalVotes' {Maybe Natural
Maybe Text
Text
proposalId :: Text
networkId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:proposalId:ListProposalVotes' :: ListProposalVotes -> Text
$sel:networkId:ListProposalVotes' :: ListProposalVotes -> Text
$sel:maxResults:ListProposalVotes' :: ListProposalVotes -> Maybe Natural
$sel:nextToken:ListProposalVotes' :: ListProposalVotes -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/networks/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
networkId,
        ByteString
"/proposals/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
proposalId,
        ByteString
"/votes"
      ]

instance Core.ToQuery ListProposalVotes where
  toQuery :: ListProposalVotes -> QueryString
toQuery ListProposalVotes' {Maybe Natural
Maybe Text
Text
proposalId :: Text
networkId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:proposalId:ListProposalVotes' :: ListProposalVotes -> Text
$sel:networkId:ListProposalVotes' :: ListProposalVotes -> Text
$sel:maxResults:ListProposalVotes' :: ListProposalVotes -> Maybe Natural
$sel:nextToken:ListProposalVotes' :: ListProposalVotes -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListProposalVotesResponse' smart constructor.
data ListProposalVotesResponse = ListProposalVotesResponse'
  { -- | The pagination token that indicates the next set of results to retrieve.
    ListProposalVotesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of votes.
    ListProposalVotesResponse -> Maybe [VoteSummary]
proposalVotes :: Prelude.Maybe [VoteSummary],
    -- | The response's http status code.
    ListProposalVotesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListProposalVotesResponse -> ListProposalVotesResponse -> Bool
(ListProposalVotesResponse -> ListProposalVotesResponse -> Bool)
-> (ListProposalVotesResponse -> ListProposalVotesResponse -> Bool)
-> Eq ListProposalVotesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProposalVotesResponse -> ListProposalVotesResponse -> Bool
$c/= :: ListProposalVotesResponse -> ListProposalVotesResponse -> Bool
== :: ListProposalVotesResponse -> ListProposalVotesResponse -> Bool
$c== :: ListProposalVotesResponse -> ListProposalVotesResponse -> Bool
Prelude.Eq, ReadPrec [ListProposalVotesResponse]
ReadPrec ListProposalVotesResponse
Int -> ReadS ListProposalVotesResponse
ReadS [ListProposalVotesResponse]
(Int -> ReadS ListProposalVotesResponse)
-> ReadS [ListProposalVotesResponse]
-> ReadPrec ListProposalVotesResponse
-> ReadPrec [ListProposalVotesResponse]
-> Read ListProposalVotesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProposalVotesResponse]
$creadListPrec :: ReadPrec [ListProposalVotesResponse]
readPrec :: ReadPrec ListProposalVotesResponse
$creadPrec :: ReadPrec ListProposalVotesResponse
readList :: ReadS [ListProposalVotesResponse]
$creadList :: ReadS [ListProposalVotesResponse]
readsPrec :: Int -> ReadS ListProposalVotesResponse
$creadsPrec :: Int -> ReadS ListProposalVotesResponse
Prelude.Read, Int -> ListProposalVotesResponse -> ShowS
[ListProposalVotesResponse] -> ShowS
ListProposalVotesResponse -> String
(Int -> ListProposalVotesResponse -> ShowS)
-> (ListProposalVotesResponse -> String)
-> ([ListProposalVotesResponse] -> ShowS)
-> Show ListProposalVotesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProposalVotesResponse] -> ShowS
$cshowList :: [ListProposalVotesResponse] -> ShowS
show :: ListProposalVotesResponse -> String
$cshow :: ListProposalVotesResponse -> String
showsPrec :: Int -> ListProposalVotesResponse -> ShowS
$cshowsPrec :: Int -> ListProposalVotesResponse -> ShowS
Prelude.Show, (forall x.
 ListProposalVotesResponse -> Rep ListProposalVotesResponse x)
-> (forall x.
    Rep ListProposalVotesResponse x -> ListProposalVotesResponse)
-> Generic ListProposalVotesResponse
forall x.
Rep ListProposalVotesResponse x -> ListProposalVotesResponse
forall x.
ListProposalVotesResponse -> Rep ListProposalVotesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProposalVotesResponse x -> ListProposalVotesResponse
$cfrom :: forall x.
ListProposalVotesResponse -> Rep ListProposalVotesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListProposalVotesResponse' 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:
--
-- 'nextToken', 'listProposalVotesResponse_nextToken' - The pagination token that indicates the next set of results to retrieve.
--
-- 'proposalVotes', 'listProposalVotesResponse_proposalVotes' - The list of votes.
--
-- 'httpStatus', 'listProposalVotesResponse_httpStatus' - The response's http status code.
newListProposalVotesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListProposalVotesResponse
newListProposalVotesResponse :: Int -> ListProposalVotesResponse
newListProposalVotesResponse Int
pHttpStatus_ =
  ListProposalVotesResponse' :: Maybe Text
-> Maybe [VoteSummary] -> Int -> ListProposalVotesResponse
ListProposalVotesResponse'
    { $sel:nextToken:ListProposalVotesResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:proposalVotes:ListProposalVotesResponse' :: Maybe [VoteSummary]
proposalVotes = Maybe [VoteSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListProposalVotesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token that indicates the next set of results to retrieve.
listProposalVotesResponse_nextToken :: Lens.Lens' ListProposalVotesResponse (Prelude.Maybe Prelude.Text)
listProposalVotesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListProposalVotesResponse -> f ListProposalVotesResponse
listProposalVotesResponse_nextToken = (ListProposalVotesResponse -> Maybe Text)
-> (ListProposalVotesResponse
    -> Maybe Text -> ListProposalVotesResponse)
-> Lens
     ListProposalVotesResponse
     ListProposalVotesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProposalVotesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProposalVotesResponse' :: ListProposalVotesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProposalVotesResponse
s@ListProposalVotesResponse' {} Maybe Text
a -> ListProposalVotesResponse
s {$sel:nextToken:ListProposalVotesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListProposalVotesResponse)

-- | The list of votes.
listProposalVotesResponse_proposalVotes :: Lens.Lens' ListProposalVotesResponse (Prelude.Maybe [VoteSummary])
listProposalVotesResponse_proposalVotes :: (Maybe [VoteSummary] -> f (Maybe [VoteSummary]))
-> ListProposalVotesResponse -> f ListProposalVotesResponse
listProposalVotesResponse_proposalVotes = (ListProposalVotesResponse -> Maybe [VoteSummary])
-> (ListProposalVotesResponse
    -> Maybe [VoteSummary] -> ListProposalVotesResponse)
-> Lens
     ListProposalVotesResponse
     ListProposalVotesResponse
     (Maybe [VoteSummary])
     (Maybe [VoteSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProposalVotesResponse' {Maybe [VoteSummary]
proposalVotes :: Maybe [VoteSummary]
$sel:proposalVotes:ListProposalVotesResponse' :: ListProposalVotesResponse -> Maybe [VoteSummary]
proposalVotes} -> Maybe [VoteSummary]
proposalVotes) (\s :: ListProposalVotesResponse
s@ListProposalVotesResponse' {} Maybe [VoteSummary]
a -> ListProposalVotesResponse
s {$sel:proposalVotes:ListProposalVotesResponse' :: Maybe [VoteSummary]
proposalVotes = Maybe [VoteSummary]
a} :: ListProposalVotesResponse) ((Maybe [VoteSummary] -> f (Maybe [VoteSummary]))
 -> ListProposalVotesResponse -> f ListProposalVotesResponse)
-> ((Maybe [VoteSummary] -> f (Maybe [VoteSummary]))
    -> Maybe [VoteSummary] -> f (Maybe [VoteSummary]))
-> (Maybe [VoteSummary] -> f (Maybe [VoteSummary]))
-> ListProposalVotesResponse
-> f ListProposalVotesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [VoteSummary] [VoteSummary] [VoteSummary] [VoteSummary]
-> Iso
     (Maybe [VoteSummary])
     (Maybe [VoteSummary])
     (Maybe [VoteSummary])
     (Maybe [VoteSummary])
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 [VoteSummary] [VoteSummary] [VoteSummary] [VoteSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listProposalVotesResponse_httpStatus :: Lens.Lens' ListProposalVotesResponse Prelude.Int
listProposalVotesResponse_httpStatus :: (Int -> f Int)
-> ListProposalVotesResponse -> f ListProposalVotesResponse
listProposalVotesResponse_httpStatus = (ListProposalVotesResponse -> Int)
-> (ListProposalVotesResponse -> Int -> ListProposalVotesResponse)
-> Lens ListProposalVotesResponse ListProposalVotesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProposalVotesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListProposalVotesResponse' :: ListProposalVotesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListProposalVotesResponse
s@ListProposalVotesResponse' {} Int
a -> ListProposalVotesResponse
s {$sel:httpStatus:ListProposalVotesResponse' :: Int
httpStatus = Int
a} :: ListProposalVotesResponse)

instance Prelude.NFData ListProposalVotesResponse