{-# 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.BackendAPIResourceConfig
-- 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.BackendAPIResourceConfig where

import Amazonka.AmplifyBackend.Types.BackendAPIAuthType
import Amazonka.AmplifyBackend.Types.BackendAPIConflictResolution
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The resource config for the data model, configured as a part of the
-- Amplify project.
--
-- /See:/ 'newBackendAPIResourceConfig' smart constructor.
data BackendAPIResourceConfig = BackendAPIResourceConfig'
  { -- | The API name used to interact with the data model, configured as a part
    -- of your Amplify project.
    BackendAPIResourceConfig -> Maybe Text
apiName :: Prelude.Maybe Prelude.Text,
    -- | The service used to provision and interact with the data model.
    BackendAPIResourceConfig -> Maybe Text
service :: Prelude.Maybe Prelude.Text,
    -- | The definition of the data model in the annotated transform of the
    -- GraphQL schema.
    BackendAPIResourceConfig -> Maybe Text
transformSchema :: Prelude.Maybe Prelude.Text,
    -- | Additional authentication methods used to interact with your data
    -- models.
    BackendAPIResourceConfig -> Maybe [BackendAPIAuthType]
additionalAuthTypes :: Prelude.Maybe [BackendAPIAuthType],
    -- | The conflict resolution strategy for your data stored in the data
    -- models.
    BackendAPIResourceConfig -> Maybe BackendAPIConflictResolution
conflictResolution :: Prelude.Maybe BackendAPIConflictResolution,
    -- | The default authentication type for interacting with the configured data
    -- models in your Amplify project.
    BackendAPIResourceConfig -> Maybe BackendAPIAuthType
defaultAuthType :: Prelude.Maybe BackendAPIAuthType
  }
  deriving (BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool
(BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool)
-> (BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool)
-> Eq BackendAPIResourceConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool
$c/= :: BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool
== :: BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool
$c== :: BackendAPIResourceConfig -> BackendAPIResourceConfig -> Bool
Prelude.Eq, ReadPrec [BackendAPIResourceConfig]
ReadPrec BackendAPIResourceConfig
Int -> ReadS BackendAPIResourceConfig
ReadS [BackendAPIResourceConfig]
(Int -> ReadS BackendAPIResourceConfig)
-> ReadS [BackendAPIResourceConfig]
-> ReadPrec BackendAPIResourceConfig
-> ReadPrec [BackendAPIResourceConfig]
-> Read BackendAPIResourceConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackendAPIResourceConfig]
$creadListPrec :: ReadPrec [BackendAPIResourceConfig]
readPrec :: ReadPrec BackendAPIResourceConfig
$creadPrec :: ReadPrec BackendAPIResourceConfig
readList :: ReadS [BackendAPIResourceConfig]
$creadList :: ReadS [BackendAPIResourceConfig]
readsPrec :: Int -> ReadS BackendAPIResourceConfig
$creadsPrec :: Int -> ReadS BackendAPIResourceConfig
Prelude.Read, Int -> BackendAPIResourceConfig -> ShowS
[BackendAPIResourceConfig] -> ShowS
BackendAPIResourceConfig -> String
(Int -> BackendAPIResourceConfig -> ShowS)
-> (BackendAPIResourceConfig -> String)
-> ([BackendAPIResourceConfig] -> ShowS)
-> Show BackendAPIResourceConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackendAPIResourceConfig] -> ShowS
$cshowList :: [BackendAPIResourceConfig] -> ShowS
show :: BackendAPIResourceConfig -> String
$cshow :: BackendAPIResourceConfig -> String
showsPrec :: Int -> BackendAPIResourceConfig -> ShowS
$cshowsPrec :: Int -> BackendAPIResourceConfig -> ShowS
Prelude.Show, (forall x.
 BackendAPIResourceConfig -> Rep BackendAPIResourceConfig x)
-> (forall x.
    Rep BackendAPIResourceConfig x -> BackendAPIResourceConfig)
