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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types.InstallationMediaFailureCause

-- | Contains the installation media for a DB engine that requires an
-- on-premises customer provided license, such as Microsoft SQL Server.
--
-- /See:/ 'newInstallationMedia' smart constructor.
data InstallationMedia = InstallationMedia'
  { -- | The engine version of the DB engine.
    InstallationMedia -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The status of the installation medium.
    InstallationMedia -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
    -- | The installation medium ID.
    InstallationMedia -> Maybe Text
installationMediaId :: Prelude.Maybe Prelude.Text,
    -- | The path to the installation medium for the DB engine.
    InstallationMedia -> Maybe Text
engineInstallationMediaPath :: Prelude.Maybe Prelude.Text,
    -- | The DB engine.
    InstallationMedia -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The path to the installation medium for the operating system associated
    -- with the DB engine.
    InstallationMedia -> Maybe Text
oSInstallationMediaPath :: Prelude.Maybe Prelude.Text,
    -- | The custom Availability Zone (AZ) that contains the installation media.
    InstallationMedia -> Maybe Text
customAvailabilityZoneId :: Prelude.Maybe Prelude.Text,
    -- | If an installation media failure occurred, the cause of the failure.
    InstallationMedia -> Maybe InstallationMediaFailureCause
failureCause :: Prelude.Maybe InstallationMediaFailureCause
  }
  deriving (InstallationMedia -> InstallationMedia -> Bool
(InstallationMedia -> InstallationMedia -> Bool)
-> (InstallationMedia -> InstallationMedia -> Bool)
-> Eq InstallationMedia
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstallationMedia -> InstallationMedia -> Bool
$c/= :: InstallationMedia -> InstallationMedia -> Bool
== :: InstallationMedia -> InstallationMedia -> Bool
$c== :: InstallationMedia -> InstallationMedia -> Bool
Prelude.Eq, ReadPrec [InstallationMedia]
ReadPrec InstallationMedia
Int -> ReadS InstallationMedia
ReadS [InstallationMedia]
(Int -> ReadS InstallationMedia)
-> ReadS [InstallationMedia]
-> ReadPrec InstallationMedia
-> ReadPrec [InstallationMedia]
-> Read InstallationMedia
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstallationMedia]
$creadListPrec :: ReadPrec [InstallationMedia]
readPrec :: ReadPrec InstallationMedia
$creadPrec :: ReadPrec InstallationMedia
readList :: ReadS [InstallationMedia]
$creadList :: ReadS [InstallationMedia]
readsPrec :: Int -> ReadS InstallationMedia
$creadsPrec :: Int -> ReadS InstallationMedia
Prelude.Read, Int -> InstallationMedia -> ShowS
[InstallationMedia] -> ShowS
InstallationMedia -> String
(Int -> InstallationMedia -> ShowS)
-> (InstallationMedia -> String)
-> ([InstallationMedia] -> ShowS)
-> Show InstallationMedia
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstallationMedia] -> ShowS
$cshowList :: [InstallationMedia] -> ShowS
show :: InstallationMedia -> String
$cshow :: InstallationMedia -> String
showsPrec :: Int -> InstallationMedia -> ShowS
$cshowsPrec :: Int -> InstallationMedia -> ShowS
Prelude.Show, (forall x. InstallationMedia -> Rep InstallationMedia x)
-> (forall x. Rep InstallationMedia x -> InstallationMedia)
-> Generic InstallationMedia
forall x. Rep InstallationMedia x -> InstallationMedia
forall x. InstallationMedia -> Rep InstallationMedia x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstallationMedia x -> InstallationMedia
$cfrom :: forall x. InstallationMedia -> Rep InstallationMedia x
Prelude.Generic)

