{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data StartSessionRequest = StartSessionRequest'
{
StartSessionRequest -> Text
ledgerName :: Prelude.Text
}
deriving (StartSessionRequest -> StartSessionRequest -> Bool
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]
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
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. 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' {$sel:ledgerName:StartSessionRequest' :: Text
ledgerName = Text
pLedgerName_}
startSessionRequest_ledgerName :: Lens.Lens' StartSessionRequest Prelude.Text
startSessionRequest_ledgerName :: Lens' StartSessionRequest Text
startSessionRequest_ledgerName = 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 where
hashWithSalt :: Int -> StartSessionRequest -> Int
hashWithSalt Int
_salt StartSessionRequest' {Text
ledgerName :: Text
$sel:ledgerName:StartSessionRequest' :: StartSessionRequest -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ledgerName
instance Prelude.NFData StartSessionRequest where
rnf :: StartSessionRequest -> ()
rnf StartSessionRequest' {Text
ledgerName :: Text
$sel:ledgerName:StartSessionRequest' :: StartSessionRequest -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
ledgerName
instance Data.ToJSON StartSessionRequest where
toJSON :: StartSessionRequest -> Value
toJSON StartSessionRequest' {Text
ledgerName :: Text
$sel:ledgerName:StartSessionRequest' :: StartSessionRequest -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"LedgerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
ledgerName)]
)