{-# 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.MemoryDb.Types.PendingModifiedServiceUpdate
-- 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.MemoryDb.Types.PendingModifiedServiceUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MemoryDb.Types.ServiceUpdateStatus
import qualified Amazonka.Prelude as Prelude

-- | Update action that has yet to be processed for the corresponding
-- apply\/stop request
--
-- /See:/ 'newPendingModifiedServiceUpdate' smart constructor.
data PendingModifiedServiceUpdate = PendingModifiedServiceUpdate'
  { -- | The status of the service update
    PendingModifiedServiceUpdate -> Maybe ServiceUpdateStatus
status :: Prelude.Maybe ServiceUpdateStatus,
    -- | The unique ID of the service update
    PendingModifiedServiceUpdate -> Maybe Text
serviceUpdateName :: Prelude.Maybe Prelude.Text
  }
  deriving (PendingModifiedServiceUpdate
-> PendingModifiedServiceUpdate -> Bool
(PendingModifiedServiceUpdate
 -> PendingModifiedServiceUpdate -> Bool)
-> (PendingModifiedServiceUpdate
    -> PendingModifiedServiceUpdate -> Bool)
-> Eq PendingModifiedServiceUpdate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PendingModifiedServiceUpdate
-> PendingModifiedServiceUpdate -> Bool
$c/= :: PendingModifiedServiceUpdate
-> PendingModifiedServiceUpdate -> Bool
== :: PendingModifiedServiceUpdate
-> PendingModifiedServiceUpdate -> Bool
$c== :: PendingModifiedServiceUpdate
-> PendingModifiedServiceUpdate -> Bool
Prelude.Eq, ReadPrec [PendingModifiedServiceUpdate]
ReadPrec PendingModifiedServiceUpdate
Int -> ReadS PendingModifiedServiceUpdate
ReadS [PendingModifiedServiceUpdate]
(Int -> ReadS PendingModifiedServiceUpdate)
-> ReadS [PendingModifiedServiceUpdate]
-> ReadPrec PendingModifiedServiceUpdate
-> ReadPrec [PendingModifiedServiceUpdate]
-> Read PendingModifiedServiceUpdate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PendingModifiedServiceUpdate]
$creadListPrec :: ReadPrec [PendingModifiedServiceUpdate]
readPrec :: ReadPrec PendingModifiedServiceUpdate
$creadPrec :: ReadPrec PendingModifiedServiceUpdate
readList :: ReadS [PendingModifiedServiceUpdate]
$creadList :: ReadS [PendingModifiedServiceUpdate]
readsPrec :: Int -> ReadS PendingModifiedServiceUpdate
$creadsPrec :: Int -> ReadS PendingModifiedServiceUpdate
Prelude.Read, Int -> PendingModifiedServiceUpdate -> ShowS
[PendingModifiedServiceUpdate] -> ShowS
PendingModifiedServiceUpdate -> String
(Int -> PendingModifiedServiceUpdate -> ShowS)
-> (PendingModifiedServiceUpdate -> String)
-> ([PendingModifiedServiceUpdate] -> ShowS)
-> Show PendingModifiedServiceUpdate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PendingModifiedServiceUpdate] -> ShowS
$cshowList :: [PendingModifiedServiceUpdate] -> ShowS
show :: PendingModifiedServiceUpdate -> String
$cshow :: PendingModifiedServiceUpdate -> String
showsPrec :: Int -> PendingModifiedServiceUpdate -> ShowS
$cshowsPrec :: Int -> PendingModifiedServiceUpdate -> ShowS
Prelude.Show, (forall x.
 PendingModifiedServiceUpdate -> Rep PendingModifiedServiceUpdate x)
-> (forall x.
    Rep PendingModifiedServiceUpdate x -> PendingModifiedServiceUpdate)
-> Generic PendingModifiedServiceUpdate
forall x.
Rep PendingModifiedServiceUpdate x -> PendingModifiedServiceUpdate
forall x.
PendingModifiedServiceUpdate -> Rep PendingModifiedServiceUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PendingModifiedServiceUpdate x -> PendingModifiedServiceUpdate
$cfrom :: forall x.
PendingModifiedServiceUpdate -> Rep PendingModifiedServiceUpdate x
Prelude.Generic)

-- |
-- Create a value of 'PendingModifiedServiceUpdate' 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:
--
-- 'status', 'pendingModifiedServiceUpdate_status' - The status of the service update
--
-- 'serviceUpdateName', 'pendingModifiedServiceUpdate_serviceUpdateName' - The unique ID of the service update
newPendingModifiedServiceUpdate ::
  PendingModifiedServiceUpdate
