{-# 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.EBSOptionsStatus
-- 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.EBSOptionsStatus where

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

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

-- |
-- Create a value of 'EBSOptionsStatus' 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', 'eBSOptionsStatus_options' - Specifies the EBS options for the specified Elasticsearch domain.
--
-- 'status', 'eBSOptionsStatus_status' - Specifies the status of the EBS options for the specified Elasticsearch
-- domain.
newEBSOptionsStatus ::
  -- | 'options'
  EBSOptions ->
  -- | 'status'
  OptionStatus ->
  EBSOptionsStatus
newEBSOptionsStatus :: EBSOptions -> OptionStatus -> EBSOptionsStatus
newEBSOptionsStatus EBSOptions
pOptions_ OptionStatus
pStatus_ =
  EBSOptionsStatus' :: EBSOptions -> OptionStatus -> EBSOptionsStatus
EBSOptionsStatus'
    { $sel:options:EBSOptionsStatus' :: EBSOptions
options = EBSOptions
pOptions_,
      $sel:status:EBSOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Specifies the EBS options for the specified Elasticsearch domain.
eBSOptionsStatus_options :: Lens.Lens' EBSOptionsStatus EBSOptions
eBSOptionsStatus_options :: (EBSOptions -> f EBSOptions)
-> EBSOptionsStatus -> f EBSOptionsStatus
eBSOptionsStatus_options = (EBSOptionsStatus -> EBSOptions)
-> (EBSOptionsStatus -> EBSOptions -> EBSOptionsStatus)
-> Lens EBSOptionsStatus EBSOptionsStatus EBSOptions EBSOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EBSOptionsStatus' {EBSOptions
options :: EBSOptions
$sel:options:EBSOptionsStatus' :: EBSOptionsStatus -> EBSOptions
options} -> EBSOptions
options) (\s :: EBSOptionsStatus
s@EBSOptionsStatus' {} EBSOptions
a -> EBSOptionsStatus
s {$sel:options:EBSOptionsStatus' :: EBSOptions
options = EBSOptions
a} :: EBSOptionsStatus)

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

instance Core.FromJSON EBSOptionsStatus where
  parseJSON :: Value -> Parser EBSOptionsStatus
parseJSON =
    String
-> (Object -> Parser EBSOptionsStatus)
-> Value
-> Parser EBSOptionsStatus
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EBSOptionsStatus"
      ( \Object
x ->
          EBSOptions -> OptionStatus -> EBSOptionsStatus
EBSOptionsStatus'
            (EBSOptions -> OptionStatus -> EBSOptionsStatus)
-> Parser EBSOptions -> Parser (OptionStatus -> EBSOptionsStatus)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser EBSOptions
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Options")
            Parser (OptionStatus -> EBSOptionsStatus)
-> Parser OptionStatus -> Parser EBSOptionsStatus
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 EBSOptionsStatus

instance Prelude.NFData EBSOptionsStatus