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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearch.Types.EBSOptions
import Amazonka.OpenSearch.Types.OptionStatus
import qualified Amazonka.Prelude as Prelude

-- | The status of the EBS options for the specified OpenSearch Service
-- domain.
--
-- /See:/ 'newEBSOptionsStatus' smart constructor.
data EBSOptionsStatus = EBSOptionsStatus'
  { -- | The configured EBS options for the specified domain.
    EBSOptionsStatus -> EBSOptions
options :: EBSOptions,
    -- | The status of the EBS options for the specified domain.
    EBSOptionsStatus -> OptionStatus
status :: OptionStatus
  }
  deriving (EBSOptionsStatus -> EBSOptionsStatus -> Bool
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]
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
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. 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' - The configured EBS options for the specified domain.
--
-- 'status', 'eBSOptionsStatus_status' - The status of the EBS options for the specified domain.
newEBSOptionsStatus ::
  -- | 'options'
  EBSOptions ->
  -- | 'status'
  OptionStatus ->
  EBSOptionsStatus
newEBSOptionsStatus :: EBSOptions -> OptionStatus -> EBSOptionsStatus
newEBSOptionsStatus EBSOptions
pOptions_ OptionStatus
pStatus_ =
  EBSOptionsStatus'
    { $sel:options:EBSOptionsStatus' :: EBSOptions
options = EBSOptions
pOptions_,
      $sel:status:EBSOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | The configured EBS options for the specified domain.
eBSOptionsStatus_options :: Lens.Lens' EBSOptionsStatus EBSOptions
eBSOptionsStatus_options :: Lens' EBSOptionsStatus EBSOptions
eBSOptionsStatus_options = 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)

-- | The status of the EBS options for the specified domain.
eBSOptionsStatus_status :: Lens.Lens' EBSOptionsStatus OptionStatus
eBSOptionsStatus_status :: Lens' EBSOptionsStatus OptionStatus
eBSOptionsStatus_status = 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 Data.FromJSON EBSOptionsStatus where
  parseJSON :: Value -> Parser EBSOptionsStatus
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"EBSOptionsStatus"
      ( \Object
x ->
          EBSOptions -> OptionStatus -> EBSOptionsStatus
EBSOptionsStatus'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Options")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Status")
      )

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

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