{-# 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.ADMChannelRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ADMChannelRequest = ADMChannelRequest'
{
ADMChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
ADMChannelRequest -> Text
clientSecret :: Prelude.Text,
ADMChannelRequest -> Text
clientId :: Prelude.Text
}
deriving (ADMChannelRequest -> ADMChannelRequest -> Bool
(ADMChannelRequest -> ADMChannelRequest -> Bool)
-> (ADMChannelRequest -> ADMChannelRequest -> Bool)
-> Eq ADMChannelRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ADMChannelRequest -> ADMChannelRequest -> Bool
$c/= :: ADMChannelRequest -> ADMChannelRequest -> Bool
== :: ADMChannelRequest -> ADMChannelRequest -> Bool
$c== :: ADMChannelRequest -> ADMChannelRequest -> Bool
Prelude.Eq, ReadPrec [ADMChannelRequest]
ReadPrec ADMChannelRequest
Int -> ReadS ADMChannelRequest
ReadS [ADMChannelRequest]
(Int -> ReadS ADMChannelRequest)
-> ReadS [ADMChannelRequest]
-> ReadPrec ADMChannelRequest
-> ReadPrec [ADMChannelRequest]
-> Read ADMChannelRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ADMChannelRequest]
$creadListPrec :: ReadPrec [ADMChannelRequest]
readPrec :: ReadPrec ADMChannelRequest
$creadPrec :: ReadPrec ADMChannelRequest
readList :: ReadS [ADMChannelRequest]
$creadList :: ReadS [ADMChannelRequest]
readsPrec :: Int -> ReadS ADMChannelRequest
$creadsPrec :: Int -> ReadS ADMChannelRequest
Prelude.Read, Int -> ADMChannelRequest -> ShowS
[ADMChannelRequest] -> ShowS
ADMChannelRequest -> String
(Int -> ADMChannelRequest -> ShowS)
-> (ADMChannelRequest -> String)
-> ([ADMChannelRequest] -> ShowS)
-> Show ADMChannelRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ADMChannelRequest] -> ShowS
$cshowList :: [ADMChannelRequest] -> ShowS
show :: ADMChannelRequest -> String
$cshow :: ADMChannelRequest -> String
showsPrec :: Int -> ADMChannelRequest -> ShowS
$cshowsPrec :: Int -> ADMChannelRequest -> ShowS
Prelude.Show, (forall x. ADMChannelRequest -> Rep ADMChannelRequest x)
-> (forall x. Rep ADMChannelRequest x -> ADMChannelRequest)
-> Generic ADMChannelRequest
forall x. Rep ADMChannelRequest x -> ADMChannelRequest
forall x. ADMChannelRequest -> Rep ADMChannelRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ADMChannelRequest x -> ADMChannelRequest
$cfrom :: forall x. ADMChannelRequest -> Rep ADMChannelRequest x
Prelude.Generic)
newADMChannelRequest ::
Prelude.Text ->
Prelude.Text ->
ADMChannelRequest
newADMChannelRequest :: Text -> Text -> ADMChannelRequest
newADMChannelRequest Text
pClientSecret_ Text
pClientId_ =
ADMChannelRequest' :: Maybe Bool -> Text -> Text -> ADMChannelRequest
ADMChannelRequest'
{ $sel:enabled:ADMChannelRequest' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:clientSecret:ADMChannelRequest' :: Text
clientSecret = Text
pClientSecret_,
$sel:clientId:ADMChannelRequest' :: Text
clientId = Text
pClientId_
}
aDMChannelRequest_enabled :: Lens.Lens' ADMChannelRequest (Prelude.Maybe Prelude.Bool)
aDMChannelRequest_enabled :: (Maybe Bool -> f (Maybe Bool))
-> ADMChannelRequest -> f ADMChannelRequest
aDMChannelRequest_enabled = (ADMChannelRequest -> Maybe Bool)
-> (ADMChannelRequest -> Maybe Bool -> ADMChannelRequest)
-> Lens
ADMChannelRequest ADMChannelRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ADMChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:ADMChannelRequest' :: ADMChannelRequest -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: ADMChannelRequest
s@ADMChannelRequest' {} Maybe Bool
a -> ADMChannelRequest
s {$sel:enabled:ADMChannelRequest' :: Maybe Bool
enabled = Maybe Bool
a} :: ADMChannelRequest)
aDMChannelRequest_clientSecret :: Lens.Lens' ADMChannelRequest Prelude.Text
aDMChannelRequest_clientSecret :: (Text -> f Text) -> ADMChannelRequest -> f ADMChannelRequest
aDMChannelRequest_clientSecret = (ADMChannelRequest -> Text)
-> (ADMChannelRequest -> Text -> ADMChannelRequest)
-> Lens ADMChannelRequest ADMChannelRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ADMChannelRequest' {Text
clientSecret :: Text
$sel:clientSecret:ADMChannelRequest' :: ADMChannelRequest -> Text
clientSecret} -> Text
clientSecret) (\s :: ADMChannelRequest
s@ADMChannelRequest' {} Text
a -> ADMChannelRequest
s {$sel:clientSecret:ADMChannelRequest' :: Text
clientSecret = Text
a} :: ADMChannelRequest)
aDMChannelRequest_clientId :: Lens.Lens' ADMChannelRequest Prelude.Text
aDMChannelRequest_clientId :: (Text -> f Text) -> ADMChannelRequest -> f ADMChannelRequest
aDMChannelRequest_clientId = (ADMChannelRequest -> Text)
-> (ADMChannelRequest -> Text -> ADMChannelRequest)
-> Lens ADMChannelRequest ADMChannelRequest Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ADMChannelRequest' {Text
clientId :: Text
$sel:clientId:ADMChannelRequest' :: ADMChannelRequest -> Text
clientId} -> Text
clientId) (\s :: ADMChannelRequest
s@ADMChannelRequest' {} Text
a -> ADMChannelRequest
s {$sel:clientId:ADMChannelRequest' :: Text
clientId = Text
a} :: ADMChannelRequest)
instance Prelude.Hashable ADMChannelRequest
instance Prelude.NFData ADMChannelRequest
instance Core.ToJSON ADMChannelRequest where
toJSON :: ADMChannelRequest -> Value
toJSON ADMChannelRequest' {Maybe Bool
Text
clientId :: Text
clientSecret :: Text
enabled :: Maybe Bool
$sel:clientId:ADMChannelRequest' :: ADMChannelRequest -> Text
$sel:clientSecret:ADMChannelRequest' :: ADMChannelRequest -> Text
$sel:enabled:ADMChannelRequest' :: ADMChannelRequest -> 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
"ClientSecret" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientSecret),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClientId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clientId)
]
)