{-# 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.SNS.Types.MessageAttributeValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MessageAttributeValue = MessageAttributeValue'
{
MessageAttributeValue -> Maybe Base64
binaryValue :: Prelude.Maybe Core.Base64,
MessageAttributeValue -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text,
MessageAttributeValue -> Text
dataType :: Prelude.Text
}
deriving (MessageAttributeValue -> MessageAttributeValue -> Bool
(MessageAttributeValue -> MessageAttributeValue -> Bool)
-> (MessageAttributeValue -> MessageAttributeValue -> Bool)
-> Eq MessageAttributeValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MessageAttributeValue -> MessageAttributeValue -> Bool
$c/= :: MessageAttributeValue -> MessageAttributeValue -> Bool
== :: MessageAttributeValue -> MessageAttributeValue -> Bool
$c== :: MessageAttributeValue -> MessageAttributeValue -> Bool
Prelude.Eq, ReadPrec [MessageAttributeValue]
ReadPrec MessageAttributeValue
Int -> ReadS MessageAttributeValue
ReadS [MessageAttributeValue]
(Int -> ReadS MessageAttributeValue)
-> ReadS [MessageAttributeValue]
-> ReadPrec MessageAttributeValue
-> ReadPrec [MessageAttributeValue]
-> Read MessageAttributeValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MessageAttributeValue]
$creadListPrec :: ReadPrec [MessageAttributeValue]
readPrec :: ReadPrec MessageAttributeValue
$creadPrec :: ReadPrec MessageAttributeValue
readList :: ReadS [MessageAttributeValue]
$creadList :: ReadS [MessageAttributeValue]
readsPrec :: Int -> ReadS MessageAttributeValue
$creadsPrec :: Int -> ReadS MessageAttributeValue
Prelude.Read, Int -> MessageAttributeValue -> ShowS
[MessageAttributeValue] -> ShowS
MessageAttributeValue -> String
(Int -> MessageAttributeValue -> ShowS)
-> (MessageAttributeValue -> String)
-> ([MessageAttributeValue] -> ShowS)
-> Show MessageAttributeValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MessageAttributeValue] -> ShowS
$cshowList :: [MessageAttributeValue] -> ShowS
show :: MessageAttributeValue -> String
$cshow :: MessageAttributeValue -> String
showsPrec :: Int -> MessageAttributeValue -> ShowS
$cshowsPrec :: Int -> MessageAttributeValue -> ShowS
Prelude.Show, (forall x. MessageAttributeValue -> Rep MessageAttributeValue x)
-> (forall x. Rep MessageAttributeValue x -> MessageAttributeValue)
-> Generic MessageAttributeValue
forall x. Rep MessageAttributeValue x -> MessageAttributeValue
forall x. MessageAttributeValue -> Rep MessageAttributeValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MessageAttributeValue x -> MessageAttributeValue
$cfrom :: forall x. MessageAttributeValue -> Rep MessageAttributeValue x
Prelude.Generic)
newMessageAttributeValue ::
Prelude.Text ->
MessageAttributeValue
newMessageAttributeValue :: Text -> MessageAttributeValue
newMessageAttributeValue Text
pDataType_ =
MessageAttributeValue' :: Maybe Base64 -> Maybe Text -> Text -> MessageAttributeValue
MessageAttributeValue'
{ $sel:binaryValue:MessageAttributeValue' :: Maybe Base64
binaryValue =
Maybe Base64
forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:MessageAttributeValue' :: Maybe Text
stringValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataType:MessageAttributeValue' :: Text
dataType = Text
pDataType_
}
messageAttributeValue_binaryValue :: Lens.Lens' MessageAttributeValue (Prelude.Maybe Prelude.ByteString)
messageAttributeValue_binaryValue :: (Maybe ByteString -> f (Maybe ByteString))
-> MessageAttributeValue -> f MessageAttributeValue
messageAttributeValue_binaryValue = (MessageAttributeValue -> Maybe Base64)
-> (MessageAttributeValue -> Maybe Base64 -> MessageAttributeValue)
-> Lens
MessageAttributeValue
MessageAttributeValue
(Maybe Base64)
(Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageAttributeValue' {Maybe Base64
binaryValue :: Maybe Base64
$sel:binaryValue:MessageAttributeValue' :: MessageAttributeValue -> Maybe Base64
binaryValue} -> Maybe Base64
binaryValue) (\s :: MessageAttributeValue
s@MessageAttributeValue' {} Maybe Base64
a -> MessageAttributeValue
s {$sel:binaryValue:MessageAttributeValue' :: Maybe Base64
binaryValue = Maybe Base64
a} :: MessageAttributeValue) ((Maybe Base64 -> f (Maybe Base64))
-> MessageAttributeValue -> f MessageAttributeValue)
-> ((Maybe ByteString -> f (Maybe ByteString))
-> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> MessageAttributeValue
-> f MessageAttributeValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
(Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
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 Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64
messageAttributeValue_stringValue :: Lens.Lens' MessageAttributeValue (Prelude.Maybe Prelude.Text)
messageAttributeValue_stringValue :: (Maybe Text -> f (Maybe Text))
-> MessageAttributeValue -> f MessageAttributeValue
messageAttributeValue_stringValue = (MessageAttributeValue -> Maybe Text)
-> (MessageAttributeValue -> Maybe Text -> MessageAttributeValue)
-> Lens
MessageAttributeValue
MessageAttributeValue
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageAttributeValue' {Maybe Text
stringValue :: Maybe Text
$sel:stringValue:MessageAttributeValue' :: MessageAttributeValue -> Maybe Text
stringValue} -> Maybe Text
stringValue) (\s :: MessageAttributeValue
s@MessageAttributeValue' {} Maybe Text
a -> MessageAttributeValue
s {$sel:stringValue:MessageAttributeValue' :: Maybe Text
stringValue = Maybe Text
a} :: MessageAttributeValue)
messageAttributeValue_dataType :: Lens.Lens' MessageAttributeValue Prelude.Text
messageAttributeValue_dataType :: (Text -> f Text)
-> MessageAttributeValue -> f MessageAttributeValue
messageAttributeValue_dataType = (MessageAttributeValue -> Text)
-> (MessageAttributeValue -> Text -> MessageAttributeValue)
-> Lens MessageAttributeValue MessageAttributeValue Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MessageAttributeValue' {Text
dataType :: Text
$sel:dataType:MessageAttributeValue' :: MessageAttributeValue -> Text
dataType} -> Text
dataType) (\s :: MessageAttributeValue
s@MessageAttributeValue' {} Text
a -> MessageAttributeValue
s {$sel:dataType:MessageAttributeValue' :: Text
dataType = Text
a} :: MessageAttributeValue)
instance Prelude.Hashable MessageAttributeValue
instance Prelude.NFData MessageAttributeValue
instance Core.ToQuery MessageAttributeValue where
toQuery :: MessageAttributeValue -> QueryString
toQuery MessageAttributeValue' {Maybe Text
Maybe Base64
Text
dataType :: Text
stringValue :: Maybe Text
binaryValue :: Maybe Base64
$sel:dataType:MessageAttributeValue' :: MessageAttributeValue -> Text
$sel:stringValue:MessageAttributeValue' :: MessageAttributeValue -> Maybe Text
$sel:binaryValue:MessageAttributeValue' :: MessageAttributeValue -> Maybe Base64
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"BinaryValue" ByteString -> Maybe Base64 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Base64
binaryValue,
ByteString
"StringValue" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
stringValue,
ByteString
"DataType" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dataType
]