{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.QLDBSession.Types.StartSessionRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data StartSessionRequest = StartSessionRequest'
{
StartSessionRequest -> Text
ledgerName :: Prelude.Text
}
deriving (StartSessionRequest -> StartSessionRequest -> Bool
(StartSessionRequest -> StartSessionRequest -> Bool)
-> (StartSessionRequest -> StartSessionRequest -> Bool)
-> Eq StartSessionRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartSessionRequest -> StartSessionRequest -> Bool
$c/= :: StartSessionRequest -> StartSessionRequest -> Bool
== :: StartSessionRequest -> StartSessionRequest -> Bool
$c== :: StartSessionRequest -> StartSessionRequest -> Bool
Prelude.Eq, ReadPrec [StartSessionRequest]
ReadPrec StartSessionRequest
Int -> ReadS StartSessionRequest
ReadS [StartSessionRequest]
(Int -> ReadS StartSessionRequest)
-> ReadS [StartSessionRequest]
-> ReadPrec StartSessionRequest
-> ReadPrec [StartSessionRequest]
-> Read StartSessionRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartSessionRequest]
$creadListPrec :: ReadPrec [StartSessionRequest]
readPrec :: ReadPrec StartSessionRequest
$creadPrec :: ReadPrec StartSessionRequest
readList :: ReadS [StartSessionRequest]
$creadList :: ReadS [StartSessionRequest]
readsPrec :: Int -> ReadS StartSessionRequest
$creadsPrec :: Int -> ReadS StartSessionRequest
Prelude.Read, Int -> StartSessionRequest -> ShowS
[StartSessionRequest] -> ShowS
StartSessionRequest -> String
(Int -> StartSessionRequest -> ShowS)
-> (StartSessionRequest -> String)
-> ([StartSessionRequest] -> ShowS)
-> Show StartSessionRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartSessionRequest] -> ShowS
$cshowList :: [StartSessionRequest] -> ShowS
show :: StartSessionRequest -> String
$cshow :: StartSessionRequest -> String
showsPrec :: Int -> StartSessionRequest -> ShowS
$cshowsPrec :: Int -> StartSessionRequest -> ShowS
Prelude.Show, (forall x. StartSessionRequest -> Rep StartSessionRequest x)
-> (forall x. Rep StartSessionRequest x -> StartSessionRequest)
-> Generic StartSessionRequest
forall x. Rep StartSessionRequest x -> StartSessionRequest
forall x. StartSessionRequest -> Rep StartSessionRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartSessionRequest x -> StartSessionRequest
$cfrom :: forall x. StartSessionRequest -> Rep StartSessionRequest x
Prelude.Generic)
newStartSessionRequest ::
Prelude.Text ->
StartSessionRequest
newStartSessionRequest :: Text -> StartSessionRequest
newStartSessionRequest Text
pLedgerName_ =
StartSessionRequest' :: Text -> StartSessionRequest
StartSessionRequest' {$sel:ledgerName:StartSessionRequest' :: Text
ledgerName = Text
pLedgerName_}
startSessionRequest_ledgerName :: Lens.Lens' StartSessionRequest Prelude.Text
startSessionRequest_ledgerName :: (Text -> f Text) -> StartSessionRequest -> f StartSessionRequest
startSessionRequest_ledgerName = (StartSessionRequest -> Text)
-> (StartSessionRequest -> Text -> StartSessionRequest)
-> Lens StartSessionRequest StartSessionRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartSessionRequest' {Text
ledgerName :: Text
$sel:ledgerName:StartSessionRequest' :: StartSessionRequest -> Text
ledgerName} -> Text
ledgerName) (\s :: StartSessionRequest
s@StartSessionRequest' {} Text
a -> StartSessionRequest
s {$sel:ledgerName:StartSessionRequest' :: Text
ledgerName = Text
a} :: StartSessionRequest)
instance Prelude.Hashable StartSessionRequest
instance Prelude.NFData StartSessionRequest
instance Core.ToJSON StartSessionRequest where
toJSON :: StartSessionRequest -> Value
toJSON StartSessionRequest' {Text
ledgerName :: Text
$sel:ledgerName:StartSessionRequest' :: StartSessionRequest -> 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
"LedgerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
ledgerName)]
)