{-# 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.DrS.Types.RecoveryInstanceProperties
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DrS.Types.RecoveryInstanceProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DrS.Types.CPU
import Amazonka.DrS.Types.IdentificationHints
import Amazonka.DrS.Types.NetworkInterface
import Amazonka.DrS.Types.OS
import Amazonka.DrS.Types.RecoveryInstanceDisk
import qualified Amazonka.Prelude as Prelude

-- | Properties of the Recovery Instance machine.
--
-- /See:/ 'newRecoveryInstanceProperties' smart constructor.
data RecoveryInstanceProperties = RecoveryInstanceProperties'
  { -- | An array of CPUs.
    RecoveryInstanceProperties -> Maybe [CPU]
cpus :: Prelude.Maybe [CPU],
    -- | An array of disks.
    RecoveryInstanceProperties -> Maybe [RecoveryInstanceDisk]
disks :: Prelude.Maybe [RecoveryInstanceDisk],
    -- | Hints used to uniquely identify a machine.
    RecoveryInstanceProperties -> Maybe IdentificationHints
identificationHints :: Prelude.Maybe IdentificationHints,
    -- | The date and time the Recovery Instance properties were last updated on.
    RecoveryInstanceProperties -> Maybe Text
lastUpdatedDateTime :: Prelude.Maybe Prelude.Text,
    -- | An array of network interfaces.
    RecoveryInstanceProperties -> Maybe [NetworkInterface]
networkInterfaces :: Prelude.Maybe [NetworkInterface],
    -- | Operating system.
    RecoveryInstanceProperties -> Maybe OS
os :: Prelude.Maybe OS,
    -- | The amount of RAM in bytes.
    RecoveryInstanceProperties -> Maybe Natural
ramBytes :: Prelude.Maybe Prelude.Natural
  }
  deriving (RecoveryInstanceProperties -> RecoveryInstanceProperties -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecoveryInstanceProperties -> RecoveryInstanceProperties -> Bool
$c/= :: RecoveryInstanceProperties -> RecoveryInstanceProperties -> Bool
== :: RecoveryInstanceProperties -> RecoveryInstanceProperties -> Bool
$c== :: RecoveryInstanceProperties -> RecoveryInstanceProperties -> Bool
Prelude.Eq, ReadPrec [RecoveryInstanceProperties]
ReadPrec RecoveryInstanceProperties
Int -> ReadS RecoveryInstanceProperties
ReadS [RecoveryInstanceProperties]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecoveryInstanceProperties]
$creadListPrec :: ReadPrec [RecoveryInstanceProperties]
readPrec :: ReadPrec RecoveryInstanceProperties
$creadPrec :: ReadPrec RecoveryInstanceProperties
readList :: ReadS [RecoveryInstanceProperties]
$creadList :: ReadS [RecoveryInstanceProperties]
readsPrec :: Int -> ReadS RecoveryInstanceProperties
$creadsPrec :: Int -> ReadS RecoveryInstanceProperties
Prelude.Read, Int -> RecoveryInstanceProperties -> ShowS
[RecoveryInstanceProperties] -> ShowS
RecoveryInstanceProperties -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecoveryInstanceProperties] -> ShowS
$cshowList :: [RecoveryInstanceProperties] -> ShowS
show :: RecoveryInstanceProperties -> String
$cshow :: RecoveryInstanceProperties -> String
showsPrec :: Int -> RecoveryInstanceProperties -> ShowS
$cshowsPrec :: Int -> RecoveryInstanceProperties -> ShowS
Prelude.Show, forall x.
Rep RecoveryInstanceProperties x -> RecoveryInstanceProperties
forall x.
RecoveryInstanceProperties -> Rep RecoveryInstanceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecoveryInstanceProperties x -> RecoveryInstanceProperties
$cfrom :: forall x.
RecoveryInstanceProperties -> Rep RecoveryInstanceProperties x
Prelude.Generic)

-- |
-- Create a value of 'RecoveryInstanceProperties' 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:
--
-- 'cpus', 'recoveryInstanceProperties_cpus' - An array of CPUs.
--
-- 'disks', 'recoveryInstanceProperties_disks' - An array of disks.
--
-- 'identificationHints', 'recoveryInstanceProperties_identificationHints' - Hints used to uniquely identify a machine.
--
-- 'lastUpdatedDateTime', 'recoveryInstanceProperties_lastUpdatedDateTime' - The date and time the Recovery Instance properties were last updated on.
--
-- 'networkInterfaces', 'recoveryInstanceProperties_networkInterfaces' - An array of network interfaces.
--
-- 'os', 'recoveryInstanceProperties_os' - Operating system.
--
-- 'ramBytes', 'recoveryInstanceProperties_ramBytes' - The amount of RAM in bytes.
newRecoveryInstanceProperties ::
  RecoveryInstanceProperties
