{-# 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.ElasticSearch.Types.ElasticsearchVersionStatus
-- 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.ElasticSearch.Types.ElasticsearchVersionStatus where

import qualified Amazonka.Core as Core
import Amazonka.ElasticSearch.Types.OptionStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Status of the Elasticsearch version options for the specified
-- Elasticsearch domain.
--
-- /See:/ 'newElasticsearchVersionStatus' smart constructor.
data ElasticsearchVersionStatus = ElasticsearchVersionStatus'
  { -- | Specifies the Elasticsearch version for the specified Elasticsearch
    -- domain.
    ElasticsearchVersionStatus -> Text
options :: Prelude.Text,
    -- | Specifies the status of the Elasticsearch version options for the
    -- specified Elasticsearch domain.
    ElasticsearchVersionStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (ElasticsearchVersionStatus -> ElasticsearchVersionStatus -> Bool
(ElasticsearchVersionStatus -> ElasticsearchVersionStatus -> Bool)
-> (ElasticsearchVersionStatus
    -> ElasticsearchVersionStatus -> Bool)
-> Eq ElasticsearchVersionStatus
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElasticsearchVersionStatus -> ElasticsearchVersionStatus -> Bool
$c/= :: ElasticsearchVersionStatus -> ElasticsearchVersionStatus -> Bool
== :: ElasticsearchVersionStatus -> ElasticsearchVersionStatus -> Bool
$c== :: ElasticsearchVersionStatus -> ElasticsearchVersionStatus -> Bool
Prelude.Eq, ReadPrec [ElasticsearchVersionStatus]
ReadPrec ElasticsearchVersionStatus
Int -> ReadS ElasticsearchVersionStatus
ReadS [ElasticsearchVersionStatus]
(Int -> ReadS ElasticsearchVersionStatus)
-> ReadS [ElasticsearchVersionStatus]
-> ReadPrec ElasticsearchVersionStatus
-> ReadPrec [ElasticsearchVersionStatus]
-> Read ElasticsearchVersionStatus
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElasticsearchVersionStatus]
$creadListPrec :: ReadPrec [ElasticsearchVersionStatus]
readPrec :: ReadPrec ElasticsearchVersionStatus
$creadPrec :: ReadPrec ElasticsearchVersionStatus
readList :: ReadS [ElasticsearchVersionStatus]
$creadList :: ReadS [ElasticsearchVersionStatus]
readsPrec :: Int -> ReadS ElasticsearchVersionStatus
$creadsPrec :: Int -> ReadS ElasticsearchVersionStatus
Prelude.Read, Int -> ElasticsearchVersionStatus -> ShowS
[ElasticsearchVersionStatus] -> ShowS
ElasticsearchVersionStatus -> String
(Int -> ElasticsearchVersionStatus -> ShowS)
-> (ElasticsearchVersionStatus -> String)
-> ([ElasticsearchVersionStatus] -> ShowS)
-> Show ElasticsearchVersionStatus
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElasticsearchVersionStatus] -> ShowS
$cshowList :: [ElasticsearchVersionStatus] -> ShowS
show :: ElasticsearchVersionStatus -> String
$cshow :: ElasticsearchVersionStatus -> String
showsPrec :: Int -> ElasticsearchVersionStatus -> ShowS
$cshowsPrec :: Int -> ElasticsearchVersionStatus -> ShowS
Prelude.Show, (forall x.
 ElasticsearchVersionStatus -> Rep ElasticsearchVersionStatus x)
-> (forall x.
    Rep ElasticsearchVersionStatus x -> ElasticsearchVersionStatus)
-> Generic ElasticsearchVersionStatus
forall x.
Rep ElasticsearchVersionStatus x -> ElasticsearchVersionStatus
forall x.
ElasticsearchVersionStatus -> Rep ElasticsearchVersionStatus x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElasticsearchVersionStatus x -> ElasticsearchVersionStatus
$cfrom :: forall x.
ElasticsearchVersionStatus -> Rep ElasticsearchVersionStatus x
Prelude.Generic)

