{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AmplifyBackend.Types.UpdateBackendAuthOAuthConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.AmplifyBackend.Types.UpdateBackendAuthOAuthConfig 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The OAuth configurations for authenticating users into your Amplify app.
--
-- /See:/ 'newUpdateBackendAuthOAuthConfig' smart constructor.
data UpdateBackendAuthOAuthConfig = UpdateBackendAuthOAuthConfig'
  { -- | Describes third-party social federation configurations for allowing your
    -- users to sign in with OAuth.
    UpdateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
socialProviderSettings :: Prelude.Maybe SocialProviderSettings,
    -- | The Amazon Cognito domain prefix used to create a hosted UI for
    -- authentication.
    UpdateBackendAuthOAuthConfig -> Maybe Text
domainPrefix :: Prelude.Maybe Prelude.Text,
    -- | The list of OAuth-related flows that can allow users to authenticate
    -- from your Amplify app.
    UpdateBackendAuthOAuthConfig -> Maybe [OAuthScopesElement]
oAuthScopes :: Prelude.Maybe [OAuthScopesElement],
    -- | The OAuth grant type to allow app users to authenticate from your
    -- Amplify app.
    UpdateBackendAuthOAuthConfig -> Maybe OAuthGrantType
oAuthGrantType :: Prelude.Maybe OAuthGrantType,
    -- | Redirect URLs that OAuth uses when a user signs out of an Amplify app.
    UpdateBackendAuthOAuthConfig -> Maybe [Text]
redirectSignOutURIs :: Prelude.Maybe [Prelude.Text],
    -- | Redirect URLs that OAuth uses when a user signs in to an Amplify app.
    UpdateBackendAuthOAuthConfig -> Maybe [Text]
redirectSignInURIs :: Prelude.Maybe [Prelude.Text]
  }
  deriving (UpdateBackendAuthOAuthConfig
-> UpdateBackendAuthOAuthConfig -> Bool
(UpdateBackendAuthOAuthConfig
 -> UpdateBackendAuthOAuthConfig -> Bool)
-> (UpdateBackendAuthOAuthConfig
    -> UpdateBackendAuthOAuthConfig -> Bool)
-> Eq UpdateBackendAuthOAuthConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBackendAuthOAuthConfig
-> UpdateBackendAuthOAuthConfig -> Bool
$c/= :: UpdateBackendAuthOAuthConfig
-> UpdateBackendAuthOAuthConfig -> Bool
== :: UpdateBackendAuthOAuthConfig
-> UpdateBackendAuthOAuthConfig -> Bool
$c== :: UpdateBackendAuthOAuthConfig
-> UpdateBackendAuthOAuthConfig -> Bool
Prelude.Eq, ReadPrec [UpdateBackendAuthOAuthConfig]
ReadPrec UpdateBackendAuthOAuthConfig
Int -> ReadS UpdateBackendAuthOAuthConfig
ReadS [UpdateBackendAuthOAuthConfig]
(Int -> ReadS UpdateBackendAuthOAuthConfig)
-> ReadS [UpdateBackendAuthOAuthConfig]
-> ReadPrec UpdateBackendAuthOAuthConfig
-> ReadPrec [UpdateBackendAuthOAuthConfig]
-> Read UpdateBackendAuthOAuthConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBackendAuthOAuthConfig]
$creadListPrec :: ReadPrec [UpdateBackendAuthOAuthConfig]
readPrec :: ReadPrec UpdateBackendAuthOAuthConfig
$creadPrec :: ReadPrec UpdateBackendAuthOAuthConfig
readList :: ReadS [UpdateBackendAuthOAuthConfig]
$creadList :: ReadS [UpdateBackendAuthOAuthConfig]
readsPrec :: Int -> ReadS UpdateBackendAuthOAuthConfig
$creadsPrec :: Int -> ReadS UpdateBackendAuthOAuthConfig
Prelude.Read, Int -> UpdateBackendAuthOAuthConfig -> ShowS
[UpdateBackendAuthOAuthConfig] -> ShowS
UpdateBackendAuthOAuthConfig -> String
(Int -> UpdateBackendAuthOAuthConfig -> ShowS)
-> (UpdateBackendAuthOAuthConfig -> String)
-> ([UpdateBackendAuthOAuthConfig] -> ShowS)
-> Show UpdateBackendAuthOAuthConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBackendAuthOAuthConfig] -> ShowS
$cshowList :: [UpdateBackendAuthOAuthConfig] -> ShowS
show :: UpdateBackendAuthOAuthConfig -> String
$cshow :: UpdateBackendAuthOAuthConfig -> String
showsPrec :: Int -> UpdateBackendAuthOAuthConfig -> ShowS
$cshowsPrec :: Int -> UpdateBackendAuthOAuthConfig -> ShowS
Prelude.Show, (forall x.
 UpdateBackendAuthOAuthConfig -> Rep UpdateBackendAuthOAuthConfig x)
