{-# 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.MigrationHubStrategy.Types.SystemInfo
-- 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.MigrationHubStrategy.Types.SystemInfo where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MigrationHubStrategy.Types.NetworkInfo
import Amazonka.MigrationHubStrategy.Types.OSInfo
import qualified Amazonka.Prelude as Prelude

-- | Information about the server that hosts application components.
--
-- /See:/ 'newSystemInfo' smart constructor.
data SystemInfo = SystemInfo'
  { -- | CPU architecture type for the server.
    SystemInfo -> Maybe Text
cpuArchitecture :: Prelude.Maybe Prelude.Text,
    -- | File system type for the server.
    SystemInfo -> Maybe Text
fileSystemType :: Prelude.Maybe Prelude.Text,
    -- | Networking information related to a server.
    SystemInfo -> Maybe [NetworkInfo]
networkInfoList :: Prelude.Maybe [NetworkInfo],
    -- | Operating system corresponding to a server.
    SystemInfo -> Maybe OSInfo
osInfo :: Prelude.Maybe OSInfo
  }
  deriving (SystemInfo -> SystemInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemInfo -> SystemInfo -> Bool
$c/= :: SystemInfo -> SystemInfo -> Bool
== :: SystemInfo -> SystemInfo -> Bool
$c== :: SystemInfo -> SystemInfo -> Bool
Prelude.Eq, ReadPrec [SystemInfo]
ReadPrec SystemInfo
Int -> ReadS SystemInfo
ReadS [SystemInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SystemInfo]
$creadListPrec :: ReadPrec [SystemInfo]
readPrec :: ReadPrec SystemInfo
$creadPrec :: ReadPrec SystemInfo
readList :: ReadS [SystemInfo]
$creadList :: ReadS [SystemInfo]
readsPrec :: Int -> ReadS SystemInfo
$creadsPrec :: Int -> ReadS SystemInfo
Prelude.Read, Int -> SystemInfo -> ShowS
[SystemInfo] -> ShowS
SystemInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SystemInfo] -> ShowS
$cshowList :: [SystemInfo] -> ShowS
show :: SystemInfo -> String
$cshow :: SystemInfo -> String
showsPrec :: Int -> SystemInfo -> ShowS
$cshowsPrec :: Int -> SystemInfo -> ShowS
Prelude.Show, forall x. Rep SystemInfo x -> SystemInfo
forall x. SystemInfo -> Rep SystemInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SystemInfo x -> SystemInfo
$cfrom :: forall x. SystemInfo -> Rep SystemInfo x
Prelude.Generic)

-- |
-- Create a value of 'SystemInfo' 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:
--
-- 'cpuArchitecture', 'systemInfo_cpuArchitecture' - CPU architecture type for the server.
--
-- 'fileSystemType', 'systemInfo_fileSystemType' - File system type for the server.
--
-- 'networkInfoList', 'systemInfo_networkInfoList' - Networking information related to a server.
--
-- 'osInfo', 'systemInfo_osInfo' - Operating system corresponding to a server.
newSystemInfo ::
  SystemInfo
newSystemInfo :: SystemInfo
newSystemInfo =
  SystemInfo'
    { $sel:cpuArchitecture:SystemInfo' :: Maybe Text
cpuArchitecture = forall a. Maybe a
Prelude.Nothing,
      $sel:fileSystemType:SystemInfo' :: Maybe Text
fileSystemType = forall a. Maybe a
Prelude.Nothing,
      $sel:networkInfoList:SystemInfo' :: Maybe [NetworkInfo]
networkInfoList = forall a. Maybe a
Prelude.Nothing,
      $sel:osInfo:SystemInfo' :: Maybe OSInfo
osInfo = forall a. Maybe a
Prelude.Nothing
    }

-- | CPU architecture type for the server.
systemInfo_cpuArchitecture :: Lens.Lens' SystemInfo (Prelude.Maybe Prelude.Text)
systemInfo_cpuArchitecture :: Lens' SystemInfo (Maybe Text)
systemInfo_cpuArchitecture = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemInfo' {Maybe Text
cpuArchitecture :: Maybe Text
$sel:cpuArchitecture:SystemInfo' :: SystemInfo -> Maybe Text
cpuArchitecture} -> Maybe Text
cpuArchitecture) (\s :: SystemInfo
s@SystemInfo' {} Maybe Text
a -> SystemInfo
s {$sel:cpuArchitecture:SystemInfo' :: Maybe Text
cpuArchitecture = Maybe Text
a} :: SystemInfo)

