{-# 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.CreateProposal
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates a proposal for a change to the network that other members of the
-- network can vote on, for example, a proposal to add a new member to the
-- network. Any member can create a proposal.
--
-- Applies only to Hyperledger Fabric.
module Amazonka.ManagedBlockChain.CreateProposal
  ( -- * Creating a Request
    CreateProposal (..),
    newCreateProposal,

    -- * Request Lenses
    createProposal_description,
    createProposal_tags,
    createProposal_clientRequestToken,
    createProposal_networkId,
    createProposal_memberId,
    createProposal_actions,

    -- * Destructuring the Response
    CreateProposalResponse (..),
    newCreateProposalResponse,

    -- * Response Lenses
    createProposalResponse_proposalId,
    createProposalResponse_httpStatus,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newCreateProposal' smart constructor.
data CreateProposal = CreateProposal'
  { -- | A description for the proposal that is visible to voting members, for
    -- example, \"Proposal to add Example Corp. as member.\"
    CreateProposal -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Tags to assign to the proposal. Each tag consists of a key and optional
    -- value.
    --
    -- When specifying tags during creation, you can specify multiple key-value
    -- pairs in a single request, with an overall maximum of 50 tags added to
    -- each resource. If the proposal is for a network invitation, the
    -- invitation inherits the tags added to the proposal.
    --
    -- 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/.
    CreateProposal -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | A unique, case-sensitive identifier that you provide to ensure the
    -- idempotency of the operation. An idempotent operation completes no more
    -- than one time. This identifier is required only if you make a service
    -- request directly using an HTTP client. It is generated automatically if
    -- you use an Amazon Web Services SDK or the CLI.
    CreateProposal -> Text
clientRequestToken :: Prelude.Text,
    -- | The unique identifier of the network for which the proposal is made.
    CreateProposal -> Text
networkId :: Prelude.Text,
    -- | The unique identifier of the member that is creating the proposal. This
    -- identifier is especially useful for identifying the member making the
    -- proposal when multiple members exist in a single Amazon Web Services
    -- account.
    CreateProposal -> Text
memberId :: Prelude.Text,
    -- | The type of actions proposed, such as inviting a member or removing a
    -- member. The types of @Actions@ in a proposal are mutually exclusive. For
    -- example, a proposal with @Invitations@ actions cannot also contain
    -- @Removals@ actions.
    CreateProposal -> ProposalActions
actions :: ProposalActions
  }
  deriving (CreateProposal -> CreateProposal -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProposal -> CreateProposal -> Bool
$c/= :: CreateProposal -> CreateProposal -> Bool
== :: CreateProposal -> CreateProposal -> Bool
$c== :: CreateProposal -> CreateProposal -> Bool
Prelude.Eq, ReadPrec [CreateProposal]
ReadPrec CreateProposal
Int -> ReadS CreateProposal
ReadS [CreateProposal]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProposal]
$creadListPrec :: ReadPrec [CreateProposal]
readPrec :: ReadPrec CreateProposal
$creadPrec :: ReadPrec CreateProposal
readList :: ReadS [CreateProposal]
$creadList :: ReadS [CreateProposal]
readsPrec :: Int -> ReadS CreateProposal
$creadsPrec :: Int -> ReadS CreateProposal
Prelude.Read, Int -> CreateProposal -> ShowS
[CreateProposal] -> ShowS
CreateProposal -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProposal] -> ShowS
$cshowList :: [CreateProposal] -> ShowS
show :: CreateProposal -> String
$cshow :: CreateProposal -> String
showsPrec :: Int -> CreateProposal -> ShowS
$cshowsPrec :: Int -> CreateProposal -> ShowS
Prelude.Show, forall x. Rep CreateProposal x -> CreateProposal
forall x. CreateProposal -> Rep CreateProposal x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProposal x -> CreateProposal
$cfrom :: forall x. CreateProposal -> Rep CreateProposal x
Prelude.Generic)

