{-# 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.QLDB.UpdateLedgerPermissionsMode
-- 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)
--
-- Updates the permissions mode of a ledger.
--
-- Before you switch to the @STANDARD@ permissions mode, you must first
-- create all required IAM policies and table tags to avoid disruption to
-- your users. To learn more, see
-- <https://docs.aws.amazon.com/qldb/latest/developerguide/ledger-management.basics.html#ledger-mgmt.basics.update-permissions.migrating Migrating to the standard permissions mode>
-- in the /Amazon QLDB Developer Guide/.
module Amazonka.QLDB.UpdateLedgerPermissionsMode
  ( -- * Creating a Request
    UpdateLedgerPermissionsMode (..),
    newUpdateLedgerPermissionsMode,

    -- * Request Lenses
    updateLedgerPermissionsMode_name,
    updateLedgerPermissionsMode_permissionsMode,

    -- * Destructuring the Response
    UpdateLedgerPermissionsModeResponse (..),
    newUpdateLedgerPermissionsModeResponse,

    -- * Response Lenses
    updateLedgerPermissionsModeResponse_arn,
    updateLedgerPermissionsModeResponse_name,
    updateLedgerPermissionsModeResponse_permissionsMode,
    updateLedgerPermissionsModeResponse_httpStatus,
  )
where

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

-- | /See:/ 'newUpdateLedgerPermissionsMode' smart constructor.
data UpdateLedgerPermissionsMode = UpdateLedgerPermissionsMode'
  { -- | The name of the ledger.
    UpdateLedgerPermissionsMode -> Text
name :: Prelude.Text,
    -- | The permissions mode to assign to the ledger. This parameter can have
    -- one of the following values:
    --
    -- -   @ALLOW_ALL@: A legacy permissions mode that enables access control
    --     with API-level granularity for ledgers.
    --
    --     This mode allows users who have the @SendCommand@ API permission for
    --     this ledger to run all PartiQL commands (hence, @ALLOW_ALL@) on any
    --     tables in the specified ledger. This mode disregards any table-level
    --     or command-level IAM permissions policies that you create for the
    --     ledger.
    --
    -- -   @STANDARD@: (/Recommended/) A permissions mode that enables access
    --     control with finer granularity for ledgers, tables, and PartiQL
    --     commands.
    --
    --     By default, this mode denies all user requests to run any PartiQL
    --     commands on any tables in this ledger. To allow PartiQL commands to
    --     run, you must create IAM permissions policies for specific table
    --     resources and PartiQL actions, in addition to the @SendCommand@ API
    --     permission for the ledger. For information, see
    --     <https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-standard-mode.html Getting started with the standard permissions mode>
    --     in the /Amazon QLDB Developer Guide/.
    --
    -- We strongly recommend using the @STANDARD@ permissions mode to maximize
    -- the security of your ledger data.
    UpdateLedgerPermissionsMode -> PermissionsMode
permissionsMode :: PermissionsMode
  }
  deriving (UpdateLedgerPermissionsMode -> UpdateLedgerPermissionsMode -> Bool
(UpdateLedgerPermissionsMode
 -> UpdateLedgerPermissionsMode -> Bool)
-> (UpdateLedgerPermissionsMode
    -> UpdateLedgerPermissionsMode -> Bool)
-> Eq UpdateLedgerPermissionsMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLedgerPermissionsMode -> UpdateLedgerPermissionsMode -> Bool
$c/= :: UpdateLedgerPermissionsMode -> UpdateLedgerPermissionsMode -> Bool
== :: UpdateLedgerPermissionsMode -> UpdateLedgerPermissionsMode -> Bool
$c== :: UpdateLedgerPermissionsMode -> UpdateLedgerPermissionsMode -> Bool
Prelude.Eq, ReadPrec [UpdateLedgerPermissionsMode]
ReadPrec UpdateLedgerPermissionsMode
Int -> ReadS UpdateLedgerPermissionsMode
ReadS [UpdateLedgerPermissionsMode]
(Int -> ReadS UpdateLedgerPermissionsMode)
-> ReadS [UpdateLedgerPermissionsMode]
-> ReadPrec UpdateLedgerPermissionsMode
-> ReadPrec [UpdateLedgerPermissionsMode]
-> Read UpdateLedgerPermissionsMode
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLedgerPermissionsMode]
$creadListPrec :: ReadPrec [UpdateLedgerPermissionsMode]
readPrec :: ReadPrec UpdateLedgerPermissionsMode
$creadPrec :: ReadPrec UpdateLedgerPermissionsMode
readList :: ReadS [UpdateLedgerPermissionsMode]
$creadList :: ReadS [UpdateLedgerPermissionsMode]
readsPrec :: Int -> ReadS UpdateLedgerPermissionsMode
$creadsPrec :: Int -> ReadS UpdateLedgerPermissionsMode
Prelude.Read, Int -> UpdateLedgerPermissionsMode -> ShowS
[UpdateLedgerPermissionsMode] -> ShowS
UpdateLedgerPermissionsMode -> String
(Int -> UpdateLedgerPermissionsMode -> ShowS)
-> (UpdateLedgerPermissionsMode -> String)
-> ([UpdateLedgerPermissionsMode] -> ShowS)
-> Show UpdateLedgerPermissionsMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLedgerPermissionsMode] -> ShowS
$cshowList :: [UpdateLedgerPermissionsMode] -> ShowS
show :: UpdateLedgerPermissionsMode -> String
$cshow :: UpdateLedgerPermissionsMode -> String
showsPrec :: Int -> UpdateLedgerPermissionsMode -> ShowS
$cshowsPrec :: Int -> UpdateLedgerPermissionsMode -> ShowS
Prelude.Show, (forall x.
 UpdateLedgerPermissionsMode -> Rep UpdateLedgerPermissionsMode x)
