{-# 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.Batch.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
privateIpv4Address :: Prelude.Maybe Prelude.Text,
NetworkInterface -> Maybe Text
attachmentId :: 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:privateIpv4Address:NetworkInterface' :: Maybe Text
privateIpv4Address = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attachmentId:NetworkInterface' :: Maybe Text
attachmentId = 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_privateIpv4Address :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text)
networkInterface_privateIpv4Address :: (Maybe Text -> f (Maybe Text))
-> NetworkInterface -> f NetworkInterface
networkInterface_privateIpv4Address = (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
privateIpv4Address :: Maybe Text
$sel:privateIpv4Address:NetworkInterface' :: NetworkInterface -> Maybe Text
privateIpv4Address} -> Maybe Text
privateIpv4Address) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe Text
a -> NetworkInterface
s {$sel:privateIpv4Address:NetworkInterface' :: Maybe Text
privateIpv4Address = Maybe Text
a} :: NetworkInterface)
networkInterface_attachmentId :: Lens.Lens' NetworkInterface (Prelude.Maybe Prelude.Text)
networkInterface_attachmentId :: (Maybe Text -> f (Maybe Text))
-> NetworkInterface -> f NetworkInterface
networkInterface_attachmentId = (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
attachmentId :: Maybe Text
$sel:attachmentId:NetworkInterface' :: NetworkInterface -> Maybe Text
attachmentId} -> Maybe Text
attachmentId) (\s :: NetworkInterface
s@NetworkInterface' {} Maybe Text
a -> NetworkInterface
s {$sel:attachmentId:NetworkInterface' :: Maybe Text
attachmentId = 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
"privateIpv4Address")
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
"attachmentId")
)
instance Prelude.Hashable NetworkInterface
instance Prelude.NFData NetworkInterface