{-# 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 #-}
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
data NetworkInfo = NetworkInfo'
{
NetworkInfo -> Text
interfaceName :: Prelude.Text,
NetworkInfo -> Text
ipAddress :: Prelude.Text,
NetworkInfo -> Text
macAddress :: Prelude.Text,
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)
newNetworkInfo ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
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_
}
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)
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)
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)
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