-> (forall x.
    Rep UpdateLedgerPermissionsMode x -> UpdateLedgerPermissionsMode)
-> Generic UpdateLedgerPermissionsMode
forall x.
Rep UpdateLedgerPermissionsMode x -> UpdateLedgerPermissionsMode
forall x.
UpdateLedgerPermissionsMode -> Rep UpdateLedgerPermissionsMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLedgerPermissionsMode x -> UpdateLedgerPermissionsMode
$cfrom :: forall x.
UpdateLedgerPermissionsMode -> Rep UpdateLedgerPermissionsMode x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLedgerPermissionsMode' 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:
--
-- 'name', 'updateLedgerPermissionsMode_name' - The name of the ledger.
--
-- 'permissionsMode', 'updateLedgerPermissionsMode_permissionsMode' - The permissions mode to assign to the ledger. This parameter can have
-- one of the following values:
--
-- -   @ALLOW_ALL@: A legacy permissions mode that enables access control
--     with API-level granularity for ledgers.
--
--     This mode allows users who have the @SendCommand@ API permission for
--     this ledger to run all PartiQL commands (hence, @ALLOW_ALL@) on any
--     tables in the specified ledger. This mode disregards any table-level
--     or command-level IAM permissions policies that you create for the
--     ledger.
--
-- -   @STANDARD@: (/Recommended/) A permissions mode that enables access
--     control with finer granularity for ledgers, tables, and PartiQL
--     commands.
--
--     By default, this mode denies all user requests to run any PartiQL
--     commands on any tables in this ledger. To allow PartiQL commands to
--     run, you must create IAM permissions policies for specific table
--     resources and PartiQL actions, in addition to the @SendCommand@ API
--     permission for the ledger. For information, see
--     <https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-standard-mode.html Getting started with the standard permissions mode>
--     in the /Amazon QLDB Developer Guide/.
--
-- We strongly recommend using the @STANDARD@ permissions mode to maximize
-- the security of your ledger data.
newUpdateLedgerPermissionsMode ::
  -- | 'name'
  Prelude.Text ->
  -- | 'permissionsMode'
  PermissionsMode ->
  UpdateLedgerPermissionsMode
newUpdateLedgerPermissionsMode :: Text -> PermissionsMode -> UpdateLedgerPermissionsMode
newUpdateLedgerPermissionsMode
  Text
pName_
  PermissionsMode
pPermissionsMode_ =
    UpdateLedgerPermissionsMode' :: Text -> PermissionsMode -> UpdateLedgerPermissionsMode
UpdateLedgerPermissionsMode'
      { $sel:name:UpdateLedgerPermissionsMode' :: Text
name = Text
pName_,
        $sel:permissionsMode:UpdateLedgerPermissionsMode' :: PermissionsMode
permissionsMode = PermissionsMode
pPermissionsMode_
      }