-> Generic BackendAPIResourceConfig
forall x.
Rep BackendAPIResourceConfig x -> BackendAPIResourceConfig
forall x.
BackendAPIResourceConfig -> Rep BackendAPIResourceConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BackendAPIResourceConfig x -> BackendAPIResourceConfig
$cfrom :: forall x.
BackendAPIResourceConfig -> Rep BackendAPIResourceConfig x
Prelude.Generic)

-- |
-- Create a value of 'BackendAPIResourceConfig' 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:
--
-- 'apiName', 'backendAPIResourceConfig_apiName' - The API name used to interact with the data model, configured as a part
-- of your Amplify project.
--
-- 'service', 'backendAPIResourceConfig_service' - The service used to provision and interact with the data model.
--
-- 'transformSchema', 'backendAPIResourceConfig_transformSchema' - The definition of the data model in the annotated transform of the
-- GraphQL schema.
--
-- 'additionalAuthTypes', 'backendAPIResourceConfig_additionalAuthTypes' - Additional authentication methods used to interact with your data
-- models.
--
-- 'conflictResolution', 'backendAPIResourceConfig_conflictResolution' - The conflict resolution strategy for your data stored in the data
-- models.
--
-- 'defaultAuthType', 'backendAPIResourceConfig_defaultAuthType' - The default authentication type for interacting with the configured data
-- models in your Amplify project.
newBackendAPIResourceConfig ::
  BackendAPIResourceConfig
newBackendAPIResourceConfig :: BackendAPIResourceConfig
newBackendAPIResourceConfig =
  BackendAPIResourceConfig' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [BackendAPIAuthType]
-> Maybe BackendAPIConflictResolution
-> Maybe BackendAPIAuthType
-> BackendAPIResourceConfig
BackendAPIResourceConfig'
    { $sel:apiName:BackendAPIResourceConfig' :: Maybe Text
apiName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:service:BackendAPIResourceConfig' :: Maybe Text
service = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:transformSchema:BackendAPIResourceConfig' :: Maybe Text
transformSchema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalAuthTypes:BackendAPIResourceConfig' :: Maybe [BackendAPIAuthType]
additionalAuthTypes = Maybe [BackendAPIAuthType]
forall a. Maybe a
Prelude.Nothing,
      $sel:conflictResolution:BackendAPIResourceConfig' :: Maybe BackendAPIConflictResolution
conflictResolution = Maybe BackendAPIConflictResolution
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultAuthType:BackendAPIResourceConfig' :: Maybe BackendAPIAuthType
defaultAuthType = Maybe BackendAPIAuthType
forall a. Maybe a
Prelude.Nothing
    }

-- | The API name used to interact with the data model, configured as a part
-- of your Amplify project.
backendAPIResourceConfig_apiName :: Lens.Lens' BackendAPIResourceConfig (Prelude.Maybe Prelude.Text)
backendAPIResourceConfig_apiName :: (Maybe Text -> f (Maybe Text))
-> BackendAPIResourceConfig -> f BackendAPIResourceConfig
backendAPIResourceConfig_apiName = (BackendAPIResourceConfig -> Maybe Text)
-> (BackendAPIResourceConfig
    -> Maybe Text -> BackendAPIResourceConfig)
-> Lens
     BackendAPIResourceConfig
     BackendAPIResourceConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAPIResourceConfig' {Maybe Text
apiName :: Maybe Text
$sel:apiName:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe Text
apiName} -> Maybe Text
apiName) (\s :: BackendAPIResourceConfig
s@BackendAPIResourceConfig' {} Maybe Text
a -> BackendAPIResourceConfig
s {$sel:apiName:BackendAPIResourceConfig' :: Maybe Text
apiName = Maybe Text
a} :: BackendAPIResourceConfig)

-- | The service used to provision and interact with the data model.
backendAPIResourceConfig_service :: Lens.Lens' BackendAPIResourceConfig (Prelude.Maybe Prelude.Text)
backendAPIResourceConfig_service :: (Maybe Text -> f (Maybe Text))
-> BackendAPIResourceConfig -> f BackendAPIResourceConfig
backendAPIResourceConfig_service = (BackendAPIResourceConfig -> Maybe Text)
-> (BackendAPIResourceConfig
    -> Maybe Text -> BackendAPIResourceConfig)