-- |
-- Create a value of 'CreateProposal' 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:
--
-- 'description', 'createProposal_description' - A description for the proposal that is visible to voting members, for
-- example, \"Proposal to add Example Corp. as member.\"
--
-- 'tags', 'createProposal_tags' - Tags to assign to the proposal. Each tag consists of a key and optional
-- value.
--
-- When specifying tags during creation, you can specify multiple key-value
-- pairs in a single request, with an overall maximum of 50 tags added to
-- each resource. If the proposal is for a network invitation, the
-- invitation inherits the tags added to the proposal.
--
-- 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/.
--
-- 'clientRequestToken', 'createProposal_clientRequestToken' - A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the operation. An idempotent operation completes no more
-- than one time. This identifier is required only if you make a service
-- request directly using an HTTP client. It is generated automatically if
-- you use an Amazon Web Services SDK or the CLI.
--
-- 'networkId', 'createProposal_networkId' - The unique identifier of the network for which the proposal is made.
--
-- 'memberId', 'createProposal_memberId' - The unique identifier of the member that is creating the proposal. This
-- identifier is especially useful for identifying the member making the
-- proposal when multiple members exist in a single Amazon Web Services
-- account.
--
-- 'actions', 'createProposal_actions' - The type of actions proposed, such as inviting a member or removing a
-- member. The types of @Actions@ in a proposal are mutually exclusive. For
-- example, a proposal with @Invitations@ actions cannot also contain
-- @Removals@ actions.
newCreateProposal ::
  -- | 'clientRequestToken'
  Prelude.Text ->
  -- | 'networkId'
  Prelude.Text ->
  -- | 'memberId'
  Prelude.Text ->
  -- | 'actions'
  ProposalActions ->
  CreateProposal
newCreateProposal :: Text -> Text -> Text -> ProposalActions -> CreateProposal
newCreateProposal
  Text
pClientRequestToken_
  Text
pNetworkId_
  Text
pMemberId_
  ProposalActions
pActions_ =
    CreateProposal'
      { $sel:description:CreateProposal' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CreateProposal' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:clientRequestToken:CreateProposal' :: Text
clientRequestToken = Text
pClientRequestToken_,
        $sel:networkId:CreateProposal' :: Text
networkId = Text
pNetworkId_,
        $sel:memberId:CreateProposal' :: Text
memberId = Text
pMemberId_,
        $sel:actions:CreateProposal' :: ProposalActions
actions = ProposalActions
pActions_
      }

-- | A description for the proposal that is visible to voting members, for
-- example, \"Proposal to add Example Corp. as member.\"
createProposal_description :: Lens.Lens' CreateProposal (Prelude.Maybe Prelude.Text)
createProposal_description :: Lens' CreateProposal (Maybe Text)
createProposal_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProposal' {Maybe Text
description :: Maybe Text
$sel:description:CreateProposal' :: CreateProposal -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateProposal
s@CreateProposal' {} Maybe Text
a -> CreateProposal
s {$sel:description:CreateProposal' :: Maybe Text
description = Maybe Text
a} :: CreateProposal)

-- | Tags to assign to the proposal. Each tag consists of a key and optional
-- value.
--
-- When specifying tags during creation, you can specify multiple key-value
-- pairs in a single request, with an overall maximum of 50 tags added to
-- each resource. If the proposal is for a network invitation, the
-- invitation inherits the tags added to the proposal.
--
-- 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/.
createProposal_tags :: Lens.Lens' CreateProposal (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createProposal_tags :: Lens' CreateProposal (Maybe (HashMap Text Text))
createProposal_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProposal' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateProposal' :: CreateProposal -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateProposal
s@CreateProposal' {} Maybe (HashMap Text Text)
a -> CreateProposal
s {$sel:tags:CreateProposal' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateProposal) 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

-- | A unique, case-sensitive identifier that you provide to ensure the
-- idempotency of the operation. An idempotent operation completes no more
-- than one time. This identifier is required only if you make a service
-- request directly using an HTTP client. It is generated automatically if
-- you use an Amazon Web Services SDK or the CLI.
createProposal_clientRequestToken :: Lens.Lens' CreateProposal Prelude.Text
createProposal_clientRequestToken :: Lens' CreateProposal Text
createProposal_clientRequestToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProposal' {Text
clientRequestToken :: Text
$sel:clientRequestToken:CreateProposal' :: CreateProposal -> Text
clientRequestToken} -> Text
clientRequestToken) (\s :: CreateProposal
s@CreateProposal' {} Text
a -> CreateProposal
s {$sel:clientRequestToken:CreateProposal' :: Text
clientRequestToken = Text
a} :: CreateProposal)

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

