{-# 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.Wisdom.Types.SourceConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Wisdom.Types.AppIntegrationsConfiguration
data SourceConfiguration = SourceConfiguration'
{
SourceConfiguration -> Maybe AppIntegrationsConfiguration
appIntegrations :: Prelude.Maybe AppIntegrationsConfiguration
}
deriving (SourceConfiguration -> SourceConfiguration -> Bool
(SourceConfiguration -> SourceConfiguration -> Bool)
-> (SourceConfiguration -> SourceConfiguration -> Bool)
-> Eq SourceConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceConfiguration -> SourceConfiguration -> Bool
$c/= :: SourceConfiguration -> SourceConfiguration -> Bool
== :: SourceConfiguration -> SourceConfiguration -> Bool
$c== :: SourceConfiguration -> SourceConfiguration -> Bool
Prelude.Eq, ReadPrec [SourceConfiguration]
ReadPrec SourceConfiguration
Int -> ReadS SourceConfiguration
ReadS [SourceConfiguration]
(Int -> ReadS SourceConfiguration)
-> ReadS [SourceConfiguration]
-> ReadPrec SourceConfiguration
-> ReadPrec [SourceConfiguration]
-> Read SourceConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceConfiguration]
$creadListPrec :: ReadPrec [SourceConfiguration]
readPrec :: ReadPrec SourceConfiguration
$creadPrec :: ReadPrec SourceConfiguration
readList :: ReadS [SourceConfiguration]
$creadList :: ReadS [SourceConfiguration]
readsPrec :: Int -> ReadS SourceConfiguration
$creadsPrec :: Int -> ReadS SourceConfiguration
Prelude.Read, Int -> SourceConfiguration -> ShowS
[SourceConfiguration] -> ShowS
SourceConfiguration -> String
(Int -> SourceConfiguration -> ShowS)
-> (SourceConfiguration -> String)
-> ([SourceConfiguration] -> ShowS)
-> Show SourceConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceConfiguration] -> ShowS
$cshowList :: [SourceConfiguration] -> ShowS
show :: SourceConfiguration -> String
$cshow :: SourceConfiguration -> String
showsPrec :: Int -> SourceConfiguration -> ShowS
$cshowsPrec :: Int -> SourceConfiguration -> ShowS
Prelude.Show, (forall x. SourceConfiguration -> Rep SourceConfiguration x)
-> (forall x. Rep SourceConfiguration x -> SourceConfiguration)
-> Generic SourceConfiguration
forall x. Rep SourceConfiguration x -> SourceConfiguration
forall x. SourceConfiguration -> Rep SourceConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceConfiguration x -> SourceConfiguration
$cfrom :: forall x. SourceConfiguration -> Rep SourceConfiguration x
Prelude.Generic)
newSourceConfiguration ::
SourceConfiguration
newSourceConfiguration :: SourceConfiguration
newSourceConfiguration =
SourceConfiguration' :: Maybe AppIntegrationsConfiguration -> SourceConfiguration
SourceConfiguration'
{ $sel:appIntegrations:SourceConfiguration' :: Maybe AppIntegrationsConfiguration
appIntegrations =
Maybe AppIntegrationsConfiguration
forall a. Maybe a
Prelude.Nothing
}
sourceConfiguration_appIntegrations :: Lens.Lens' SourceConfiguration (Prelude.Maybe AppIntegrationsConfiguration)
sourceConfiguration_appIntegrations :: (Maybe AppIntegrationsConfiguration
-> f (Maybe AppIntegrationsConfiguration))
-> SourceConfiguration -> f SourceConfiguration
sourceConfiguration_appIntegrations = (SourceConfiguration -> Maybe AppIntegrationsConfiguration)
-> (SourceConfiguration
-> Maybe AppIntegrationsConfiguration -> SourceConfiguration)
-> Lens
SourceConfiguration
SourceConfiguration
(Maybe AppIntegrationsConfiguration)
(Maybe AppIntegrationsConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceConfiguration' {Maybe AppIntegrationsConfiguration
appIntegrations :: Maybe AppIntegrationsConfiguration
$sel:appIntegrations:SourceConfiguration' :: SourceConfiguration -> Maybe AppIntegrationsConfiguration
appIntegrations} -> Maybe AppIntegrationsConfiguration
appIntegrations) (\s :: SourceConfiguration
s@SourceConfiguration' {} Maybe AppIntegrationsConfiguration
a -> SourceConfiguration
s {$sel:appIntegrations:SourceConfiguration' :: Maybe AppIntegrationsConfiguration
appIntegrations = Maybe AppIntegrationsConfiguration
a} :: SourceConfiguration)
instance Core.FromJSON SourceConfiguration where
parseJSON :: Value -> Parser SourceConfiguration
parseJSON =
String
-> (Object -> Parser SourceConfiguration)
-> Value
-> Parser SourceConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SourceConfiguration"
( \Object
x ->
Maybe AppIntegrationsConfiguration -> SourceConfiguration
SourceConfiguration'
(Maybe AppIntegrationsConfiguration -> SourceConfiguration)
-> Parser (Maybe AppIntegrationsConfiguration)
-> Parser SourceConfiguration
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AppIntegrationsConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"appIntegrations")
)
instance Prelude.Hashable SourceConfiguration
instance Prelude.NFData SourceConfiguration
instance Core.ToJSON SourceConfiguration where
toJSON :: SourceConfiguration -> Value
toJSON SourceConfiguration' {Maybe AppIntegrationsConfiguration
appIntegrations :: Maybe AppIntegrationsConfiguration
$sel:appIntegrations:SourceConfiguration' :: SourceConfiguration -> Maybe AppIntegrationsConfiguration
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"appIntegrations" Text -> AppIntegrationsConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AppIntegrationsConfiguration -> Pair)
-> Maybe AppIntegrationsConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AppIntegrationsConfiguration
appIntegrations
]
)