-- | The name of the ledger.
updateLedgerPermissionsMode_name :: Lens.Lens' UpdateLedgerPermissionsMode Prelude.Text
updateLedgerPermissionsMode_name :: (Text -> f Text)
-> UpdateLedgerPermissionsMode -> f UpdateLedgerPermissionsMode
updateLedgerPermissionsMode_name = (UpdateLedgerPermissionsMode -> Text)
-> (UpdateLedgerPermissionsMode
    -> Text -> UpdateLedgerPermissionsMode)
-> Lens
     UpdateLedgerPermissionsMode UpdateLedgerPermissionsMode Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLedgerPermissionsMode' {Text
name :: Text
$sel:name:UpdateLedgerPermissionsMode' :: UpdateLedgerPermissionsMode -> Text
name} -> Text
name) (\s :: UpdateLedgerPermissionsMode
s@UpdateLedgerPermissionsMode' {} Text
a -> UpdateLedgerPermissionsMode
s {$sel:name:UpdateLedgerPermissionsMode' :: Text
name = Text
a} :: UpdateLedgerPermissionsMode)

-- | The permissions mode to assign to the ledger. This parameter can have
-- one of the following values:
--
-- -   @ALLOW_ALL@: A legacy permissions mode that enables access control
--     with API-level granularity for ledgers.
--
--     This mode allows users who have the @SendCommand@ API permission for
--     this ledger to run all PartiQL commands (hence, @ALLOW_ALL@) on any
--     tables in the specified ledger. This mode disregards any table-level
--     or command-level IAM permissions policies that you create for the
--     ledger.
--
-- -   @STANDARD@: (/Recommended/) A permissions mode that enables access
--     control with finer granularity for ledgers, tables, and PartiQL
--     commands.
--
--     By default, this mode denies all user requests to run any PartiQL
--     commands on any tables in this ledger. To allow PartiQL commands to
--     run, you must create IAM permissions policies for specific table
--     resources and PartiQL actions, in addition to the @SendCommand@ API
--     permission for the ledger. For information, see
--     <https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-standard-mode.html Getting started with the standard permissions mode>
--     in the /Amazon QLDB Developer Guide/.
--
-- We strongly recommend using the @STANDARD@ permissions mode to maximize
-- the security of your ledger data.
updateLedgerPermissionsMode_permissionsMode :: Lens.Lens' UpdateLedgerPermissionsMode PermissionsMode
updateLedgerPermissionsMode_permissionsMode :: (PermissionsMode -> f PermissionsMode)
-> UpdateLedgerPermissionsMode -> f UpdateLedgerPermissionsMode
updateLedgerPermissionsMode_permissionsMode = (UpdateLedgerPermissionsMode -> PermissionsMode)
-> (UpdateLedgerPermissionsMode
    -> PermissionsMode -> UpdateLedgerPermissionsMode)
-> Lens
     UpdateLedgerPermissionsMode
     UpdateLedgerPermissionsMode
     PermissionsMode
     PermissionsMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLedgerPermissionsMode' {PermissionsMode
permissionsMode :: PermissionsMode
$sel:permissionsMode:UpdateLedgerPermissionsMode' :: UpdateLedgerPermissionsMode -> PermissionsMode
permissionsMode} -> PermissionsMode
permissionsMode) (\s :: UpdateLedgerPermissionsMode
s@UpdateLedgerPermissionsMode' {} PermissionsMode
a -> UpdateLedgerPermissionsMode
s {$sel:permissionsMode:UpdateLedgerPermissionsMode' :: PermissionsMode
permissionsMode = PermissionsMode
a} :: UpdateLedgerPermissionsMode)

instance Core.AWSRequest UpdateLedgerPermissionsMode where
  type
    AWSResponse UpdateLedgerPermissionsMode =
      UpdateLedgerPermissionsModeResponse
  request :: UpdateLedgerPermissionsMode -> Request UpdateLedgerPermissionsMode