-- |
-- Create a value of 'InstallationMedia' 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:
--
-- 'engineVersion', 'installationMedia_engineVersion' - The engine version of the DB engine.
--
-- 'status', 'installationMedia_status' - The status of the installation medium.
--
-- 'installationMediaId', 'installationMedia_installationMediaId' - The installation medium ID.
--
-- 'engineInstallationMediaPath', 'installationMedia_engineInstallationMediaPath' - The path to the installation medium for the DB engine.
--
-- 'engine', 'installationMedia_engine' - The DB engine.
--
-- 'oSInstallationMediaPath', 'installationMedia_oSInstallationMediaPath' - The path to the installation medium for the operating system associated
-- with the DB engine.
--
-- 'customAvailabilityZoneId', 'installationMedia_customAvailabilityZoneId' - The custom Availability Zone (AZ) that contains the installation media.
--
-- 'failureCause', 'installationMedia_failureCause' - If an installation media failure occurred, the cause of the failure.
newInstallationMedia ::
  InstallationMedia
newInstallationMedia :: InstallationMedia
newInstallationMedia =
  InstallationMedia' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe InstallationMediaFailureCause
-> InstallationMedia
InstallationMedia'
    { $sel:engineVersion:InstallationMedia' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:status:InstallationMedia' :: Maybe Text
status = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:installationMediaId:InstallationMedia' :: Maybe Text
installationMediaId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engineInstallationMediaPath:InstallationMedia' :: Maybe Text
engineInstallationMediaPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:InstallationMedia' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:oSInstallationMediaPath:InstallationMedia' :: Maybe Text
oSInstallationMediaPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:customAvailabilityZoneId:InstallationMedia' :: Maybe Text
customAvailabilityZoneId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:failureCause:InstallationMedia' :: Maybe InstallationMediaFailureCause
failureCause = Maybe InstallationMediaFailureCause
forall a. Maybe a
Prelude.Nothing
    }

-- | The engine version of the DB engine.
installationMedia_engineVersion :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_engineVersion :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_engineVersion = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:InstallationMedia' :: InstallationMedia -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:engineVersion:InstallationMedia' :: Maybe Text
engineVersion = Maybe Text
a} :: InstallationMedia)

-- | The status of the installation medium.
installationMedia_status :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_status :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_status = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
status :: Maybe Text
$sel:status:InstallationMedia' :: InstallationMedia -> Maybe Text
status} -> Maybe Text
status) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:status:InstallationMedia' :: Maybe Text
status = Maybe Text
a} :: InstallationMedia)

-- | The installation medium ID.
installationMedia_installationMediaId :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_installationMediaId :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_installationMediaId = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
installationMediaId :: Maybe Text
$sel:installationMediaId:InstallationMedia' :: InstallationMedia -> Maybe Text
installationMediaId} -> Maybe Text
installationMediaId) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:installationMediaId:InstallationMedia' :: Maybe Text
installationMediaId = Maybe Text
a} :: InstallationMedia)

-- | The path to the installation medium for the DB engine.
installationMedia_engineInstallationMediaPath :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_engineInstallationMediaPath :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_engineInstallationMediaPath = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
engineInstallationMediaPath :: Maybe Text
$sel:engineInstallationMediaPath:InstallationMedia' :: InstallationMedia -> Maybe Text
engineInstallationMediaPath} -> Maybe Text
engineInstallationMediaPath) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:engineInstallationMediaPath:InstallationMedia' :: Maybe Text
engineInstallationMediaPath = Maybe Text
a} :: InstallationMedia)

-- | The DB engine.
installationMedia_engine :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_engine :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_engine = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
engine :: Maybe Text
$sel:engine:InstallationMedia' :: InstallationMedia -> Maybe Text
engine} -> Maybe Text
engine) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:engine:InstallationMedia' :: Maybe Text
engine = Maybe Text
a} :: InstallationMedia)

-- | The path to the installation medium for the operating system associated
-- with the DB engine.
installationMedia_oSInstallationMediaPath :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_oSInstallationMediaPath :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_oSInstallationMediaPath = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
oSInstallationMediaPath :: Maybe Text
$sel:oSInstallationMediaPath:InstallationMedia' :: InstallationMedia -> Maybe Text
oSInstallationMediaPath} -> Maybe Text
oSInstallationMediaPath) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:oSInstallationMediaPath:InstallationMedia' :: Maybe Text
oSInstallationMediaPath = Maybe Text
a} :: InstallationMedia)

