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

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

-- | Information about the server\'s network for which the assessment was
-- run.
--
-- /See:/ 'newNetworkInfo' smart constructor.
data NetworkInfo = NetworkInfo'
  { -- | Information about the name of the interface of the server for which the
    -- assessment was run.
    NetworkInfo -> Text
interfaceName :: Prelude.Text,
    -- | Information about the IP address of the server for which the assessment
    -- was run.
    NetworkInfo -> Text
ipAddress :: Prelude.Text,
    -- | Information about the MAC address of the server for which the assessment
    -- was run.
    NetworkInfo -> Text
macAddress :: Prelude.Text,
    -- | Information about the subnet mask of the server for which the assessment
    -- was run.
    NetworkInfo -> Text
netMask :: Prelude.Text
  }
  deriving (NetworkInfo -> NetworkInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkInfo -> NetworkInfo -> Bool
$c/= :: NetworkInfo -> NetworkInfo -> Bool
== :: NetworkInfo -> NetworkInfo -> Bool
$c== :: NetworkInfo -> NetworkInfo -> Bool
Prelude.Eq, ReadPrec [NetworkInfo]
ReadPrec NetworkInfo
Int -> ReadS NetworkInfo
ReadS [NetworkInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkInfo]
$creadListPrec :: ReadPrec [NetworkInfo]
readPrec :: ReadPrec NetworkInfo
$creadPrec :: ReadPrec NetworkInfo
readList :: ReadS [NetworkInfo]
$creadList :: ReadS [NetworkInfo]
readsPrec :: Int -> ReadS NetworkInfo
$creadsPrec :: Int -> ReadS NetworkInfo
Prelude.Read, Int -> NetworkInfo -> ShowS
[NetworkInfo] -> ShowS
NetworkInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkInfo] -> ShowS
$cshowList :: [NetworkInfo] -> ShowS
show :: NetworkInfo -> String
$cshow :: NetworkInfo -> String
showsPrec :: Int -> NetworkInfo -> ShowS
$cshowsPrec :: Int -> NetworkInfo -> ShowS
Prelude.Show, forall x. Rep NetworkInfo x -> NetworkInfo
forall x. NetworkInfo -> Rep NetworkInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkInfo x -> NetworkInfo
$cfrom :: forall x. NetworkInfo -> Rep NetworkInfo x
Prelude.Generic)

-- |
-- Create a value of 'NetworkInfo' 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:
--
-- 'interfaceName', 'networkInfo_interfaceName' - Information about the name of the interface of the server for which the
-- assessment was run.
--
-- 'ipAddress', 'networkInfo_ipAddress' - Information about the IP address of the server for which the assessment
-- was run.
--
-- 'macAddress', 'networkInfo_macAddress' - Information about the MAC address of the server for which the assessment
-- was run.
--
-- 'netMask', 'networkInfo_netMask' - Information about the subnet mask of the server for which the assessment
-- was run.
newNetworkInfo ::
  -- | 'interfaceName'
  Prelude.Text ->
  -- | 'ipAddress'
  Prelude.Text ->
  -- | 'macAddress'
  Prelude.Text ->
  -- | 'netMask'
  Prelude.Text ->
  NetworkInfo
newNetworkInfo :: Text -> Text -> Text -> Text -> NetworkInfo
newNetworkInfo
  Text
pInterfaceName_
  Text
pIpAddress_
  Text
pMacAddress_
  Text
pNetMask_ =
    NetworkInfo'
      { $sel:interfaceName:NetworkInfo' :: Text
interfaceName = Text
pInterfaceName_,
        $sel:ipAddress:NetworkInfo' :: Text
ipAddress = Text
pIpAddress_,
        $sel:macAddress:NetworkInfo' :: Text
macAddress = Text
pMacAddress_,
        $sel:netMask:NetworkInfo' :: Text
netMask = Text
pNetMask_
      }

