{-# 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.RDS.Types.ValidDBInstanceModificationsMessage
-- 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.RDS.Types.ValidDBInstanceModificationsMessage where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.AvailableProcessorFeature
import Amazonka.RDS.Types.ValidStorageOptions

-- | Information about valid modifications that you can make to your DB
-- instance. Contains the result of a successful call to the
-- @DescribeValidDBInstanceModifications@ action. You can use this
-- information when you call @ModifyDBInstance@.
--
-- /See:/ 'newValidDBInstanceModificationsMessage' smart constructor.
data ValidDBInstanceModificationsMessage = ValidDBInstanceModificationsMessage'
  { -- | Valid processor features for your DB instance.
    ValidDBInstanceModificationsMessage
-> Maybe [AvailableProcessorFeature]
validProcessorFeatures :: Prelude.Maybe [AvailableProcessorFeature],
    -- | Valid storage options for your DB instance.
    ValidDBInstanceModificationsMessage -> Maybe [ValidStorageOptions]
storage :: Prelude.Maybe [ValidStorageOptions]
  }
  deriving (ValidDBInstanceModificationsMessage
-> ValidDBInstanceModificationsMessage -> Bool
(ValidDBInstanceModificationsMessage
 -> ValidDBInstanceModificationsMessage -> Bool)
-> (ValidDBInstanceModificationsMessage
    -> ValidDBInstanceModificationsMessage -> Bool)
-> Eq ValidDBInstanceModificationsMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidDBInstanceModificationsMessage
-> ValidDBInstanceModificationsMessage -> Bool
$c/= :: ValidDBInstanceModificationsMessage
-> ValidDBInstanceModificationsMessage -> Bool
== :: ValidDBInstanceModificationsMessage
-> ValidDBInstanceModificationsMessage -> Bool
$c== :: ValidDBInstanceModificationsMessage
-> ValidDBInstanceModificationsMessage -> Bool
Prelude.Eq, ReadPrec [ValidDBInstanceModificationsMessage]
ReadPrec ValidDBInstanceModificationsMessage
Int -> ReadS ValidDBInstanceModificationsMessage
ReadS [ValidDBInstanceModificationsMessage]
(Int -> ReadS ValidDBInstanceModificationsMessage)
-> ReadS [ValidDBInstanceModificationsMessage]
-> ReadPrec ValidDBInstanceModificationsMessage
-> ReadPrec [ValidDBInstanceModificationsMessage]
-> Read ValidDBInstanceModificationsMessage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ValidDBInstanceModificationsMessage]
$creadListPrec :: ReadPrec [ValidDBInstanceModificationsMessage]
readPrec :: ReadPrec ValidDBInstanceModificationsMessage
$creadPrec :: ReadPrec ValidDBInstanceModificationsMessage
readList :: ReadS [ValidDBInstanceModificationsMessage]
$creadList :: ReadS [ValidDBInstanceModificationsMessage]
readsPrec :: Int -> ReadS ValidDBInstanceModificationsMessage
$creadsPrec :: Int -> ReadS ValidDBInstanceModificationsMessage
Prelude.Read, Int -> ValidDBInstanceModificationsMessage -> ShowS
[ValidDBInstanceModificationsMessage] -> ShowS
ValidDBInstanceModificationsMessage -> String
(Int -> ValidDBInstanceModificationsMessage -> ShowS)
-> (ValidDBInstanceModificationsMessage -> String)
-> ([ValidDBInstanceModificationsMessage] -> ShowS)
-> Show ValidDBInstanceModificationsMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValidDBInstanceModificationsMessage] -> ShowS
$cshowList :: [ValidDBInstanceModificationsMessage] -> ShowS
show :: ValidDBInstanceModificationsMessage -> String
$cshow :: ValidDBInstanceModificationsMessage -> String
showsPrec :: Int -> ValidDBInstanceModificationsMessage -> ShowS
$cshowsPrec :: Int -> ValidDBInstanceModificationsMessage -> ShowS
Prelude.Show, (forall x.
 ValidDBInstanceModificationsMessage
 -> Rep ValidDBInstanceModificationsMessage x)
-> (forall x.
    Rep ValidDBInstanceModificationsMessage x
    -> ValidDBInstanceModificationsMessage)
-> Generic ValidDBInstanceModificationsMessage
forall x.
Rep ValidDBInstanceModificationsMessage x
-> ValidDBInstanceModificationsMessage
forall x.
ValidDBInstanceModificationsMessage
-> Rep ValidDBInstanceModificationsMessage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ValidDBInstanceModificationsMessage x
-> ValidDBInstanceModificationsMessage
$cfrom :: forall x.
ValidDBInstanceModificationsMessage
-> Rep ValidDBInstanceModificationsMessage x
Prelude.Generic)

