{-# 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.CloudSearch.Types.IndexFieldStatus where
import Amazonka.CloudSearch.Types.IndexField
import Amazonka.CloudSearch.Types.OptionStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data IndexFieldStatus = IndexFieldStatus'
{ IndexFieldStatus -> IndexField
options :: IndexField,
IndexFieldStatus -> OptionStatus
status :: OptionStatus
}
deriving (IndexFieldStatus -> IndexFieldStatus -> Bool
(IndexFieldStatus -> IndexFieldStatus -> Bool)
-> (IndexFieldStatus -> IndexFieldStatus -> Bool)
-> Eq IndexFieldStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IndexFieldStatus -> IndexFieldStatus -> Bool
$c/= :: IndexFieldStatus -> IndexFieldStatus -> Bool
== :: IndexFieldStatus -> IndexFieldStatus -> Bool
$c== :: IndexFieldStatus -> IndexFieldStatus -> Bool
Prelude.Eq, ReadPrec [IndexFieldStatus]
ReadPrec IndexFieldStatus
Int -> ReadS IndexFieldStatus
ReadS [IndexFieldStatus]
(Int -> ReadS IndexFieldStatus)
-> ReadS [IndexFieldStatus]
-> ReadPrec IndexFieldStatus
-> ReadPrec [IndexFieldStatus]
-> Read IndexFieldStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [IndexFieldStatus]
$creadListPrec :: ReadPrec [IndexFieldStatus]
readPrec :: ReadPrec IndexFieldStatus
$creadPrec :: ReadPrec IndexFieldStatus
readList :: ReadS [IndexFieldStatus]
$creadList :: ReadS [IndexFieldStatus]
readsPrec :: Int -> ReadS IndexFieldStatus
$creadsPrec :: Int -> ReadS IndexFieldStatus
Prelude.Read, Int -> IndexFieldStatus -> ShowS
[IndexFieldStatus] -> ShowS
IndexFieldStatus -> String
(Int -> IndexFieldStatus -> ShowS)
-> (IndexFieldStatus -> String)
-> ([IndexFieldStatus] -> ShowS)
-> Show IndexFieldStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IndexFieldStatus] -> ShowS
$cshowList :: [IndexFieldStatus] -> ShowS
show :: IndexFieldStatus -> String
$cshow :: IndexFieldStatus -> String
showsPrec :: Int -> IndexFieldStatus -> ShowS
$cshowsPrec :: Int -> IndexFieldStatus -> ShowS
Prelude.Show, (forall x. IndexFieldStatus -> Rep IndexFieldStatus x)
-> (forall x. Rep IndexFieldStatus x -> IndexFieldStatus)
-> Generic IndexFieldStatus
forall x. Rep IndexFieldStatus x -> IndexFieldStatus
forall x. IndexFieldStatus -> Rep IndexFieldStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IndexFieldStatus x -> IndexFieldStatus
$cfrom :: forall x. IndexFieldStatus -> Rep IndexFieldStatus x
Prelude.Generic)
newIndexFieldStatus ::
IndexField ->
OptionStatus ->
IndexFieldStatus
newIndexFieldStatus :: IndexField -> OptionStatus -> IndexFieldStatus
newIndexFieldStatus IndexField
pOptions_ OptionStatus
pStatus_ =
IndexFieldStatus' :: IndexField -> OptionStatus -> IndexFieldStatus
IndexFieldStatus'
{ $sel:options:IndexFieldStatus' :: IndexField
options = IndexField
pOptions_,
$sel:status:IndexFieldStatus' :: OptionStatus
status = OptionStatus
pStatus_
}
indexFieldStatus_options :: Lens.Lens' IndexFieldStatus IndexField
indexFieldStatus_options :: (IndexField -> f IndexField)
-> IndexFieldStatus -> f IndexFieldStatus
indexFieldStatus_options = (IndexFieldStatus -> IndexField)
-> (IndexFieldStatus -> IndexField -> IndexFieldStatus)
-> Lens IndexFieldStatus IndexFieldStatus IndexField IndexField
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexFieldStatus' {IndexField
options :: IndexField
$sel:options:IndexFieldStatus' :: IndexFieldStatus -> IndexField
options} -> IndexField
options) (\s :: IndexFieldStatus
s@IndexFieldStatus' {} IndexField
a -> IndexFieldStatus
s {$sel:options:IndexFieldStatus' :: IndexField
options = IndexField
a} :: IndexFieldStatus)
indexFieldStatus_status :: Lens.Lens' IndexFieldStatus OptionStatus
indexFieldStatus_status :: (OptionStatus -> f OptionStatus)
-> IndexFieldStatus -> f IndexFieldStatus
indexFieldStatus_status = (IndexFieldStatus -> OptionStatus)
-> (IndexFieldStatus -> OptionStatus -> IndexFieldStatus)
-> Lens IndexFieldStatus IndexFieldStatus OptionStatus OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IndexFieldStatus' {OptionStatus
status :: OptionStatus
$sel:status:IndexFieldStatus' :: IndexFieldStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: IndexFieldStatus
s@IndexFieldStatus' {} OptionStatus
a -> IndexFieldStatus
s {$sel:status:IndexFieldStatus' :: OptionStatus
status = OptionStatus
a} :: IndexFieldStatus)
instance Core.FromXML IndexFieldStatus where
parseXML :: [Node] -> Either String IndexFieldStatus
parseXML [Node]
x =
IndexField -> OptionStatus -> IndexFieldStatus
IndexFieldStatus'
(IndexField -> OptionStatus -> IndexFieldStatus)
-> Either String IndexField
-> Either String (OptionStatus -> IndexFieldStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String IndexField
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Options")
Either String (OptionStatus -> IndexFieldStatus)
-> Either String OptionStatus -> Either String IndexFieldStatus
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String OptionStatus
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Status")
instance Prelude.Hashable IndexFieldStatus
instance Prelude.NFData IndexFieldStatus