-- | The unique identifier of the member that is creating the proposal. This
-- identifier is especially useful for identifying the member making the
-- proposal when multiple members exist in a single Amazon Web Services
-- account.
createProposal_memberId :: Lens.Lens' CreateProposal Prelude.Text
createProposal_memberId :: Lens' CreateProposal Text
createProposal_memberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProposal' {Text
memberId :: Text
$sel:memberId:CreateProposal' :: CreateProposal -> Text
memberId} -> Text
memberId) (\s :: CreateProposal
s@CreateProposal' {} Text
a -> CreateProposal
s {$sel:memberId:CreateProposal' :: Text
memberId = Text
a} :: CreateProposal)

-- | The type of actions proposed, such as inviting a member or removing a
-- member. The types of @Actions@ in a proposal are mutually exclusive. For
-- example, a proposal with @Invitations@ actions cannot also contain
-- @Removals@ actions.
createProposal_actions :: Lens.Lens' CreateProposal ProposalActions
createProposal_actions :: Lens' CreateProposal ProposalActions
createProposal_actions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateProposal' {ProposalActions
actions :: ProposalActions
$sel:actions:CreateProposal' :: CreateProposal -> ProposalActions
actions} -> ProposalActions
actions) (\s :: CreateProposal
s@CreateProposal' {} ProposalActions
a -> CreateProposal
s {$sel:actions:CreateProposal' :: ProposalActions
actions = ProposalActions
a} :: CreateProposal)

instance Core.AWSRequest CreateProposal where
  type
    AWSResponse CreateProposal =
      CreateProposalResponse
  request :: (Service -> Service) -> CreateProposal -> Request CreateProposal
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy CreateProposal
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateProposal)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Int -> CreateProposalResponse
CreateProposalResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ProposalId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable CreateProposal where
  hashWithSalt :: Int -> CreateProposal -> Int
hashWithSalt Int
_salt CreateProposal' {Maybe Text
Maybe (HashMap Text Text)
Text
ProposalActions
actions :: ProposalActions
memberId :: Text
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:actions:CreateProposal' :: CreateProposal -> ProposalActions
$sel:memberId:CreateProposal' :: CreateProposal -> Text
$sel:networkId:CreateProposal' :: CreateProposal -> Text
$sel:clientRequestToken:CreateProposal' :: CreateProposal -> Text
$sel:tags:CreateProposal' :: CreateProposal -> Maybe (HashMap Text Text)
$sel:description:CreateProposal' :: CreateProposal -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clientRequestToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
memberId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ProposalActions
actions

instance Prelude.NFData CreateProposal where
  rnf :: CreateProposal -> ()
rnf CreateProposal' {Maybe Text
Maybe (HashMap Text Text)
Text
ProposalActions
actions :: ProposalActions
memberId :: Text
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:actions:CreateProposal' :: CreateProposal -> ProposalActions
$sel:memberId:CreateProposal' :: CreateProposal -> Text
$sel:networkId:CreateProposal' :: CreateProposal -> Text
$sel:clientRequestToken:CreateProposal' :: CreateProposal -> Text
$sel:tags:CreateProposal' :: CreateProposal -> Maybe (HashMap Text Text)
$sel:description:CreateProposal' :: CreateProposal -> Maybe Text
..} =
    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 (HashMap Text Text)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clientRequestToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
memberId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ProposalActions
actions

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

instance Data.ToJSON CreateProposal where
  toJSON :: CreateProposal -> Value
toJSON CreateProposal' {Maybe Text
Maybe (HashMap Text Text)
Text
ProposalActions
actions :: ProposalActions
memberId :: Text
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:actions:CreateProposal' :: CreateProposal -> ProposalActions
$sel:memberId:CreateProposal' :: CreateProposal -> Text
$sel:networkId:CreateProposal' :: CreateProposal -> Text
$sel:clientRequestToken:CreateProposal' :: CreateProposal -> Text
$sel:tags:CreateProposal' :: CreateProposal -> Maybe (HashMap Text Text)
$sel:description:CreateProposal' :: CreateProposal -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"Tags" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"ClientRequestToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
clientRequestToken),
            forall a. a -> Maybe a
