{-# 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 #-}
module Amazonka.QLDB.CreateLedger
(
CreateLedger (..),
newCreateLedger,
createLedger_deletionProtection,
createLedger_kmsKey,
createLedger_tags,
createLedger_name,
createLedger_permissionsMode,
CreateLedgerResponse (..),
newCreateLedgerResponse,
createLedgerResponse_state,
createLedgerResponse_deletionProtection,
createLedgerResponse_kmsKeyArn,
createLedgerResponse_arn,
createLedgerResponse_name,
createLedgerResponse_creationDateTime,
createLedgerResponse_permissionsMode,
createLedgerResponse_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
data CreateLedger = CreateLedger'
{
CreateLedger -> Maybe Bool
deletionProtection :: Prelude.Maybe Prelude.Bool,
CreateLedger -> Maybe Text
kmsKey :: Prelude.Maybe Prelude.Text,
CreateLedger -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
CreateLedger -> Text
name :: Prelude.Text,
CreateLedger -> PermissionsMode
permissionsMode :: PermissionsMode
}
deriving (CreateLedger -> CreateLedger -> Bool
(CreateLedger -> CreateLedger -> Bool)
-> (CreateLedger -> CreateLedger -> Bool) -> Eq CreateLedger
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLedger -> CreateLedger -> Bool
$c/= :: CreateLedger -> CreateLedger -> Bool
== :: CreateLedger -> CreateLedger -> Bool
$c== :: CreateLedger -> CreateLedger -> Bool
Prelude.Eq, ReadPrec [CreateLedger]
ReadPrec CreateLedger
Int -> ReadS CreateLedger
ReadS [CreateLedger]
(Int -> ReadS CreateLedger)
-> ReadS [CreateLedger]
-> ReadPrec CreateLedger
-> ReadPrec [CreateLedger]
-> Read CreateLedger
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLedger]
$creadListPrec :: ReadPrec [CreateLedger]
readPrec :: ReadPrec CreateLedger
$creadPrec :: ReadPrec CreateLedger
readList :: ReadS [CreateLedger]
$creadList :: ReadS [CreateLedger]
readsPrec :: Int -> ReadS CreateLedger
$creadsPrec :: Int -> ReadS CreateLedger
Prelude.Read, Int -> CreateLedger -> ShowS
[CreateLedger] -> ShowS
CreateLedger -> String
(Int -> CreateLedger -> ShowS)
-> (CreateLedger -> String)
-> ([CreateLedger] -> ShowS)
-> Show CreateLedger
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLedger] -> ShowS
$cshowList :: [CreateLedger] -> ShowS
show :: CreateLedger -> String
$cshow :: CreateLedger -> String
showsPrec :: Int -> CreateLedger -> ShowS
$cshowsPrec :: Int -> CreateLedger -> ShowS
Prelude.Show, (forall x. CreateLedger -> Rep CreateLedger x)
-> (forall x. Rep CreateLedger x -> CreateLedger)
-> Generic CreateLedger
forall x. Rep CreateLedger x -> CreateLedger
forall x. CreateLedger -> Rep CreateLedger x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLedger x -> CreateLedger
$cfrom :: forall x. CreateLedger -> Rep CreateLedger x
Prelude.Generic)
newCreateLedger ::
Prelude.Text ->
PermissionsMode ->
CreateLedger
newCreateLedger :: Text -> PermissionsMode -> CreateLedger
newCreateLedger Text
pName_ PermissionsMode
pPermissionsMode_ =
CreateLedger' :: Maybe Bool
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> PermissionsMode
-> CreateLedger
CreateLedger'
{ $sel:deletionProtection:CreateLedger' :: Maybe Bool
deletionProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKey:CreateLedger' :: Maybe Text
kmsKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tags:CreateLedger' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateLedger' :: Text
name = Text
pName_,
$sel:permissionsMode:CreateLedger' :: PermissionsMode
permissionsMode = PermissionsMode
pPermissionsMode_
}
createLedger_deletionProtection :: Lens.Lens' CreateLedger (Prelude.Maybe Prelude.Bool)
createLedger_deletionProtection :: (Maybe Bool -> f (Maybe Bool)) -> CreateLedger -> f CreateLedger
createLedger_deletionProtection = (CreateLedger -> Maybe Bool)
-> (CreateLedger -> Maybe Bool -> CreateLedger)
-> Lens CreateLedger CreateLedger (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedger' {Maybe Bool
deletionProtection :: Maybe Bool
$sel:deletionProtection:CreateLedger' :: CreateLedger -> Maybe Bool
deletionProtection} -> Maybe Bool
deletionProtection) (\s :: CreateLedger
s@CreateLedger' {} Maybe Bool
a -> CreateLedger
s {$sel:deletionProtection:CreateLedger' :: Maybe Bool
deletionProtection = Maybe Bool
a} :: CreateLedger)
createLedger_kmsKey :: Lens.Lens' CreateLedger (Prelude.Maybe Prelude.Text)
createLedger_kmsKey :: (Maybe Text -> f (Maybe Text)) -> CreateLedger -> f CreateLedger
createLedger_kmsKey = (CreateLedger -> Maybe Text)
-> (CreateLedger -> Maybe Text -> CreateLedger)
-> Lens CreateLedger CreateLedger (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedger' {Maybe Text
kmsKey :: Maybe Text
$sel:kmsKey:CreateLedger' :: CreateLedger -> Maybe Text
kmsKey} -> Maybe Text
kmsKey) (\s :: CreateLedger
s@CreateLedger' {} Maybe Text
a -> CreateLedger
s {$sel:kmsKey:CreateLedger' :: Maybe Text
kmsKey = Maybe Text
a} :: CreateLedger)
createLedger_tags :: Lens.Lens' CreateLedger (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
createLedger_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateLedger -> f CreateLedger
createLedger_tags = (CreateLedger -> Maybe (HashMap Text Text))
-> (CreateLedger -> Maybe (HashMap Text Text) -> CreateLedger)
-> Lens
CreateLedger
CreateLedger
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedger' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:CreateLedger' :: CreateLedger -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: CreateLedger
s@CreateLedger' {} Maybe (HashMap Text Text)
a -> CreateLedger
s {$sel:tags:CreateLedger' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: CreateLedger) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateLedger -> f CreateLedger)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> CreateLedger
-> f CreateLedger
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createLedger_name :: Lens.Lens' CreateLedger Prelude.Text
createLedger_name :: (Text -> f Text) -> CreateLedger -> f CreateLedger
createLedger_name = (CreateLedger -> Text)
-> (CreateLedger -> Text -> CreateLedger)
-> Lens CreateLedger CreateLedger Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedger' {Text
name :: Text
$sel:name:CreateLedger' :: CreateLedger -> Text
name} -> Text
name) (\s :: CreateLedger
s@CreateLedger' {} Text
a -> CreateLedger
s {$sel:name:CreateLedger' :: Text
name = Text
a} :: CreateLedger)
createLedger_permissionsMode :: Lens.Lens' CreateLedger PermissionsMode
createLedger_permissionsMode :: (PermissionsMode -> f PermissionsMode)
-> CreateLedger -> f CreateLedger
createLedger_permissionsMode = (CreateLedger -> PermissionsMode)
-> (CreateLedger -> PermissionsMode -> CreateLedger)
-> Lens CreateLedger CreateLedger PermissionsMode PermissionsMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedger' {PermissionsMode
permissionsMode :: PermissionsMode
$sel:permissionsMode:CreateLedger' :: CreateLedger -> PermissionsMode
permissionsMode} -> PermissionsMode
permissionsMode) (\s :: CreateLedger
s@CreateLedger' {} PermissionsMode
a -> CreateLedger
s {$sel:permissionsMode:CreateLedger' :: PermissionsMode
permissionsMode = PermissionsMode
a} :: CreateLedger)
instance Core.AWSRequest CreateLedger where
type AWSResponse CreateLedger = CreateLedgerResponse
request :: CreateLedger -> Request CreateLedger
request = Service -> CreateLedger -> Request CreateLedger
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy CreateLedger
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateLedger)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse CreateLedger))
-> Logger
-> Service
-> Proxy CreateLedger
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateLedger)))
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 LedgerState
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse
CreateLedgerResponse'
(Maybe LedgerState
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
-> Either String (Maybe LedgerState)
-> Either
String
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe LedgerState)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"State")
Either
String
(Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
-> Either String (Maybe Bool)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DeletionProtection")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
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
"KmsKeyArn")
Either
String
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
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
"Arn")
Either
String
(Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe POSIX
-> Maybe PermissionsMode -> Int -> CreateLedgerResponse)
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 POSIX
-> Maybe PermissionsMode -> Int -> CreateLedgerResponse)
-> Either String (Maybe POSIX)
-> Either
String (Maybe PermissionsMode -> Int -> CreateLedgerResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CreationDateTime")
Either
String (Maybe PermissionsMode -> Int -> CreateLedgerResponse)
-> Either String (Maybe PermissionsMode)
-> Either String (Int -> CreateLedgerResponse)
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 -> CreateLedgerResponse)
-> Either String Int -> Either String CreateLedgerResponse
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 CreateLedger
instance Prelude.NFData CreateLedger
instance Core.ToHeaders CreateLedger where
toHeaders :: CreateLedger -> ResponseHeaders
toHeaders =
ResponseHeaders -> CreateLedger -> 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 CreateLedger where
toJSON :: CreateLedger -> Value
toJSON CreateLedger' {Maybe Bool
Maybe Text
Maybe (HashMap Text Text)
Text
PermissionsMode
permissionsMode :: PermissionsMode
name :: Text
tags :: Maybe (HashMap Text Text)
kmsKey :: Maybe Text
deletionProtection :: Maybe Bool
$sel:permissionsMode:CreateLedger' :: CreateLedger -> PermissionsMode
$sel:name:CreateLedger' :: CreateLedger -> Text
$sel:tags:CreateLedger' :: CreateLedger -> Maybe (HashMap Text Text)
$sel:kmsKey:CreateLedger' :: CreateLedger -> Maybe Text
$sel:deletionProtection:CreateLedger' :: CreateLedger -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DeletionProtection" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
deletionProtection,
(Text
"KmsKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKey,
(Text
"Tags" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
tags,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
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 CreateLedger where
toPath :: CreateLedger -> ByteString
toPath = ByteString -> CreateLedger -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/ledgers"
instance Core.ToQuery CreateLedger where
toQuery :: CreateLedger -> QueryString
toQuery = QueryString -> CreateLedger -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateLedgerResponse = CreateLedgerResponse'
{
CreateLedgerResponse -> Maybe LedgerState
state :: Prelude.Maybe LedgerState,
CreateLedgerResponse -> Maybe Bool
deletionProtection :: Prelude.Maybe Prelude.Bool,
CreateLedgerResponse -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
CreateLedgerResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
CreateLedgerResponse -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
CreateLedgerResponse -> Maybe POSIX
creationDateTime :: Prelude.Maybe Core.POSIX,
CreateLedgerResponse -> Maybe PermissionsMode
permissionsMode :: Prelude.Maybe PermissionsMode,
CreateLedgerResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateLedgerResponse -> CreateLedgerResponse -> Bool
(CreateLedgerResponse -> CreateLedgerResponse -> Bool)
-> (CreateLedgerResponse -> CreateLedgerResponse -> Bool)
-> Eq CreateLedgerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateLedgerResponse -> CreateLedgerResponse -> Bool
$c/= :: CreateLedgerResponse -> CreateLedgerResponse -> Bool
== :: CreateLedgerResponse -> CreateLedgerResponse -> Bool
$c== :: CreateLedgerResponse -> CreateLedgerResponse -> Bool
Prelude.Eq, ReadPrec [CreateLedgerResponse]
ReadPrec CreateLedgerResponse
Int -> ReadS CreateLedgerResponse
ReadS [CreateLedgerResponse]
(Int -> ReadS CreateLedgerResponse)
-> ReadS [CreateLedgerResponse]
-> ReadPrec CreateLedgerResponse
-> ReadPrec [CreateLedgerResponse]
-> Read CreateLedgerResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateLedgerResponse]
$creadListPrec :: ReadPrec [CreateLedgerResponse]
readPrec :: ReadPrec CreateLedgerResponse
$creadPrec :: ReadPrec CreateLedgerResponse
readList :: ReadS [CreateLedgerResponse]
$creadList :: ReadS [CreateLedgerResponse]
readsPrec :: Int -> ReadS CreateLedgerResponse
$creadsPrec :: Int -> ReadS CreateLedgerResponse
Prelude.Read, Int -> CreateLedgerResponse -> ShowS
[CreateLedgerResponse] -> ShowS
CreateLedgerResponse -> String
(Int -> CreateLedgerResponse -> ShowS)
-> (CreateLedgerResponse -> String)
-> ([CreateLedgerResponse] -> ShowS)
-> Show CreateLedgerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateLedgerResponse] -> ShowS
$cshowList :: [CreateLedgerResponse] -> ShowS
show :: CreateLedgerResponse -> String
$cshow :: CreateLedgerResponse -> String
showsPrec :: Int -> CreateLedgerResponse -> ShowS
$cshowsPrec :: Int -> CreateLedgerResponse -> ShowS
Prelude.Show, (forall x. CreateLedgerResponse -> Rep CreateLedgerResponse x)
-> (forall x. Rep CreateLedgerResponse x -> CreateLedgerResponse)
-> Generic CreateLedgerResponse
forall x. Rep CreateLedgerResponse x -> CreateLedgerResponse
forall x. CreateLedgerResponse -> Rep CreateLedgerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateLedgerResponse x -> CreateLedgerResponse
$cfrom :: forall x. CreateLedgerResponse -> Rep CreateLedgerResponse x
Prelude.Generic)
newCreateLedgerResponse ::
Prelude.Int ->
CreateLedgerResponse
newCreateLedgerResponse :: Int -> CreateLedgerResponse
newCreateLedgerResponse Int
pHttpStatus_ =
CreateLedgerResponse' :: Maybe LedgerState
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe PermissionsMode
-> Int
-> CreateLedgerResponse
CreateLedgerResponse'
{ $sel:state:CreateLedgerResponse' :: Maybe LedgerState
state = Maybe LedgerState
forall a. Maybe a
Prelude.Nothing,
$sel:deletionProtection:CreateLedgerResponse' :: Maybe Bool
deletionProtection = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyArn:CreateLedgerResponse' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:arn:CreateLedgerResponse' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:CreateLedgerResponse' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:creationDateTime:CreateLedgerResponse' :: Maybe POSIX
creationDateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:permissionsMode:CreateLedgerResponse' :: Maybe PermissionsMode
permissionsMode = Maybe PermissionsMode
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateLedgerResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createLedgerResponse_state :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe LedgerState)
createLedgerResponse_state :: (Maybe LedgerState -> f (Maybe LedgerState))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_state = (CreateLedgerResponse -> Maybe LedgerState)
-> (CreateLedgerResponse
-> Maybe LedgerState -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse
CreateLedgerResponse
(Maybe LedgerState)
(Maybe LedgerState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe LedgerState
state :: Maybe LedgerState
$sel:state:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe LedgerState
state} -> Maybe LedgerState
state) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe LedgerState
a -> CreateLedgerResponse
s {$sel:state:CreateLedgerResponse' :: Maybe LedgerState
state = Maybe LedgerState
a} :: CreateLedgerResponse)
createLedgerResponse_deletionProtection :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe Prelude.Bool)
createLedgerResponse_deletionProtection :: (Maybe Bool -> f (Maybe Bool))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_deletionProtection = (CreateLedgerResponse -> Maybe Bool)
-> (CreateLedgerResponse -> Maybe Bool -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse CreateLedgerResponse (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe Bool
deletionProtection :: Maybe Bool
$sel:deletionProtection:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe Bool
deletionProtection} -> Maybe Bool
deletionProtection) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe Bool
a -> CreateLedgerResponse
s {$sel:deletionProtection:CreateLedgerResponse' :: Maybe Bool
deletionProtection = Maybe Bool
a} :: CreateLedgerResponse)
createLedgerResponse_kmsKeyArn :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe Prelude.Text)
createLedgerResponse_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_kmsKeyArn = (CreateLedgerResponse -> Maybe Text)
-> (CreateLedgerResponse -> Maybe Text -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse CreateLedgerResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe Text
a -> CreateLedgerResponse
s {$sel:kmsKeyArn:CreateLedgerResponse' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: CreateLedgerResponse)
createLedgerResponse_arn :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe Prelude.Text)
createLedgerResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_arn = (CreateLedgerResponse -> Maybe Text)
-> (CreateLedgerResponse -> Maybe Text -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse CreateLedgerResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe Text
a -> CreateLedgerResponse
s {$sel:arn:CreateLedgerResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateLedgerResponse)
createLedgerResponse_name :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe Prelude.Text)
createLedgerResponse_name :: (Maybe Text -> f (Maybe Text))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_name = (CreateLedgerResponse -> Maybe Text)
-> (CreateLedgerResponse -> Maybe Text -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse CreateLedgerResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe Text
name :: Maybe Text
$sel:name:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe Text
a -> CreateLedgerResponse
s {$sel:name:CreateLedgerResponse' :: Maybe Text
name = Maybe Text
a} :: CreateLedgerResponse)
createLedgerResponse_creationDateTime :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe Prelude.UTCTime)
createLedgerResponse_creationDateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_creationDateTime = (CreateLedgerResponse -> Maybe POSIX)
-> (CreateLedgerResponse -> Maybe POSIX -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse
CreateLedgerResponse
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe POSIX
creationDateTime :: Maybe POSIX
$sel:creationDateTime:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe POSIX
creationDateTime} -> Maybe POSIX
creationDateTime) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe POSIX
a -> CreateLedgerResponse
s {$sel:creationDateTime:CreateLedgerResponse' :: Maybe POSIX
creationDateTime = Maybe POSIX
a} :: CreateLedgerResponse) ((Maybe POSIX -> f (Maybe POSIX))
-> CreateLedgerResponse -> f CreateLedgerResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> CreateLedgerResponse
-> f CreateLedgerResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
createLedgerResponse_permissionsMode :: Lens.Lens' CreateLedgerResponse (Prelude.Maybe PermissionsMode)
createLedgerResponse_permissionsMode :: (Maybe PermissionsMode -> f (Maybe PermissionsMode))
-> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_permissionsMode = (CreateLedgerResponse -> Maybe PermissionsMode)
-> (CreateLedgerResponse
-> Maybe PermissionsMode -> CreateLedgerResponse)
-> Lens
CreateLedgerResponse
CreateLedgerResponse
(Maybe PermissionsMode)
(Maybe PermissionsMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Maybe PermissionsMode
permissionsMode :: Maybe PermissionsMode
$sel:permissionsMode:CreateLedgerResponse' :: CreateLedgerResponse -> Maybe PermissionsMode
permissionsMode} -> Maybe PermissionsMode
permissionsMode) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Maybe PermissionsMode
a -> CreateLedgerResponse
s {$sel:permissionsMode:CreateLedgerResponse' :: Maybe PermissionsMode
permissionsMode = Maybe PermissionsMode
a} :: CreateLedgerResponse)
createLedgerResponse_httpStatus :: Lens.Lens' CreateLedgerResponse Prelude.Int
createLedgerResponse_httpStatus :: (Int -> f Int) -> CreateLedgerResponse -> f CreateLedgerResponse
createLedgerResponse_httpStatus = (CreateLedgerResponse -> Int)
-> (CreateLedgerResponse -> Int -> CreateLedgerResponse)
-> Lens CreateLedgerResponse CreateLedgerResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateLedgerResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateLedgerResponse' :: CreateLedgerResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateLedgerResponse
s@CreateLedgerResponse' {} Int
a -> CreateLedgerResponse
s {$sel:httpStatus:CreateLedgerResponse' :: Int
httpStatus = Int
a} :: CreateLedgerResponse)
instance Prelude.NFData CreateLedgerResponse