{-# 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.VersionStatus 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 VersionStatus = VersionStatus'
{
VersionStatus -> Text
options :: Prelude.Text,
VersionStatus -> OptionStatus
status :: OptionStatus
}
deriving (VersionStatus -> VersionStatus -> Bool
(VersionStatus -> VersionStatus -> Bool)
-> (VersionStatus -> VersionStatus -> Bool) -> Eq VersionStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VersionStatus -> VersionStatus -> Bool
$c/= :: VersionStatus -> VersionStatus -> Bool
== :: VersionStatus -> VersionStatus -> Bool
$c== :: VersionStatus -> VersionStatus -> Bool
Prelude.Eq, ReadPrec [VersionStatus]
ReadPrec VersionStatus
Int -> ReadS VersionStatus
ReadS [VersionStatus]
(Int -> ReadS VersionStatus)
-> ReadS [VersionStatus]
-> ReadPrec VersionStatus
-> ReadPrec [VersionStatus]
-> Read VersionStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VersionStatus]
$creadListPrec :: ReadPrec [VersionStatus]
readPrec :: ReadPrec VersionStatus
$creadPrec :: ReadPrec VersionStatus
readList :: ReadS [VersionStatus]
$creadList :: ReadS [VersionStatus]
readsPrec :: Int -> ReadS VersionStatus
$creadsPrec :: Int -> ReadS VersionStatus
Prelude.Read, Int -> VersionStatus -> ShowS
[VersionStatus] -> ShowS
VersionStatus -> String
(Int -> VersionStatus -> ShowS)
-> (VersionStatus -> String)
-> ([VersionStatus] -> ShowS)
-> Show VersionStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VersionStatus] -> ShowS
$cshowList :: [VersionStatus] -> ShowS
show :: VersionStatus -> String
$cshow :: VersionStatus -> String
showsPrec :: Int -> VersionStatus -> ShowS
$cshowsPrec :: Int -> VersionStatus -> ShowS
Prelude.Show, (forall x. VersionStatus -> Rep VersionStatus x)
-> (forall x. Rep VersionStatus x -> VersionStatus)
-> Generic VersionStatus
forall x. Rep VersionStatus x -> VersionStatus
forall x. VersionStatus -> Rep VersionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VersionStatus x -> VersionStatus
$cfrom :: forall x. VersionStatus -> Rep VersionStatus x
Prelude.Generic)
newVersionStatus ::
Prelude.Text ->
OptionStatus ->
VersionStatus
newVersionStatus :: Text -> OptionStatus -> VersionStatus
newVersionStatus Text
pOptions_ OptionStatus
pStatus_ =
VersionStatus' :: Text -> OptionStatus -> VersionStatus
VersionStatus'
{ $sel:options:VersionStatus' :: Text
options = Text
pOptions_,
$sel:status:VersionStatus' :: OptionStatus
status = OptionStatus
pStatus_
}
versionStatus_options :: Lens.Lens' VersionStatus Prelude.Text
versionStatus_options :: (Text -> f Text) -> VersionStatus -> f VersionStatus
versionStatus_options = (VersionStatus -> Text)
-> (VersionStatus -> Text -> VersionStatus)
-> Lens VersionStatus VersionStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersionStatus' {Text
options :: Text
$sel:options:VersionStatus' :: VersionStatus -> Text
options} -> Text
options) (\s :: VersionStatus
s@VersionStatus' {} Text
a -> VersionStatus
s {$sel:options:VersionStatus' :: Text
options = Text
a} :: VersionStatus)
versionStatus_status :: Lens.Lens' VersionStatus OptionStatus
versionStatus_status :: (OptionStatus -> f OptionStatus)
-> VersionStatus -> f VersionStatus
versionStatus_status = (VersionStatus -> OptionStatus)
-> (VersionStatus -> OptionStatus -> VersionStatus)
-> Lens VersionStatus VersionStatus OptionStatus OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VersionStatus' {OptionStatus
status :: OptionStatus
$sel:status:VersionStatus' :: VersionStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: VersionStatus
s@VersionStatus' {} OptionStatus
a -> VersionStatus
s {$sel:status:VersionStatus' :: OptionStatus
status = OptionStatus
a} :: VersionStatus)
instance Core.FromJSON VersionStatus where
parseJSON :: Value -> Parser VersionStatus
parseJSON =
String
-> (Object -> Parser VersionStatus)
-> Value
-> Parser VersionStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VersionStatus"
( \Object
x ->
Text -> OptionStatus -> VersionStatus
VersionStatus'
(Text -> OptionStatus -> VersionStatus)
-> Parser Text -> Parser (OptionStatus -> VersionStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Options")
Parser (OptionStatus -> VersionStatus)
-> Parser OptionStatus -> Parser VersionStatus
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 VersionStatus
instance Prelude.NFData VersionStatus