{-# 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.SMS.Types.UserDataValidationParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SMS.Types.ScriptType
import Amazonka.SMS.Types.Source
data UserDataValidationParameters = UserDataValidationParameters'
{
UserDataValidationParameters -> Maybe ScriptType
scriptType :: Prelude.Maybe ScriptType,
UserDataValidationParameters -> Maybe Source
source :: Prelude.Maybe Source
}
deriving (UserDataValidationParameters
-> UserDataValidationParameters -> Bool
(UserDataValidationParameters
-> UserDataValidationParameters -> Bool)
-> (UserDataValidationParameters
-> UserDataValidationParameters -> Bool)
-> Eq UserDataValidationParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserDataValidationParameters
-> UserDataValidationParameters -> Bool
$c/= :: UserDataValidationParameters
-> UserDataValidationParameters -> Bool
== :: UserDataValidationParameters
-> UserDataValidationParameters -> Bool
$c== :: UserDataValidationParameters
-> UserDataValidationParameters -> Bool
Prelude.Eq, ReadPrec [UserDataValidationParameters]
ReadPrec UserDataValidationParameters
Int -> ReadS UserDataValidationParameters
ReadS [UserDataValidationParameters]
(Int -> ReadS UserDataValidationParameters)
-> ReadS [UserDataValidationParameters]
-> ReadPrec UserDataValidationParameters
-> ReadPrec [UserDataValidationParameters]
-> Read UserDataValidationParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserDataValidationParameters]
$creadListPrec :: ReadPrec [UserDataValidationParameters]
readPrec :: ReadPrec UserDataValidationParameters
$creadPrec :: ReadPrec UserDataValidationParameters
readList :: ReadS [UserDataValidationParameters]
$creadList :: ReadS [UserDataValidationParameters]
readsPrec :: Int -> ReadS UserDataValidationParameters
$creadsPrec :: Int -> ReadS UserDataValidationParameters
Prelude.Read, Int -> UserDataValidationParameters -> ShowS
[UserDataValidationParameters] -> ShowS
UserDataValidationParameters -> String
(Int -> UserDataValidationParameters -> ShowS)
-> (UserDataValidationParameters -> String)
-> ([UserDataValidationParameters] -> ShowS)
-> Show UserDataValidationParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserDataValidationParameters] -> ShowS
$cshowList :: [UserDataValidationParameters] -> ShowS
show :: UserDataValidationParameters -> String
$cshow :: UserDataValidationParameters -> String
showsPrec :: Int -> UserDataValidationParameters -> ShowS
$cshowsPrec :: Int -> UserDataValidationParameters -> ShowS
Prelude.Show, (forall x.
UserDataValidationParameters -> Rep UserDataValidationParameters x)
-> (forall x.
Rep UserDataValidationParameters x -> UserDataValidationParameters)
-> Generic UserDataValidationParameters
forall x.
Rep UserDataValidationParameters x -> UserDataValidationParameters
forall x.
UserDataValidationParameters -> Rep UserDataValidationParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UserDataValidationParameters x -> UserDataValidationParameters
$cfrom :: forall x.
UserDataValidationParameters -> Rep UserDataValidationParameters x
Prelude.Generic)
newUserDataValidationParameters ::
UserDataValidationParameters
newUserDataValidationParameters :: UserDataValidationParameters
newUserDataValidationParameters =
UserDataValidationParameters' :: Maybe ScriptType -> Maybe Source -> UserDataValidationParameters
UserDataValidationParameters'
{ $sel:scriptType:UserDataValidationParameters' :: Maybe ScriptType
scriptType =
Maybe ScriptType
forall a. Maybe a
Prelude.Nothing,
$sel:source:UserDataValidationParameters' :: Maybe Source
source = Maybe Source
forall a. Maybe a
Prelude.Nothing
}
userDataValidationParameters_scriptType :: Lens.Lens' UserDataValidationParameters (Prelude.Maybe ScriptType)
userDataValidationParameters_scriptType :: (Maybe ScriptType -> f (Maybe ScriptType))
-> UserDataValidationParameters -> f UserDataValidationParameters
userDataValidationParameters_scriptType = (UserDataValidationParameters -> Maybe ScriptType)
-> (UserDataValidationParameters
-> Maybe ScriptType -> UserDataValidationParameters)
-> Lens
UserDataValidationParameters
UserDataValidationParameters
(Maybe ScriptType)
(Maybe ScriptType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserDataValidationParameters' {Maybe ScriptType
scriptType :: Maybe ScriptType
$sel:scriptType:UserDataValidationParameters' :: UserDataValidationParameters -> Maybe ScriptType
scriptType} -> Maybe ScriptType
scriptType) (\s :: UserDataValidationParameters
s@UserDataValidationParameters' {} Maybe ScriptType
a -> UserDataValidationParameters
s {$sel:scriptType:UserDataValidationParameters' :: Maybe ScriptType
scriptType = Maybe ScriptType
a} :: UserDataValidationParameters)
userDataValidationParameters_source :: Lens.Lens' UserDataValidationParameters (Prelude.Maybe Source)
userDataValidationParameters_source :: (Maybe Source -> f (Maybe Source))
-> UserDataValidationParameters -> f UserDataValidationParameters
userDataValidationParameters_source = (UserDataValidationParameters -> Maybe Source)
-> (UserDataValidationParameters
-> Maybe Source -> UserDataValidationParameters)
-> Lens
UserDataValidationParameters
UserDataValidationParameters
(Maybe Source)
(Maybe Source)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserDataValidationParameters' {Maybe Source
source :: Maybe Source
$sel:source:UserDataValidationParameters' :: UserDataValidationParameters -> Maybe Source
source} -> Maybe Source
source) (\s :: UserDataValidationParameters
s@UserDataValidationParameters' {} Maybe Source
a -> UserDataValidationParameters
s {$sel:source:UserDataValidationParameters' :: Maybe Source
source = Maybe Source
a} :: UserDataValidationParameters)
instance Core.FromJSON UserDataValidationParameters where
parseJSON :: Value -> Parser UserDataValidationParameters
parseJSON =
String
-> (Object -> Parser UserDataValidationParameters)
-> Value
-> Parser UserDataValidationParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserDataValidationParameters"
( \Object
x ->
Maybe ScriptType -> Maybe Source -> UserDataValidationParameters
UserDataValidationParameters'
(Maybe ScriptType -> Maybe Source -> UserDataValidationParameters)
-> Parser (Maybe ScriptType)
-> Parser (Maybe Source -> UserDataValidationParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ScriptType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"scriptType")
Parser (Maybe Source -> UserDataValidationParameters)
-> Parser (Maybe Source) -> Parser UserDataValidationParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Source)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"source")
)
instance
Prelude.Hashable
UserDataValidationParameters
instance Prelude.NFData UserDataValidationParameters
instance Core.ToJSON UserDataValidationParameters where
toJSON :: UserDataValidationParameters -> Value
toJSON UserDataValidationParameters' {Maybe ScriptType
Maybe Source
source :: Maybe Source
scriptType :: Maybe ScriptType
$sel:source:UserDataValidationParameters' :: UserDataValidationParameters -> Maybe Source
$sel:scriptType:UserDataValidationParameters' :: UserDataValidationParameters -> Maybe ScriptType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"scriptType" Text -> ScriptType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ScriptType -> Pair) -> Maybe ScriptType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ScriptType
scriptType,
(Text
"source" Text -> Source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Source -> Pair) -> Maybe Source -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Source
source
]
)