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

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

-- | Contains the cause of an installation media failure. Installation media
-- is used for a DB engine that requires an on-premises customer provided
-- license, such as Microsoft SQL Server.
--
-- /See:/ 'newInstallationMediaFailureCause' smart constructor.
data InstallationMediaFailureCause = InstallationMediaFailureCause'
  { -- | The reason that an installation media import failed.
    InstallationMediaFailureCause -> Maybe Text
message :: Prelude.Maybe Prelude.Text
  }
  deriving (InstallationMediaFailureCause
-> InstallationMediaFailureCause -> Bool
(InstallationMediaFailureCause
 -> InstallationMediaFailureCause -> Bool)
-> (InstallationMediaFailureCause
    -> InstallationMediaFailureCause -> Bool)
-> Eq InstallationMediaFailureCause
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstallationMediaFailureCause
-> InstallationMediaFailureCause -> Bool
$c/= :: InstallationMediaFailureCause
-> InstallationMediaFailureCause -> Bool
== :: InstallationMediaFailureCause
-> InstallationMediaFailureCause -> Bool
$c== :: InstallationMediaFailureCause
-> InstallationMediaFailureCause -> Bool
Prelude.Eq, ReadPrec [InstallationMediaFailureCause]
ReadPrec InstallationMediaFailureCause
Int -> ReadS InstallationMediaFailureCause
ReadS [InstallationMediaFailureCause]
(Int -> ReadS InstallationMediaFailureCause)
-> ReadS [InstallationMediaFailureCause]
-> ReadPrec InstallationMediaFailureCause
-> ReadPrec [InstallationMediaFailureCause]
-> Read InstallationMediaFailureCause
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstallationMediaFailureCause]
$creadListPrec :: ReadPrec [InstallationMediaFailureCause]
readPrec :: ReadPrec InstallationMediaFailureCause
$creadPrec :: ReadPrec InstallationMediaFailureCause
readList :: ReadS [InstallationMediaFailureCause]
$creadList :: ReadS [InstallationMediaFailureCause]
readsPrec :: Int -> ReadS InstallationMediaFailureCause
$creadsPrec :: Int -> ReadS InstallationMediaFailureCause
Prelude.Read, Int -> InstallationMediaFailureCause -> ShowS
[InstallationMediaFailureCause] -> ShowS
InstallationMediaFailureCause -> String
(Int -> InstallationMediaFailureCause -> ShowS)
-> (InstallationMediaFailureCause -> String)
-> ([InstallationMediaFailureCause] -> ShowS)
-> Show InstallationMediaFailureCause
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstallationMediaFailureCause] -> ShowS
$cshowList :: [InstallationMediaFailureCause] -> ShowS
show :: InstallationMediaFailureCause -> String
$cshow :: InstallationMediaFailureCause -> String
showsPrec :: Int -> InstallationMediaFailureCause -> ShowS
$cshowsPrec :: Int -> InstallationMediaFailureCause -> ShowS
Prelude.Show, (forall x.
 InstallationMediaFailureCause
 -> Rep InstallationMediaFailureCause x)
-> (forall x.
    Rep InstallationMediaFailureCause x
    -> InstallationMediaFailureCause)
-> Generic InstallationMediaFailureCause
forall x.
Rep InstallationMediaFailureCause x
-> InstallationMediaFailureCause
forall x.
InstallationMediaFailureCause
-> Rep InstallationMediaFailureCause x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InstallationMediaFailureCause x
-> InstallationMediaFailureCause
$cfrom :: forall x.
InstallationMediaFailureCause
-> Rep InstallationMediaFailureCause x
Prelude.Generic)

-- |
-- Create a value of 'InstallationMediaFailureCause' 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:
--
-- 'message', 'installationMediaFailureCause_message' - The reason that an installation media import failed.
newInstallationMediaFailureCause ::
  InstallationMediaFailureCause
newInstallationMediaFailureCause :: InstallationMediaFailureCause
newInstallationMediaFailureCause =
  InstallationMediaFailureCause' :: Maybe Text -> InstallationMediaFailureCause
InstallationMediaFailureCause'
    { $sel:message:InstallationMediaFailureCause' :: Maybe Text
message =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The reason that an installation media import failed.
installationMediaFailureCause_message :: Lens.Lens' InstallationMediaFailureCause (Prelude.Maybe Prelude.Text)
installationMediaFailureCause_message :: (Maybe Text -> f (Maybe Text))
-> InstallationMediaFailureCause -> f InstallationMediaFailureCause
installationMediaFailureCause_message = (InstallationMediaFailureCause -> Maybe Text)
-> (InstallationMediaFailureCause
    -> Maybe Text -> InstallationMediaFailureCause)
-> Lens
     InstallationMediaFailureCause
     InstallationMediaFailureCause
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMediaFailureCause' {Maybe Text
message :: Maybe Text
$sel:message:InstallationMediaFailureCause' :: InstallationMediaFailureCause -> Maybe Text
message} -> Maybe Text
message) (\s :: InstallationMediaFailureCause
s@InstallationMediaFailureCause' {} Maybe Text
a -> InstallationMediaFailureCause
s {$sel:message:InstallationMediaFailureCause' :: Maybe Text
message = Maybe Text
a} :: InstallationMediaFailureCause)

instance Core.FromXML InstallationMediaFailureCause where
  parseXML :: [Node] -> Either String InstallationMediaFailureCause
parseXML [Node]
x =
    Maybe Text -> InstallationMediaFailureCause
InstallationMediaFailureCause'
      (Maybe Text -> InstallationMediaFailureCause)
-> Either String (Maybe Text)
-> Either String InstallationMediaFailureCause
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Message")

instance
  Prelude.Hashable
    InstallationMediaFailureCause

instance Prelude.NFData InstallationMediaFailureCause