{-# 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.PinpointSmsVoiceV2.Types.KeywordInformation where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.PinpointSmsVoiceV2.Types.KeywordAction
import qualified Amazonka.Prelude as Prelude
data KeywordInformation = KeywordInformation'
{
KeywordInformation -> Text
keyword :: Prelude.Text,
KeywordInformation -> Text
keywordMessage :: Prelude.Text,
KeywordInformation -> KeywordAction
keywordAction :: KeywordAction
}
deriving (KeywordInformation -> KeywordInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: KeywordInformation -> KeywordInformation -> Bool
$c/= :: KeywordInformation -> KeywordInformation -> Bool
== :: KeywordInformation -> KeywordInformation -> Bool
$c== :: KeywordInformation -> KeywordInformation -> Bool
Prelude.Eq, ReadPrec [KeywordInformation]
ReadPrec KeywordInformation
Int -> ReadS KeywordInformation
ReadS [KeywordInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [KeywordInformation]
$creadListPrec :: ReadPrec [KeywordInformation]
readPrec :: ReadPrec KeywordInformation
$creadPrec :: ReadPrec KeywordInformation
readList :: ReadS [KeywordInformation]
$creadList :: ReadS [KeywordInformation]
readsPrec :: Int -> ReadS KeywordInformation
$creadsPrec :: Int -> ReadS KeywordInformation
Prelude.Read, Int -> KeywordInformation -> ShowS
[KeywordInformation] -> ShowS
KeywordInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [KeywordInformation] -> ShowS
$cshowList :: [KeywordInformation] -> ShowS
show :: KeywordInformation -> String
$cshow :: KeywordInformation -> String
showsPrec :: Int -> KeywordInformation -> ShowS
$cshowsPrec :: Int -> KeywordInformation -> ShowS
Prelude.Show, forall x. Rep KeywordInformation x -> KeywordInformation
forall x. KeywordInformation -> Rep KeywordInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep KeywordInformation x -> KeywordInformation
$cfrom :: forall x. KeywordInformation -> Rep KeywordInformation x
Prelude.Generic)
newKeywordInformation ::
Prelude.Text ->
Prelude.Text ->
KeywordAction ->
KeywordInformation
newKeywordInformation :: Text -> Text -> KeywordAction -> KeywordInformation
newKeywordInformation
Text
pKeyword_
Text
pKeywordMessage_
KeywordAction
pKeywordAction_ =
KeywordInformation'
{ $sel:keyword:KeywordInformation' :: Text
keyword = Text
pKeyword_,
$sel:keywordMessage:KeywordInformation' :: Text
keywordMessage = Text
pKeywordMessage_,
$sel:keywordAction:KeywordInformation' :: KeywordAction
keywordAction = KeywordAction
pKeywordAction_
}
keywordInformation_keyword :: Lens.Lens' KeywordInformation Prelude.Text
keywordInformation_keyword :: Lens' KeywordInformation Text
keywordInformation_keyword = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeywordInformation' {Text
keyword :: Text
$sel:keyword:KeywordInformation' :: KeywordInformation -> Text
keyword} -> Text
keyword) (\s :: KeywordInformation
s@KeywordInformation' {} Text
a -> KeywordInformation
s {$sel:keyword:KeywordInformation' :: Text
keyword = Text
a} :: KeywordInformation)
keywordInformation_keywordMessage :: Lens.Lens' KeywordInformation Prelude.Text
keywordInformation_keywordMessage :: Lens' KeywordInformation Text
keywordInformation_keywordMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeywordInformation' {Text
keywordMessage :: Text
$sel:keywordMessage:KeywordInformation' :: KeywordInformation -> Text
keywordMessage} -> Text
keywordMessage) (\s :: KeywordInformation
s@KeywordInformation' {} Text
a -> KeywordInformation
s {$sel:keywordMessage:KeywordInformation' :: Text
keywordMessage = Text
a} :: KeywordInformation)
keywordInformation_keywordAction :: Lens.Lens' KeywordInformation KeywordAction
keywordInformation_keywordAction :: Lens' KeywordInformation KeywordAction
keywordInformation_keywordAction = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\KeywordInformation' {KeywordAction
keywordAction :: KeywordAction
$sel:keywordAction:KeywordInformation' :: KeywordInformation -> KeywordAction
keywordAction} -> KeywordAction
keywordAction) (\s :: KeywordInformation
s@KeywordInformation' {} KeywordAction
a -> KeywordInformation
s {$sel:keywordAction:KeywordInformation' :: KeywordAction
keywordAction = KeywordAction
a} :: KeywordInformation)
instance Data.FromJSON KeywordInformation where
parseJSON :: Value -> Parser KeywordInformation
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"KeywordInformation"
( \Object
x ->
Text -> Text -> KeywordAction -> KeywordInformation
KeywordInformation'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Keyword")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"KeywordMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"KeywordAction")
)
instance Prelude.Hashable KeywordInformation where
hashWithSalt :: Int -> KeywordInformation -> Int
hashWithSalt Int
_salt KeywordInformation' {Text
KeywordAction
keywordAction :: KeywordAction
keywordMessage :: Text
keyword :: Text
$sel:keywordAction:KeywordInformation' :: KeywordInformation -> KeywordAction
$sel:keywordMessage:KeywordInformation' :: KeywordInformation -> Text
$sel:keyword:KeywordInformation' :: KeywordInformation -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyword
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keywordMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` KeywordAction
keywordAction
instance Prelude.NFData KeywordInformation where
rnf :: KeywordInformation -> ()
rnf KeywordInformation' {Text
KeywordAction
keywordAction :: KeywordAction
keywordMessage :: Text
keyword :: Text
$sel:keywordAction:KeywordInformation' :: KeywordInformation -> KeywordAction
$sel:keywordMessage:KeywordInformation' :: KeywordInformation -> Text
$sel:keyword:KeywordInformation' :: KeywordInformation -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
keyword
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
keywordMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf KeywordAction
keywordAction