{-# 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.OpenSearch.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.OpenSearch.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.OpenSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude

-- | Status of the advanced options for the specified domain. The following
-- options are available:
--
-- -   @\"rest.action.multi.allow_explicit_index\": \"true\" | \"false\"@ -
--     Note the use of a string rather than a boolean. Specifies whether
--     explicit references to indexes are allowed inside the body of HTTP
--     requests. If you want to configure access policies for domain
--     sub-resources, such as specific indexes and domain APIs, you must
--     disable this property. Default is true.
--
-- -   @\"indices.fielddata.cache.size\": \"80\" @ - Note the use of a
--     string rather than a boolean. Specifies the percentage of heap space
--     allocated to field data. Default is unbounded.
--
-- -   @\"indices.query.bool.max_clause_count\": \"1024\"@ - Note the use
--     of a string rather than a boolean. Specifies the maximum number of
--     clauses allowed in a Lucene boolean query. Default is 1,024. Queries
--     with more than the permitted number of clauses result in a
--     @TooManyClauses@ error.
--
-- -   @\"override_main_response_version\": \"true\" | \"false\"@ - Note
--     the use of a string rather than a boolean. Specifies whether the
--     domain reports its version as 7.10 to allow Elasticsearch OSS
--     clients and plugins to continue working with it. Default is false
--     when creating a domain and true when upgrading a domain.
--
-- For more information, see
-- <https://docs.aws.amazon.com/opensearch-service/latest/developerguide/createupdatedomains.html#createdomain-configure-advanced-options Advanced cluster parameters>.
--
-- /See:/ 'newAdvancedOptionsStatus' smart constructor.
data AdvancedOptionsStatus = AdvancedOptionsStatus'
  { -- | The status of advanced options for the specified domain.
    AdvancedOptionsStatus -> HashMap Text Text
options :: Prelude.HashMap Prelude.Text Prelude.Text,
    -- | The status of advanced options for the specified 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' - The status of advanced options for the specified domain.
--
-- 'status', 'advancedOptionsStatus_status' - The status of advanced options for the specified 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_
    }

-- | The status of advanced options for the specified 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

-- | The status of advanced options for the specified 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