-> (forall x.
    Rep UpdateBackendAuthOAuthConfig x -> UpdateBackendAuthOAuthConfig)
-> Generic UpdateBackendAuthOAuthConfig
forall x.
Rep UpdateBackendAuthOAuthConfig x -> UpdateBackendAuthOAuthConfig
forall x.
UpdateBackendAuthOAuthConfig -> Rep UpdateBackendAuthOAuthConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateBackendAuthOAuthConfig x -> UpdateBackendAuthOAuthConfig
$cfrom :: forall x.
UpdateBackendAuthOAuthConfig -> Rep UpdateBackendAuthOAuthConfig x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBackendAuthOAuthConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'socialProviderSettings', 'updateBackendAuthOAuthConfig_socialProviderSettings' - Describes third-party social federation configurations for allowing your
-- users to sign in with OAuth.
--
-- 'domainPrefix', 'updateBackendAuthOAuthConfig_domainPrefix' - The Amazon Cognito domain prefix used to create a hosted UI for
-- authentication.
--
-- 'oAuthScopes', 'updateBackendAuthOAuthConfig_oAuthScopes' - The list of OAuth-related flows that can allow users to authenticate
-- from your Amplify app.
--
-- 'oAuthGrantType', 'updateBackendAuthOAuthConfig_oAuthGrantType' - The OAuth grant type to allow app users to authenticate from your
-- Amplify app.
--
-- 'redirectSignOutURIs', 'updateBackendAuthOAuthConfig_redirectSignOutURIs' - Redirect URLs that OAuth uses when a user signs out of an Amplify app.
--
-- 'redirectSignInURIs', 'updateBackendAuthOAuthConfig_redirectSignInURIs' - Redirect URLs that OAuth uses when a user signs in to an Amplify app.
newUpdateBackendAuthOAuthConfig ::
  UpdateBackendAuthOAuthConfig
newUpdateBackendAuthOAuthConfig :: UpdateBackendAuthOAuthConfig
newUpdateBackendAuthOAuthConfig =
  UpdateBackendAuthOAuthConfig' :: Maybe SocialProviderSettings
