{-# 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.DrS.Types.NetworkInterface 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 NetworkInterface = NetworkInterface'
{
NetworkInterface -> Maybe [Text]
ips :: Prelude.Maybe [Prelude.Text],
NetworkInterface -> Maybe Bool
isPrimary :: Prelude.Maybe Prelude.Bool,
NetworkInterface -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text
}
deriving (NetworkInterface -> NetworkInterface -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkInterface -> NetworkInterface -> Bool
$c/= :: NetworkInterface -> NetworkInterface -> Bool
== :: NetworkInterface -> NetworkInterface -> Bool
$c== :: NetworkInterface -> NetworkInterface -> Bool
Prelude.Eq, ReadPrec [NetworkInterface]
ReadPrec NetworkInterface
Int -> ReadS NetworkInterface
ReadS [NetworkInterface]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkInterface]
$creadListPrec :: ReadPrec [NetworkInterface]
readPrec :: ReadPrec NetworkInterface
$creadPrec :: ReadPrec NetworkInterface
readList :: ReadS [NetworkInterface]
$creadList :: ReadS [NetworkInterface]
readsPrec :: Int -> ReadS NetworkInterface
$creadsPrec :: Int -> ReadS NetworkInterface
Prelude.Read, Int -> NetworkInterface -> ShowS
[NetworkInterface] -> ShowS
NetworkInterface -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkInterface] -> ShowS
$cshowList :: [NetworkInterface] -> ShowS
show :: NetworkInterface -> String
$cshow :: NetworkInterface -> String
showsPrec :: Int -> NetworkInterface -> ShowS
$cshowsPrec :: Int -> NetworkInterface -> ShowS
Prelude.Show, forall x. Rep NetworkInterface x -> NetworkInterface
forall x. NetworkInterface -> Rep NetworkInterface x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkInterface x -> NetworkInterface
$cfrom :: forall x. NetworkInterface -> Rep NetworkInterface x
Prelude.Generic)
newNetworkInterface ::
NetworkInterface
newNetworkInterface :: NetworkInterface
newNetworkInterface =
NetworkInterface'
{ $sel:ips:NetworkInterface' :: Maybe [Text]
ips = forall a. Maybe a
Prelude.Nothing,
$sel:isPrimary:NetworkInterface' :: Maybe Bool
isPrimary = forall a. Maybe a
Prelude.Nothing,
$sel:macAddress:NetworkInterface' :: Maybe Text
macAddress = forall a. Maybe a
Prelude.Nothing
}
networkInterface_ips :: Lens.Lens' NetworkInterface (Prelude.Maybe [Prelude.Text])
networkInterface_ips :: Lens' NetworkInterface (Maybe [Text])
networkInterface_ips = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterface' {Maybe [Text]
ips :: Maybe [Text]
$sel:ips:NetworkInterface' :: NetworkInterface -> Maybe [Text]
ips} -> Maybe [Text]
ips) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe [Text]
a -> NetworkInterface
s {$sel:ips:NetworkInterface' :: Maybe [Text]
ips = Maybe [Text]
a} :: NetworkInterface) 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
networkInterface_isPrimary :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Bool)
networkInterface_isPrimary :: Lens' NetworkInterface (Maybe Bool)
networkInterface_isPrimary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterface' {Maybe Bool
isPrimary :: Maybe Bool
$sel:isPrimary:NetworkInterface' :: NetworkInterface -> Maybe Bool
isPrimary} -> Maybe Bool
isPrimary) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe Bool
a -> NetworkInterface
s {$sel:isPrimary:NetworkInterface' :: Maybe Bool
isPrimary = Maybe Bool
a} :: NetworkInterface)
networkInterface_macAddress :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text)
networkInterface_macAddress :: Lens' NetworkInterface (Maybe Text)
networkInterface_macAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterface' {Maybe Text
macAddress :: Maybe Text
$sel:macAddress:NetworkInterface' :: NetworkInterface -> Maybe Text
macAddress} -> Maybe Text
macAddress) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe Text
a -> NetworkInterface
s {$sel:macAddress:NetworkInterface' :: Maybe Text
macAddress = Maybe Text
a} :: NetworkInterface)
instance Data.FromJSON NetworkInterface where
parseJSON :: Value -> Parser NetworkInterface
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NetworkInterface"
( \Object
x ->
Maybe [Text] -> Maybe Bool -> Maybe Text -> NetworkInterface
NetworkInterface'
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
"ips" 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
"isPrimary")
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
"macAddress")
)
instance Prelude.Hashable NetworkInterface where
hashWithSalt :: Int -> NetworkInterface -> Int
hashWithSalt Int
_salt NetworkInterface' {Maybe Bool
Maybe [Text]
Maybe Text
macAddress :: Maybe Text
isPrimary :: Maybe Bool
ips :: Maybe [Text]
$sel:macAddress:NetworkInterface' :: NetworkInterface -> Maybe Text
$sel:isPrimary:NetworkInterface' :: NetworkInterface -> Maybe Bool
$sel:ips:NetworkInterface' :: NetworkInterface -> Maybe [Text]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
ips
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isPrimary
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
macAddress
instance Prelude.NFData NetworkInterface where
rnf :: NetworkInterface -> ()
rnf NetworkInterface' {Maybe Bool
Maybe [Text]
Maybe Text
macAddress :: Maybe Text
isPrimary :: Maybe Bool
ips :: Maybe [Text]
$sel:macAddress:NetworkInterface' :: NetworkInterface -> Maybe Text
$sel:isPrimary:NetworkInterface' :: NetworkInterface -> Maybe Bool
$sel:ips:NetworkInterface' :: NetworkInterface -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
ips
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isPrimary
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
macAddress