{-# 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.MGN.Types.SourceProperties
-- 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.MGN.Types.SourceProperties where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types.CPU
import Amazonka.MGN.Types.Disk
import Amazonka.MGN.Types.IdentificationHints
import Amazonka.MGN.Types.NetworkInterface
import Amazonka.MGN.Types.OS
import qualified Amazonka.Prelude as Prelude

-- | Source server properties.
--
-- /See:/ 'newSourceProperties' smart constructor.
data SourceProperties = SourceProperties'
  { -- | Source server identification hints.
    SourceProperties -> Maybe IdentificationHints
identificationHints :: Prelude.Maybe IdentificationHints,
    -- | Source server network interfaces.
    SourceProperties -> Maybe [NetworkInterface]
networkInterfaces :: Prelude.Maybe [NetworkInterface],
    -- | Source server last update date and time.
    SourceProperties -> Maybe Text
lastUpdatedDateTime :: Prelude.Maybe Prelude.Text,
    -- | Source server recommended instance type.
    SourceProperties -> Maybe Text
recommendedInstanceType :: Prelude.Maybe Prelude.Text,
    -- | Source server OS.
    SourceProperties -> Maybe OS
os :: Prelude.Maybe OS,
    -- | Source server RAM in bytes.
    SourceProperties -> Maybe Natural
ramBytes :: Prelude.Maybe Prelude.Natural,
    -- | Source Server CPUs.
    SourceProperties -> Maybe [CPU]
cpus :: Prelude.Maybe [CPU],
    -- | Source Server disks.
    SourceProperties -> Maybe [Disk]
disks :: Prelude.Maybe [Disk]
  }
  deriving (SourceProperties -> SourceProperties -> Bool
(SourceProperties -> SourceProperties -> Bool)
-> (SourceProperties -> SourceProperties -> Bool)
-> Eq SourceProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceProperties -> SourceProperties -> Bool
$c/= :: SourceProperties -> SourceProperties -> Bool
== :: SourceProperties -> SourceProperties -> Bool
$c== :: SourceProperties -> SourceProperties -> Bool
Prelude.Eq, ReadPrec [SourceProperties]
ReadPrec SourceProperties
Int -> ReadS SourceProperties
ReadS [SourceProperties]
(Int -> ReadS SourceProperties)
-> ReadS [SourceProperties]
-> ReadPrec SourceProperties
-> ReadPrec [SourceProperties]
-> Read SourceProperties
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourceProperties]
$creadListPrec :: ReadPrec [SourceProperties]
readPrec :: ReadPrec SourceProperties
$creadPrec :: ReadPrec SourceProperties
readList :: ReadS [SourceProperties]
$creadList :: ReadS [SourceProperties]
readsPrec :: Int -> ReadS SourceProperties
$creadsPrec :: Int -> ReadS SourceProperties
Prelude.Read, Int -> SourceProperties -> ShowS
[SourceProperties] -> ShowS
SourceProperties -> String
(Int -> SourceProperties -> ShowS)
-> (SourceProperties -> String)
-> ([SourceProperties] -> ShowS)
-> Show SourceProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceProperties] -> ShowS
$cshowList :: [SourceProperties] -> ShowS
show :: SourceProperties -> String
$cshow :: SourceProperties -> String
showsPrec :: Int -> SourceProperties -> ShowS
$cshowsPrec :: Int -> SourceProperties -> ShowS
Prelude.Show, (forall x. SourceProperties -> Rep SourceProperties x)
-> (forall x. Rep SourceProperties x -> SourceProperties)
-> Generic SourceProperties
forall x. Rep SourceProperties x -> SourceProperties
forall x. SourceProperties -> Rep SourceProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourceProperties x -> SourceProperties
$cfrom :: forall x. SourceProperties -> Rep SourceProperties x
Prelude.Generic)

-- |
-- Create a value of 'SourceProperties' 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:
--
-- 'identificationHints', 'sourceProperties_identificationHints' - Source server identification hints.
--
-- 'networkInterfaces', 'sourceProperties_networkInterfaces' - Source server network interfaces.
--
-- 'lastUpdatedDateTime', 'sourceProperties_lastUpdatedDateTime' - Source server last update date and time.
--
-- 'recommendedInstanceType', 'sourceProperties_recommendedInstanceType' - Source server recommended instance type.
--
-- 'os', 'sourceProperties_os' - Source server OS.
--
-- 'ramBytes', 'sourceProperties_ramBytes' - Source server RAM in bytes.
--
-- 'cpus', 'sourceProperties_cpus' - Source Server CPUs.
--
-- 'disks', 'sourceProperties_disks' - Source Server disks.
newSourceProperties ::
  SourceProperties
newSourceProperties :: SourceProperties
newSourceProperties =
  SourceProperties' :: Maybe IdentificationHints
