{-# 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.CreateBackendAuthOAuthConfig where
import Amazonka.AmplifyBackend.Types.OAuthGrantType
import Amazonka.AmplifyBackend.Types.OAuthScopesElement
import Amazonka.AmplifyBackend.Types.SocialProviderSettings
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data CreateBackendAuthOAuthConfig = CreateBackendAuthOAuthConfig'
{
CreateBackendAuthOAuthConfig -> Maybe Text
domainPrefix :: Prelude.Maybe Prelude.Text,
CreateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
socialProviderSettings :: Prelude.Maybe SocialProviderSettings,
CreateBackendAuthOAuthConfig -> [Text]
redirectSignOutURIs :: [Prelude.Text],
CreateBackendAuthOAuthConfig -> [Text]
redirectSignInURIs :: [Prelude.Text],
CreateBackendAuthOAuthConfig -> OAuthGrantType
oAuthGrantType :: OAuthGrantType,
CreateBackendAuthOAuthConfig -> [OAuthScopesElement]
oAuthScopes :: [OAuthScopesElement]
}
deriving (CreateBackendAuthOAuthConfig
-> CreateBackendAuthOAuthConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBackendAuthOAuthConfig
-> CreateBackendAuthOAuthConfig -> Bool
$c/= :: CreateBackendAuthOAuthConfig
-> CreateBackendAuthOAuthConfig -> Bool
== :: CreateBackendAuthOAuthConfig
-> CreateBackendAuthOAuthConfig -> Bool
$c== :: CreateBackendAuthOAuthConfig
-> CreateBackendAuthOAuthConfig -> Bool
Prelude.Eq, ReadPrec [CreateBackendAuthOAuthConfig]
ReadPrec CreateBackendAuthOAuthConfig
Int -> ReadS CreateBackendAuthOAuthConfig
ReadS [CreateBackendAuthOAuthConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBackendAuthOAuthConfig]
$creadListPrec :: ReadPrec [CreateBackendAuthOAuthConfig]
readPrec :: ReadPrec CreateBackendAuthOAuthConfig
$creadPrec :: ReadPrec CreateBackendAuthOAuthConfig
readList :: ReadS [CreateBackendAuthOAuthConfig]
$creadList :: ReadS [CreateBackendAuthOAuthConfig]
readsPrec :: Int -> ReadS CreateBackendAuthOAuthConfig
$creadsPrec :: Int -> ReadS CreateBackendAuthOAuthConfig
Prelude.Read, Int -> CreateBackendAuthOAuthConfig -> ShowS
[CreateBackendAuthOAuthConfig] -> ShowS
CreateBackendAuthOAuthConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBackendAuthOAuthConfig] -> ShowS
$cshowList :: [CreateBackendAuthOAuthConfig] -> ShowS
show :: CreateBackendAuthOAuthConfig -> String
$cshow :: CreateBackendAuthOAuthConfig -> String
showsPrec :: Int -> CreateBackendAuthOAuthConfig -> ShowS
$cshowsPrec :: Int -> CreateBackendAuthOAuthConfig -> ShowS
Prelude.Show, forall x.
Rep CreateBackendAuthOAuthConfig x -> CreateBackendAuthOAuthConfig
forall x.
CreateBackendAuthOAuthConfig -> Rep CreateBackendAuthOAuthConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateBackendAuthOAuthConfig x -> CreateBackendAuthOAuthConfig
$cfrom :: forall x.
CreateBackendAuthOAuthConfig -> Rep CreateBackendAuthOAuthConfig x
Prelude.Generic)
newCreateBackendAuthOAuthConfig ::
OAuthGrantType ->
CreateBackendAuthOAuthConfig
newCreateBackendAuthOAuthConfig :: OAuthGrantType -> CreateBackendAuthOAuthConfig
newCreateBackendAuthOAuthConfig OAuthGrantType
pOAuthGrantType_ =
CreateBackendAuthOAuthConfig'
{ $sel:domainPrefix:CreateBackendAuthOAuthConfig' :: Maybe Text
domainPrefix =
forall a. Maybe a
Prelude.Nothing,
$sel:socialProviderSettings:CreateBackendAuthOAuthConfig' :: Maybe SocialProviderSettings
socialProviderSettings = forall a. Maybe a
Prelude.Nothing,
$sel:redirectSignOutURIs:CreateBackendAuthOAuthConfig' :: [Text]
redirectSignOutURIs = forall a. Monoid a => a
Prelude.mempty,
$sel:redirectSignInURIs:CreateBackendAuthOAuthConfig' :: [Text]
redirectSignInURIs = forall a. Monoid a => a
Prelude.mempty,
$sel:oAuthGrantType:CreateBackendAuthOAuthConfig' :: OAuthGrantType
oAuthGrantType = OAuthGrantType
pOAuthGrantType_,
$sel:oAuthScopes:CreateBackendAuthOAuthConfig' :: [OAuthScopesElement]
oAuthScopes = forall a. Monoid a => a
Prelude.mempty
}
createBackendAuthOAuthConfig_domainPrefix :: Lens.Lens' CreateBackendAuthOAuthConfig (Prelude.Maybe Prelude.Text)
createBackendAuthOAuthConfig_domainPrefix :: Lens' CreateBackendAuthOAuthConfig (Maybe Text)
createBackendAuthOAuthConfig_domainPrefix = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuthOAuthConfig' {Maybe Text
domainPrefix :: Maybe Text
$sel:domainPrefix:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe Text
domainPrefix} -> Maybe Text
domainPrefix) (\s :: CreateBackendAuthOAuthConfig
s@CreateBackendAuthOAuthConfig' {} Maybe Text
a -> CreateBackendAuthOAuthConfig
s {$sel:domainPrefix:CreateBackendAuthOAuthConfig' :: Maybe Text
domainPrefix = Maybe Text
a} :: CreateBackendAuthOAuthConfig)
createBackendAuthOAuthConfig_socialProviderSettings :: Lens.Lens' CreateBackendAuthOAuthConfig (Prelude.Maybe SocialProviderSettings)
createBackendAuthOAuthConfig_socialProviderSettings :: Lens' CreateBackendAuthOAuthConfig (Maybe SocialProviderSettings)
createBackendAuthOAuthConfig_socialProviderSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuthOAuthConfig' {Maybe SocialProviderSettings
socialProviderSettings :: Maybe SocialProviderSettings
$sel:socialProviderSettings:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
socialProviderSettings} -> Maybe SocialProviderSettings
socialProviderSettings) (\s :: CreateBackendAuthOAuthConfig
s@CreateBackendAuthOAuthConfig' {} Maybe SocialProviderSettings
a -> CreateBackendAuthOAuthConfig
s {$sel:socialProviderSettings:CreateBackendAuthOAuthConfig' :: Maybe SocialProviderSettings
socialProviderSettings = Maybe SocialProviderSettings
a} :: CreateBackendAuthOAuthConfig)
createBackendAuthOAuthConfig_redirectSignOutURIs :: Lens.Lens' CreateBackendAuthOAuthConfig [Prelude.Text]
createBackendAuthOAuthConfig_redirectSignOutURIs :: Lens' CreateBackendAuthOAuthConfig [Text]
createBackendAuthOAuthConfig_redirectSignOutURIs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuthOAuthConfig' {[Text]
redirectSignOutURIs :: [Text]
$sel:redirectSignOutURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
redirectSignOutURIs} -> [Text]
redirectSignOutURIs) (\s :: CreateBackendAuthOAuthConfig
s@CreateBackendAuthOAuthConfig' {} [Text]
a -> CreateBackendAuthOAuthConfig
s {$sel:redirectSignOutURIs:CreateBackendAuthOAuthConfig' :: [Text]
redirectSignOutURIs = [Text]
a} :: CreateBackendAuthOAuthConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createBackendAuthOAuthConfig_redirectSignInURIs :: Lens.Lens' CreateBackendAuthOAuthConfig [Prelude.Text]
createBackendAuthOAuthConfig_redirectSignInURIs :: Lens' CreateBackendAuthOAuthConfig [Text]
createBackendAuthOAuthConfig_redirectSignInURIs = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuthOAuthConfig' {[Text]
redirectSignInURIs :: [Text]
$sel:redirectSignInURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
redirectSignInURIs} -> [Text]
redirectSignInURIs) (\s :: CreateBackendAuthOAuthConfig
s@CreateBackendAuthOAuthConfig' {} [Text]
a -> CreateBackendAuthOAuthConfig
s {$sel:redirectSignInURIs:CreateBackendAuthOAuthConfig' :: [Text]
redirectSignInURIs = [Text]
a} :: CreateBackendAuthOAuthConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
createBackendAuthOAuthConfig_oAuthGrantType :: Lens.Lens' CreateBackendAuthOAuthConfig OAuthGrantType
createBackendAuthOAuthConfig_oAuthGrantType :: Lens' CreateBackendAuthOAuthConfig OAuthGrantType
createBackendAuthOAuthConfig_oAuthGrantType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuthOAuthConfig' {OAuthGrantType
oAuthGrantType :: OAuthGrantType
$sel:oAuthGrantType:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> OAuthGrantType
oAuthGrantType} -> OAuthGrantType
oAuthGrantType) (\s :: CreateBackendAuthOAuthConfig
s@CreateBackendAuthOAuthConfig' {} OAuthGrantType
a -> CreateBackendAuthOAuthConfig
s {$sel:oAuthGrantType:CreateBackendAuthOAuthConfig' :: OAuthGrantType
oAuthGrantType = OAuthGrantType
a} :: CreateBackendAuthOAuthConfig)
createBackendAuthOAuthConfig_oAuthScopes :: Lens.Lens' CreateBackendAuthOAuthConfig [OAuthScopesElement]
createBackendAuthOAuthConfig_oAuthScopes :: Lens' CreateBackendAuthOAuthConfig [OAuthScopesElement]
createBackendAuthOAuthConfig_oAuthScopes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBackendAuthOAuthConfig' {[OAuthScopesElement]
oAuthScopes :: [OAuthScopesElement]
$sel:oAuthScopes:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [OAuthScopesElement]
oAuthScopes} -> [OAuthScopesElement]
oAuthScopes) (\s :: CreateBackendAuthOAuthConfig
s@CreateBackendAuthOAuthConfig' {} [OAuthScopesElement]
a -> CreateBackendAuthOAuthConfig
s {$sel:oAuthScopes:CreateBackendAuthOAuthConfig' :: [OAuthScopesElement]
oAuthScopes = [OAuthScopesElement]
a} :: CreateBackendAuthOAuthConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON CreateBackendAuthOAuthConfig where
parseJSON :: Value -> Parser CreateBackendAuthOAuthConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CreateBackendAuthOAuthConfig"
( \Object
x ->
Maybe Text
-> Maybe SocialProviderSettings
-> [Text]
-> [Text]
-> OAuthGrantType
-> [OAuthScopesElement]
-> CreateBackendAuthOAuthConfig
CreateBackendAuthOAuthConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"domainPrefix")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"socialProviderSettings")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"redirectSignOutURIs"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"redirectSignInURIs"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"oAuthGrantType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"oAuthScopes" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
CreateBackendAuthOAuthConfig
where
hashWithSalt :: Int -> CreateBackendAuthOAuthConfig -> Int
hashWithSalt Int
_salt CreateBackendAuthOAuthConfig' {[Text]
[OAuthScopesElement]
Maybe Text
Maybe SocialProviderSettings
OAuthGrantType
oAuthScopes :: [OAuthScopesElement]
oAuthGrantType :: OAuthGrantType
redirectSignInURIs :: [Text]
redirectSignOutURIs :: [Text]
socialProviderSettings :: Maybe SocialProviderSettings
domainPrefix :: Maybe Text
$sel:oAuthScopes:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [OAuthScopesElement]
$sel:oAuthGrantType:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> OAuthGrantType
$sel:redirectSignInURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
$sel:redirectSignOutURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
$sel:socialProviderSettings:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
$sel:domainPrefix:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
domainPrefix
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SocialProviderSettings
socialProviderSettings
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
redirectSignOutURIs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
redirectSignInURIs
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OAuthGrantType
oAuthGrantType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [OAuthScopesElement]
oAuthScopes
instance Prelude.NFData CreateBackendAuthOAuthConfig where
rnf :: CreateBackendAuthOAuthConfig -> ()
rnf CreateBackendAuthOAuthConfig' {[Text]
[OAuthScopesElement]
Maybe Text
Maybe SocialProviderSettings
OAuthGrantType
oAuthScopes :: [OAuthScopesElement]
oAuthGrantType :: OAuthGrantType
redirectSignInURIs :: [Text]
redirectSignOutURIs :: [Text]
socialProviderSettings :: Maybe SocialProviderSettings
domainPrefix :: Maybe Text
$sel:oAuthScopes:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [OAuthScopesElement]
$sel:oAuthGrantType:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> OAuthGrantType
$sel:redirectSignInURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
$sel:redirectSignOutURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
$sel:socialProviderSettings:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
$sel:domainPrefix:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
domainPrefix
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SocialProviderSettings
socialProviderSettings
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
redirectSignOutURIs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
redirectSignInURIs
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OAuthGrantType
oAuthGrantType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [OAuthScopesElement]
oAuthScopes
instance Data.ToJSON CreateBackendAuthOAuthConfig where
toJSON :: CreateBackendAuthOAuthConfig -> Value
toJSON CreateBackendAuthOAuthConfig' {[Text]
[OAuthScopesElement]
Maybe Text
Maybe SocialProviderSettings
OAuthGrantType
oAuthScopes :: [OAuthScopesElement]
oAuthGrantType :: OAuthGrantType
redirectSignInURIs :: [Text]
redirectSignOutURIs :: [Text]
socialProviderSettings :: Maybe SocialProviderSettings
domainPrefix :: Maybe Text
$sel:oAuthScopes:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [OAuthScopesElement]
$sel:oAuthGrantType:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> OAuthGrantType
$sel:redirectSignInURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
$sel:redirectSignOutURIs:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> [Text]
$sel:socialProviderSettings:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
$sel:domainPrefix:CreateBackendAuthOAuthConfig' :: CreateBackendAuthOAuthConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"domainPrefix" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
domainPrefix,
(Key
"socialProviderSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SocialProviderSettings
socialProviderSettings,
forall a. a -> Maybe a
Prelude.Just
(Key
"redirectSignOutURIs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
redirectSignOutURIs),
forall a. a -> Maybe a
Prelude.Just
(Key
"redirectSignInURIs" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
redirectSignInURIs),
forall a. a -> Maybe a
Prelude.Just
(Key
"oAuthGrantType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OAuthGrantType
oAuthGrantType),
forall a. a -> Maybe a
Prelude.Just (Key
"oAuthScopes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [OAuthScopesElement]
oAuthScopes)
]
)