{-# 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.QuickSight.Types.AmazonOpenSearchParameters
-- 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.QuickSight.Types.AmazonOpenSearchParameters where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | /See:/ 'newAmazonOpenSearchParameters' smart constructor.
data AmazonOpenSearchParameters = AmazonOpenSearchParameters'
  { AmazonOpenSearchParameters -> Text
domain :: Prelude.Text
  }
  deriving (AmazonOpenSearchParameters -> AmazonOpenSearchParameters -> Bool
(AmazonOpenSearchParameters -> AmazonOpenSearchParameters -> Bool)
-> (AmazonOpenSearchParameters
    -> AmazonOpenSearchParameters -> Bool)
-> Eq AmazonOpenSearchParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AmazonOpenSearchParameters -> AmazonOpenSearchParameters -> Bool
$c/= :: AmazonOpenSearchParameters -> AmazonOpenSearchParameters -> Bool
== :: AmazonOpenSearchParameters -> AmazonOpenSearchParameters -> Bool
$c== :: AmazonOpenSearchParameters -> AmazonOpenSearchParameters -> Bool
Prelude.Eq, ReadPrec [AmazonOpenSearchParameters]
ReadPrec AmazonOpenSearchParameters
Int -> ReadS AmazonOpenSearchParameters
ReadS [AmazonOpenSearchParameters]
(Int -> ReadS AmazonOpenSearchParameters)
-> ReadS [AmazonOpenSearchParameters]
-> ReadPrec AmazonOpenSearchParameters
-> ReadPrec [AmazonOpenSearchParameters]
-> Read AmazonOpenSearchParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AmazonOpenSearchParameters]
$creadListPrec :: ReadPrec [AmazonOpenSearchParameters]
readPrec :: ReadPrec AmazonOpenSearchParameters
$creadPrec :: ReadPrec AmazonOpenSearchParameters
readList :: ReadS [AmazonOpenSearchParameters]
$creadList :: ReadS [AmazonOpenSearchParameters]
readsPrec :: Int -> ReadS AmazonOpenSearchParameters
$creadsPrec :: Int -> ReadS AmazonOpenSearchParameters
Prelude.Read, Int -> AmazonOpenSearchParameters -> ShowS
[AmazonOpenSearchParameters] -> ShowS
AmazonOpenSearchParameters -> String
(Int -> AmazonOpenSearchParameters -> ShowS)
-> (AmazonOpenSearchParameters -> String)
-> ([AmazonOpenSearchParameters] -> ShowS)
-> Show AmazonOpenSearchParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AmazonOpenSearchParameters] -> ShowS
$cshowList :: [AmazonOpenSearchParameters] -> ShowS
show :: AmazonOpenSearchParameters -> String
$cshow :: AmazonOpenSearchParameters -> String
showsPrec :: Int -> AmazonOpenSearchParameters -> ShowS
$cshowsPrec :: Int -> AmazonOpenSearchParameters -> ShowS
Prelude.Show, (forall x.
 AmazonOpenSearchParameters -> Rep AmazonOpenSearchParameters x)
-> (forall x.
    Rep AmazonOpenSearchParameters x -> AmazonOpenSearchParameters)
-> Generic AmazonOpenSearchParameters
forall x.
Rep AmazonOpenSearchParameters x -> AmazonOpenSearchParameters
forall x.
AmazonOpenSearchParameters -> Rep AmazonOpenSearchParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AmazonOpenSearchParameters x -> AmazonOpenSearchParameters
$cfrom :: forall x.
AmazonOpenSearchParameters -> Rep AmazonOpenSearchParameters x
Prelude.Generic)

-- |
-- Create a value of 'AmazonOpenSearchParameters' 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:
--
-- 'domain', 'amazonOpenSearchParameters_domain' - Undocumented member.
newAmazonOpenSearchParameters ::
  -- | 'domain'
  Prelude.Text ->
  AmazonOpenSearchParameters
newAmazonOpenSearchParameters :: Text -> AmazonOpenSearchParameters
newAmazonOpenSearchParameters Text
pDomain_ =
  AmazonOpenSearchParameters' :: Text -> AmazonOpenSearchParameters
AmazonOpenSearchParameters' {$sel:domain:AmazonOpenSearchParameters' :: Text
domain = Text
pDomain_}

-- | Undocumented member.
amazonOpenSearchParameters_domain :: Lens.Lens' AmazonOpenSearchParameters Prelude.Text
amazonOpenSearchParameters_domain :: (Text -> f Text)
-> AmazonOpenSearchParameters -> f AmazonOpenSearchParameters
amazonOpenSearchParameters_domain = (AmazonOpenSearchParameters -> Text)
-> (AmazonOpenSearchParameters
    -> Text -> AmazonOpenSearchParameters)
-> Lens
     AmazonOpenSearchParameters AmazonOpenSearchParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AmazonOpenSearchParameters' {Text
domain :: Text
$sel:domain:AmazonOpenSearchParameters' :: AmazonOpenSearchParameters -> Text
domain} -> Text
domain) (\s :: AmazonOpenSearchParameters
s@AmazonOpenSearchParameters' {} Text
a -> AmazonOpenSearchParameters
s {$sel:domain:AmazonOpenSearchParameters' :: Text
domain = Text
a} :: AmazonOpenSearchParameters)

instance Core.FromJSON AmazonOpenSearchParameters where
  parseJSON :: Value -> Parser AmazonOpenSearchParameters
parseJSON =
    String
-> (Object -> Parser AmazonOpenSearchParameters)
-> Value
-> Parser AmazonOpenSearchParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AmazonOpenSearchParameters"
      ( \Object
x ->
          Text -> AmazonOpenSearchParameters
AmazonOpenSearchParameters'
            (Text -> AmazonOpenSearchParameters)
-> Parser Text -> Parser AmazonOpenSearchParameters
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
"Domain")
      )

instance Prelude.Hashable AmazonOpenSearchParameters

instance Prelude.NFData AmazonOpenSearchParameters

instance Core.ToJSON AmazonOpenSearchParameters where
  toJSON :: AmazonOpenSearchParameters -> Value
toJSON AmazonOpenSearchParameters' {Text
domain :: Text
$sel:domain:AmazonOpenSearchParameters' :: AmazonOpenSearchParameters -> 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
"Domain" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
domain)]
      )