-- |
-- Create a value of 'ValidDBInstanceModificationsMessage' 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:
--
-- 'validProcessorFeatures', 'validDBInstanceModificationsMessage_validProcessorFeatures' - Valid processor features for your DB instance.
--
-- 'storage', 'validDBInstanceModificationsMessage_storage' - Valid storage options for your DB instance.
newValidDBInstanceModificationsMessage ::
  ValidDBInstanceModificationsMessage
newValidDBInstanceModificationsMessage :: ValidDBInstanceModificationsMessage
newValidDBInstanceModificationsMessage =
  ValidDBInstanceModificationsMessage' :: Maybe [AvailableProcessorFeature]
-> Maybe [ValidStorageOptions]
-> ValidDBInstanceModificationsMessage
ValidDBInstanceModificationsMessage'
    { $sel:validProcessorFeatures:ValidDBInstanceModificationsMessage' :: Maybe [AvailableProcessorFeature]
validProcessorFeatures =
        Maybe [AvailableProcessorFeature]
forall a. Maybe a
Prelude.Nothing,
      $sel:storage:ValidDBInstanceModificationsMessage' :: Maybe [ValidStorageOptions]
storage = Maybe [ValidStorageOptions]
forall a. Maybe a
Prelude.Nothing
    }

-- | Valid processor features for your DB instance.
validDBInstanceModificationsMessage_validProcessorFeatures :: Lens.Lens' ValidDBInstanceModificationsMessage (Prelude.Maybe [AvailableProcessorFeature])
validDBInstanceModificationsMessage_validProcessorFeatures :: (Maybe [AvailableProcessorFeature]
 -> f (Maybe [AvailableProcessorFeature]))
-> ValidDBInstanceModificationsMessage
-> f ValidDBInstanceModificationsMessage
validDBInstanceModificationsMessage_validProcessorFeatures = (ValidDBInstanceModificationsMessage
 -> Maybe [AvailableProcessorFeature])
-> (ValidDBInstanceModificationsMessage
    -> Maybe [AvailableProcessorFeature]
    -> ValidDBInstanceModificationsMessage)
-> Lens
     ValidDBInstanceModificationsMessage
     ValidDBInstanceModificationsMessage
     (Maybe [AvailableProcessorFeature])
     (Maybe [AvailableProcessorFeature])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidDBInstanceModificationsMessage' {Maybe [AvailableProcessorFeature]
validProcessorFeatures :: Maybe [AvailableProcessorFeature]
$sel:validProcessorFeatures:ValidDBInstanceModificationsMessage' :: ValidDBInstanceModificationsMessage
-> Maybe [AvailableProcessorFeature]
validProcessorFeatures} -> Maybe [AvailableProcessorFeature]
validProcessorFeatures) (\s :: ValidDBInstanceModificationsMessage
s@ValidDBInstanceModificationsMessage' {} Maybe [AvailableProcessorFeature]
a -> ValidDBInstanceModificationsMessage
s {$sel:validProcessorFeatures:ValidDBInstanceModificationsMessage' :: Maybe [AvailableProcessorFeature]
validProcessorFeatures = Maybe [AvailableProcessorFeature]
a} :: ValidDBInstanceModificationsMessage) ((Maybe [AvailableProcessorFeature]
  -> f (Maybe [AvailableProcessorFeature]))
 -> ValidDBInstanceModificationsMessage
 -> f ValidDBInstanceModificationsMessage)
-> ((Maybe [AvailableProcessorFeature]
     -> f (Maybe [AvailableProcessorFeature]))
    -> Maybe [AvailableProcessorFeature]
    -> f (Maybe [AvailableProcessorFeature]))
-> (Maybe [AvailableProcessorFeature]
    -> f (Maybe [AvailableProcessorFeature]))
-> ValidDBInstanceModificationsMessage
-> f ValidDBInstanceModificationsMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AvailableProcessorFeature]
  [AvailableProcessorFeature]
  [AvailableProcessorFeature]
  [AvailableProcessorFeature]
-> Iso
     (Maybe [AvailableProcessorFeature])
     (Maybe [AvailableProcessorFeature])
     (Maybe [AvailableProcessorFeature])
     (Maybe [AvailableProcessorFeature])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AvailableProcessorFeature]
  [AvailableProcessorFeature]
  [AvailableProcessorFeature]
  [AvailableProcessorFeature]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Valid storage options for your DB instance.