-> Lens
     BackendAPIResourceConfig
     BackendAPIResourceConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAPIResourceConfig' {Maybe Text
service :: Maybe Text
$sel:service:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe Text
service} -> Maybe Text
service) (\s :: BackendAPIResourceConfig
s@BackendAPIResourceConfig' {} Maybe Text
a -> BackendAPIResourceConfig
s {$sel:service:BackendAPIResourceConfig' :: Maybe Text
service = Maybe Text
a} :: BackendAPIResourceConfig)

-- | The definition of the data model in the annotated transform of the
-- GraphQL schema.
backendAPIResourceConfig_transformSchema :: Lens.Lens' BackendAPIResourceConfig (Prelude.Maybe Prelude.Text)
backendAPIResourceConfig_transformSchema :: (Maybe Text -> f (Maybe Text))
-> BackendAPIResourceConfig -> f BackendAPIResourceConfig
backendAPIResourceConfig_transformSchema = (BackendAPIResourceConfig -> Maybe Text)
-> (BackendAPIResourceConfig
    -> Maybe Text -> BackendAPIResourceConfig)
-> Lens
     BackendAPIResourceConfig
     BackendAPIResourceConfig
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAPIResourceConfig' {Maybe Text
transformSchema :: Maybe Text
$sel:transformSchema:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe Text
transformSchema} -> Maybe Text
transformSchema) (\s :: BackendAPIResourceConfig
s@BackendAPIResourceConfig' {} Maybe Text
a -> BackendAPIResourceConfig
s {$sel:transformSchema:BackendAPIResourceConfig' :: Maybe Text
transformSchema = Maybe Text
a} :: BackendAPIResourceConfig)

-- | Additional authentication methods used to interact with your data
-- models.
backendAPIResourceConfig_additionalAuthTypes :: Lens.Lens' BackendAPIResourceConfig (Prelude.Maybe [BackendAPIAuthType])
backendAPIResourceConfig_additionalAuthTypes :: (Maybe [BackendAPIAuthType] -> f (Maybe [BackendAPIAuthType]))
-> BackendAPIResourceConfig -> f BackendAPIResourceConfig
backendAPIResourceConfig_additionalAuthTypes = (BackendAPIResourceConfig -> Maybe [BackendAPIAuthType])
-> (BackendAPIResourceConfig
    -> Maybe [BackendAPIAuthType] -> BackendAPIResourceConfig)
-> Lens
     BackendAPIResourceConfig
     BackendAPIResourceConfig
     (Maybe [BackendAPIAuthType])
     (Maybe [BackendAPIAuthType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAPIResourceConfig' {Maybe [BackendAPIAuthType]
additionalAuthTypes :: Maybe [BackendAPIAuthType]
$sel:additionalAuthTypes:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe [BackendAPIAuthType]
additionalAuthTypes} -> Maybe [BackendAPIAuthType]
additionalAuthTypes) (\s :: BackendAPIResourceConfig
s@BackendAPIResourceConfig' {} Maybe [BackendAPIAuthType]
a -> BackendAPIResourceConfig
s {$sel:additionalAuthTypes:BackendAPIResourceConfig' :: Maybe [BackendAPIAuthType]
additionalAuthTypes = Maybe [BackendAPIAuthType]
a} :: BackendAPIResourceConfig) ((Maybe [BackendAPIAuthType] -> f (Maybe [BackendAPIAuthType]))
 -> BackendAPIResourceConfig -> f BackendAPIResourceConfig)
-> ((Maybe [BackendAPIAuthType] -> f (Maybe [BackendAPIAuthType]))
    -> Maybe [BackendAPIAuthType] -> f (Maybe [BackendAPIAuthType]))
-> (Maybe [BackendAPIAuthType] -> f (Maybe [BackendAPIAuthType]))
-> BackendAPIResourceConfig
-> f BackendAPIResourceConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [BackendAPIAuthType]
  [BackendAPIAuthType]
  [BackendAPIAuthType]
  [BackendAPIAuthType]
