{-# 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.GuardDuty.Types.LocalPortDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LocalPortDetails = LocalPortDetails'
{
LocalPortDetails -> Maybe Text
portName :: Prelude.Maybe Prelude.Text,
LocalPortDetails -> Maybe Int
port :: Prelude.Maybe Prelude.Int
}
deriving (LocalPortDetails -> LocalPortDetails -> Bool
(LocalPortDetails -> LocalPortDetails -> Bool)
-> (LocalPortDetails -> LocalPortDetails -> Bool)
-> Eq LocalPortDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LocalPortDetails -> LocalPortDetails -> Bool
$c/= :: LocalPortDetails -> LocalPortDetails -> Bool
== :: LocalPortDetails -> LocalPortDetails -> Bool
$c== :: LocalPortDetails -> LocalPortDetails -> Bool
Prelude.Eq, ReadPrec [LocalPortDetails]
ReadPrec LocalPortDetails
Int -> ReadS LocalPortDetails
ReadS [LocalPortDetails]
(Int -> ReadS LocalPortDetails)
-> ReadS [LocalPortDetails]
-> ReadPrec LocalPortDetails
-> ReadPrec [LocalPortDetails]
-> Read LocalPortDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LocalPortDetails]
$creadListPrec :: ReadPrec [LocalPortDetails]
readPrec :: ReadPrec LocalPortDetails
$creadPrec :: ReadPrec LocalPortDetails
readList :: ReadS [LocalPortDetails]
$creadList :: ReadS [LocalPortDetails]
readsPrec :: Int -> ReadS LocalPortDetails
$creadsPrec :: Int -> ReadS LocalPortDetails
Prelude.Read, Int -> LocalPortDetails -> ShowS
[LocalPortDetails] -> ShowS
LocalPortDetails -> String
(Int -> LocalPortDetails -> ShowS)
-> (LocalPortDetails -> String)
-> ([LocalPortDetails] -> ShowS)
-> Show LocalPortDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LocalPortDetails] -> ShowS
$cshowList :: [LocalPortDetails] -> ShowS
show :: LocalPortDetails -> String
$cshow :: LocalPortDetails -> String
showsPrec :: Int -> LocalPortDetails -> ShowS
$cshowsPrec :: Int -> LocalPortDetails -> ShowS
Prelude.Show, (forall x. LocalPortDetails -> Rep LocalPortDetails x)
-> (forall x. Rep LocalPortDetails x -> LocalPortDetails)
-> Generic LocalPortDetails
forall x. Rep LocalPortDetails x -> LocalPortDetails
forall x. LocalPortDetails -> Rep LocalPortDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LocalPortDetails x -> LocalPortDetails
$cfrom :: forall x. LocalPortDetails -> Rep LocalPortDetails x
Prelude.Generic)
newLocalPortDetails ::
LocalPortDetails
newLocalPortDetails :: LocalPortDetails
newLocalPortDetails =
LocalPortDetails' :: Maybe Text -> Maybe Int -> LocalPortDetails
LocalPortDetails'
{ $sel:portName:LocalPortDetails' :: Maybe Text
portName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:port:LocalPortDetails' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
localPortDetails_portName :: Lens.Lens' LocalPortDetails (Prelude.Maybe Prelude.Text)
localPortDetails_portName :: (Maybe Text -> f (Maybe Text))
-> LocalPortDetails -> f LocalPortDetails
localPortDetails_portName = (LocalPortDetails -> Maybe Text)
-> (LocalPortDetails -> Maybe Text -> LocalPortDetails)
-> Lens LocalPortDetails LocalPortDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalPortDetails' {Maybe Text
portName :: Maybe Text
$sel:portName:LocalPortDetails' :: LocalPortDetails -> Maybe Text
portName} -> Maybe Text
portName) (\s :: LocalPortDetails
s@LocalPortDetails' {} Maybe Text
a -> LocalPortDetails
s {$sel:portName:LocalPortDetails' :: Maybe Text
portName = Maybe Text
a} :: LocalPortDetails)
localPortDetails_port :: Lens.Lens' LocalPortDetails (Prelude.Maybe Prelude.Int)
localPortDetails_port :: (Maybe Int -> f (Maybe Int))
-> LocalPortDetails -> f LocalPortDetails
localPortDetails_port = (LocalPortDetails -> Maybe Int)
-> (LocalPortDetails -> Maybe Int -> LocalPortDetails)
-> Lens LocalPortDetails LocalPortDetails (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LocalPortDetails' {Maybe Int
port :: Maybe Int
$sel:port:LocalPortDetails' :: LocalPortDetails -> Maybe Int
port} -> Maybe Int
port) (\s :: LocalPortDetails
s@LocalPortDetails' {} Maybe Int
a -> LocalPortDetails
s {$sel:port:LocalPortDetails' :: Maybe Int
port = Maybe Int
a} :: LocalPortDetails)
instance Core.FromJSON LocalPortDetails where
parseJSON :: Value -> Parser LocalPortDetails
parseJSON =
String
-> (Object -> Parser LocalPortDetails)
-> Value
-> Parser LocalPortDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LocalPortDetails"
( \Object
x ->
Maybe Text -> Maybe Int -> LocalPortDetails
LocalPortDetails'
(Maybe Text -> Maybe Int -> LocalPortDetails)
-> Parser (Maybe Text) -> Parser (Maybe Int -> LocalPortDetails)
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
"portName")
Parser (Maybe Int -> LocalPortDetails)
-> Parser (Maybe Int) -> Parser LocalPortDetails
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"port")
)
instance Prelude.Hashable LocalPortDetails
instance Prelude.NFData LocalPortDetails