{-# 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.CloudSearch.Types.IndexFieldStatus
-- 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.CloudSearch.Types.IndexFieldStatus where

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

-- | The value of an @IndexField@ and its current status.
--
-- /See:/ 'newIndexFieldStatus' smart constructor.
data IndexFieldStatus = IndexFieldStatus'
  { IndexFieldStatus -> IndexField
options :: IndexField,
    IndexFieldStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (IndexFieldStatus -> IndexFieldStatus -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'IndexFieldStatus' 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', 'indexFieldStatus_options' - Undocumented member.
--
-- 'status', 'indexFieldStatus_status' - Undocumented member.
newIndexFieldStatus ::
  -- | 'options'
  IndexField ->
  -- | 'status'
  OptionStatus ->
  IndexFieldStatus
newIndexFieldStatus :: IndexField -> OptionStatus -> IndexFieldStatus
newIndexFieldStatus IndexField
pOptions_ OptionStatus
pStatus_ =
  IndexFieldStatus'
    { $sel:options:IndexFieldStatus' :: IndexField
options = IndexField
pOptions_,
      $sel:status:IndexFieldStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Undocumented member.
indexFieldStatus_options :: Lens.Lens' IndexFieldStatus IndexField
indexFieldStatus_options :: Lens' IndexFieldStatus IndexField
indexFieldStatus_options = 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)

-- | Undocumented member.
indexFieldStatus_status :: Lens.Lens' IndexFieldStatus OptionStatus
indexFieldStatus_status :: Lens' IndexFieldStatus OptionStatus
indexFieldStatus_status = 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 Data.FromXML IndexFieldStatus where
  parseXML :: [Node] -> Either String IndexFieldStatus
parseXML [Node]
x =
    IndexField -> OptionStatus -> IndexFieldStatus
IndexFieldStatus'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Options")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Status")

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

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