-> Iso
     (Maybe [BackendAPIAuthType])
     (Maybe [BackendAPIAuthType])
     (Maybe [BackendAPIAuthType])
     (Maybe [BackendAPIAuthType])
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
  [BackendAPIAuthType]
  [BackendAPIAuthType]
  [BackendAPIAuthType]
  [BackendAPIAuthType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The conflict resolution strategy for your data stored in the data
-- models.
backendAPIResourceConfig_conflictResolution :: Lens.Lens' BackendAPIResourceConfig (Prelude.Maybe BackendAPIConflictResolution)
backendAPIResourceConfig_conflictResolution :: (Maybe BackendAPIConflictResolution
 -> f (Maybe BackendAPIConflictResolution))
-> BackendAPIResourceConfig -> f BackendAPIResourceConfig
backendAPIResourceConfig_conflictResolution = (BackendAPIResourceConfig -> Maybe BackendAPIConflictResolution)
-> (BackendAPIResourceConfig
    -> Maybe BackendAPIConflictResolution -> BackendAPIResourceConfig)
-> Lens
     BackendAPIResourceConfig
     BackendAPIResourceConfig
     (Maybe BackendAPIConflictResolution)
     (Maybe BackendAPIConflictResolution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAPIResourceConfig' {Maybe BackendAPIConflictResolution
conflictResolution :: Maybe BackendAPIConflictResolution
$sel:conflictResolution:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe BackendAPIConflictResolution
conflictResolution} -> Maybe BackendAPIConflictResolution
conflictResolution) (\s :: BackendAPIResourceConfig
s@BackendAPIResourceConfig' {} Maybe BackendAPIConflictResolution
a -> BackendAPIResourceConfig
s {$sel:conflictResolution:BackendAPIResourceConfig' :: Maybe BackendAPIConflictResolution
conflictResolution = Maybe BackendAPIConflictResolution
a} :: BackendAPIResourceConfig)

-- | The default authentication type for interacting with the configured data
-- models in your Amplify project.
backendAPIResourceConfig_defaultAuthType :: Lens.Lens' BackendAPIResourceConfig (Prelude.Maybe BackendAPIAuthType)
backendAPIResourceConfig_defaultAuthType :: (Maybe BackendAPIAuthType -> f (Maybe BackendAPIAuthType))
-> BackendAPIResourceConfig -> f BackendAPIResourceConfig
backendAPIResourceConfig_defaultAuthType = (BackendAPIResourceConfig -> Maybe BackendAPIAuthType)
-> (BackendAPIResourceConfig
    -> Maybe BackendAPIAuthType -> BackendAPIResourceConfig)
-> Lens
     BackendAPIResourceConfig
     BackendAPIResourceConfig
     (Maybe BackendAPIAuthType)
     (Maybe BackendAPIAuthType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackendAPIResourceConfig' {Maybe BackendAPIAuthType
defaultAuthType :: Maybe BackendAPIAuthType
$sel:defaultAuthType:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe BackendAPIAuthType
defaultAuthType} -> Maybe BackendAPIAuthType
defaultAuthType) (\s :: BackendAPIResourceConfig
s@BackendAPIResourceConfig' {} Maybe BackendAPIAuthType
a -> BackendAPIResourceConfig
s {$sel:defaultAuthType:BackendAPIResourceConfig' :: Maybe BackendAPIAuthType
defaultAuthType = Maybe BackendAPIAuthType
a} :: BackendAPIResourceConfig)

instance Core.FromJSON BackendAPIResourceConfig where
  parseJSON :: Value -> Parser BackendAPIResourceConfig
parseJSON =
    String
