{-# 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.NetworkPath 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.Step
import qualified Amazonka.Prelude as Prelude
data NetworkPath = NetworkPath'
{
NetworkPath -> Maybe (NonEmpty Step)
steps :: Prelude.Maybe (Prelude.NonEmpty Step)
}
deriving (NetworkPath -> NetworkPath -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkPath -> NetworkPath -> Bool
$c/= :: NetworkPath -> NetworkPath -> Bool
== :: NetworkPath -> NetworkPath -> Bool
$c== :: NetworkPath -> NetworkPath -> Bool
Prelude.Eq, ReadPrec [NetworkPath]
ReadPrec NetworkPath
Int -> ReadS NetworkPath
ReadS [NetworkPath]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkPath]
$creadListPrec :: ReadPrec [NetworkPath]
readPrec :: ReadPrec NetworkPath
$creadPrec :: ReadPrec NetworkPath
readList :: ReadS [NetworkPath]
$creadList :: ReadS [NetworkPath]
readsPrec :: Int -> ReadS NetworkPath
$creadsPrec :: Int -> ReadS NetworkPath
Prelude.Read, Int -> NetworkPath -> ShowS
[NetworkPath] -> ShowS
NetworkPath -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkPath] -> ShowS
$cshowList :: [NetworkPath] -> ShowS
show :: NetworkPath -> String
$cshow :: NetworkPath -> String
showsPrec :: Int -> NetworkPath -> ShowS
$cshowsPrec :: Int -> NetworkPath -> ShowS
Prelude.Show, forall x. Rep NetworkPath x -> NetworkPath
forall x. NetworkPath -> Rep NetworkPath x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkPath x -> NetworkPath
$cfrom :: forall x. NetworkPath -> Rep NetworkPath x
Prelude.Generic)
newNetworkPath ::
NetworkPath
newNetworkPath :: NetworkPath
newNetworkPath =
NetworkPath' {$sel:steps:NetworkPath' :: Maybe (NonEmpty Step)
steps = forall a. Maybe a
Prelude.Nothing}
networkPath_steps :: Lens.Lens' NetworkPath (Prelude.Maybe (Prelude.NonEmpty Step))
networkPath_steps :: Lens' NetworkPath (Maybe (NonEmpty Step))
networkPath_steps = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkPath' {Maybe (NonEmpty Step)
steps :: Maybe (NonEmpty Step)
$sel:steps:NetworkPath' :: NetworkPath -> Maybe (NonEmpty Step)
steps} -> Maybe (NonEmpty Step)
steps) (\s :: NetworkPath
s@NetworkPath' {} Maybe (NonEmpty Step)
a -> NetworkPath
s {$sel:steps:NetworkPath' :: Maybe (NonEmpty Step)
steps = Maybe (NonEmpty Step)
a} :: NetworkPath) 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
instance Data.FromJSON NetworkPath where
parseJSON :: Value -> Parser NetworkPath
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"NetworkPath"
( \Object
x ->
Maybe (NonEmpty Step) -> NetworkPath
NetworkPath' 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
"steps")
)
instance Prelude.Hashable NetworkPath where
hashWithSalt :: Int -> NetworkPath -> Int
hashWithSalt Int
_salt NetworkPath' {Maybe (NonEmpty Step)
steps :: Maybe (NonEmpty Step)
$sel:steps:NetworkPath' :: NetworkPath -> Maybe (NonEmpty Step)
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Step)
steps
instance Prelude.NFData NetworkPath where
rnf :: NetworkPath -> ()
rnf NetworkPath' {Maybe (NonEmpty Step)
steps :: Maybe (NonEmpty Step)
$sel:steps:NetworkPath' :: NetworkPath -> Maybe (NonEmpty Step)
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Step)
steps