newRecoveryInstanceProperties :: RecoveryInstanceProperties
newRecoveryInstanceProperties =
  RecoveryInstanceProperties'
    { $sel:cpus:RecoveryInstanceProperties' :: Maybe [CPU]
cpus = forall a. Maybe a
Prelude.Nothing,
      $sel:disks:RecoveryInstanceProperties' :: Maybe [RecoveryInstanceDisk]
disks = forall a. Maybe a
Prelude.Nothing,
      $sel:identificationHints:RecoveryInstanceProperties' :: Maybe IdentificationHints
identificationHints = forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:RecoveryInstanceProperties' :: Maybe Text
lastUpdatedDateTime = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:RecoveryInstanceProperties' :: Maybe [NetworkInterface]
networkInterfaces = forall a. Maybe a
Prelude.Nothing,
      $sel:os:RecoveryInstanceProperties' :: Maybe OS
os = forall a. Maybe a
Prelude.Nothing,
      $sel:ramBytes:RecoveryInstanceProperties' :: Maybe Natural
ramBytes = forall a. Maybe a
Prelude.Nothing
    }

-- | An array of CPUs.
recoveryInstanceProperties_cpus :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe [CPU])
recoveryInstanceProperties_cpus :: Lens' RecoveryInstanceProperties (Maybe [CPU])
recoveryInstanceProperties_cpus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe [CPU]
cpus :: Maybe [CPU]
$sel:cpus:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [CPU]
cpus} -> Maybe [CPU]
cpus) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe [CPU]
a -> RecoveryInstanceProperties
s {$sel:cpus:RecoveryInstanceProperties' :: Maybe [CPU]
cpus = Maybe [CPU]
a} :: RecoveryInstanceProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An array of disks.
recoveryInstanceProperties_disks :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe [RecoveryInstanceDisk])
recoveryInstanceProperties_disks :: Lens' RecoveryInstanceProperties (Maybe [RecoveryInstanceDisk])
recoveryInstanceProperties_disks = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe [RecoveryInstanceDisk]
disks :: Maybe [RecoveryInstanceDisk]
$sel:disks:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [RecoveryInstanceDisk]
disks} -> Maybe [RecoveryInstanceDisk]
disks) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe [RecoveryInstanceDisk]
a -> RecoveryInstanceProperties
s {$sel:disks:RecoveryInstanceProperties' :: Maybe [RecoveryInstanceDisk]
disks = Maybe [RecoveryInstanceDisk]
a} :: RecoveryInstanceProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Hints used to uniquely identify a machine.
recoveryInstanceProperties_identificationHints :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe IdentificationHints)
recoveryInstanceProperties_identificationHints :: Lens' RecoveryInstanceProperties (Maybe IdentificationHints)
recoveryInstanceProperties_identificationHints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe IdentificationHints
identificationHints :: Maybe IdentificationHints
$sel:identificationHints:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe IdentificationHints
identificationHints} -> Maybe IdentificationHints
identificationHints) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe IdentificationHints
a -> RecoveryInstanceProperties
s {$sel:identificationHints:RecoveryInstanceProperties' :: Maybe IdentificationHints
identificationHints = Maybe IdentificationHints
a} :: RecoveryInstanceProperties)

-- | The date and time the Recovery Instance properties were last updated on.
recoveryInstanceProperties_lastUpdatedDateTime :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe Prelude.Text)
recoveryInstanceProperties_lastUpdatedDateTime :: Lens' RecoveryInstanceProperties (Maybe Text)
recoveryInstanceProperties_lastUpdatedDateTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe Text
lastUpdatedDateTime :: Maybe Text
$sel:lastUpdatedDateTime:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe Text
lastUpdatedDateTime} -> Maybe Text
lastUpdatedDateTime) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe Text
a -> RecoveryInstanceProperties
s {$sel:lastUpdatedDateTime:RecoveryInstanceProperties' :: Maybe Text
lastUpdatedDateTime = Maybe Text
a} :: RecoveryInstanceProperties)

