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