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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A request to apply a service update
--
-- /See:/ 'newServiceUpdateRequest' smart constructor.
data ServiceUpdateRequest = ServiceUpdateRequest'
  { -- | The unique ID of the service update
    ServiceUpdateRequest -> Maybe Text
serviceUpdateNameToApply :: Prelude.Maybe Prelude.Text
  }
  deriving (ServiceUpdateRequest -> ServiceUpdateRequest -> Bool
(ServiceUpdateRequest -> ServiceUpdateRequest -> Bool)
-> (ServiceUpdateRequest -> ServiceUpdateRequest -> Bool)
-> Eq ServiceUpdateRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceUpdateRequest -> ServiceUpdateRequest -> Bool
$c/= :: ServiceUpdateRequest -> ServiceUpdateRequest -> Bool
== :: ServiceUpdateRequest -> ServiceUpdateRequest -> Bool
$c== :: ServiceUpdateRequest -> ServiceUpdateRequest -> Bool
Prelude.Eq, ReadPrec [ServiceUpdateRequest]
ReadPrec ServiceUpdateRequest
Int -> ReadS ServiceUpdateRequest
ReadS [ServiceUpdateRequest]
(Int -> ReadS ServiceUpdateRequest)
-> ReadS [ServiceUpdateRequest]
-> ReadPrec ServiceUpdateRequest
-> ReadPrec [ServiceUpdateRequest]
-> Read ServiceUpdateRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceUpdateRequest]
$creadListPrec :: ReadPrec [ServiceUpdateRequest]
readPrec :: ReadPrec ServiceUpdateRequest
$creadPrec :: ReadPrec ServiceUpdateRequest
readList :: ReadS [ServiceUpdateRequest]
$creadList :: ReadS [ServiceUpdateRequest]
readsPrec :: Int -> ReadS ServiceUpdateRequest
$creadsPrec :: Int -> ReadS ServiceUpdateRequest
Prelude.Read, Int -> ServiceUpdateRequest -> ShowS
[ServiceUpdateRequest] -> ShowS
ServiceUpdateRequest -> String
(Int -> ServiceUpdateRequest -> ShowS)
-> (ServiceUpdateRequest -> String)
-> ([ServiceUpdateRequest] -> ShowS)
-> Show ServiceUpdateRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceUpdateRequest] -> ShowS
$cshowList :: [ServiceUpdateRequest] -> ShowS
show :: ServiceUpdateRequest -> String
$cshow :: ServiceUpdateRequest -> String
showsPrec :: Int -> ServiceUpdateRequest -> ShowS
$cshowsPrec :: Int -> ServiceUpdateRequest -> ShowS
Prelude.Show, (forall x. ServiceUpdateRequest -> Rep ServiceUpdateRequest x)
-> (forall x. Rep ServiceUpdateRequest x -> ServiceUpdateRequest)
-> Generic ServiceUpdateRequest
forall x. Rep ServiceUpdateRequest x -> ServiceUpdateRequest
forall x. ServiceUpdateRequest -> Rep ServiceUpdateRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceUpdateRequest x -> ServiceUpdateRequest
$cfrom :: forall x. ServiceUpdateRequest -> Rep ServiceUpdateRequest x
Prelude.Generic)

-- |
-- Create a value of 'ServiceUpdateRequest' 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:
--
-- 'serviceUpdateNameToApply', 'serviceUpdateRequest_serviceUpdateNameToApply' - The unique ID of the service update
newServiceUpdateRequest ::
  ServiceUpdateRequest
newServiceUpdateRequest :: ServiceUpdateRequest
newServiceUpdateRequest =
  ServiceUpdateRequest' :: Maybe Text -> ServiceUpdateRequest
ServiceUpdateRequest'
    { $sel:serviceUpdateNameToApply:ServiceUpdateRequest' :: Maybe Text
serviceUpdateNameToApply =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

instance Prelude.Hashable ServiceUpdateRequest

instance Prelude.NFData ServiceUpdateRequest

instance Core.ToJSON ServiceUpdateRequest where
  toJSON :: ServiceUpdateRequest -> Value
toJSON ServiceUpdateRequest' {Maybe Text
serviceUpdateNameToApply :: Maybe Text
$sel:serviceUpdateNameToApply:ServiceUpdateRequest' :: ServiceUpdateRequest -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ServiceUpdateNameToApply" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serviceUpdateNameToApply
          ]
      )