{-# 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.BaiduChannelRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BaiduChannelRequest = BaiduChannelRequest'
{
BaiduChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
BaiduChannelRequest -> Text
secretKey :: Prelude.Text,
BaiduChannelRequest -> Text
apiKey :: Prelude.Text
}
deriving (BaiduChannelRequest -> BaiduChannelRequest -> Bool
(BaiduChannelRequest -> BaiduChannelRequest -> Bool)
-> (BaiduChannelRequest -> BaiduChannelRequest -> Bool)
-> Eq BaiduChannelRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BaiduChannelRequest -> BaiduChannelRequest -> Bool
$c/= :: BaiduChannelRequest -> BaiduChannelRequest -> Bool
== :: BaiduChannelRequest -> BaiduChannelRequest -> Bool
$c== :: BaiduChannelRequest -> BaiduChannelRequest -> Bool
Prelude.Eq, ReadPrec [BaiduChannelRequest]
ReadPrec BaiduChannelRequest
Int -> ReadS BaiduChannelRequest
ReadS [BaiduChannelRequest]
(Int -> ReadS BaiduChannelRequest)
-> ReadS [BaiduChannelRequest]
-> ReadPrec BaiduChannelRequest
-> ReadPrec [BaiduChannelRequest]
-> Read BaiduChannelRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BaiduChannelRequest]
$creadListPrec :: ReadPrec [BaiduChannelRequest]
readPrec :: ReadPrec BaiduChannelRequest
$creadPrec :: ReadPrec BaiduChannelRequest
readList :: ReadS [BaiduChannelRequest]
$creadList :: ReadS [BaiduChannelRequest]
readsPrec :: Int -> ReadS BaiduChannelRequest
$creadsPrec :: Int -> ReadS BaiduChannelRequest
Prelude.Read, Int -> BaiduChannelRequest -> ShowS
[BaiduChannelRequest] -> ShowS
BaiduChannelRequest -> String
(Int -> BaiduChannelRequest -> ShowS)
-> (BaiduChannelRequest -> String)
-> ([BaiduChannelRequest] -> ShowS)
-> Show BaiduChannelRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BaiduChannelRequest] -> ShowS
$cshowList :: [BaiduChannelRequest] -> ShowS
show :: BaiduChannelRequest -> String
$cshow :: BaiduChannelRequest -> String
showsPrec :: Int -> BaiduChannelRequest -> ShowS
$cshowsPrec :: Int -> BaiduChannelRequest -> ShowS
Prelude.Show, (forall x. BaiduChannelRequest -> Rep BaiduChannelRequest x)
-> (forall x. Rep BaiduChannelRequest x -> BaiduChannelRequest)
-> Generic BaiduChannelRequest
forall x. Rep BaiduChannelRequest x -> BaiduChannelRequest
forall x. BaiduChannelRequest -> Rep BaiduChannelRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BaiduChannelRequest x -> BaiduChannelRequest
$cfrom :: forall x. BaiduChannelRequest -> Rep BaiduChannelRequest x
Prelude.Generic)
newBaiduChannelRequest ::
Prelude.Text ->
Prelude.Text ->
BaiduChannelRequest
newBaiduChannelRequest :: Text -> Text -> BaiduChannelRequest
newBaiduChannelRequest Text
pSecretKey_ Text
pApiKey_ =
BaiduChannelRequest' :: Maybe Bool -> Text -> Text -> BaiduChannelRequest
BaiduChannelRequest'
{ $sel:enabled:BaiduChannelRequest' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:secretKey:BaiduChannelRequest' :: Text
secretKey = Text
pSecretKey_,
$sel:apiKey:BaiduChannelRequest' :: Text
apiKey = Text
pApiKey_
}
baiduChannelRequest_enabled :: Lens.Lens' BaiduChannelRequest (Prelude.Maybe Prelude.Bool)
baiduChannelRequest_enabled :: (Maybe Bool -> f (Maybe Bool))
-> BaiduChannelRequest -> f BaiduChannelRequest
baiduChannelRequest_enabled = (BaiduChannelRequest -> Maybe Bool)
-> (BaiduChannelRequest -> Maybe Bool -> BaiduChannelRequest)
-> Lens
BaiduChannelRequest BaiduChannelRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:BaiduChannelRequest' :: BaiduChannelRequest -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: BaiduChannelRequest
s@BaiduChannelRequest' {} Maybe Bool
a -> BaiduChannelRequest
s {$sel:enabled:BaiduChannelRequest' :: Maybe Bool
enabled = Maybe Bool
a} :: BaiduChannelRequest)
baiduChannelRequest_secretKey :: Lens.Lens' BaiduChannelRequest Prelude.Text
baiduChannelRequest_secretKey :: (Text -> f Text) -> BaiduChannelRequest -> f BaiduChannelRequest
baiduChannelRequest_secretKey = (BaiduChannelRequest -> Text)
-> (BaiduChannelRequest -> Text -> BaiduChannelRequest)
-> Lens BaiduChannelRequest BaiduChannelRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduChannelRequest' {Text
secretKey :: Text
$sel:secretKey:BaiduChannelRequest' :: BaiduChannelRequest -> Text
secretKey} -> Text
secretKey) (\s :: BaiduChannelRequest
s@BaiduChannelRequest' {} Text
a -> BaiduChannelRequest
s {$sel:secretKey:BaiduChannelRequest' :: Text
secretKey = Text
a} :: BaiduChannelRequest)
baiduChannelRequest_apiKey :: Lens.Lens' BaiduChannelRequest Prelude.Text
baiduChannelRequest_apiKey :: (Text -> f Text) -> BaiduChannelRequest -> f BaiduChannelRequest
baiduChannelRequest_apiKey = (BaiduChannelRequest -> Text)
-> (BaiduChannelRequest -> Text -> BaiduChannelRequest)
-> Lens BaiduChannelRequest BaiduChannelRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BaiduChannelRequest' {Text
apiKey :: Text
$sel:apiKey:BaiduChannelRequest' :: BaiduChannelRequest -> Text
apiKey} -> Text
apiKey) (\s :: BaiduChannelRequest
s@BaiduChannelRequest' {} Text
a -> BaiduChannelRequest
s {$sel:apiKey:BaiduChannelRequest' :: Text
apiKey = Text
a} :: BaiduChannelRequest)
instance Prelude.Hashable BaiduChannelRequest
instance Prelude.NFData BaiduChannelRequest
instance Core.ToJSON BaiduChannelRequest where
toJSON :: BaiduChannelRequest -> Value
toJSON BaiduChannelRequest' {Maybe Bool
Text
apiKey :: Text
secretKey :: Text
enabled :: Maybe Bool
$sel:apiKey:BaiduChannelRequest' :: BaiduChannelRequest -> Text
$sel:secretKey:BaiduChannelRequest' :: BaiduChannelRequest -> Text
$sel:enabled:BaiduChannelRequest' :: BaiduChannelRequest -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Enabled" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
enabled,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SecretKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
secretKey),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ApiKey" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
apiKey)
]
)