{-# 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.Inspector2.Types.NetworkReachabilityDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Inspector2.Types.NetworkPath
import Amazonka.Inspector2.Types.NetworkProtocol
import Amazonka.Inspector2.Types.PortRange
import qualified Amazonka.Prelude as Prelude
data NetworkReachabilityDetails = NetworkReachabilityDetails'
{
NetworkReachabilityDetails -> NetworkPath
networkPath :: NetworkPath,
NetworkReachabilityDetails -> PortRange
openPortRange :: PortRange,
NetworkReachabilityDetails -> NetworkProtocol
protocol :: NetworkProtocol
}
deriving (NetworkReachabilityDetails -> NetworkReachabilityDetails -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkReachabilityDetails -> NetworkReachabilityDetails -> Bool
$c/= :: NetworkReachabilityDetails -> NetworkReachabilityDetails -> Bool
== :: NetworkReachabilityDetails -> NetworkReachabilityDetails -> Bool
$c== :: NetworkReachabilityDetails -> NetworkReachabilityDetails -> Bool
Prelude.Eq, ReadPrec [NetworkReachabilityDetails]
ReadPrec NetworkReachabilityDetails
Int -> ReadS NetworkReachabilityDetails
ReadS [NetworkReachabilityDetails]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkReachabilityDetails]
$creadListPrec :: ReadPrec [NetworkReachabilityDetails]
readPrec :: ReadPrec NetworkReachabilityDetails
$creadPrec :: ReadPrec NetworkReachabilityDetails
readList :: ReadS [NetworkReachabilityDetails]
$creadList :: ReadS [NetworkReachabilityDetails]
readsPrec :: Int -> ReadS NetworkReachabilityDetails
$creadsPrec :: Int -> ReadS NetworkReachabilityDetails
Prelude.Read, Int -> NetworkReachabilityDetails -> ShowS
[NetworkReachabilityDetails] -> ShowS
NetworkReachabilityDetails -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkReachabilityDetails] -> ShowS
$cshowList :: [NetworkReachabilityDetails] -> ShowS
show :: NetworkReachabilityDetails -> String
$cshow :: NetworkReachabilityDetails -> String
showsPrec :: Int -> NetworkReachabilityDetails -> ShowS
$cshowsPrec :: Int -> NetworkReachabilityDetails -> ShowS
Prelude.Show, forall x.
Rep NetworkReachabilityDetails x -> NetworkReachabilityDetails
forall x.
NetworkReachabilityDetails -> Rep NetworkReachabilityDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep NetworkReachabilityDetails x -> NetworkReachabilityDetails
$cfrom :: forall x.
NetworkReachabilityDetails -> Rep NetworkReachabilityDetails x
Prelude.Generic)
newNetworkReachabilityDetails ::
NetworkPath ->
PortRange ->
NetworkProtocol ->
NetworkReachabilityDetails
newNetworkReachabilityDetails :: NetworkPath
-> PortRange -> NetworkProtocol -> NetworkReachabilityDetails
newNetworkReachabilityDetails
NetworkPath
pNetworkPath_
PortRange
pOpenPortRange_
NetworkProtocol
pProtocol_ =
NetworkReachabilityDetails'
{ $sel:networkPath:NetworkReachabilityDetails' :: NetworkPath
networkPath =
NetworkPath
pNetworkPath_,
$sel:openPortRange:NetworkReachabilityDetails' :: PortRange
openPortRange = PortRange
pOpenPortRange_,
$sel:protocol:NetworkReachabilityDetails' :: NetworkProtocol
protocol = NetworkProtocol
pProtocol_
}
networkReachabilityDetails_networkPath :: Lens.Lens' NetworkReachabilityDetails NetworkPath
networkReachabilityDetails_networkPath :: Lens' NetworkReachabilityDetails NetworkPath
networkReachabilityDetails_networkPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkReachabilityDetails' {NetworkPath
networkPath :: NetworkPath
$sel:networkPath:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> NetworkPath
networkPath} -> NetworkPath
networkPath) (\s :: NetworkReachabilityDetails
s@NetworkReachabilityDetails' {} NetworkPath
a -> NetworkReachabilityDetails
s {$sel:networkPath:NetworkReachabilityDetails' :: NetworkPath
networkPath = NetworkPath
a} :: NetworkReachabilityDetails)
networkReachabilityDetails_openPortRange :: Lens.Lens' NetworkReachabilityDetails PortRange
networkReachabilityDetails_openPortRange :: Lens' NetworkReachabilityDetails PortRange
networkReachabilityDetails_openPortRange = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkReachabilityDetails' {PortRange
openPortRange :: PortRange
$sel:openPortRange:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> PortRange
openPortRange} -> PortRange
openPortRange) (\s :: NetworkReachabilityDetails
s@NetworkReachabilityDetails' {} PortRange
a -> NetworkReachabilityDetails
s {$sel:openPortRange:NetworkReachabilityDetails' :: PortRange
openPortRange = PortRange
a} :: NetworkReachabilityDetails)
networkReachabilityDetails_protocol :: Lens.Lens' NetworkReachabilityDetails NetworkProtocol
networkReachabilityDetails_protocol :: Lens' NetworkReachabilityDetails NetworkProtocol
networkReachabilityDetails_protocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkReachabilityDetails' {NetworkProtocol
protocol :: NetworkProtocol
$sel:protocol:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> NetworkProtocol
protocol} -> NetworkProtocol
protocol) (\s :: NetworkReachabilityDetails
s@NetworkReachabilityDetails' {} NetworkProtocol
a -> NetworkReachabilityDetails
s {$sel:protocol:NetworkReachabilityDetails' :: NetworkProtocol
protocol = NetworkProtocol
a} :: NetworkReachabilityDetails)
instance Data.FromJSON NetworkReachabilityDetails where
parseJSON :: Value -> Parser NetworkReachabilityDetails
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NetworkReachabilityDetails"
( \Object
x ->
NetworkPath
-> PortRange -> NetworkProtocol -> NetworkReachabilityDetails
NetworkReachabilityDetails'
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
"networkPath")
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
"openPortRange")
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
"protocol")
)
instance Prelude.Hashable NetworkReachabilityDetails where
hashWithSalt :: Int -> NetworkReachabilityDetails -> Int
hashWithSalt Int
_salt NetworkReachabilityDetails' {NetworkProtocol
PortRange
NetworkPath
protocol :: NetworkProtocol
openPortRange :: PortRange
networkPath :: NetworkPath
$sel:protocol:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> NetworkProtocol
$sel:openPortRange:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> PortRange
$sel:networkPath:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> NetworkPath
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NetworkPath
networkPath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PortRange
openPortRange
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NetworkProtocol
protocol
instance Prelude.NFData NetworkReachabilityDetails where
rnf :: NetworkReachabilityDetails -> ()
rnf NetworkReachabilityDetails' {NetworkProtocol
PortRange
NetworkPath
protocol :: NetworkProtocol
openPortRange :: PortRange
networkPath :: NetworkPath
$sel:protocol:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> NetworkProtocol
$sel:openPortRange:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> PortRange
$sel:networkPath:NetworkReachabilityDetails' :: NetworkReachabilityDetails -> NetworkPath
..} =
forall a. NFData a => a -> ()
Prelude.rnf NetworkPath
networkPath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PortRange
openPortRange
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NetworkProtocol
protocol