{-# 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.LexModels.Types.LogSettingsRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LexModels.Types.Destination
import Amazonka.LexModels.Types.LogType
import qualified Amazonka.Prelude as Prelude
data LogSettingsRequest = LogSettingsRequest'
{
LogSettingsRequest -> Maybe Text
kmsKeyArn :: Prelude.Maybe Prelude.Text,
LogSettingsRequest -> LogType
logType :: LogType,
LogSettingsRequest -> Destination
destination :: Destination,
LogSettingsRequest -> Text
resourceArn :: Prelude.Text
}
deriving (LogSettingsRequest -> LogSettingsRequest -> Bool
(LogSettingsRequest -> LogSettingsRequest -> Bool)
-> (LogSettingsRequest -> LogSettingsRequest -> Bool)
-> Eq LogSettingsRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LogSettingsRequest -> LogSettingsRequest -> Bool
$c/= :: LogSettingsRequest -> LogSettingsRequest -> Bool
== :: LogSettingsRequest -> LogSettingsRequest -> Bool
$c== :: LogSettingsRequest -> LogSettingsRequest -> Bool
Prelude.Eq, ReadPrec [LogSettingsRequest]
ReadPrec LogSettingsRequest
Int -> ReadS LogSettingsRequest
ReadS [LogSettingsRequest]
(Int -> ReadS LogSettingsRequest)
-> ReadS [LogSettingsRequest]
-> ReadPrec LogSettingsRequest
-> ReadPrec [LogSettingsRequest]
-> Read LogSettingsRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LogSettingsRequest]
$creadListPrec :: ReadPrec [LogSettingsRequest]
readPrec :: ReadPrec LogSettingsRequest
$creadPrec :: ReadPrec LogSettingsRequest
readList :: ReadS [LogSettingsRequest]
$creadList :: ReadS [LogSettingsRequest]
readsPrec :: Int -> ReadS LogSettingsRequest
$creadsPrec :: Int -> ReadS LogSettingsRequest
Prelude.Read, Int -> LogSettingsRequest -> ShowS
[LogSettingsRequest] -> ShowS
LogSettingsRequest -> String
(Int -> LogSettingsRequest -> ShowS)
-> (LogSettingsRequest -> String)
-> ([LogSettingsRequest] -> ShowS)
-> Show LogSettingsRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LogSettingsRequest] -> ShowS
$cshowList :: [LogSettingsRequest] -> ShowS
show :: LogSettingsRequest -> String
$cshow :: LogSettingsRequest -> String
showsPrec :: Int -> LogSettingsRequest -> ShowS
$cshowsPrec :: Int -> LogSettingsRequest -> ShowS
Prelude.Show, (forall x. LogSettingsRequest -> Rep LogSettingsRequest x)
-> (forall x. Rep LogSettingsRequest x -> LogSettingsRequest)
-> Generic LogSettingsRequest
forall x. Rep LogSettingsRequest x -> LogSettingsRequest
forall x. LogSettingsRequest -> Rep LogSettingsRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LogSettingsRequest x -> LogSettingsRequest
$cfrom :: forall x. LogSettingsRequest -> Rep LogSettingsRequest x
Prelude.Generic)
newLogSettingsRequest ::
LogType ->
Destination ->
Prelude.Text ->
LogSettingsRequest
newLogSettingsRequest :: LogType -> Destination -> Text -> LogSettingsRequest
newLogSettingsRequest
LogType
pLogType_
Destination
pDestination_
Text
pResourceArn_ =
LogSettingsRequest' :: Maybe Text -> LogType -> Destination -> Text -> LogSettingsRequest
LogSettingsRequest'
{ $sel:kmsKeyArn:LogSettingsRequest' :: Maybe Text
kmsKeyArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logType:LogSettingsRequest' :: LogType
logType = LogType
pLogType_,
$sel:destination:LogSettingsRequest' :: Destination
destination = Destination
pDestination_,
$sel:resourceArn:LogSettingsRequest' :: Text
resourceArn = Text
pResourceArn_
}
logSettingsRequest_kmsKeyArn :: Lens.Lens' LogSettingsRequest (Prelude.Maybe Prelude.Text)
logSettingsRequest_kmsKeyArn :: (Maybe Text -> f (Maybe Text))
-> LogSettingsRequest -> f LogSettingsRequest
logSettingsRequest_kmsKeyArn = (LogSettingsRequest -> Maybe Text)
-> (LogSettingsRequest -> Maybe Text -> LogSettingsRequest)
-> Lens
LogSettingsRequest LogSettingsRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsRequest' {Maybe Text
kmsKeyArn :: Maybe Text
$sel:kmsKeyArn:LogSettingsRequest' :: LogSettingsRequest -> Maybe Text
kmsKeyArn} -> Maybe Text
kmsKeyArn) (\s :: LogSettingsRequest
s@LogSettingsRequest' {} Maybe Text
a -> LogSettingsRequest
s {$sel:kmsKeyArn:LogSettingsRequest' :: Maybe Text
kmsKeyArn = Maybe Text
a} :: LogSettingsRequest)
logSettingsRequest_logType :: Lens.Lens' LogSettingsRequest LogType
logSettingsRequest_logType :: (LogType -> f LogType)
-> LogSettingsRequest -> f LogSettingsRequest
logSettingsRequest_logType = (LogSettingsRequest -> LogType)
-> (LogSettingsRequest -> LogType -> LogSettingsRequest)
-> Lens LogSettingsRequest LogSettingsRequest LogType LogType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsRequest' {LogType
logType :: LogType
$sel:logType:LogSettingsRequest' :: LogSettingsRequest -> LogType
logType} -> LogType
logType) (\s :: LogSettingsRequest
s@LogSettingsRequest' {} LogType
a -> LogSettingsRequest
s {$sel:logType:LogSettingsRequest' :: LogType
logType = LogType
a} :: LogSettingsRequest)
logSettingsRequest_destination :: Lens.Lens' LogSettingsRequest Destination
logSettingsRequest_destination :: (Destination -> f Destination)
-> LogSettingsRequest -> f LogSettingsRequest
logSettingsRequest_destination = (LogSettingsRequest -> Destination)
-> (LogSettingsRequest -> Destination -> LogSettingsRequest)
-> Lens
LogSettingsRequest LogSettingsRequest Destination Destination
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsRequest' {Destination
destination :: Destination
$sel:destination:LogSettingsRequest' :: LogSettingsRequest -> Destination
destination} -> Destination
destination) (\s :: LogSettingsRequest
s@LogSettingsRequest' {} Destination
a -> LogSettingsRequest
s {$sel:destination:LogSettingsRequest' :: Destination
destination = Destination
a} :: LogSettingsRequest)
logSettingsRequest_resourceArn :: Lens.Lens' LogSettingsRequest Prelude.Text
logSettingsRequest_resourceArn :: (Text -> f Text) -> LogSettingsRequest -> f LogSettingsRequest
logSettingsRequest_resourceArn = (LogSettingsRequest -> Text)
-> (LogSettingsRequest -> Text -> LogSettingsRequest)
-> Lens LogSettingsRequest LogSettingsRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LogSettingsRequest' {Text
resourceArn :: Text
$sel:resourceArn:LogSettingsRequest' :: LogSettingsRequest -> Text
resourceArn} -> Text
resourceArn) (\s :: LogSettingsRequest
s@LogSettingsRequest' {} Text
a -> LogSettingsRequest
s {$sel:resourceArn:LogSettingsRequest' :: Text
resourceArn = Text
a} :: LogSettingsRequest)
instance Prelude.Hashable LogSettingsRequest
instance Prelude.NFData LogSettingsRequest
instance Core.ToJSON LogSettingsRequest where
toJSON :: LogSettingsRequest -> Value
toJSON LogSettingsRequest' {Maybe Text
Text
Destination
LogType
resourceArn :: Text
destination :: Destination
logType :: LogType
kmsKeyArn :: Maybe Text
$sel:resourceArn:LogSettingsRequest' :: LogSettingsRequest -> Text
$sel:destination:LogSettingsRequest' :: LogSettingsRequest -> Destination
$sel:logType:LogSettingsRequest' :: LogSettingsRequest -> LogType
$sel:kmsKeyArn:LogSettingsRequest' :: LogSettingsRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"kmsKeyArn" 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
kmsKeyArn,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"logType" Text -> LogType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= LogType
logType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"destination" Text -> Destination -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Destination
destination),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resourceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceArn)
]
)