{-# 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.AmplifyBackend.Types.BackendAuthAppleProviderConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BackendAuthAppleProviderConfig = BackendAuthAppleProviderConfig'
{
BackendAuthAppleProviderConfig -> Maybe Text
clientId :: Prelude.Maybe Prelude.Text,
BackendAuthAppleProviderConfig -> Maybe Text
privateKey :: Prelude.Maybe Prelude.Text,
BackendAuthAppleProviderConfig -> Maybe Text
keyId :: Prelude.Maybe Prelude.Text,
BackendAuthAppleProviderConfig -> Maybe Text
teamId :: Prelude.Maybe Prelude.Text
}
deriving (BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool
(BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool)
-> (BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool)
-> Eq BackendAuthAppleProviderConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool
$c/= :: BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool
== :: BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool
$c== :: BackendAuthAppleProviderConfig
-> BackendAuthAppleProviderConfig -> Bool
Prelude.Eq, ReadPrec [BackendAuthAppleProviderConfig]
ReadPrec BackendAuthAppleProviderConfig
Int -> ReadS BackendAuthAppleProviderConfig
ReadS [BackendAuthAppleProviderConfig]
(Int -> ReadS BackendAuthAppleProviderConfig)
-> ReadS [BackendAuthAppleProviderConfig]
-> ReadPrec BackendAuthAppleProviderConfig
-> ReadPrec [BackendAuthAppleProviderConfig]
-> Read BackendAuthAppleProviderConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackendAuthAppleProviderConfig]
$creadListPrec :: ReadPrec [BackendAuthAppleProviderConfig]
readPrec :: ReadPrec BackendAuthAppleProviderConfig
$creadPrec :: ReadPrec BackendAuthAppleProviderConfig
readList :: ReadS [BackendAuthAppleProviderConfig]
$creadList :: ReadS [BackendAuthAppleProviderConfig]
readsPrec :: Int -> ReadS BackendAuthAppleProviderConfig
$creadsPrec :: Int -> ReadS BackendAuthAppleProviderConfig
Prelude.Read, Int -> BackendAuthAppleProviderConfig -> ShowS
[BackendAuthAppleProviderConfig] -> ShowS
BackendAuthAppleProviderConfig -> String
(Int -> BackendAuthAppleProviderConfig -> ShowS)
-> (BackendAuthAppleProviderConfig -> String)
-> ([BackendAuthAppleProviderConfig] -> ShowS)
-> Show BackendAuthAppleProviderConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackendAuthAppleProviderConfig] -> ShowS
$cshowList :: [BackendAuthAppleProviderConfig] -> ShowS
show :: BackendAuthAppleProviderConfig -> String
$cshow :: BackendAuthAppleProviderConfig -> String
showsPrec :: Int -> BackendAuthAppleProviderConfig -> ShowS
$cshowsPrec :: Int -> BackendAuthAppleProviderConfig -> ShowS
Prelude.Show, (forall x.
BackendAuthAppleProviderConfig
-> Rep BackendAuthAppleProviderConfig x)
-> (forall x.
Rep BackendAuthAppleProviderConfig x
-> BackendAuthAppleProviderConfig)
-> Generic BackendAuthAppleProviderConfig
forall x.
Rep BackendAuthAppleProviderConfig x
-> BackendAuthAppleProviderConfig
forall x.
BackendAuthAppleProviderConfig
-> Rep BackendAuthAppleProviderConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BackendAuthAppleProviderConfig x
-> BackendAuthAppleProviderConfig
$cfrom :: forall x.
BackendAuthAppleProviderConfig
-> Rep BackendAuthAppleProviderConfig x
Prelude.Generic)
newBackendAuthAppleProviderConfig ::
BackendAuthAppleProviderConfig
newBackendAuthAppleProviderConfig :: BackendAuthAppleProviderConfig
newBackendAuthAppleProviderConfig =
BackendAuthAppleProviderConfig' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> BackendAuthAppleProviderConfig
BackendAuthAppleProviderConfig'
{ $sel:clientId:BackendAuthAppleProviderConfig' :: Maybe Text
clientId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:privateKey:BackendAuthAppleProviderConfig' :: Maybe Text
privateKey = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:keyId:BackendAuthAppleProviderConfig' :: Maybe Text
keyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:teamId:BackendAuthAppleProviderConfig' :: Maybe Text
teamId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
backendAuthAppleProviderConfig_clientId :: Lens.Lens' BackendAuthAppleProviderConfig (Prelude.Maybe Prelude.Text)
backendAuthAppleProviderConfig_clientId :: (Maybe Text -> f (Maybe Text))
-> BackendAuthAppleProviderConfig
-> f BackendAuthAppleProviderConfig
backendAuthAppleProviderConfig_clientId = (BackendAuthAppleProviderConfig -> Maybe Text)
-> (BackendAuthAppleProviderConfig
-> Maybe Text -> BackendAuthAppleProviderConfig)
-> Lens
BackendAuthAppleProviderConfig
BackendAuthAppleProviderConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAuthAppleProviderConfig' {Maybe Text
clientId :: Maybe Text
$sel:clientId:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
clientId} -> Maybe Text
clientId) (\s :: BackendAuthAppleProviderConfig
s@BackendAuthAppleProviderConfig' {} Maybe Text
a -> BackendAuthAppleProviderConfig
s {$sel:clientId:BackendAuthAppleProviderConfig' :: Maybe Text
clientId = Maybe Text
a} :: BackendAuthAppleProviderConfig)
backendAuthAppleProviderConfig_privateKey :: Lens.Lens' BackendAuthAppleProviderConfig (Prelude.Maybe Prelude.Text)
backendAuthAppleProviderConfig_privateKey :: (Maybe Text -> f (Maybe Text))
-> BackendAuthAppleProviderConfig
-> f BackendAuthAppleProviderConfig
backendAuthAppleProviderConfig_privateKey = (BackendAuthAppleProviderConfig -> Maybe Text)
-> (BackendAuthAppleProviderConfig
-> Maybe Text -> BackendAuthAppleProviderConfig)
-> Lens
BackendAuthAppleProviderConfig
BackendAuthAppleProviderConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAuthAppleProviderConfig' {Maybe Text
privateKey :: Maybe Text
$sel:privateKey:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
privateKey} -> Maybe Text
privateKey) (\s :: BackendAuthAppleProviderConfig
s@BackendAuthAppleProviderConfig' {} Maybe Text
a -> BackendAuthAppleProviderConfig
s {$sel:privateKey:BackendAuthAppleProviderConfig' :: Maybe Text
privateKey = Maybe Text
a} :: BackendAuthAppleProviderConfig)
backendAuthAppleProviderConfig_keyId :: Lens.Lens' BackendAuthAppleProviderConfig (Prelude.Maybe Prelude.Text)
backendAuthAppleProviderConfig_keyId :: (Maybe Text -> f (Maybe Text))
-> BackendAuthAppleProviderConfig
-> f BackendAuthAppleProviderConfig
backendAuthAppleProviderConfig_keyId = (BackendAuthAppleProviderConfig -> Maybe Text)
-> (BackendAuthAppleProviderConfig
-> Maybe Text -> BackendAuthAppleProviderConfig)
-> Lens
BackendAuthAppleProviderConfig
BackendAuthAppleProviderConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAuthAppleProviderConfig' {Maybe Text
keyId :: Maybe Text
$sel:keyId:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
keyId} -> Maybe Text
keyId) (\s :: BackendAuthAppleProviderConfig
s@BackendAuthAppleProviderConfig' {} Maybe Text
a -> BackendAuthAppleProviderConfig
s {$sel:keyId:BackendAuthAppleProviderConfig' :: Maybe Text
keyId = Maybe Text
a} :: BackendAuthAppleProviderConfig)
backendAuthAppleProviderConfig_teamId :: Lens.Lens' BackendAuthAppleProviderConfig (Prelude.Maybe Prelude.Text)
backendAuthAppleProviderConfig_teamId :: (Maybe Text -> f (Maybe Text))
-> BackendAuthAppleProviderConfig
-> f BackendAuthAppleProviderConfig
backendAuthAppleProviderConfig_teamId = (BackendAuthAppleProviderConfig -> Maybe Text)
-> (BackendAuthAppleProviderConfig
-> Maybe Text -> BackendAuthAppleProviderConfig)
-> Lens
BackendAuthAppleProviderConfig
BackendAuthAppleProviderConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAuthAppleProviderConfig' {Maybe Text
teamId :: Maybe Text
$sel:teamId:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
teamId} -> Maybe Text
teamId) (\s :: BackendAuthAppleProviderConfig
s@BackendAuthAppleProviderConfig' {} Maybe Text
a -> BackendAuthAppleProviderConfig
s {$sel:teamId:BackendAuthAppleProviderConfig' :: Maybe Text
teamId = Maybe Text
a} :: BackendAuthAppleProviderConfig)
instance Core.FromJSON BackendAuthAppleProviderConfig where
parseJSON :: Value -> Parser BackendAuthAppleProviderConfig
parseJSON =
String
-> (Object -> Parser BackendAuthAppleProviderConfig)
-> Value
-> Parser BackendAuthAppleProviderConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BackendAuthAppleProviderConfig"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> BackendAuthAppleProviderConfig
BackendAuthAppleProviderConfig'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> BackendAuthAppleProviderConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> BackendAuthAppleProviderConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"client_id")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> BackendAuthAppleProviderConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> BackendAuthAppleProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"private_key")
Parser (Maybe Text -> Maybe Text -> BackendAuthAppleProviderConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> BackendAuthAppleProviderConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"key_id")
Parser (Maybe Text -> BackendAuthAppleProviderConfig)
-> Parser (Maybe Text) -> Parser BackendAuthAppleProviderConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"team_id")
)
instance
Prelude.Hashable
BackendAuthAppleProviderConfig
instance
Prelude.NFData
BackendAuthAppleProviderConfig
instance Core.ToJSON BackendAuthAppleProviderConfig where
toJSON :: BackendAuthAppleProviderConfig -> Value
toJSON BackendAuthAppleProviderConfig' {Maybe Text
teamId :: Maybe Text
keyId :: Maybe Text
privateKey :: Maybe Text
clientId :: Maybe Text
$sel:teamId:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
$sel:keyId:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
$sel:privateKey:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
$sel:clientId:BackendAuthAppleProviderConfig' :: BackendAuthAppleProviderConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"client_id" 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
clientId,
(Text
"private_key" 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
"key_id" 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
keyId,
(Text
"team_id" 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
]
)