newPendingModifiedServiceUpdate :: PendingModifiedServiceUpdate
newPendingModifiedServiceUpdate =
  PendingModifiedServiceUpdate' :: Maybe ServiceUpdateStatus
-> Maybe Text -> PendingModifiedServiceUpdate
PendingModifiedServiceUpdate'
    { $sel:status:PendingModifiedServiceUpdate' :: Maybe ServiceUpdateStatus
status =
        Maybe ServiceUpdateStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceUpdateName:PendingModifiedServiceUpdate' :: Maybe Text
serviceUpdateName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the service update
pendingModifiedServiceUpdate_status :: Lens.Lens' PendingModifiedServiceUpdate (Prelude.Maybe ServiceUpdateStatus)
pendingModifiedServiceUpdate_status :: (Maybe ServiceUpdateStatus -> f (Maybe ServiceUpdateStatus))
-> PendingModifiedServiceUpdate -> f PendingModifiedServiceUpdate
pendingModifiedServiceUpdate_status = (PendingModifiedServiceUpdate -> Maybe ServiceUpdateStatus)
-> (PendingModifiedServiceUpdate
    -> Maybe ServiceUpdateStatus -> PendingModifiedServiceUpdate)
-> Lens
     PendingModifiedServiceUpdate
     PendingModifiedServiceUpdate
     (Maybe ServiceUpdateStatus)
     (Maybe ServiceUpdateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingModifiedServiceUpdate' {Maybe ServiceUpdateStatus
status :: Maybe ServiceUpdateStatus
$sel:status:PendingModifiedServiceUpdate' :: PendingModifiedServiceUpdate -> Maybe ServiceUpdateStatus
status} -> Maybe ServiceUpdateStatus
status) (\s :: PendingModifiedServiceUpdate
s@PendingModifiedServiceUpdate' {} Maybe ServiceUpdateStatus
a -> PendingModifiedServiceUpdate
s {$sel:status:PendingModifiedServiceUpdate' :: Maybe ServiceUpdateStatus
status = Maybe ServiceUpdateStatus
a} :: PendingModifiedServiceUpdate)

-- | The unique ID of the service update
pendingModifiedServiceUpdate_serviceUpdateName :: Lens.Lens' PendingModifiedServiceUpdate (Prelude.Maybe Prelude.Text)
pendingModifiedServiceUpdate_serviceUpdateName :: (Maybe Text -> f (Maybe Text))
-> PendingModifiedServiceUpdate -> f PendingModifiedServiceUpdate
pendingModifiedServiceUpdate_serviceUpdateName = (PendingModifiedServiceUpdate -> Maybe Text)
-> (PendingModifiedServiceUpdate
    -> Maybe Text -> PendingModifiedServiceUpdate)
-> Lens
     PendingModifiedServiceUpdate
     PendingModifiedServiceUpdate
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingModifiedServiceUpdate' {Maybe Text
serviceUpdateName :: Maybe Text
$sel:serviceUpdateName:PendingModifiedServiceUpdate' :: PendingModifiedServiceUpdate -> Maybe Text
serviceUpdateName} -> Maybe Text
serviceUpdateName) (\s :: PendingModifiedServiceUpdate
s@PendingModifiedServiceUpdate' {} Maybe Text
a -> PendingModifiedServiceUpdate
s {$sel:serviceUpdateName:PendingModifiedServiceUpdate' :: Maybe Text
serviceUpdateName = Maybe Text
a} :: PendingModifiedServiceUpdate)

instance Core.FromJSON PendingModifiedServiceUpdate where
  parseJSON :: Value -> Parser PendingModifiedServiceUpdate
parseJSON =
    String
-> (Object -> Parser PendingModifiedServiceUpdate)
-> Value
-> Parser PendingModifiedServiceUpdate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PendingModifiedServiceUpdate"
      ( \Object
x ->
          Maybe ServiceUpdateStatus
-> Maybe Text -> PendingModifiedServiceUpdate
PendingModifiedServiceUpdate'
            (Maybe ServiceUpdateStatus
 -> Maybe Text -> PendingModifiedServiceUpdate)
-> Parser (Maybe ServiceUpdateStatus)
-> Parser (Maybe Text -> PendingModifiedServiceUpdate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ServiceUpdateStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser (Maybe Text -> PendingModifiedServiceUpdate)
-> Parser (Maybe Text) -> Parser PendingModifiedServiceUpdate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ServiceUpdateName")
      )

instance
  Prelude.Hashable
    PendingModifiedServiceUpdate

instance Prelude.NFData PendingModifiedServiceUpdate