{-# 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.StorageGateway.Types.NetworkInterface where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data NetworkInterface = NetworkInterface'
{
NetworkInterface -> Maybe Text
ipv6Address :: Prelude.Maybe Prelude.Text,
NetworkInterface -> Maybe Text
macAddress :: Prelude.Maybe Prelude.Text,
NetworkInterface -> Maybe Text
ipv4Address :: Prelude.Maybe Prelude.Text
}
deriving (NetworkInterface -> NetworkInterface -> Bool
(NetworkInterface -> NetworkInterface -> Bool)
-> (NetworkInterface -> NetworkInterface -> Bool)
-> Eq NetworkInterface
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]
(Int -> ReadS NetworkInterface)
-> ReadS [NetworkInterface]
-> ReadPrec NetworkInterface
-> ReadPrec [NetworkInterface]
-> Read 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
(Int -> NetworkInterface -> ShowS)
-> (NetworkInterface -> String)
-> ([NetworkInterface] -> ShowS)
-> Show NetworkInterface
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. NetworkInterface -> Rep NetworkInterface x)
-> (forall x. Rep NetworkInterface x -> NetworkInterface)
-> Generic NetworkInterface
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' :: Maybe Text -> Maybe Text -> Maybe Text -> NetworkInterface
NetworkInterface'
{ $sel:ipv6Address:NetworkInterface' :: Maybe Text
ipv6Address = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:macAddress:NetworkInterface' :: Maybe Text
macAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:ipv4Address:NetworkInterface' :: Maybe Text
ipv4Address = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
networkInterface_ipv6Address :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text)
networkInterface_ipv6Address :: (Maybe Text -> f (Maybe Text))
-> NetworkInterface -> f NetworkInterface
networkInterface_ipv6Address = (NetworkInterface -> Maybe Text)
-> (NetworkInterface -> Maybe Text -> NetworkInterface)
-> Lens NetworkInterface NetworkInterface (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterface' {Maybe Text
ipv6Address :: Maybe Text
$sel:ipv6Address:NetworkInterface' :: NetworkInterface -> Maybe Text
ipv6Address} -> Maybe Text
ipv6Address) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe Text
a -> NetworkInterface
s {$sel:ipv6Address:NetworkInterface' :: Maybe Text
ipv6Address = Maybe Text
a} :: NetworkInterface)
networkInterface_macAddress :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text)
networkInterface_macAddress :: (Maybe Text -> f (Maybe Text))
-> NetworkInterface -> f NetworkInterface
networkInterface_macAddress = (NetworkInterface -> Maybe Text)
-> (NetworkInterface -> Maybe Text -> NetworkInterface)
-> Lens NetworkInterface NetworkInterface (Maybe Text) (Maybe Text)
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)
networkInterface_ipv4Address :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text)
networkInterface_ipv4Address :: (Maybe Text -> f (Maybe Text))
-> NetworkInterface -> f NetworkInterface
networkInterface_ipv4Address = (NetworkInterface -> Maybe Text)
-> (NetworkInterface -> Maybe Text -> NetworkInterface)
-> Lens NetworkInterface NetworkInterface (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInterface' {Maybe Text
ipv4Address :: Maybe Text
$sel:ipv4Address:NetworkInterface' :: NetworkInterface -> Maybe Text
ipv4Address} -> Maybe Text
ipv4Address) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe Text
a -> NetworkInterface
s {$sel:ipv4Address:NetworkInterface' :: Maybe Text
ipv4Address = Maybe Text
a} :: NetworkInterface)
instance Core.FromJSON NetworkInterface where
parseJSON :: Value -> Parser NetworkInterface
parseJSON =
String
-> (Object -> Parser NetworkInterface)
-> Value
-> Parser NetworkInterface
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NetworkInterface"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> NetworkInterface
NetworkInterface'
(Maybe Text -> Maybe Text -> Maybe Text -> NetworkInterface)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> NetworkInterface)
forall (f :: * -> *) a b. Functor 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
"Ipv6Address")
Parser (Maybe Text -> Maybe Text -> NetworkInterface)
-> Parser (Maybe Text) -> Parser (Maybe Text -> NetworkInterface)
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
"MacAddress")
Parser (Maybe Text -> NetworkInterface)
-> Parser (Maybe Text) -> Parser NetworkInterface
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
"Ipv4Address")
)
instance Prelude.Hashable NetworkInterface
instance Prelude.NFData NetworkInterface