-- | File system type for the server.
systemInfo_fileSystemType :: Lens.Lens' SystemInfo (Prelude.Maybe Prelude.Text)
systemInfo_fileSystemType :: Lens' SystemInfo (Maybe Text)
systemInfo_fileSystemType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemInfo' {Maybe Text
fileSystemType :: Maybe Text
$sel:fileSystemType:SystemInfo' :: SystemInfo -> Maybe Text
fileSystemType} -> Maybe Text
fileSystemType) (\s :: SystemInfo
s@SystemInfo' {} Maybe Text
a -> SystemInfo
s {$sel:fileSystemType:SystemInfo' :: Maybe Text
fileSystemType = Maybe Text
a} :: SystemInfo)

-- | Networking information related to a server.
systemInfo_networkInfoList :: Lens.Lens' SystemInfo (Prelude.Maybe [NetworkInfo])
systemInfo_networkInfoList :: Lens' SystemInfo (Maybe [NetworkInfo])
systemInfo_networkInfoList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemInfo' {Maybe [NetworkInfo]
networkInfoList :: Maybe [NetworkInfo]
$sel:networkInfoList:SystemInfo' :: SystemInfo -> Maybe [NetworkInfo]
networkInfoList} -> Maybe [NetworkInfo]
networkInfoList) (\s :: SystemInfo
s@SystemInfo' {} Maybe [NetworkInfo]
a -> SystemInfo
s {$sel:networkInfoList:SystemInfo' :: Maybe [NetworkInfo]
networkInfoList = Maybe [NetworkInfo]
a} :: SystemInfo) 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 corresponding to a server.
systemInfo_osInfo :: Lens.Lens' SystemInfo (Prelude.Maybe OSInfo)
systemInfo_osInfo :: Lens' SystemInfo (Maybe OSInfo)
systemInfo_osInfo = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemInfo' {Maybe OSInfo
osInfo :: Maybe OSInfo
$sel:osInfo:SystemInfo' :: SystemInfo -> Maybe OSInfo
osInfo} -> Maybe OSInfo
osInfo) (\s :: SystemInfo
s@SystemInfo' {} Maybe OSInfo
a -> SystemInfo
s {$sel:osInfo:SystemInfo' :: Maybe OSInfo
osInfo = Maybe OSInfo
a} :: SystemInfo)

instance Data.FromJSON SystemInfo where
  parseJSON :: Value -> Parser SystemInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SystemInfo"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe [NetworkInfo] -> Maybe OSInfo -> SystemInfo
SystemInfo'
            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
"cpuArchitecture")
            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
"fileSystemType")
            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
"networkInfoList"
                            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
"osInfo")
      )

instance Prelude.Hashable SystemInfo where
  hashWithSalt :: Int -> SystemInfo -> Int
hashWithSalt Int
_salt SystemInfo' {Maybe [NetworkInfo]
Maybe Text
Maybe OSInfo
osInfo :: Maybe OSInfo
networkInfoList :: Maybe [NetworkInfo]
fileSystemType :: Maybe Text
cpuArchitecture :: Maybe Text
$sel:osInfo:SystemInfo' :: SystemInfo -> Maybe OSInfo
$sel:networkInfoList:SystemInfo' :: SystemInfo -> Maybe [NetworkInfo]
$sel:fileSystemType:SystemInfo' :: SystemInfo -> Maybe Text
$sel:cpuArchitecture:SystemInfo' :: SystemInfo -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cpuArchitecture
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fileSystemType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [NetworkInfo]
networkInfoList
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OSInfo
osInfo

instance Prelude.NFData SystemInfo where
  rnf :: SystemInfo -> ()
rnf SystemInfo' {Maybe [NetworkInfo]
Maybe Text
Maybe OSInfo
osInfo :: Maybe OSInfo
networkInfoList :: Maybe [NetworkInfo]
fileSystemType :: Maybe Text
cpuArchitecture :: Maybe Text
$sel:osInfo:SystemInfo' :: SystemInfo -> Maybe OSInfo
$sel:networkInfoList:SystemInfo' :: SystemInfo -> Maybe [NetworkInfo]
$sel:fileSystemType:SystemInfo' :: SystemInfo -> Maybe Text
$sel:cpuArchitecture:SystemInfo' :: SystemInfo -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cpuArchitecture
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fileSystemType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [NetworkInfo]
networkInfoList
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OSInfo
osInfo