Prelude.Just (Key
"MemberId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
memberId),
            forall a. a -> Maybe a
Prelude.Just (Key
"Actions" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ProposalActions
actions)
          ]
      )

instance Data.ToPath CreateProposal where
  toPath :: CreateProposal -> ByteString
toPath CreateProposal' {Maybe Text
Maybe (HashMap Text Text)
Text
ProposalActions
actions :: ProposalActions
memberId :: Text
networkId :: Text
clientRequestToken :: Text
tags :: Maybe (HashMap Text Text)
description :: Maybe Text
$sel:actions:CreateProposal' :: CreateProposal -> ProposalActions
$sel:memberId:CreateProposal' :: CreateProposal -> Text
$sel:networkId:CreateProposal' :: CreateProposal -> Text
$sel:clientRequestToken:CreateProposal' :: CreateProposal -> Text
$sel:tags:CreateProposal' :: CreateProposal -> Maybe (HashMap Text Text)
$sel:description:CreateProposal' :: CreateProposal -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/networks/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
networkId, ByteString
"/proposals"]

instance Data.ToQuery CreateProposal where
  toQuery :: CreateProposal -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateProposalResponse' smart constructor.
data CreateProposalResponse = CreateProposalResponse'
  { -- | The unique identifier of the proposal.
    CreateProposalResponse -> Maybe Text
proposalId :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateProposalResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateProposalResponse -> CreateProposalResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateProposalResponse -> CreateProposalResponse -> Bool
$c/= :: CreateProposalResponse -> CreateProposalResponse -> Bool
== :: CreateProposalResponse -> CreateProposalResponse -> Bool
$c== :: CreateProposalResponse -> CreateProposalResponse -> Bool
Prelude.Eq, ReadPrec [CreateProposalResponse]
ReadPrec CreateProposalResponse
Int -> ReadS CreateProposalResponse
ReadS [CreateProposalResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateProposalResponse]
$creadListPrec :: ReadPrec [CreateProposalResponse]
readPrec :: ReadPrec CreateProposalResponse
$creadPrec :: ReadPrec CreateProposalResponse
readList :: ReadS [CreateProposalResponse]
$creadList :: ReadS [CreateProposalResponse]
readsPrec :: Int -> ReadS CreateProposalResponse
$creadsPrec :: Int -> ReadS CreateProposalResponse
Prelude.Read, Int -> CreateProposalResponse -> ShowS
[CreateProposalResponse] -> ShowS
CreateProposalResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateProposalResponse] -> ShowS
$cshowList :: [CreateProposalResponse] -> ShowS
show :: CreateProposalResponse -> String
$cshow :: CreateProposalResponse -> String
showsPrec :: Int -> CreateProposalResponse -> ShowS
$cshowsPrec :: Int -> CreateProposalResponse -> ShowS
Prelude.Show, forall x. Rep CreateProposalResponse x -> CreateProposalResponse
forall x. CreateProposalResponse -> Rep CreateProposalResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateProposalResponse x -> CreateProposalResponse
$cfrom :: forall x. CreateProposalResponse -> Rep CreateProposalResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateProposalResponse' 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:
--
-- 'proposalId', 'createProposalResponse_proposalId' - The unique identifier of the proposal.
--
-- 'httpStatus', 'createProposalResponse_httpStatus' - The response's http status code.
newCreateProposalResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateProposalResponse
newCreateProposalResponse :: Int -> CreateProposalResponse
newCreateProposalResponse Int
pHttpStatus_ =
  CreateProposalResponse'
    { $sel:proposalId:CreateProposalResponse' :: Maybe Text
proposalId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateProposalResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

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

instance Prelude.NFData CreateProposalResponse where
  rnf :: CreateProposalResponse -> ()
rnf CreateProposalResponse' {Int
Maybe Text
httpStatus :: Int
proposalId :: Maybe Text
$sel:httpStatus:CreateProposalResponse' :: CreateProposalResponse -> Int
$sel:proposalId:CreateProposalResponse' :: CreateProposalResponse -> Maybe Text
..} =
    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 Int
httpStatus