-- | An array of network interfaces.
recoveryInstanceProperties_networkInterfaces :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe [NetworkInterface])
recoveryInstanceProperties_networkInterfaces :: Lens' RecoveryInstanceProperties (Maybe [NetworkInterface])
recoveryInstanceProperties_networkInterfaces = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe [NetworkInterface]
networkInterfaces :: Maybe [NetworkInterface]
$sel:networkInterfaces:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [NetworkInterface]
networkInterfaces} -> Maybe [NetworkInterface]
networkInterfaces) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe [NetworkInterface]
a -> RecoveryInstanceProperties
s {$sel:networkInterfaces:RecoveryInstanceProperties' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
a} :: RecoveryInstanceProperties) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Operating system.
recoveryInstanceProperties_os :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe OS)
recoveryInstanceProperties_os :: Lens' RecoveryInstanceProperties (Maybe OS)
recoveryInstanceProperties_os = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe OS
os :: Maybe OS
$sel:os:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe OS
os} -> Maybe OS
os) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe OS
a -> RecoveryInstanceProperties
s {$sel:os:RecoveryInstanceProperties' :: Maybe OS
os = Maybe OS
a} :: RecoveryInstanceProperties)

-- | The amount of RAM in bytes.
recoveryInstanceProperties_ramBytes :: Lens.Lens' RecoveryInstanceProperties (Prelude.Maybe Prelude.Natural)
recoveryInstanceProperties_ramBytes :: Lens' RecoveryInstanceProperties (Maybe Natural)
recoveryInstanceProperties_ramBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecoveryInstanceProperties' {Maybe Natural
ramBytes :: Maybe Natural
$sel:ramBytes:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe Natural
ramBytes} -> Maybe Natural
ramBytes) (\s :: RecoveryInstanceProperties
s@RecoveryInstanceProperties' {} Maybe Natural
a -> RecoveryInstanceProperties
s {$sel:ramBytes:RecoveryInstanceProperties' :: Maybe Natural
ramBytes = Maybe Natural
a} :: RecoveryInstanceProperties)

instance Data.FromJSON RecoveryInstanceProperties where
  parseJSON :: Value -> Parser RecoveryInstanceProperties
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RecoveryInstanceProperties"
      ( \Object
x ->
          Maybe [CPU]
-> Maybe [RecoveryInstanceDisk]
-> Maybe IdentificationHints
-> Maybe Text
-> Maybe [NetworkInterface]
-> Maybe OS
-> Maybe Natural
-> RecoveryInstanceProperties
RecoveryInstanceProperties'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"cpus" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"disks" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"identificationHints")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"lastUpdatedDateTime")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"networkInterfaces"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"os")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ramBytes")
      )

instance Prelude.Hashable RecoveryInstanceProperties where
  hashWithSalt :: Int -> RecoveryInstanceProperties -> Int
hashWithSalt Int
_salt RecoveryInstanceProperties' {Maybe Natural
Maybe [CPU]
Maybe [NetworkInterface]
Maybe [RecoveryInstanceDisk]
Maybe Text
Maybe IdentificationHints
Maybe OS
ramBytes :: Maybe Natural
os :: Maybe OS
networkInterfaces :: Maybe [NetworkInterface]
lastUpdatedDateTime :: Maybe Text
identificationHints :: Maybe IdentificationHints
disks :: Maybe [RecoveryInstanceDisk]
cpus :: Maybe [CPU]
$sel:ramBytes:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe Natural
$sel:os:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe OS
$sel:networkInterfaces:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [NetworkInterface]
$sel:lastUpdatedDateTime:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe Text
$sel:identificationHints:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe IdentificationHints
$sel:disks:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [RecoveryInstanceDisk]
$sel:cpus:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [CPU]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CPU]
cpus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [RecoveryInstanceDisk]
disks
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IdentificationHints
identificationHints
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastUpdatedDateTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NetworkInterface]
networkInterfaces
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OS
os
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
ramBytes

instance Prelude.NFData RecoveryInstanceProperties where
  rnf :: RecoveryInstanceProperties -> ()
rnf RecoveryInstanceProperties' {Maybe Natural
Maybe [CPU]
Maybe [NetworkInterface]
Maybe [RecoveryInstanceDisk]
Maybe Text
Maybe IdentificationHints
Maybe OS
ramBytes :: Maybe Natural
os :: Maybe OS
networkInterfaces :: Maybe [NetworkInterface]
lastUpdatedDateTime :: Maybe Text
identificationHints :: Maybe IdentificationHints
disks :: Maybe [RecoveryInstanceDisk]
cpus :: Maybe [CPU]
$sel:ramBytes:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe Natural
$sel:os:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe OS
$sel:networkInterfaces:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [NetworkInterface]
$sel:lastUpdatedDateTime:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe Text
$sel:identificationHints:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe IdentificationHints
$sel:disks:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [RecoveryInstanceDisk]
$sel:cpus:RecoveryInstanceProperties' :: RecoveryInstanceProperties -> Maybe [CPU]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CPU]
cpus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RecoveryInstanceDisk]
disks
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IdentificationHints
identificationHints
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastUpdatedDateTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkInterface]
networkInterfaces
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OS
os
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
ramBytes