-- | Information about the name of the interface of the server for which the
-- assessment was run.
networkInfo_interfaceName :: Lens.Lens' NetworkInfo Prelude.Text
networkInfo_interfaceName :: Lens' NetworkInfo Text
networkInfo_interfaceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInfo' {Text
interfaceName :: Text
$sel:interfaceName:NetworkInfo' :: NetworkInfo -> Text
interfaceName} -> Text
interfaceName) (\s :: NetworkInfo
s@NetworkInfo' {} Text
a -> NetworkInfo
s {$sel:interfaceName:NetworkInfo' :: Text
interfaceName = Text
a} :: NetworkInfo)

-- | Information about the IP address of the server for which the assessment
-- was run.
networkInfo_ipAddress :: Lens.Lens' NetworkInfo Prelude.Text
networkInfo_ipAddress :: Lens' NetworkInfo Text
networkInfo_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInfo' {Text
ipAddress :: Text
$sel:ipAddress:NetworkInfo' :: NetworkInfo -> Text
ipAddress} -> Text
ipAddress) (\s :: NetworkInfo
s@NetworkInfo' {} Text
a -> NetworkInfo
s {$sel:ipAddress:NetworkInfo' :: Text
ipAddress = Text
a} :: NetworkInfo)

-- | Information about the MAC address of the server for which the assessment
-- was run.
networkInfo_macAddress :: Lens.Lens' NetworkInfo Prelude.Text
networkInfo_macAddress :: Lens' NetworkInfo Text
networkInfo_macAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInfo' {Text
macAddress :: Text
$sel:macAddress:NetworkInfo' :: NetworkInfo -> Text
macAddress} -> Text
macAddress) (\s :: NetworkInfo
s@NetworkInfo' {} Text
a -> NetworkInfo
s {$sel:macAddress:NetworkInfo' :: Text
macAddress = Text
a} :: NetworkInfo)

-- | Information about the subnet mask of the server for which the assessment
-- was run.
networkInfo_netMask :: Lens.Lens' NetworkInfo Prelude.Text
networkInfo_netMask :: Lens' NetworkInfo Text
networkInfo_netMask = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInfo' {Text
netMask :: Text
$sel:netMask:NetworkInfo' :: NetworkInfo -> Text
netMask} -> Text
netMask) (\s :: NetworkInfo
s@NetworkInfo' {} Text
a -> NetworkInfo
s {$sel:netMask:NetworkInfo' :: Text
netMask = Text
a} :: NetworkInfo)

instance Data.FromJSON NetworkInfo where
  parseJSON :: Value -> Parser NetworkInfo
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NetworkInfo"
      ( \Object
x ->
          Text -> Text -> Text -> Text -> NetworkInfo
NetworkInfo'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"interfaceName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ipAddress")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"macAddress")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"netMask")
      )

instance Prelude.Hashable NetworkInfo where
  hashWithSalt :: Int -> NetworkInfo -> Int
hashWithSalt Int
_salt NetworkInfo' {Text
netMask :: Text
macAddress :: Text
ipAddress :: Text
interfaceName :: Text
$sel:netMask:NetworkInfo' :: NetworkInfo -> Text
$sel:macAddress:NetworkInfo' :: NetworkInfo -> Text
$sel:ipAddress:NetworkInfo' :: NetworkInfo -> Text
$sel:interfaceName:NetworkInfo' :: NetworkInfo -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
interfaceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
macAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
netMask

instance Prelude.NFData NetworkInfo where
  rnf :: NetworkInfo -> ()
rnf NetworkInfo' {Text
netMask :: Text
macAddress :: Text
ipAddress :: Text
interfaceName :: Text
$sel:netMask:NetworkInfo' :: NetworkInfo -> Text
$sel:macAddress:NetworkInfo' :: NetworkInfo -> Text
$sel:ipAddress:NetworkInfo' :: NetworkInfo -> Text
$sel:interfaceName:NetworkInfo' :: NetworkInfo -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
interfaceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
macAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
netMask