-> Maybe Text
-> Maybe [OAuthScopesElement]
-> Maybe OAuthGrantType
-> Maybe [Text]
-> Maybe [Text]
-> UpdateBackendAuthOAuthConfig
UpdateBackendAuthOAuthConfig'
    { $sel:socialProviderSettings:UpdateBackendAuthOAuthConfig' :: Maybe SocialProviderSettings
socialProviderSettings =
        Maybe SocialProviderSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:domainPrefix:UpdateBackendAuthOAuthConfig' :: Maybe Text
domainPrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:oAuthScopes:UpdateBackendAuthOAuthConfig' :: Maybe [OAuthScopesElement]
oAuthScopes = Maybe [OAuthScopesElement]
forall a. Maybe a
Prelude.Nothing,
      $sel:oAuthGrantType:UpdateBackendAuthOAuthConfig' :: Maybe OAuthGrantType
oAuthGrantType = Maybe OAuthGrantType
forall a. Maybe a
Prelude.Nothing,
      $sel:redirectSignOutURIs:UpdateBackendAuthOAuthConfig' :: Maybe [Text]
redirectSignOutURIs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:redirectSignInURIs:UpdateBackendAuthOAuthConfig' :: Maybe [Text]
redirectSignInURIs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes third-party social federation configurations for allowing your
-- users to sign in with OAuth.
updateBackendAuthOAuthConfig_socialProviderSettings :: Lens.Lens' UpdateBackendAuthOAuthConfig (Prelude.Maybe SocialProviderSettings)
updateBackendAuthOAuthConfig_socialProviderSettings :: (Maybe SocialProviderSettings -> f (Maybe SocialProviderSettings))
-> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig
updateBackendAuthOAuthConfig_socialProviderSettings = (UpdateBackendAuthOAuthConfig -> Maybe SocialProviderSettings)
-> (UpdateBackendAuthOAuthConfig
    -> Maybe SocialProviderSettings -> UpdateBackendAuthOAuthConfig)
-> Lens
     UpdateBackendAuthOAuthConfig
     UpdateBackendAuthOAuthConfig
     (Maybe SocialProviderSettings)
     (Maybe SocialProviderSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthOAuthConfig' {Maybe SocialProviderSettings
socialProviderSettings :: Maybe SocialProviderSettings
$sel:socialProviderSettings:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
socialProviderSettings} -> Maybe SocialProviderSettings
socialProviderSettings) (\s :: UpdateBackendAuthOAuthConfig
s@UpdateBackendAuthOAuthConfig' {} Maybe SocialProviderSettings
a -> UpdateBackendAuthOAuthConfig
s {$sel:socialProviderSettings:UpdateBackendAuthOAuthConfig' :: Maybe SocialProviderSettings
socialProviderSettings = Maybe SocialProviderSettings
a} :: UpdateBackendAuthOAuthConfig)

-- | The Amazon Cognito domain prefix used to create a hosted UI for
-- authentication.
updateBackendAuthOAuthConfig_domainPrefix :: Lens.Lens' UpdateBackendAuthOAuthConfig (Prelude.Maybe Prelude.Text)
updateBackendAuthOAuthConfig_domainPrefix :: (Maybe Text -> f (Maybe Text))
-> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig
updateBackendAuthOAuthConfig_domainPrefix = (UpdateBackendAuthOAuthConfig -> Maybe Text)
-> (UpdateBackendAuthOAuthConfig
    -> Maybe Text -> UpdateBackendAuthOAuthConfig)
-> Lens
     UpdateBackendAuthOAuthConfig
     UpdateBackendAuthOAuthConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthOAuthConfig' {Maybe Text
domainPrefix :: Maybe Text
$sel:domainPrefix:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe Text
domainPrefix} -> Maybe Text
domainPrefix) (\s :: UpdateBackendAuthOAuthConfig
s@UpdateBackendAuthOAuthConfig' {} Maybe Text
a -> UpdateBackendAuthOAuthConfig
s {$sel:domainPrefix:UpdateBackendAuthOAuthConfig' :: Maybe Text
domainPrefix = Maybe Text
a} :: UpdateBackendAuthOAuthConfig)

-- | The list of OAuth-related flows that can allow users to authenticate
-- from your Amplify app.
updateBackendAuthOAuthConfig_oAuthScopes :: Lens.Lens' UpdateBackendAuthOAuthConfig (Prelude.Maybe [OAuthScopesElement])
updateBackendAuthOAuthConfig_oAuthScopes :: (Maybe [OAuthScopesElement] -> f (Maybe [OAuthScopesElement]))
-> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig
updateBackendAuthOAuthConfig_oAuthScopes = (UpdateBackendAuthOAuthConfig -> Maybe [OAuthScopesElement])
-> (UpdateBackendAuthOAuthConfig
    -> Maybe [OAuthScopesElement] -> UpdateBackendAuthOAuthConfig)
