{-# 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.ElasticSearch.Types.AdvancedOptionsStatus
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ElasticSearch.Types.AdvancedOptionsStatus where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElasticSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude

-- | Status of the advanced options for the specified Elasticsearch domain.
-- Currently, the following advanced options are available:
--
-- -   Option to allow references to indices in an HTTP request body. Must
--     be @false@ when configuring access to individual sub-resources. By
--     default, the value is @true@. See
--     <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options Configuration Advanced Options>
--     for more information.
-- -   Option to specify the percentage of heap space that is allocated to
--     field data. By default, this setting is unbounded.
--
-- For more information, see
-- <http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-createupdatedomains.html#es-createdomain-configure-advanced-options Configuring Advanced Options>.
--
-- /See:/ 'newAdvancedOptionsStatus' smart constructor.
data AdvancedOptionsStatus = AdvancedOptionsStatus'
  { -- | Specifies the status of advanced options for the specified Elasticsearch
    -- domain.
    AdvancedOptionsStatus -> HashMap Text Text
options :: Prelude.HashMap Prelude.Text Prelude.Text,
    -- | Specifies the status of @OptionStatus@ for advanced options for the
    -- specified Elasticsearch domain.
    AdvancedOptionsStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool
$c/= :: AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool
== :: AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool
$c== :: AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool
Prelude.Eq, ReadPrec [AdvancedOptionsStatus]
ReadPrec AdvancedOptionsStatus
Int -> ReadS AdvancedOptionsStatus
ReadS [AdvancedOptionsStatus]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AdvancedOptionsStatus]
$creadListPrec :: ReadPrec [AdvancedOptionsStatus]
readPrec :: ReadPrec AdvancedOptionsStatus
$creadPrec :: ReadPrec AdvancedOptionsStatus
readList :: ReadS [AdvancedOptionsStatus]
$creadList :: ReadS [AdvancedOptionsStatus]
readsPrec :: Int -> ReadS AdvancedOptionsStatus
$creadsPrec :: Int -> ReadS AdvancedOptionsStatus
Prelude.Read, Int -> AdvancedOptionsStatus -> ShowS
[AdvancedOptionsStatus] -> ShowS
AdvancedOptionsStatus -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AdvancedOptionsStatus] -> ShowS
$cshowList :: [AdvancedOptionsStatus] -> ShowS
show :: AdvancedOptionsStatus -> String
$cshow :: AdvancedOptionsStatus -> String
showsPrec :: Int -> AdvancedOptionsStatus -> ShowS
$cshowsPrec :: Int -> AdvancedOptionsStatus -> ShowS
Prelude.Show, forall x. Rep AdvancedOptionsStatus x -> AdvancedOptionsStatus
forall x. AdvancedOptionsStatus -> Rep AdvancedOptionsStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AdvancedOptionsStatus x -> AdvancedOptionsStatus
$cfrom :: forall x. AdvancedOptionsStatus -> Rep AdvancedOptionsStatus x
Prelude.Generic)

-- |
-- Create a value of 'AdvancedOptionsStatus' 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:
--
-- 'options', 'advancedOptionsStatus_options' - Specifies the status of advanced options for the specified Elasticsearch
-- domain.
--
-- 'status', 'advancedOptionsStatus_status' - Specifies the status of @OptionStatus@ for advanced options for the
-- specified Elasticsearch domain.
newAdvancedOptionsStatus ::
  -- | 'status'
  OptionStatus ->
  AdvancedOptionsStatus
newAdvancedOptionsStatus :: OptionStatus -> AdvancedOptionsStatus
newAdvancedOptionsStatus OptionStatus
pStatus_ =
  AdvancedOptionsStatus'
    { $sel:options:AdvancedOptionsStatus' :: HashMap Text Text
options = forall a. Monoid a => a
Prelude.mempty,
      $sel:status:AdvancedOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Specifies the status of advanced options for the specified Elasticsearch
-- domain.
advancedOptionsStatus_options :: Lens.Lens' AdvancedOptionsStatus (Prelude.HashMap Prelude.Text Prelude.Text)
advancedOptionsStatus_options :: Lens' AdvancedOptionsStatus (HashMap Text Text)
advancedOptionsStatus_options = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedOptionsStatus' {HashMap Text Text
options :: HashMap Text Text
$sel:options:AdvancedOptionsStatus' :: AdvancedOptionsStatus -> HashMap Text Text
options} -> HashMap Text Text
options) (\s :: AdvancedOptionsStatus
s@AdvancedOptionsStatus' {} HashMap Text Text
a -> AdvancedOptionsStatus
s {$sel:options:AdvancedOptionsStatus' :: HashMap Text Text
options = HashMap Text Text
a} :: AdvancedOptionsStatus) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the status of @OptionStatus@ for advanced options for the
-- specified Elasticsearch domain.
advancedOptionsStatus_status :: Lens.Lens' AdvancedOptionsStatus OptionStatus
advancedOptionsStatus_status :: Lens' AdvancedOptionsStatus OptionStatus
advancedOptionsStatus_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AdvancedOptionsStatus' {OptionStatus
status :: OptionStatus
$sel:status:AdvancedOptionsStatus' :: AdvancedOptionsStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: AdvancedOptionsStatus
s@AdvancedOptionsStatus' {} OptionStatus
a -> AdvancedOptionsStatus
s {$sel:status:AdvancedOptionsStatus' :: OptionStatus
status = OptionStatus
a} :: AdvancedOptionsStatus)

instance Data.FromJSON AdvancedOptionsStatus where
  parseJSON :: Value -> Parser AdvancedOptionsStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AdvancedOptionsStatus"
      ( \Object
x ->
          HashMap Text Text -> OptionStatus -> AdvancedOptionsStatus
AdvancedOptionsStatus'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Options" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
      )

instance Prelude.Hashable AdvancedOptionsStatus where
  hashWithSalt :: Int -> AdvancedOptionsStatus -> Int
hashWithSalt Int
_salt AdvancedOptionsStatus' {HashMap Text Text
OptionStatus
status :: OptionStatus
options :: HashMap Text Text
$sel:status:AdvancedOptionsStatus' :: AdvancedOptionsStatus -> OptionStatus
$sel:options:AdvancedOptionsStatus' :: AdvancedOptionsStatus -> HashMap Text Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
options
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OptionStatus
status

instance Prelude.NFData AdvancedOptionsStatus where
  rnf :: AdvancedOptionsStatus -> ()
rnf AdvancedOptionsStatus' {HashMap Text Text
OptionStatus
status :: OptionStatus
options :: HashMap Text Text
$sel:status:AdvancedOptionsStatus' :: AdvancedOptionsStatus -> OptionStatus
$sel:options:AdvancedOptionsStatus' :: AdvancedOptionsStatus -> HashMap Text Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf HashMap Text Text
options
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OptionStatus
status