{-# 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.SuggesterStatus
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudSearch.Types.SuggesterStatus where

import Amazonka.CloudSearch.Types.OptionStatus
import Amazonka.CloudSearch.Types.Suggester
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The value of a @Suggester@ and its current status.
--
-- /See:/ 'newSuggesterStatus' smart constructor.
data SuggesterStatus = SuggesterStatus'
  { SuggesterStatus -> Suggester
options :: Suggester,
    SuggesterStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (SuggesterStatus -> SuggesterStatus -> Bool
(SuggesterStatus -> SuggesterStatus -> Bool)
-> (SuggesterStatus -> SuggesterStatus -> Bool)
-> Eq SuggesterStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuggesterStatus -> SuggesterStatus -> Bool
$c/= :: SuggesterStatus -> SuggesterStatus -> Bool
== :: SuggesterStatus -> SuggesterStatus -> Bool
$c== :: SuggesterStatus -> SuggesterStatus -> Bool
Prelude.Eq, ReadPrec [SuggesterStatus]
ReadPrec SuggesterStatus
Int -> ReadS SuggesterStatus
ReadS [SuggesterStatus]
(Int -> ReadS SuggesterStatus)
-> ReadS [SuggesterStatus]
-> ReadPrec SuggesterStatus
-> ReadPrec [SuggesterStatus]
-> Read SuggesterStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuggesterStatus]
$creadListPrec :: ReadPrec [SuggesterStatus]
readPrec :: ReadPrec SuggesterStatus
$creadPrec :: ReadPrec SuggesterStatus
readList :: ReadS [SuggesterStatus]
$creadList :: ReadS [SuggesterStatus]
readsPrec :: Int -> ReadS SuggesterStatus
$creadsPrec :: Int -> ReadS SuggesterStatus
Prelude.Read, Int -> SuggesterStatus -> ShowS
[SuggesterStatus] -> ShowS
SuggesterStatus -> String
(Int -> SuggesterStatus -> ShowS)
-> (SuggesterStatus -> String)
-> ([SuggesterStatus] -> ShowS)
-> Show SuggesterStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuggesterStatus] -> ShowS
$cshowList :: [SuggesterStatus] -> ShowS
show :: SuggesterStatus -> String
$cshow :: SuggesterStatus -> String
showsPrec :: Int -> SuggesterStatus -> ShowS
$cshowsPrec :: Int -> SuggesterStatus -> ShowS
Prelude.Show, (forall x. SuggesterStatus -> Rep SuggesterStatus x)
-> (forall x. Rep SuggesterStatus x -> SuggesterStatus)
-> Generic SuggesterStatus
forall x. Rep SuggesterStatus x -> SuggesterStatus
forall x. SuggesterStatus -> Rep SuggesterStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SuggesterStatus x -> SuggesterStatus
$cfrom :: forall x. SuggesterStatus -> Rep SuggesterStatus x
Prelude.Generic)

-- |
-- Create a value of 'SuggesterStatus' 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', 'suggesterStatus_options' - Undocumented member.
--
-- 'status', 'suggesterStatus_status' - Undocumented member.
newSuggesterStatus ::
  -- | 'options'
  Suggester ->
  -- | 'status'
  OptionStatus ->
  SuggesterStatus
newSuggesterStatus :: Suggester -> OptionStatus -> SuggesterStatus
newSuggesterStatus Suggester
pOptions_ OptionStatus
pStatus_ =
  SuggesterStatus' :: Suggester -> OptionStatus -> SuggesterStatus
SuggesterStatus'
    { $sel:options:SuggesterStatus' :: Suggester
options = Suggester
pOptions_,
      $sel:status:SuggesterStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Undocumented member.
suggesterStatus_options :: Lens.Lens' SuggesterStatus Suggester
suggesterStatus_options :: (Suggester -> f Suggester) -> SuggesterStatus -> f SuggesterStatus
suggesterStatus_options = (SuggesterStatus -> Suggester)
-> (SuggesterStatus -> Suggester -> SuggesterStatus)
-> Lens SuggesterStatus SuggesterStatus Suggester Suggester
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuggesterStatus' {Suggester
options :: Suggester
$sel:options:SuggesterStatus' :: SuggesterStatus -> Suggester
options} -> Suggester
options) (\s :: SuggesterStatus
s@SuggesterStatus' {} Suggester
a -> SuggesterStatus
s {$sel:options:SuggesterStatus' :: Suggester
options = Suggester
a} :: SuggesterStatus)

-- | Undocumented member.
suggesterStatus_status :: Lens.Lens' SuggesterStatus OptionStatus
suggesterStatus_status :: (OptionStatus -> f OptionStatus)
-> SuggesterStatus -> f SuggesterStatus
suggesterStatus_status = (SuggesterStatus -> OptionStatus)
-> (SuggesterStatus -> OptionStatus -> SuggesterStatus)
-> Lens SuggesterStatus SuggesterStatus OptionStatus OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuggesterStatus' {OptionStatus
status :: OptionStatus
$sel:status:SuggesterStatus' :: SuggesterStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: SuggesterStatus
s@SuggesterStatus' {} OptionStatus
a -> SuggesterStatus
s {$sel:status:SuggesterStatus' :: OptionStatus
status = OptionStatus
a} :: SuggesterStatus)

instance Core.FromXML SuggesterStatus where
  parseXML :: [Node] -> Either String SuggesterStatus
parseXML [Node]
x =
    Suggester -> OptionStatus -> SuggesterStatus
SuggesterStatus'
      (Suggester -> OptionStatus -> SuggesterStatus)
-> Either String Suggester
-> Either String (OptionStatus -> SuggesterStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Suggester
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Options")
      Either String (OptionStatus -> SuggesterStatus)
-> Either String OptionStatus -> Either String SuggesterStatus
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 SuggesterStatus

instance Prelude.NFData SuggesterStatus