request = Service
-> UpdateLedgerPermissionsMode
-> Request UpdateLedgerPermissionsMode
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateLedgerPermissionsMode
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLedgerPermissionsMode)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateLedgerPermissionsMode))
-> Logger
-> Service
-> Proxy UpdateLedgerPermissionsMode
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateLedgerPermissionsMode)))
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 Text
-> Maybe PermissionsMode
-> Int
-> UpdateLedgerPermissionsModeResponse
UpdateLedgerPermissionsModeResponse'
            (Maybe Text
 -> Maybe Text
 -> Maybe PermissionsMode
 -> Int
 -> UpdateLedgerPermissionsModeResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe PermissionsMode
      -> Int
      -> UpdateLedgerPermissionsModeResponse)
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
"Arn")
            Either
  String
  (Maybe Text
   -> Maybe PermissionsMode
   -> Int
   -> UpdateLedgerPermissionsModeResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe PermissionsMode
      -> Int -> UpdateLedgerPermissionsModeResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Name")
            Either
  String
  (Maybe PermissionsMode
   -> Int -> UpdateLedgerPermissionsModeResponse)
-> Either String (Maybe PermissionsMode)
-> Either String (Int -> UpdateLedgerPermissionsModeResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe PermissionsMode)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PermissionsMode")
            Either String (Int -> UpdateLedgerPermissionsModeResponse)
-> Either String Int
-> Either String UpdateLedgerPermissionsModeResponse
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 UpdateLedgerPermissionsMode

instance Prelude.NFData UpdateLedgerPermissionsMode

instance Core.ToHeaders UpdateLedgerPermissionsMode where
  toHeaders :: UpdateLedgerPermissionsMode -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateLedgerPermissionsMode -> 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.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateLedgerPermissionsMode where
  toJSON :: UpdateLedgerPermissionsMode -> Value
toJSON UpdateLedgerPermissionsMode' {Text
PermissionsMode
permissionsMode :: PermissionsMode
name :: Text
$sel:permissionsMode:UpdateLedgerPermissionsMode' :: UpdateLedgerPermissionsMode -> PermissionsMode
$sel:name:UpdateLedgerPermissionsMode' :: UpdateLedgerPermissionsMode -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"PermissionsMode" Text -> PermissionsMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= PermissionsMode
permissionsMode)
          ]
      )

instance Core.ToPath UpdateLedgerPermissionsMode where
  toPath :: UpdateLedgerPermissionsMode -> ByteString
toPath UpdateLedgerPermissionsMode' {Text
PermissionsMode
permissionsMode :: PermissionsMode
name :: Text
$sel:permissionsMode:UpdateLedgerPermissionsMode' :: UpdateLedgerPermissionsMode -> PermissionsMode
$sel:name:UpdateLedgerPermissionsMode' :: UpdateLedgerPermissionsMode -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/ledgers/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name, ByteString
"/permissions-mode"]

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