-> Lens
     UpdateBackendAuthOAuthConfig
     UpdateBackendAuthOAuthConfig
     (Maybe [OAuthScopesElement])
     (Maybe [OAuthScopesElement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthOAuthConfig' {Maybe [OAuthScopesElement]
oAuthScopes :: Maybe [OAuthScopesElement]
$sel:oAuthScopes:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe [OAuthScopesElement]
oAuthScopes} -> Maybe [OAuthScopesElement]
oAuthScopes) (\s :: UpdateBackendAuthOAuthConfig
s@UpdateBackendAuthOAuthConfig' {} Maybe [OAuthScopesElement]
a -> UpdateBackendAuthOAuthConfig
s {$sel:oAuthScopes:UpdateBackendAuthOAuthConfig' :: Maybe [OAuthScopesElement]
oAuthScopes = Maybe [OAuthScopesElement]
a} :: UpdateBackendAuthOAuthConfig) ((Maybe [OAuthScopesElement] -> f (Maybe [OAuthScopesElement]))
 -> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig)
-> ((Maybe [OAuthScopesElement] -> f (Maybe [OAuthScopesElement]))
    -> Maybe [OAuthScopesElement] -> f (Maybe [OAuthScopesElement]))
-> (Maybe [OAuthScopesElement] -> f (Maybe [OAuthScopesElement]))
-> UpdateBackendAuthOAuthConfig
-> f UpdateBackendAuthOAuthConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [OAuthScopesElement]
  [OAuthScopesElement]
  [OAuthScopesElement]
  [OAuthScopesElement]
-> Iso
     (Maybe [OAuthScopesElement])
     (Maybe [OAuthScopesElement])
     (Maybe [OAuthScopesElement])
     (Maybe [OAuthScopesElement])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [OAuthScopesElement]
  [OAuthScopesElement]
  [OAuthScopesElement]
  [OAuthScopesElement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The OAuth grant type to allow app users to authenticate from your
-- Amplify app.
updateBackendAuthOAuthConfig_oAuthGrantType :: Lens.Lens' UpdateBackendAuthOAuthConfig (Prelude.Maybe OAuthGrantType)
updateBackendAuthOAuthConfig_oAuthGrantType :: (Maybe OAuthGrantType -> f (Maybe OAuthGrantType))
-> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig
updateBackendAuthOAuthConfig_oAuthGrantType = (UpdateBackendAuthOAuthConfig -> Maybe OAuthGrantType)
-> (UpdateBackendAuthOAuthConfig
    -> Maybe OAuthGrantType -> UpdateBackendAuthOAuthConfig)
-> Lens
     UpdateBackendAuthOAuthConfig
     UpdateBackendAuthOAuthConfig
     (Maybe OAuthGrantType)
     (Maybe OAuthGrantType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthOAuthConfig' {Maybe OAuthGrantType
oAuthGrantType :: Maybe OAuthGrantType
$sel:oAuthGrantType:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe OAuthGrantType
oAuthGrantType} -> Maybe OAuthGrantType
oAuthGrantType) (\s :: UpdateBackendAuthOAuthConfig
s@UpdateBackendAuthOAuthConfig' {} Maybe OAuthGrantType
a -> UpdateBackendAuthOAuthConfig
s {$sel:oAuthGrantType:UpdateBackendAuthOAuthConfig' :: Maybe OAuthGrantType
oAuthGrantType = Maybe OAuthGrantType
a} :: UpdateBackendAuthOAuthConfig)

-- | Redirect URLs that OAuth uses when a user signs out of an Amplify app.
updateBackendAuthOAuthConfig_redirectSignOutURIs :: Lens.Lens' UpdateBackendAuthOAuthConfig (Prelude.Maybe [Prelude.Text])
updateBackendAuthOAuthConfig_redirectSignOutURIs :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig
updateBackendAuthOAuthConfig_redirectSignOutURIs = (UpdateBackendAuthOAuthConfig -> Maybe [Text])
-> (UpdateBackendAuthOAuthConfig
    -> Maybe [Text] -> UpdateBackendAuthOAuthConfig)
