{-# 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.OpenSearch.Types.AdvancedOptionsStatus where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpenSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude
data AdvancedOptionsStatus = AdvancedOptionsStatus'
{
AdvancedOptionsStatus -> HashMap Text Text
options :: Prelude.HashMap Prelude.Text Prelude.Text,
AdvancedOptionsStatus -> OptionStatus
status :: OptionStatus
}
deriving (AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool
(AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool)
-> (AdvancedOptionsStatus -> AdvancedOptionsStatus -> Bool)
-> Eq AdvancedOptionsStatus
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]
(Int -> ReadS AdvancedOptionsStatus)
-> ReadS [AdvancedOptionsStatus]
-> ReadPrec AdvancedOptionsStatus
-> ReadPrec [AdvancedOptionsStatus]
-> Read 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
(Int -> AdvancedOptionsStatus -> ShowS)
-> (AdvancedOptionsStatus -> String)
-> ([AdvancedOptionsStatus] -> ShowS)
-> Show AdvancedOptionsStatus
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. AdvancedOptionsStatus -> Rep AdvancedOptionsStatus x)
-> (forall x. Rep AdvancedOptionsStatus x -> AdvancedOptionsStatus)
-> Generic AdvancedOptionsStatus
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)
newAdvancedOptionsStatus ::
OptionStatus ->
AdvancedOptionsStatus
newAdvancedOptionsStatus :: OptionStatus -> AdvancedOptionsStatus
newAdvancedOptionsStatus OptionStatus
pStatus_ =
AdvancedOptionsStatus' :: HashMap Text Text -> OptionStatus -> AdvancedOptionsStatus
AdvancedOptionsStatus'
{ $sel:options:AdvancedOptionsStatus' :: HashMap Text Text
options = HashMap Text Text
forall a. Monoid a => a
Prelude.mempty,
$sel:status:AdvancedOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
}
advancedOptionsStatus_options :: Lens.Lens' AdvancedOptionsStatus (Prelude.HashMap Prelude.Text Prelude.Text)
advancedOptionsStatus_options :: (HashMap Text Text -> f (HashMap Text Text))
-> AdvancedOptionsStatus -> f AdvancedOptionsStatus
advancedOptionsStatus_options = (AdvancedOptionsStatus -> HashMap Text Text)
-> (AdvancedOptionsStatus
-> HashMap Text Text -> AdvancedOptionsStatus)
-> Lens
AdvancedOptionsStatus
AdvancedOptionsStatus
(HashMap Text Text)
(HashMap Text Text)
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) ((HashMap Text Text -> f (HashMap Text Text))
-> AdvancedOptionsStatus -> f AdvancedOptionsStatus)
-> ((HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text))
-> (HashMap Text Text -> f (HashMap Text Text))
-> AdvancedOptionsStatus
-> f AdvancedOptionsStatus
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Text -> f (HashMap Text Text))
-> HashMap Text Text -> f (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
advancedOptionsStatus_status :: Lens.Lens' AdvancedOptionsStatus OptionStatus
advancedOptionsStatus_status :: (OptionStatus -> f OptionStatus)
-> AdvancedOptionsStatus -> f AdvancedOptionsStatus
advancedOptionsStatus_status = (AdvancedOptionsStatus -> OptionStatus)
-> (AdvancedOptionsStatus -> OptionStatus -> AdvancedOptionsStatus)
-> Lens
AdvancedOptionsStatus
AdvancedOptionsStatus
OptionStatus
OptionStatus
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 Core.FromJSON AdvancedOptionsStatus where
parseJSON :: Value -> Parser AdvancedOptionsStatus
parseJSON =
String
-> (Object -> Parser AdvancedOptionsStatus)
-> Value
-> Parser AdvancedOptionsStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AdvancedOptionsStatus"
( \Object
x ->
HashMap Text Text -> OptionStatus -> AdvancedOptionsStatus
AdvancedOptionsStatus'
(HashMap Text Text -> OptionStatus -> AdvancedOptionsStatus)
-> Parser (HashMap Text Text)
-> Parser (OptionStatus -> AdvancedOptionsStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (HashMap Text Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Options" Parser (Maybe (HashMap Text Text))
-> HashMap Text Text -> Parser (HashMap Text Text)
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= HashMap Text Text
forall a. Monoid a => a
Prelude.mempty)
Parser (OptionStatus -> AdvancedOptionsStatus)
-> Parser OptionStatus -> Parser AdvancedOptionsStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser OptionStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Status")
)
instance Prelude.Hashable AdvancedOptionsStatus
instance Prelude.NFData AdvancedOptionsStatus