-> Maybe [NetworkInterface]
-> Maybe Text
-> Maybe Text
-> Maybe OS
-> Maybe Natural
-> Maybe [CPU]
-> Maybe [Disk]
-> SourceProperties
SourceProperties'
    { $sel:identificationHints:SourceProperties' :: Maybe IdentificationHints
identificationHints =
        Maybe IdentificationHints
forall a. Maybe a
Prelude.Nothing,
      $sel:networkInterfaces:SourceProperties' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedDateTime:SourceProperties' :: Maybe Text
lastUpdatedDateTime = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:recommendedInstanceType:SourceProperties' :: Maybe Text
recommendedInstanceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:os:SourceProperties' :: Maybe OS
os = Maybe OS
forall a. Maybe a
Prelude.Nothing,
      $sel:ramBytes:SourceProperties' :: Maybe Natural
ramBytes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:cpus:SourceProperties' :: Maybe [CPU]
cpus = Maybe [CPU]
forall a. Maybe a
Prelude.Nothing,
      $sel:disks:SourceProperties' :: Maybe [Disk]
disks = Maybe [Disk]
forall a. Maybe a
Prelude.Nothing
    }

-- | Source server identification hints.
sourceProperties_identificationHints :: Lens.Lens' SourceProperties (Prelude.Maybe IdentificationHints)
sourceProperties_identificationHints :: (Maybe IdentificationHints -> f (Maybe IdentificationHints))
-> SourceProperties -> f SourceProperties
sourceProperties_identificationHints = (SourceProperties -> Maybe IdentificationHints)
-> (SourceProperties
    -> Maybe IdentificationHints -> SourceProperties)
-> Lens
     SourceProperties
     SourceProperties
     (Maybe IdentificationHints)
     (Maybe IdentificationHints)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe IdentificationHints
identificationHints :: Maybe IdentificationHints
$sel:identificationHints:SourceProperties' :: SourceProperties -> Maybe IdentificationHints
identificationHints} -> Maybe IdentificationHints
identificationHints) (\s :: SourceProperties
s@SourceProperties' {} Maybe IdentificationHints
a -> SourceProperties
s {$sel:identificationHints:SourceProperties' :: Maybe IdentificationHints
identificationHints = Maybe IdentificationHints
a} :: SourceProperties)

-- | Source server network interfaces.
sourceProperties_networkInterfaces :: Lens.Lens' SourceProperties (Prelude.Maybe [NetworkInterface])
sourceProperties_networkInterfaces :: (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> SourceProperties -> f SourceProperties
sourceProperties_networkInterfaces = (SourceProperties -> Maybe [NetworkInterface])
-> (SourceProperties
    -> Maybe [NetworkInterface] -> SourceProperties)
-> Lens
     SourceProperties
     SourceProperties
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe [NetworkInterface]
networkInterfaces :: Maybe [NetworkInterface]
$sel:networkInterfaces:SourceProperties' :: SourceProperties -> Maybe [NetworkInterface]
networkInterfaces} -> Maybe [NetworkInterface]
networkInterfaces) (\s :: SourceProperties
s@SourceProperties' {} Maybe [NetworkInterface]
a -> SourceProperties
s {$sel:networkInterfaces:SourceProperties' :: Maybe [NetworkInterface]
networkInterfaces = Maybe [NetworkInterface]
a} :: SourceProperties) ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
 -> SourceProperties -> f SourceProperties)
-> ((Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
    -> Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> (Maybe [NetworkInterface] -> f (Maybe [NetworkInterface]))
-> SourceProperties
-> f SourceProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
-> Iso
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
     (Maybe [NetworkInterface])
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
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
  [NetworkInterface]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Source server last update date and time.
sourceProperties_lastUpdatedDateTime :: Lens.Lens' SourceProperties (Prelude.Maybe Prelude.Text)
sourceProperties_lastUpdatedDateTime :: (Maybe Text -> f (Maybe Text))
-> SourceProperties -> f SourceProperties
sourceProperties_lastUpdatedDateTime = (SourceProperties -> Maybe Text)
-> (SourceProperties -> Maybe Text -> SourceProperties)
-> Lens SourceProperties SourceProperties (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe Text
lastUpdatedDateTime :: Maybe Text
$sel:lastUpdatedDateTime:SourceProperties' :: SourceProperties -> Maybe Text
lastUpdatedDateTime} -> Maybe Text
lastUpdatedDateTime) (\s :: SourceProperties
s@SourceProperties' {} Maybe Text
a -> SourceProperties
s {$sel:lastUpdatedDateTime:SourceProperties' :: Maybe Text
lastUpdatedDateTime = Maybe Text
a} :: SourceProperties)

-- | Source server recommended instance type.
sourceProperties_recommendedInstanceType :: Lens.Lens' SourceProperties (Prelude.Maybe Prelude.Text)
sourceProperties_recommendedInstanceType :: (Maybe Text -> f (Maybe Text))
-> SourceProperties -> f SourceProperties
sourceProperties_recommendedInstanceType = (SourceProperties -> Maybe Text)
-> (SourceProperties -> Maybe Text -> SourceProperties)
-> Lens SourceProperties SourceProperties (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe Text
recommendedInstanceType :: Maybe Text
$sel:recommendedInstanceType:SourceProperties' :: SourceProperties -> Maybe Text
recommendedInstanceType} -> Maybe Text
recommendedInstanceType) (\s :: SourceProperties
s@SourceProperties' {} Maybe Text
a -> SourceProperties
s {$sel:recommendedInstanceType:SourceProperties' :: Maybe Text
recommendedInstanceType = Maybe Text
a} :: SourceProperties)