validDBInstanceModificationsMessage_storage :: Lens.Lens' ValidDBInstanceModificationsMessage (Prelude.Maybe [ValidStorageOptions])
validDBInstanceModificationsMessage_storage :: (Maybe [ValidStorageOptions] -> f (Maybe [ValidStorageOptions]))
-> ValidDBInstanceModificationsMessage
-> f ValidDBInstanceModificationsMessage
validDBInstanceModificationsMessage_storage = (ValidDBInstanceModificationsMessage
 -> Maybe [ValidStorageOptions])
-> (ValidDBInstanceModificationsMessage
    -> Maybe [ValidStorageOptions]
    -> ValidDBInstanceModificationsMessage)
-> Lens
     ValidDBInstanceModificationsMessage
     ValidDBInstanceModificationsMessage
     (Maybe [ValidStorageOptions])
     (Maybe [ValidStorageOptions])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidDBInstanceModificationsMessage' {Maybe [ValidStorageOptions]
storage :: Maybe [ValidStorageOptions]
$sel:storage:ValidDBInstanceModificationsMessage' :: ValidDBInstanceModificationsMessage -> Maybe [ValidStorageOptions]
storage} -> Maybe [ValidStorageOptions]
storage) (\s :: ValidDBInstanceModificationsMessage
s@ValidDBInstanceModificationsMessage' {} Maybe [ValidStorageOptions]
a -> ValidDBInstanceModificationsMessage
s {$sel:storage:ValidDBInstanceModificationsMessage' :: Maybe [ValidStorageOptions]
storage = Maybe [ValidStorageOptions]
a} :: ValidDBInstanceModificationsMessage) ((Maybe [ValidStorageOptions] -> f (Maybe [ValidStorageOptions]))
 -> ValidDBInstanceModificationsMessage
 -> f ValidDBInstanceModificationsMessage)
-> ((Maybe [ValidStorageOptions]
     -> f (Maybe [ValidStorageOptions]))
    -> Maybe [ValidStorageOptions] -> f (Maybe [ValidStorageOptions]))
-> (Maybe [ValidStorageOptions] -> f (Maybe [ValidStorageOptions]))
-> ValidDBInstanceModificationsMessage
-> f ValidDBInstanceModificationsMessage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ValidStorageOptions]
  [ValidStorageOptions]
  [ValidStorageOptions]
  [ValidStorageOptions]
-> Iso
     (Maybe [ValidStorageOptions])
     (Maybe [ValidStorageOptions])
     (Maybe [ValidStorageOptions])
     (Maybe [ValidStorageOptions])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ValidStorageOptions]
  [ValidStorageOptions]
  [ValidStorageOptions]
  [ValidStorageOptions]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromXML
    ValidDBInstanceModificationsMessage
  where
  parseXML :: [Node] -> Either String ValidDBInstanceModificationsMessage
parseXML [Node]
x =
    Maybe [AvailableProcessorFeature]
-> Maybe [ValidStorageOptions]
-> ValidDBInstanceModificationsMessage
ValidDBInstanceModificationsMessage'
      (Maybe [AvailableProcessorFeature]
 -> Maybe [ValidStorageOptions]
 -> ValidDBInstanceModificationsMessage)
-> Either String (Maybe [AvailableProcessorFeature])
-> Either
     String
     (Maybe [ValidStorageOptions]
      -> ValidDBInstanceModificationsMessage)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ValidProcessorFeatures"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [AvailableProcessorFeature]))
-> Either String (Maybe [AvailableProcessorFeature])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [AvailableProcessorFeature])
-> [Node] -> Either String (Maybe [AvailableProcessorFeature])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                        (Text -> [Node] -> Either String [AvailableProcessorFeature]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"AvailableProcessorFeature")
                  )
      Either
  String
  (Maybe [ValidStorageOptions]
   -> ValidDBInstanceModificationsMessage)
-> Either String (Maybe [ValidStorageOptions])
-> Either String ValidDBInstanceModificationsMessage
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Storage" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [ValidStorageOptions]))
-> Either String (Maybe [ValidStorageOptions])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [ValidStorageOptions])
-> [Node] -> Either String (Maybe [ValidStorageOptions])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [ValidStorageOptions]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ValidStorageOptions")
                  )

instance
  Prelude.Hashable
    ValidDBInstanceModificationsMessage

instance
  Prelude.NFData
    ValidDBInstanceModificationsMessage