{-# 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.Pinpoint.Types.NumberValidateRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NumberValidateRequest = NumberValidateRequest'
{
NumberValidateRequest -> Maybe Text
isoCountryCode :: Prelude.Maybe Prelude.Text,
NumberValidateRequest -> Maybe Text
phoneNumber :: Prelude.Maybe Prelude.Text
}
deriving (NumberValidateRequest -> NumberValidateRequest -> Bool
(NumberValidateRequest -> NumberValidateRequest -> Bool)
-> (NumberValidateRequest -> NumberValidateRequest -> Bool)
-> Eq NumberValidateRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NumberValidateRequest -> NumberValidateRequest -> Bool
$c/= :: NumberValidateRequest -> NumberValidateRequest -> Bool
== :: NumberValidateRequest -> NumberValidateRequest -> Bool
$c== :: NumberValidateRequest -> NumberValidateRequest -> Bool
Prelude.Eq, ReadPrec [NumberValidateRequest]
ReadPrec NumberValidateRequest
Int -> ReadS NumberValidateRequest
ReadS [NumberValidateRequest]
(Int -> ReadS NumberValidateRequest)
-> ReadS [NumberValidateRequest]
-> ReadPrec NumberValidateRequest
-> ReadPrec [NumberValidateRequest]
-> Read NumberValidateRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NumberValidateRequest]
$creadListPrec :: ReadPrec [NumberValidateRequest]
readPrec :: ReadPrec NumberValidateRequest
$creadPrec :: ReadPrec NumberValidateRequest
readList :: ReadS [NumberValidateRequest]
$creadList :: ReadS [NumberValidateRequest]
readsPrec :: Int -> ReadS NumberValidateRequest
$creadsPrec :: Int -> ReadS NumberValidateRequest
Prelude.Read, Int -> NumberValidateRequest -> ShowS
[NumberValidateRequest] -> ShowS
NumberValidateRequest -> String
(Int -> NumberValidateRequest -> ShowS)
-> (NumberValidateRequest -> String)
-> ([NumberValidateRequest] -> ShowS)
-> Show NumberValidateRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NumberValidateRequest] -> ShowS
$cshowList :: [NumberValidateRequest] -> ShowS
show :: NumberValidateRequest -> String
$cshow :: NumberValidateRequest -> String
showsPrec :: Int -> NumberValidateRequest -> ShowS
$cshowsPrec :: Int -> NumberValidateRequest -> ShowS
Prelude.Show, (forall x. NumberValidateRequest -> Rep NumberValidateRequest x)
-> (forall x. Rep NumberValidateRequest x -> NumberValidateRequest)
-> Generic NumberValidateRequest
forall x. Rep NumberValidateRequest x -> NumberValidateRequest
forall x. NumberValidateRequest -> Rep NumberValidateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NumberValidateRequest x -> NumberValidateRequest
$cfrom :: forall x. NumberValidateRequest -> Rep NumberValidateRequest x
Prelude.Generic)
newNumberValidateRequest ::
NumberValidateRequest
newNumberValidateRequest :: NumberValidateRequest
newNumberValidateRequest =
NumberValidateRequest' :: Maybe Text -> Maybe Text -> NumberValidateRequest
NumberValidateRequest'
{ $sel:isoCountryCode:NumberValidateRequest' :: Maybe Text
isoCountryCode =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:NumberValidateRequest' :: Maybe Text
phoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
numberValidateRequest_isoCountryCode :: Lens.Lens' NumberValidateRequest (Prelude.Maybe Prelude.Text)
numberValidateRequest_isoCountryCode :: (Maybe Text -> f (Maybe Text))
-> NumberValidateRequest -> f NumberValidateRequest
numberValidateRequest_isoCountryCode = (NumberValidateRequest -> Maybe Text)
-> (NumberValidateRequest -> Maybe Text -> NumberValidateRequest)
-> Lens
NumberValidateRequest
NumberValidateRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NumberValidateRequest' {Maybe Text
isoCountryCode :: Maybe Text
$sel:isoCountryCode:NumberValidateRequest' :: NumberValidateRequest -> Maybe Text
isoCountryCode} -> Maybe Text
isoCountryCode) (\s :: NumberValidateRequest
s@NumberValidateRequest' {} Maybe Text
a -> NumberValidateRequest
s {$sel:isoCountryCode:NumberValidateRequest' :: Maybe Text
isoCountryCode = Maybe Text
a} :: NumberValidateRequest)
numberValidateRequest_phoneNumber :: Lens.Lens' NumberValidateRequest (Prelude.Maybe Prelude.Text)
numberValidateRequest_phoneNumber :: (Maybe Text -> f (Maybe Text))
-> NumberValidateRequest -> f NumberValidateRequest
numberValidateRequest_phoneNumber = (NumberValidateRequest -> Maybe Text)
-> (NumberValidateRequest -> Maybe Text -> NumberValidateRequest)
-> Lens
NumberValidateRequest
NumberValidateRequest
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NumberValidateRequest' {Maybe Text
phoneNumber :: Maybe Text
$sel:phoneNumber:NumberValidateRequest' :: NumberValidateRequest -> Maybe Text
phoneNumber} -> Maybe Text
phoneNumber) (\s :: NumberValidateRequest
s@NumberValidateRequest' {} Maybe Text
a -> NumberValidateRequest
s {$sel:phoneNumber:NumberValidateRequest' :: Maybe Text
phoneNumber = Maybe Text
a} :: NumberValidateRequest)
instance Prelude.Hashable NumberValidateRequest
instance Prelude.NFData NumberValidateRequest
instance Core.ToJSON NumberValidateRequest where
toJSON :: NumberValidateRequest -> Value
toJSON NumberValidateRequest' {Maybe Text
phoneNumber :: Maybe Text
isoCountryCode :: Maybe Text
$sel:phoneNumber:NumberValidateRequest' :: NumberValidateRequest -> Maybe Text
$sel:isoCountryCode:NumberValidateRequest' :: NumberValidateRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"IsoCountryCode" 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
isoCountryCode,
(Text
"PhoneNumber" 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
phoneNumber
]
)