-- | /See:/ 'newUpdateLedgerPermissionsModeResponse' smart constructor.
data UpdateLedgerPermissionsModeResponse = UpdateLedgerPermissionsModeResponse'
  { -- | The Amazon Resource Name (ARN) for the ledger.
    UpdateLedgerPermissionsModeResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the ledger.
    UpdateLedgerPermissionsModeResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current permissions mode of the ledger.
    UpdateLedgerPermissionsModeResponse -> Maybe PermissionsMode
permissionsMode :: Prelude.Maybe PermissionsMode,
    -- | The response's http status code.
    UpdateLedgerPermissionsModeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateLedgerPermissionsModeResponse
-> UpdateLedgerPermissionsModeResponse -> Bool
(UpdateLedgerPermissionsModeResponse
 -> UpdateLedgerPermissionsModeResponse -> Bool)
-> (UpdateLedgerPermissionsModeResponse
    -> UpdateLedgerPermissionsModeResponse -> Bool)
-> Eq UpdateLedgerPermissionsModeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateLedgerPermissionsModeResponse
-> UpdateLedgerPermissionsModeResponse -> Bool
$c/= :: UpdateLedgerPermissionsModeResponse
-> UpdateLedgerPermissionsModeResponse -> Bool
== :: UpdateLedgerPermissionsModeResponse
-> UpdateLedgerPermissionsModeResponse -> Bool
$c== :: UpdateLedgerPermissionsModeResponse
-> UpdateLedgerPermissionsModeResponse -> Bool
Prelude.Eq, ReadPrec [UpdateLedgerPermissionsModeResponse]
ReadPrec UpdateLedgerPermissionsModeResponse
Int -> ReadS UpdateLedgerPermissionsModeResponse
ReadS [UpdateLedgerPermissionsModeResponse]
(Int -> ReadS UpdateLedgerPermissionsModeResponse)
-> ReadS [UpdateLedgerPermissionsModeResponse]
-> ReadPrec UpdateLedgerPermissionsModeResponse
-> ReadPrec [UpdateLedgerPermissionsModeResponse]
-> Read UpdateLedgerPermissionsModeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateLedgerPermissionsModeResponse]
$creadListPrec :: ReadPrec [UpdateLedgerPermissionsModeResponse]
readPrec :: ReadPrec UpdateLedgerPermissionsModeResponse
$creadPrec :: ReadPrec UpdateLedgerPermissionsModeResponse
readList :: ReadS [UpdateLedgerPermissionsModeResponse]
$creadList :: ReadS [UpdateLedgerPermissionsModeResponse]
readsPrec :: Int -> ReadS UpdateLedgerPermissionsModeResponse
$creadsPrec :: Int -> ReadS UpdateLedgerPermissionsModeResponse
Prelude.Read, Int -> UpdateLedgerPermissionsModeResponse -> ShowS
[UpdateLedgerPermissionsModeResponse] -> ShowS
UpdateLedgerPermissionsModeResponse -> String
(Int -> UpdateLedgerPermissionsModeResponse -> ShowS)
-> (UpdateLedgerPermissionsModeResponse -> String)
-> ([UpdateLedgerPermissionsModeResponse] -> ShowS)
-> Show UpdateLedgerPermissionsModeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateLedgerPermissionsModeResponse] -> ShowS
$cshowList :: [UpdateLedgerPermissionsModeResponse] -> ShowS
show :: UpdateLedgerPermissionsModeResponse -> String
$cshow :: UpdateLedgerPermissionsModeResponse -> String
showsPrec :: Int -> UpdateLedgerPermissionsModeResponse -> ShowS
$cshowsPrec :: Int -> UpdateLedgerPermissionsModeResponse -> ShowS
Prelude.Show, (forall x.
 UpdateLedgerPermissionsModeResponse
 -> Rep UpdateLedgerPermissionsModeResponse x)
-> (forall x.
    Rep UpdateLedgerPermissionsModeResponse x
    -> UpdateLedgerPermissionsModeResponse)
-> Generic UpdateLedgerPermissionsModeResponse
forall x.
Rep UpdateLedgerPermissionsModeResponse x
-> UpdateLedgerPermissionsModeResponse
forall x.
UpdateLedgerPermissionsModeResponse
-> Rep UpdateLedgerPermissionsModeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateLedgerPermissionsModeResponse x
-> UpdateLedgerPermissionsModeResponse
$cfrom :: forall x.
UpdateLedgerPermissionsModeResponse
-> Rep UpdateLedgerPermissionsModeResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateLedgerPermissionsModeResponse' 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:
--
-- 'arn', 'updateLedgerPermissionsModeResponse_arn' - The Amazon Resource Name (ARN) for the ledger.
--
-- 'name', 'updateLedgerPermissionsModeResponse_name' - The name of the ledger.
--
-- 'permissionsMode', 'updateLedgerPermissionsModeResponse_permissionsMode' - The current permissions mode of the ledger.
--
-- 'httpStatus', 'updateLedgerPermissionsModeResponse_httpStatus' - The response's http status code.
newUpdateLedgerPermissionsModeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateLedgerPermissionsModeResponse
newUpdateLedgerPermissionsModeResponse :: Int -> UpdateLedgerPermissionsModeResponse
newUpdateLedgerPermissionsModeResponse Int
pHttpStatus_ =
  UpdateLedgerPermissionsModeResponse' :: Maybe Text