-> Lens
     UpdateBackendAuthOAuthConfig
     UpdateBackendAuthOAuthConfig
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthOAuthConfig' {Maybe [Text]
redirectSignOutURIs :: Maybe [Text]
$sel:redirectSignOutURIs:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe [Text]
redirectSignOutURIs} -> Maybe [Text]
redirectSignOutURIs) (\s :: UpdateBackendAuthOAuthConfig
s@UpdateBackendAuthOAuthConfig' {} Maybe [Text]
a -> UpdateBackendAuthOAuthConfig
s {$sel:redirectSignOutURIs:UpdateBackendAuthOAuthConfig' :: Maybe [Text]
redirectSignOutURIs = Maybe [Text]
a} :: UpdateBackendAuthOAuthConfig) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateBackendAuthOAuthConfig
-> f UpdateBackendAuthOAuthConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Redirect URLs that OAuth uses when a user signs in to an Amplify app.
updateBackendAuthOAuthConfig_redirectSignInURIs :: Lens.Lens' UpdateBackendAuthOAuthConfig (Prelude.Maybe [Prelude.Text])
updateBackendAuthOAuthConfig_redirectSignInURIs :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig
updateBackendAuthOAuthConfig_redirectSignInURIs = (UpdateBackendAuthOAuthConfig -> Maybe [Text])
-> (UpdateBackendAuthOAuthConfig
    -> Maybe [Text] -> UpdateBackendAuthOAuthConfig)
-> Lens
     UpdateBackendAuthOAuthConfig
     UpdateBackendAuthOAuthConfig
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBackendAuthOAuthConfig' {Maybe [Text]
redirectSignInURIs :: Maybe [Text]
$sel:redirectSignInURIs:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe [Text]
redirectSignInURIs} -> Maybe [Text]
redirectSignInURIs) (\s :: UpdateBackendAuthOAuthConfig
s@UpdateBackendAuthOAuthConfig' {} Maybe [Text]
a -> UpdateBackendAuthOAuthConfig
s {$sel:redirectSignInURIs:UpdateBackendAuthOAuthConfig' :: Maybe [Text]
redirectSignInURIs = Maybe [Text]
a} :: UpdateBackendAuthOAuthConfig) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateBackendAuthOAuthConfig -> f UpdateBackendAuthOAuthConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateBackendAuthOAuthConfig
-> f UpdateBackendAuthOAuthConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.Hashable
    UpdateBackendAuthOAuthConfig

instance Prelude.NFData UpdateBackendAuthOAuthConfig

instance Core.ToJSON UpdateBackendAuthOAuthConfig where
  toJSON :: UpdateBackendAuthOAuthConfig -> Value
toJSON UpdateBackendAuthOAuthConfig' {Maybe [Text]
Maybe [OAuthScopesElement]
Maybe Text
Maybe OAuthGrantType
Maybe SocialProviderSettings
redirectSignInURIs :: Maybe [Text]
redirectSignOutURIs :: Maybe [Text]
oAuthGrantType :: Maybe OAuthGrantType
oAuthScopes :: Maybe [OAuthScopesElement]
domainPrefix :: Maybe Text
socialProviderSettings :: Maybe SocialProviderSettings
$sel:redirectSignInURIs:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe [Text]
$sel:redirectSignOutURIs:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe [Text]
$sel:oAuthGrantType:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe OAuthGrantType
$sel:oAuthScopes:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe [OAuthScopesElement]
$sel:domainPrefix:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe Text
$sel:socialProviderSettings:UpdateBackendAuthOAuthConfig' :: UpdateBackendAuthOAuthConfig -> Maybe SocialProviderSettings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"socialProviderSettings" Text -> SocialProviderSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (SocialProviderSettings -> Pair)
-> Maybe SocialProviderSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SocialProviderSettings
socialProviderSettings,
            (Text
"domainPrefix" 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
domainPrefix,
            (Text
"oAuthScopes" Text -> [OAuthScopesElement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([OAuthScopesElement] -> Pair)
-> Maybe [OAuthScopesElement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [OAuthScopesElement]
oAuthScopes,
            (Text
"oAuthGrantType" Text -> OAuthGrantType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (OAuthGrantType -> Pair) -> Maybe OAuthGrantType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OAuthGrantType
oAuthGrantType,
            (Text
"redirectSignOutURIs" 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]
redirectSignOutURIs,
            (Text
"redirectSignInURIs" 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]
redirectSignInURIs
          ]
      )