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