-- | The custom Availability Zone (AZ) that contains the installation media.
installationMedia_customAvailabilityZoneId :: Lens.Lens' InstallationMedia (Prelude.Maybe Prelude.Text)
installationMedia_customAvailabilityZoneId :: (Maybe Text -> f (Maybe Text))
-> InstallationMedia -> f InstallationMedia
installationMedia_customAvailabilityZoneId = (InstallationMedia -> Maybe Text)
-> (InstallationMedia -> Maybe Text -> InstallationMedia)
-> Lens
     InstallationMedia InstallationMedia (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe Text
customAvailabilityZoneId :: Maybe Text
$sel:customAvailabilityZoneId:InstallationMedia' :: InstallationMedia -> Maybe Text
customAvailabilityZoneId} -> Maybe Text
customAvailabilityZoneId) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe Text
a -> InstallationMedia
s {$sel:customAvailabilityZoneId:InstallationMedia' :: Maybe Text
customAvailabilityZoneId = Maybe Text
a} :: InstallationMedia)

-- | If an installation media failure occurred, the cause of the failure.
installationMedia_failureCause :: Lens.Lens' InstallationMedia (Prelude.Maybe InstallationMediaFailureCause)
installationMedia_failureCause :: (Maybe InstallationMediaFailureCause
 -> f (Maybe InstallationMediaFailureCause))
-> InstallationMedia -> f InstallationMedia
installationMedia_failureCause = (InstallationMedia -> Maybe InstallationMediaFailureCause)
-> (InstallationMedia
    -> Maybe InstallationMediaFailureCause -> InstallationMedia)
-> Lens
     InstallationMedia
     InstallationMedia
     (Maybe InstallationMediaFailureCause)
     (Maybe InstallationMediaFailureCause)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstallationMedia' {Maybe InstallationMediaFailureCause
failureCause :: Maybe InstallationMediaFailureCause
$sel:failureCause:InstallationMedia' :: InstallationMedia -> Maybe InstallationMediaFailureCause
failureCause} -> Maybe InstallationMediaFailureCause
failureCause) (\s :: InstallationMedia
s@InstallationMedia' {} Maybe InstallationMediaFailureCause
a -> InstallationMedia
s {$sel:failureCause:InstallationMedia' :: Maybe InstallationMediaFailureCause
failureCause = Maybe InstallationMediaFailureCause
a} :: InstallationMedia)

instance Core.FromXML InstallationMedia where
  parseXML :: [Node] -> Either String InstallationMedia
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe InstallationMediaFailureCause
-> InstallationMedia
InstallationMedia'
      (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe InstallationMediaFailureCause
 -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstallationMediaFailureCause
      -> InstallationMedia)
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
"EngineVersion")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstallationMediaFailureCause
   -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstallationMediaFailureCause
      -> InstallationMedia)
forall (f :: * -> *) a b. Applicative f => 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
"Status")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstallationMediaFailureCause
   -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstallationMediaFailureCause
      -> InstallationMedia)
forall (f :: * -> *) a b. Applicative f => 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
"InstallationMediaId")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstallationMediaFailureCause
   -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe InstallationMediaFailureCause
      -> InstallationMedia)
forall (f :: * -> *) a b. Applicative f => 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
"EngineInstallationMediaPath")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe InstallationMediaFailureCause
   -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe InstallationMediaFailureCause
      -> InstallationMedia)
forall (f :: * -> *) a b. Applicative f => 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
"Engine")
      Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe InstallationMediaFailureCause
   -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe InstallationMediaFailureCause -> InstallationMedia)
forall (f :: * -> *) a b. Applicative f => 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
"OSInstallationMediaPath")
      Either
  String
  (Maybe Text
   -> Maybe InstallationMediaFailureCause -> InstallationMedia)
-> Either String (Maybe Text)
-> Either
     String (Maybe InstallationMediaFailureCause -> InstallationMedia)
forall (f :: * -> *) a b. Applicative f => 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
"CustomAvailabilityZoneId")
      Either
  String (Maybe InstallationMediaFailureCause -> InstallationMedia)
-> Either String (Maybe InstallationMediaFailureCause)
-> Either String InstallationMedia
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe InstallationMediaFailureCause)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureCause")

instance Prelude.Hashable InstallationMedia

instance Prelude.NFData InstallationMedia