-- | Source server OS.
sourceProperties_os :: Lens.Lens' SourceProperties (Prelude.Maybe OS)
sourceProperties_os :: (Maybe OS -> f (Maybe OS))
-> SourceProperties -> f SourceProperties
sourceProperties_os = (SourceProperties -> Maybe OS)
-> (SourceProperties -> Maybe OS -> SourceProperties)
-> Lens SourceProperties SourceProperties (Maybe OS) (Maybe OS)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe OS
os :: Maybe OS
$sel:os:SourceProperties' :: SourceProperties -> Maybe OS
os} -> Maybe OS
os) (\s :: SourceProperties
s@SourceProperties' {} Maybe OS
a -> SourceProperties
s {$sel:os:SourceProperties' :: Maybe OS
os = Maybe OS
a} :: SourceProperties)

-- | Source server RAM in bytes.
sourceProperties_ramBytes :: Lens.Lens' SourceProperties (Prelude.Maybe Prelude.Natural)
sourceProperties_ramBytes :: (Maybe Natural -> f (Maybe Natural))
-> SourceProperties -> f SourceProperties
sourceProperties_ramBytes = (SourceProperties -> Maybe Natural)
-> (SourceProperties -> Maybe Natural -> SourceProperties)
-> Lens
     SourceProperties SourceProperties (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe Natural
ramBytes :: Maybe Natural
$sel:ramBytes:SourceProperties' :: SourceProperties -> Maybe Natural
ramBytes} -> Maybe Natural
ramBytes) (\s :: SourceProperties
s@SourceProperties' {} Maybe Natural
a -> SourceProperties
s {$sel:ramBytes:SourceProperties' :: Maybe Natural
ramBytes = Maybe Natural
a} :: SourceProperties)

-- | Source Server CPUs.
sourceProperties_cpus :: Lens.Lens' SourceProperties (Prelude.Maybe [CPU])
sourceProperties_cpus :: (Maybe [CPU] -> f (Maybe [CPU]))
-> SourceProperties -> f SourceProperties
sourceProperties_cpus = (SourceProperties -> Maybe [CPU])
-> (SourceProperties -> Maybe [CPU] -> SourceProperties)
-> Lens
     SourceProperties SourceProperties (Maybe [CPU]) (Maybe [CPU])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe [CPU]
cpus :: Maybe [CPU]
$sel:cpus:SourceProperties' :: SourceProperties -> Maybe [CPU]
cpus} -> Maybe [CPU]
cpus) (\s :: SourceProperties
s@SourceProperties' {} Maybe [CPU]
a -> SourceProperties
s {$sel:cpus:SourceProperties' :: Maybe [CPU]
cpus = Maybe [CPU]
a} :: SourceProperties) ((Maybe [CPU] -> f (Maybe [CPU]))
 -> SourceProperties -> f SourceProperties)
-> ((Maybe [CPU] -> f (Maybe [CPU]))
    -> Maybe [CPU] -> f (Maybe [CPU]))
-> (Maybe [CPU] -> f (Maybe [CPU]))
-> SourceProperties
-> f SourceProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CPU] [CPU] [CPU] [CPU]
-> Iso (Maybe [CPU]) (Maybe [CPU]) (Maybe [CPU]) (Maybe [CPU])
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 [CPU] [CPU] [CPU] [CPU]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Source Server disks.
sourceProperties_disks :: Lens.Lens' SourceProperties (Prelude.Maybe [Disk])
sourceProperties_disks :: (Maybe [Disk] -> f (Maybe [Disk]))
-> SourceProperties -> f SourceProperties
sourceProperties_disks = (SourceProperties -> Maybe [Disk])
-> (SourceProperties -> Maybe [Disk] -> SourceProperties)
-> Lens
     SourceProperties SourceProperties (Maybe [Disk]) (Maybe [Disk])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourceProperties' {Maybe [Disk]
disks :: Maybe [Disk]
$sel:disks:SourceProperties' :: SourceProperties -> Maybe [Disk]
disks} -> Maybe [Disk]
disks) (\s :: SourceProperties
s@SourceProperties' {} Maybe [Disk]
a -> SourceProperties
s {$sel:disks:SourceProperties' :: Maybe [Disk]
disks = Maybe [Disk]
a} :: SourceProperties) ((Maybe [Disk] -> f (Maybe [Disk]))
 -> SourceProperties -> f SourceProperties)
-> ((Maybe [Disk] -> f (Maybe [Disk]))
    -> Maybe [Disk] -> f (Maybe [Disk]))
-> (Maybe [Disk] -> f (Maybe [Disk]))
-> SourceProperties
-> f SourceProperties
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Disk] [Disk] [Disk] [Disk]
-> Iso (Maybe [Disk]) (Maybe [Disk]) (Maybe [Disk]) (Maybe [Disk])
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 [Disk] [Disk] [Disk] [Disk]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable SourceProperties

instance Prelude.NFData SourceProperties