-- |
-- Create a value of 'ElasticsearchVersionStatus' 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', 'elasticsearchVersionStatus_options' - Specifies the Elasticsearch version for the specified Elasticsearch
-- domain.
--
-- 'status', 'elasticsearchVersionStatus_status' - Specifies the status of the Elasticsearch version options for the
-- specified Elasticsearch domain.
newElasticsearchVersionStatus ::
  -- | 'options'
  Prelude.Text ->
  -- | 'status'
  OptionStatus ->
  ElasticsearchVersionStatus
newElasticsearchVersionStatus :: Text -> OptionStatus -> ElasticsearchVersionStatus
newElasticsearchVersionStatus Text
pOptions_ OptionStatus
pStatus_ =
  ElasticsearchVersionStatus' :: Text -> OptionStatus -> ElasticsearchVersionStatus
ElasticsearchVersionStatus'
    { $sel:options:ElasticsearchVersionStatus' :: Text
options = Text
pOptions_,
      $sel:status:ElasticsearchVersionStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Specifies the Elasticsearch version for the specified Elasticsearch
-- domain.
elasticsearchVersionStatus_options :: Lens.Lens' ElasticsearchVersionStatus Prelude.Text
elasticsearchVersionStatus_options :: (Text -> f Text)
-> ElasticsearchVersionStatus -> f ElasticsearchVersionStatus
elasticsearchVersionStatus_options = (ElasticsearchVersionStatus -> Text)
-> (ElasticsearchVersionStatus
    -> Text -> ElasticsearchVersionStatus)
-> Lens
     ElasticsearchVersionStatus ElasticsearchVersionStatus Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchVersionStatus' {Text
options :: Text
$sel:options:ElasticsearchVersionStatus' :: ElasticsearchVersionStatus -> Text
options} -> Text
options) (\s :: ElasticsearchVersionStatus
s@ElasticsearchVersionStatus' {} Text
a -> ElasticsearchVersionStatus
s {$sel:options:ElasticsearchVersionStatus' :: Text
options = Text
a} :: ElasticsearchVersionStatus)

-- | Specifies the status of the Elasticsearch version options for the
-- specified Elasticsearch domain.
elasticsearchVersionStatus_status :: Lens.Lens' ElasticsearchVersionStatus OptionStatus
elasticsearchVersionStatus_status :: (OptionStatus -> f OptionStatus)
-> ElasticsearchVersionStatus -> f ElasticsearchVersionStatus
elasticsearchVersionStatus_status = (ElasticsearchVersionStatus -> OptionStatus)
-> (ElasticsearchVersionStatus
    -> OptionStatus -> ElasticsearchVersionStatus)
-> Lens
     ElasticsearchVersionStatus
     ElasticsearchVersionStatus
     OptionStatus
     OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElasticsearchVersionStatus' {OptionStatus
status :: OptionStatus
$sel:status:ElasticsearchVersionStatus' :: ElasticsearchVersionStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: ElasticsearchVersionStatus
s@ElasticsearchVersionStatus' {} OptionStatus
a -> ElasticsearchVersionStatus
s {$sel:status:ElasticsearchVersionStatus' :: OptionStatus
status = OptionStatus
a} :: ElasticsearchVersionStatus)

instance Core.FromJSON ElasticsearchVersionStatus where
  parseJSON :: Value -> Parser ElasticsearchVersionStatus
parseJSON =
    String
-> (Object -> Parser ElasticsearchVersionStatus)
-> Value
-> Parser ElasticsearchVersionStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ElasticsearchVersionStatus"
      ( \Object
x ->
          Text -> OptionStatus -> ElasticsearchVersionStatus
ElasticsearchVersionStatus'
            (Text -> OptionStatus -> ElasticsearchVersionStatus)
-> Parser Text
-> Parser (OptionStatus -> ElasticsearchVersionStatus)
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 -> ElasticsearchVersionStatus)
-> Parser OptionStatus -> Parser ElasticsearchVersionStatus
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 ElasticsearchVersionStatus

instance Prelude.NFData ElasticsearchVersionStatus