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

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

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

-- |
-- Create a value of 'SnapshotOptionsStatus' 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', 'snapshotOptionsStatus_options' - Specifies the daily snapshot options specified for the Elasticsearch
-- domain.
--
-- 'status', 'snapshotOptionsStatus_status' - Specifies the status of a daily automated snapshot.
newSnapshotOptionsStatus ::
  -- | 'options'
  SnapshotOptions ->
  -- | 'status'
  OptionStatus ->
  SnapshotOptionsStatus
newSnapshotOptionsStatus :: SnapshotOptions -> OptionStatus -> SnapshotOptionsStatus
newSnapshotOptionsStatus SnapshotOptions
pOptions_ OptionStatus
pStatus_ =
  SnapshotOptionsStatus' :: SnapshotOptions -> OptionStatus -> SnapshotOptionsStatus
SnapshotOptionsStatus'
    { $sel:options:SnapshotOptionsStatus' :: SnapshotOptions
options = SnapshotOptions
pOptions_,
      $sel:status:SnapshotOptionsStatus' :: OptionStatus
status = OptionStatus
pStatus_
    }

-- | Specifies the daily snapshot options specified for the Elasticsearch
-- domain.
snapshotOptionsStatus_options :: Lens.Lens' SnapshotOptionsStatus SnapshotOptions
snapshotOptionsStatus_options :: (SnapshotOptions -> f SnapshotOptions)
-> SnapshotOptionsStatus -> f SnapshotOptionsStatus
snapshotOptionsStatus_options = (SnapshotOptionsStatus -> SnapshotOptions)
-> (SnapshotOptionsStatus
    -> SnapshotOptions -> SnapshotOptionsStatus)
-> Lens
     SnapshotOptionsStatus
     SnapshotOptionsStatus
     SnapshotOptions
     SnapshotOptions
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotOptionsStatus' {SnapshotOptions
options :: SnapshotOptions
$sel:options:SnapshotOptionsStatus' :: SnapshotOptionsStatus -> SnapshotOptions
options} -> SnapshotOptions
options) (\s :: SnapshotOptionsStatus
s@SnapshotOptionsStatus' {} SnapshotOptions
a -> SnapshotOptionsStatus
s {$sel:options:SnapshotOptionsStatus' :: SnapshotOptions
options = SnapshotOptions
a} :: SnapshotOptionsStatus)

-- | Specifies the status of a daily automated snapshot.
snapshotOptionsStatus_status :: Lens.Lens' SnapshotOptionsStatus OptionStatus
snapshotOptionsStatus_status :: (OptionStatus -> f OptionStatus)
-> SnapshotOptionsStatus -> f SnapshotOptionsStatus
snapshotOptionsStatus_status = (SnapshotOptionsStatus -> OptionStatus)
-> (SnapshotOptionsStatus -> OptionStatus -> SnapshotOptionsStatus)
-> Lens
     SnapshotOptionsStatus
     SnapshotOptionsStatus
     OptionStatus
     OptionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnapshotOptionsStatus' {OptionStatus
status :: OptionStatus
$sel:status:SnapshotOptionsStatus' :: SnapshotOptionsStatus -> OptionStatus
status} -> OptionStatus
status) (\s :: SnapshotOptionsStatus
s@SnapshotOptionsStatus' {} OptionStatus
a -> SnapshotOptionsStatus
s {$sel:status:SnapshotOptionsStatus' :: OptionStatus
status = OptionStatus
a} :: SnapshotOptionsStatus)

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

instance Prelude.NFData SnapshotOptionsStatus