-> Maybe Text
-> Maybe PermissionsMode
-> Int
-> UpdateLedgerPermissionsModeResponse
UpdateLedgerPermissionsModeResponse'
    { $sel:arn:UpdateLedgerPermissionsModeResponse' :: Maybe Text
arn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:UpdateLedgerPermissionsModeResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionsMode:UpdateLedgerPermissionsModeResponse' :: Maybe PermissionsMode
permissionsMode = Maybe PermissionsMode
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateLedgerPermissionsModeResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name (ARN) for the ledger.
updateLedgerPermissionsModeResponse_arn :: Lens.Lens' UpdateLedgerPermissionsModeResponse (Prelude.Maybe Prelude.Text)
updateLedgerPermissionsModeResponse_arn :: (Maybe Text -> f (Maybe Text))
-> UpdateLedgerPermissionsModeResponse
-> f UpdateLedgerPermissionsModeResponse
updateLedgerPermissionsModeResponse_arn = (UpdateLedgerPermissionsModeResponse -> Maybe Text)
-> (UpdateLedgerPermissionsModeResponse
    -> Maybe Text -> UpdateLedgerPermissionsModeResponse)
-> Lens
     UpdateLedgerPermissionsModeResponse
     UpdateLedgerPermissionsModeResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLedgerPermissionsModeResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:UpdateLedgerPermissionsModeResponse' :: UpdateLedgerPermissionsModeResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: UpdateLedgerPermissionsModeResponse
s@UpdateLedgerPermissionsModeResponse' {} Maybe Text
a -> UpdateLedgerPermissionsModeResponse
s {$sel:arn:UpdateLedgerPermissionsModeResponse' :: Maybe Text
arn = Maybe Text
a} :: UpdateLedgerPermissionsModeResponse)

-- | The name of the ledger.
updateLedgerPermissionsModeResponse_name :: Lens.Lens' UpdateLedgerPermissionsModeResponse (Prelude.Maybe Prelude.Text)
updateLedgerPermissionsModeResponse_name :: (Maybe Text -> f (Maybe Text))
-> UpdateLedgerPermissionsModeResponse
-> f UpdateLedgerPermissionsModeResponse
updateLedgerPermissionsModeResponse_name = (UpdateLedgerPermissionsModeResponse -> Maybe Text)
-> (UpdateLedgerPermissionsModeResponse
    -> Maybe Text -> UpdateLedgerPermissionsModeResponse)
-> Lens
     UpdateLedgerPermissionsModeResponse
     UpdateLedgerPermissionsModeResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLedgerPermissionsModeResponse' {Maybe Text
name :: Maybe Text
$sel:name:UpdateLedgerPermissionsModeResponse' :: UpdateLedgerPermissionsModeResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: UpdateLedgerPermissionsModeResponse
s@UpdateLedgerPermissionsModeResponse' {} Maybe Text
a -> UpdateLedgerPermissionsModeResponse
s {$sel:name:UpdateLedgerPermissionsModeResponse' :: Maybe Text
name = Maybe Text
a} :: UpdateLedgerPermissionsModeResponse)

-- | The current permissions mode of the ledger.
updateLedgerPermissionsModeResponse_permissionsMode :: Lens.Lens' UpdateLedgerPermissionsModeResponse (Prelude.Maybe PermissionsMode)
updateLedgerPermissionsModeResponse_permissionsMode :: (Maybe PermissionsMode -> f (Maybe PermissionsMode))
-> UpdateLedgerPermissionsModeResponse
-> f UpdateLedgerPermissionsModeResponse
updateLedgerPermissionsModeResponse_permissionsMode = (UpdateLedgerPermissionsModeResponse -> Maybe PermissionsMode)
-> (UpdateLedgerPermissionsModeResponse
    -> Maybe PermissionsMode -> UpdateLedgerPermissionsModeResponse)
-> Lens
     UpdateLedgerPermissionsModeResponse
     UpdateLedgerPermissionsModeResponse
     (Maybe PermissionsMode)
     (Maybe PermissionsMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateLedgerPermissionsModeResponse' {Maybe PermissionsMode
permissionsMode :: Maybe PermissionsMode
$sel:permissionsMode:UpdateLedgerPermissionsModeResponse' :: UpdateLedgerPermissionsModeResponse -> Maybe PermissionsMode
permissionsMode} -> Maybe PermissionsMode
permissionsMode) (\s :: UpdateLedgerPermissionsModeResponse
s@UpdateLedgerPermissionsModeResponse' {} Maybe PermissionsMode
a -> UpdateLedgerPermissionsModeResponse
s {$sel:permissionsMode:UpdateLedgerPermissionsModeResponse' :: Maybe PermissionsMode
permissionsMode = Maybe PermissionsMode
a} :: UpdateLedgerPermissionsModeResponse)

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

instance
  Prelude.NFData
    UpdateLedgerPermissionsModeResponse