-> (Object -> Parser BackendAPIResourceConfig)
-> Value
-> Parser BackendAPIResourceConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BackendAPIResourceConfig"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [BackendAPIAuthType]
-> Maybe BackendAPIConflictResolution
-> Maybe BackendAPIAuthType
-> BackendAPIResourceConfig
BackendAPIResourceConfig'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [BackendAPIAuthType]
 -> Maybe BackendAPIConflictResolution
 -> Maybe BackendAPIAuthType
 -> BackendAPIResourceConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [BackendAPIAuthType]
      -> Maybe BackendAPIConflictResolution
      -> Maybe BackendAPIAuthType
      -> BackendAPIResourceConfig)
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
"apiName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [BackendAPIAuthType]
   -> Maybe BackendAPIConflictResolution
   -> Maybe BackendAPIAuthType
   -> BackendAPIResourceConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [BackendAPIAuthType]
      -> Maybe BackendAPIConflictResolution
      -> Maybe BackendAPIAuthType
      -> BackendAPIResourceConfig)
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
"service")
            Parser
  (Maybe Text
   -> Maybe [BackendAPIAuthType]
   -> Maybe BackendAPIConflictResolution
   -> Maybe BackendAPIAuthType
   -> BackendAPIResourceConfig)
-> Parser (Maybe Text)
-> Parser
     (Maybe [BackendAPIAuthType]
      -> Maybe BackendAPIConflictResolution
      -> Maybe BackendAPIAuthType
      -> BackendAPIResourceConfig)
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
"transformSchema")
            Parser
  (Maybe [BackendAPIAuthType]
   -> Maybe BackendAPIConflictResolution
   -> Maybe BackendAPIAuthType
   -> BackendAPIResourceConfig)
-> Parser (Maybe [BackendAPIAuthType])
-> Parser
     (Maybe BackendAPIConflictResolution
      -> Maybe BackendAPIAuthType -> BackendAPIResourceConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [BackendAPIAuthType]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"additionalAuthTypes"
                            Parser (Maybe (Maybe [BackendAPIAuthType]))
-> Maybe [BackendAPIAuthType]
-> Parser (Maybe [BackendAPIAuthType])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [BackendAPIAuthType]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe BackendAPIConflictResolution
   -> Maybe BackendAPIAuthType -> BackendAPIResourceConfig)
-> Parser (Maybe BackendAPIConflictResolution)
-> Parser (Maybe BackendAPIAuthType -> BackendAPIResourceConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BackendAPIConflictResolution)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"conflictResolution")
            Parser (Maybe BackendAPIAuthType -> BackendAPIResourceConfig)
-> Parser (Maybe BackendAPIAuthType)
-> Parser BackendAPIResourceConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BackendAPIAuthType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultAuthType")
      )

instance Prelude.Hashable BackendAPIResourceConfig

instance Prelude.NFData BackendAPIResourceConfig

instance Core.ToJSON BackendAPIResourceConfig where
  toJSON :: BackendAPIResourceConfig -> Value
toJSON BackendAPIResourceConfig' {Maybe [BackendAPIAuthType]
Maybe Text
Maybe BackendAPIAuthType
Maybe BackendAPIConflictResolution
defaultAuthType :: Maybe BackendAPIAuthType
conflictResolution :: Maybe BackendAPIConflictResolution
additionalAuthTypes :: Maybe [BackendAPIAuthType]
transformSchema :: Maybe Text
service :: Maybe Text
apiName :: Maybe Text
$sel:defaultAuthType:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe BackendAPIAuthType
$sel:conflictResolution:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe BackendAPIConflictResolution
$sel:additionalAuthTypes:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe [BackendAPIAuthType]
$sel:transformSchema:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe Text
$sel:service:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe Text
$sel:apiName:BackendAPIResourceConfig' :: BackendAPIResourceConfig -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"apiName" 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
apiName,
            (Text
"service" 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
service,
            (Text
"transformSchema" 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
transformSchema,
            (Text
"additionalAuthTypes" Text -> [BackendAPIAuthType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([BackendAPIAuthType] -> Pair)
-> Maybe [BackendAPIAuthType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [BackendAPIAuthType]
additionalAuthTypes,
            (Text
"conflictResolution" Text -> BackendAPIConflictResolution -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BackendAPIConflictResolution -> Pair)
-> Maybe BackendAPIConflictResolution -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BackendAPIConflictResolution
conflictResolution,
            (Text
"defaultAuthType" Text -> BackendAPIAuthType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (BackendAPIAuthType -> Pair)
-> Maybe BackendAPIAuthType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BackendAPIAuthType
defaultAuthType
          ]
      )