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