{-# 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.APNSChannelRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data APNSChannelRequest = APNSChannelRequest'
{
APNSChannelRequest -> Maybe Text
tokenKey :: Prelude.Maybe Prelude.Text,
APNSChannelRequest -> Maybe Text
privateKey :: Prelude.Maybe Prelude.Text,
APNSChannelRequest -> Maybe Bool
enabled :: Prelude.Maybe Prelude.Bool,
APNSChannelRequest -> Maybe Text
teamId :: Prelude.Maybe Prelude.Text,
APNSChannelRequest -> Maybe Text
bundleId :: Prelude.Maybe Prelude.Text,
APNSChannelRequest -> Maybe Text
defaultAuthenticationMethod :: Prelude.Maybe Prelude.Text,
APNSChannelRequest -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
APNSChannelRequest -> Maybe Text
tokenKeyId :: Prelude.Maybe Prelude.Text
}
deriving (APNSChannelRequest -> APNSChannelRequest -> Bool
(APNSChannelRequest -> APNSChannelRequest -> Bool)
-> (APNSChannelRequest -> APNSChannelRequest -> Bool)
-> Eq APNSChannelRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: APNSChannelRequest -> APNSChannelRequest -> Bool
$c/= :: APNSChannelRequest -> APNSChannelRequest -> Bool
== :: APNSChannelRequest -> APNSChannelRequest -> Bool
$c== :: APNSChannelRequest -> APNSChannelRequest -> Bool
Prelude.Eq, ReadPrec [APNSChannelRequest]
ReadPrec APNSChannelRequest
Int -> ReadS APNSChannelRequest
ReadS [APNSChannelRequest]
(Int -> ReadS APNSChannelRequest)
-> ReadS [APNSChannelRequest]
-> ReadPrec APNSChannelRequest
-> ReadPrec [APNSChannelRequest]
-> Read APNSChannelRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [APNSChannelRequest]
$creadListPrec :: ReadPrec [APNSChannelRequest]
readPrec :: ReadPrec APNSChannelRequest
$creadPrec :: ReadPrec APNSChannelRequest
readList :: ReadS [APNSChannelRequest]
$creadList :: ReadS [APNSChannelRequest]
readsPrec :: Int -> ReadS APNSChannelRequest
$creadsPrec :: Int -> ReadS APNSChannelRequest
Prelude.Read, Int -> APNSChannelRequest -> ShowS
[APNSChannelRequest] -> ShowS
APNSChannelRequest -> String
(Int -> APNSChannelRequest -> ShowS)
-> (APNSChannelRequest -> String)
-> ([APNSChannelRequest] -> ShowS)
-> Show APNSChannelRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [APNSChannelRequest] -> ShowS
$cshowList :: [APNSChannelRequest] -> ShowS
show :: APNSChannelRequest -> String
$cshow :: APNSChannelRequest -> String
showsPrec :: Int -> APNSChannelRequest -> ShowS
$cshowsPrec :: Int -> APNSChannelRequest -> ShowS
Prelude.Show, (forall x. APNSChannelRequest -> Rep APNSChannelRequest x)
-> (forall x. Rep APNSChannelRequest x -> APNSChannelRequest)
-> Generic APNSChannelRequest
forall x. Rep APNSChannelRequest x -> APNSChannelRequest
forall x. APNSChannelRequest -> Rep APNSChannelRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep APNSChannelRequest x -> APNSChannelRequest
$cfrom :: forall x. APNSChannelRequest -> Rep APNSChannelRequest x
Prelude.Generic)
newAPNSChannelRequest ::
APNSChannelRequest
newAPNSChannelRequest :: APNSChannelRequest
newAPNSChannelRequest =
APNSChannelRequest' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> APNSChannelRequest
APNSChannelRequest'
{ $sel:tokenKey:APNSChannelRequest' :: Maybe Text
tokenKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:privateKey:APNSChannelRequest' :: Maybe Text
privateKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:enabled:APNSChannelRequest' :: Maybe Bool
enabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:teamId:APNSChannelRequest' :: Maybe Text
teamId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bundleId:APNSChannelRequest' :: Maybe Text
bundleId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:defaultAuthenticationMethod:APNSChannelRequest' :: Maybe Text
defaultAuthenticationMethod = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:certificate:APNSChannelRequest' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:tokenKeyId:APNSChannelRequest' :: Maybe Text
tokenKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
aPNSChannelRequest_tokenKey :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_tokenKey :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_tokenKey = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
tokenKey :: Maybe Text
$sel:tokenKey:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
tokenKey} -> Maybe Text
tokenKey) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:tokenKey:APNSChannelRequest' :: Maybe Text
tokenKey = Maybe Text
a} :: APNSChannelRequest)
aPNSChannelRequest_privateKey :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_privateKey :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_privateKey = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
privateKey :: Maybe Text
$sel:privateKey:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
privateKey} -> Maybe Text
privateKey) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:privateKey:APNSChannelRequest' :: Maybe Text
privateKey = Maybe Text
a} :: APNSChannelRequest)
aPNSChannelRequest_enabled :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Bool)
aPNSChannelRequest_enabled :: (Maybe Bool -> f (Maybe Bool))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_enabled = (APNSChannelRequest -> Maybe Bool)
-> (APNSChannelRequest -> Maybe Bool -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Bool
enabled :: Maybe Bool
$sel:enabled:APNSChannelRequest' :: APNSChannelRequest -> Maybe Bool
enabled} -> Maybe Bool
enabled) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Bool
a -> APNSChannelRequest
s {$sel:enabled:APNSChannelRequest' :: Maybe Bool
enabled = Maybe Bool
a} :: APNSChannelRequest)
aPNSChannelRequest_teamId :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_teamId :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_teamId = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
teamId :: Maybe Text
$sel:teamId:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
teamId} -> Maybe Text
teamId) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:teamId:APNSChannelRequest' :: Maybe Text
teamId = Maybe Text
a} :: APNSChannelRequest)
aPNSChannelRequest_bundleId :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_bundleId :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_bundleId = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
bundleId :: Maybe Text
$sel:bundleId:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
bundleId} -> Maybe Text
bundleId) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:bundleId:APNSChannelRequest' :: Maybe Text
bundleId = Maybe Text
a} :: APNSChannelRequest)
aPNSChannelRequest_defaultAuthenticationMethod :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_defaultAuthenticationMethod :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_defaultAuthenticationMethod = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
defaultAuthenticationMethod :: Maybe Text
$sel:defaultAuthenticationMethod:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
defaultAuthenticationMethod} -> Maybe Text
defaultAuthenticationMethod) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:defaultAuthenticationMethod:APNSChannelRequest' :: Maybe Text
defaultAuthenticationMethod = Maybe Text
a} :: APNSChannelRequest)
aPNSChannelRequest_certificate :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_certificate :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_certificate = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
certificate :: Maybe Text
$sel:certificate:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:certificate:APNSChannelRequest' :: Maybe Text
certificate = Maybe Text
a} :: APNSChannelRequest)
aPNSChannelRequest_tokenKeyId :: Lens.Lens' APNSChannelRequest (Prelude.Maybe Prelude.Text)
aPNSChannelRequest_tokenKeyId :: (Maybe Text -> f (Maybe Text))
-> APNSChannelRequest -> f APNSChannelRequest
aPNSChannelRequest_tokenKeyId = (APNSChannelRequest -> Maybe Text)
-> (APNSChannelRequest -> Maybe Text -> APNSChannelRequest)
-> Lens
APNSChannelRequest APNSChannelRequest (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\APNSChannelRequest' {Maybe Text
tokenKeyId :: Maybe Text
$sel:tokenKeyId:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
tokenKeyId} -> Maybe Text
tokenKeyId) (\s :: APNSChannelRequest
s@APNSChannelRequest' {} Maybe Text
a -> APNSChannelRequest
s {$sel:tokenKeyId:APNSChannelRequest' :: Maybe Text
tokenKeyId = Maybe Text
a} :: APNSChannelRequest)
instance Prelude.Hashable APNSChannelRequest
instance Prelude.NFData APNSChannelRequest
instance Core.ToJSON APNSChannelRequest where
toJSON :: APNSChannelRequest -> Value
toJSON APNSChannelRequest' {Maybe Bool
Maybe Text
tokenKeyId :: Maybe Text
certificate :: Maybe Text
defaultAuthenticationMethod :: Maybe Text
bundleId :: Maybe Text
teamId :: Maybe Text
enabled :: Maybe Bool
privateKey :: Maybe Text
tokenKey :: Maybe Text
$sel:tokenKeyId:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
$sel:certificate:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
$sel:defaultAuthenticationMethod:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
$sel:bundleId:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
$sel:teamId:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
$sel:enabled:APNSChannelRequest' :: APNSChannelRequest -> Maybe Bool
$sel:privateKey:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
$sel:tokenKey:APNSChannelRequest' :: APNSChannelRequest -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TokenKey" 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
tokenKey,
(Text
"PrivateKey" 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
privateKey,
(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,
(Text
"TeamId" 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
teamId,
(Text
"BundleId" 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
bundleId,
(Text
"DefaultAuthenticationMethod" 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
defaultAuthenticationMethod,
(Text
"Certificate" 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
certificate,
(Text
"TokenKeyId" 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
tokenKeyId
]
)