{-# 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.Lightsail.Types.InstancePortInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.AccessDirection
import Amazonka.Lightsail.Types.NetworkProtocol
import Amazonka.Lightsail.Types.PortAccessType
import qualified Amazonka.Prelude as Prelude
data InstancePortInfo = InstancePortInfo'
{
InstancePortInfo -> Maybe Int
fromPort :: Prelude.Maybe Prelude.Int,
InstancePortInfo -> Maybe [Text]
cidrs :: Prelude.Maybe [Prelude.Text],
InstancePortInfo -> Maybe Text
commonName :: Prelude.Maybe Prelude.Text,
InstancePortInfo -> Maybe NetworkProtocol
protocol :: Prelude.Maybe NetworkProtocol,
InstancePortInfo -> Maybe [Text]
cidrListAliases :: Prelude.Maybe [Prelude.Text],
InstancePortInfo -> Maybe [Text]
ipv6Cidrs :: Prelude.Maybe [Prelude.Text],
InstancePortInfo -> Maybe AccessDirection
accessDirection :: Prelude.Maybe AccessDirection,
InstancePortInfo -> Maybe PortAccessType
accessType :: Prelude.Maybe PortAccessType,
InstancePortInfo -> Maybe Int
toPort :: Prelude.Maybe Prelude.Int,
InstancePortInfo -> Maybe Text
accessFrom :: Prelude.Maybe Prelude.Text
}
deriving (InstancePortInfo -> InstancePortInfo -> Bool
(InstancePortInfo -> InstancePortInfo -> Bool)
-> (InstancePortInfo -> InstancePortInfo -> Bool)
-> Eq InstancePortInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstancePortInfo -> InstancePortInfo -> Bool
$c/= :: InstancePortInfo -> InstancePortInfo -> Bool
== :: InstancePortInfo -> InstancePortInfo -> Bool
$c== :: InstancePortInfo -> InstancePortInfo -> Bool
Prelude.Eq, ReadPrec [InstancePortInfo]
ReadPrec InstancePortInfo
Int -> ReadS InstancePortInfo
ReadS [InstancePortInfo]
(Int -> ReadS InstancePortInfo)
-> ReadS [InstancePortInfo]
-> ReadPrec InstancePortInfo
-> ReadPrec [InstancePortInfo]
-> Read InstancePortInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstancePortInfo]
$creadListPrec :: ReadPrec [InstancePortInfo]
readPrec :: ReadPrec InstancePortInfo
$creadPrec :: ReadPrec InstancePortInfo
readList :: ReadS [InstancePortInfo]
$creadList :: ReadS [InstancePortInfo]
readsPrec :: Int -> ReadS InstancePortInfo
$creadsPrec :: Int -> ReadS InstancePortInfo
Prelude.Read, Int -> InstancePortInfo -> ShowS
[InstancePortInfo] -> ShowS
InstancePortInfo -> String
(Int -> InstancePortInfo -> ShowS)
-> (InstancePortInfo -> String)
-> ([InstancePortInfo] -> ShowS)
-> Show InstancePortInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstancePortInfo] -> ShowS
$cshowList :: [InstancePortInfo] -> ShowS
show :: InstancePortInfo -> String
$cshow :: InstancePortInfo -> String
showsPrec :: Int -> InstancePortInfo -> ShowS
$cshowsPrec :: Int -> InstancePortInfo -> ShowS
Prelude.Show, (forall x. InstancePortInfo -> Rep InstancePortInfo x)
-> (forall x. Rep InstancePortInfo x -> InstancePortInfo)
-> Generic InstancePortInfo
forall x. Rep InstancePortInfo x -> InstancePortInfo
forall x. InstancePortInfo -> Rep InstancePortInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstancePortInfo x -> InstancePortInfo
$cfrom :: forall x. InstancePortInfo -> Rep InstancePortInfo x
Prelude.Generic)
newInstancePortInfo ::
InstancePortInfo
newInstancePortInfo :: InstancePortInfo
newInstancePortInfo =
InstancePortInfo' :: Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo
InstancePortInfo'
{ $sel:fromPort:InstancePortInfo' :: Maybe Int
fromPort = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:cidrs:InstancePortInfo' :: Maybe [Text]
cidrs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:commonName:InstancePortInfo' :: Maybe Text
commonName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:InstancePortInfo' :: Maybe NetworkProtocol
protocol = Maybe NetworkProtocol
forall a. Maybe a
Prelude.Nothing,
$sel:cidrListAliases:InstancePortInfo' :: Maybe [Text]
cidrListAliases = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:ipv6Cidrs:InstancePortInfo' :: Maybe [Text]
ipv6Cidrs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:accessDirection:InstancePortInfo' :: Maybe AccessDirection
accessDirection = Maybe AccessDirection
forall a. Maybe a
Prelude.Nothing,
$sel:accessType:InstancePortInfo' :: Maybe PortAccessType
accessType = Maybe PortAccessType
forall a. Maybe a
Prelude.Nothing,
$sel:toPort:InstancePortInfo' :: Maybe Int
toPort = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:accessFrom:InstancePortInfo' :: Maybe Text
accessFrom = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instancePortInfo_fromPort :: Lens.Lens' InstancePortInfo (Prelude.Maybe Prelude.Int)
instancePortInfo_fromPort :: (Maybe Int -> f (Maybe Int))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_fromPort = (InstancePortInfo -> Maybe Int)
-> (InstancePortInfo -> Maybe Int -> InstancePortInfo)
-> Lens InstancePortInfo InstancePortInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe Int
fromPort :: Maybe Int
$sel:fromPort:InstancePortInfo' :: InstancePortInfo -> Maybe Int
fromPort} -> Maybe Int
fromPort) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe Int
a -> InstancePortInfo
s {$sel:fromPort:InstancePortInfo' :: Maybe Int
fromPort = Maybe Int
a} :: InstancePortInfo)
instancePortInfo_cidrs :: Lens.Lens' InstancePortInfo (Prelude.Maybe [Prelude.Text])
instancePortInfo_cidrs :: (Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_cidrs = (InstancePortInfo -> Maybe [Text])
-> (InstancePortInfo -> Maybe [Text] -> InstancePortInfo)
-> Lens
InstancePortInfo InstancePortInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe [Text]
cidrs :: Maybe [Text]
$sel:cidrs:InstancePortInfo' :: InstancePortInfo -> Maybe [Text]
cidrs} -> Maybe [Text]
cidrs) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe [Text]
a -> InstancePortInfo
s {$sel:cidrs:InstancePortInfo' :: Maybe [Text]
cidrs = Maybe [Text]
a} :: InstancePortInfo) ((Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo -> f InstancePortInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo
-> f InstancePortInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instancePortInfo_commonName :: Lens.Lens' InstancePortInfo (Prelude.Maybe Prelude.Text)
instancePortInfo_commonName :: (Maybe Text -> f (Maybe Text))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_commonName = (InstancePortInfo -> Maybe Text)
-> (InstancePortInfo -> Maybe Text -> InstancePortInfo)
-> Lens InstancePortInfo InstancePortInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe Text
commonName :: Maybe Text
$sel:commonName:InstancePortInfo' :: InstancePortInfo -> Maybe Text
commonName} -> Maybe Text
commonName) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe Text
a -> InstancePortInfo
s {$sel:commonName:InstancePortInfo' :: Maybe Text
commonName = Maybe Text
a} :: InstancePortInfo)
instancePortInfo_protocol :: Lens.Lens' InstancePortInfo (Prelude.Maybe NetworkProtocol)
instancePortInfo_protocol :: (Maybe NetworkProtocol -> f (Maybe NetworkProtocol))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_protocol = (InstancePortInfo -> Maybe NetworkProtocol)
-> (InstancePortInfo -> Maybe NetworkProtocol -> InstancePortInfo)
-> Lens
InstancePortInfo
InstancePortInfo
(Maybe NetworkProtocol)
(Maybe NetworkProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe NetworkProtocol
protocol :: Maybe NetworkProtocol
$sel:protocol:InstancePortInfo' :: InstancePortInfo -> Maybe NetworkProtocol
protocol} -> Maybe NetworkProtocol
protocol) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe NetworkProtocol
a -> InstancePortInfo
s {$sel:protocol:InstancePortInfo' :: Maybe NetworkProtocol
protocol = Maybe NetworkProtocol
a} :: InstancePortInfo)
instancePortInfo_cidrListAliases :: Lens.Lens' InstancePortInfo (Prelude.Maybe [Prelude.Text])
instancePortInfo_cidrListAliases :: (Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_cidrListAliases = (InstancePortInfo -> Maybe [Text])
-> (InstancePortInfo -> Maybe [Text] -> InstancePortInfo)
-> Lens
InstancePortInfo InstancePortInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe [Text]
cidrListAliases :: Maybe [Text]
$sel:cidrListAliases:InstancePortInfo' :: InstancePortInfo -> Maybe [Text]
cidrListAliases} -> Maybe [Text]
cidrListAliases) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe [Text]
a -> InstancePortInfo
s {$sel:cidrListAliases:InstancePortInfo' :: Maybe [Text]
cidrListAliases = Maybe [Text]
a} :: InstancePortInfo) ((Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo -> f InstancePortInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo
-> f InstancePortInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instancePortInfo_ipv6Cidrs :: Lens.Lens' InstancePortInfo (Prelude.Maybe [Prelude.Text])
instancePortInfo_ipv6Cidrs :: (Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_ipv6Cidrs = (InstancePortInfo -> Maybe [Text])
-> (InstancePortInfo -> Maybe [Text] -> InstancePortInfo)
-> Lens
InstancePortInfo InstancePortInfo (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe [Text]
ipv6Cidrs :: Maybe [Text]
$sel:ipv6Cidrs:InstancePortInfo' :: InstancePortInfo -> Maybe [Text]
ipv6Cidrs} -> Maybe [Text]
ipv6Cidrs) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe [Text]
a -> InstancePortInfo
s {$sel:ipv6Cidrs:InstancePortInfo' :: Maybe [Text]
ipv6Cidrs = Maybe [Text]
a} :: InstancePortInfo) ((Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo -> f InstancePortInfo)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> InstancePortInfo
-> f InstancePortInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instancePortInfo_accessDirection :: Lens.Lens' InstancePortInfo (Prelude.Maybe AccessDirection)
instancePortInfo_accessDirection :: (Maybe AccessDirection -> f (Maybe AccessDirection))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_accessDirection = (InstancePortInfo -> Maybe AccessDirection)
-> (InstancePortInfo -> Maybe AccessDirection -> InstancePortInfo)
-> Lens
InstancePortInfo
InstancePortInfo
(Maybe AccessDirection)
(Maybe AccessDirection)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe AccessDirection
accessDirection :: Maybe AccessDirection
$sel:accessDirection:InstancePortInfo' :: InstancePortInfo -> Maybe AccessDirection
accessDirection} -> Maybe AccessDirection
accessDirection) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe AccessDirection
a -> InstancePortInfo
s {$sel:accessDirection:InstancePortInfo' :: Maybe AccessDirection
accessDirection = Maybe AccessDirection
a} :: InstancePortInfo)
instancePortInfo_accessType :: Lens.Lens' InstancePortInfo (Prelude.Maybe PortAccessType)
instancePortInfo_accessType :: (Maybe PortAccessType -> f (Maybe PortAccessType))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_accessType = (InstancePortInfo -> Maybe PortAccessType)
-> (InstancePortInfo -> Maybe PortAccessType -> InstancePortInfo)
-> Lens
InstancePortInfo
InstancePortInfo
(Maybe PortAccessType)
(Maybe PortAccessType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe PortAccessType
accessType :: Maybe PortAccessType
$sel:accessType:InstancePortInfo' :: InstancePortInfo -> Maybe PortAccessType
accessType} -> Maybe PortAccessType
accessType) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe PortAccessType
a -> InstancePortInfo
s {$sel:accessType:InstancePortInfo' :: Maybe PortAccessType
accessType = Maybe PortAccessType
a} :: InstancePortInfo)
instancePortInfo_toPort :: Lens.Lens' InstancePortInfo (Prelude.Maybe Prelude.Int)
instancePortInfo_toPort :: (Maybe Int -> f (Maybe Int))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_toPort = (InstancePortInfo -> Maybe Int)
-> (InstancePortInfo -> Maybe Int -> InstancePortInfo)
-> Lens InstancePortInfo InstancePortInfo (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe Int
toPort :: Maybe Int
$sel:toPort:InstancePortInfo' :: InstancePortInfo -> Maybe Int
toPort} -> Maybe Int
toPort) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe Int
a -> InstancePortInfo
s {$sel:toPort:InstancePortInfo' :: Maybe Int
toPort = Maybe Int
a} :: InstancePortInfo)
instancePortInfo_accessFrom :: Lens.Lens' InstancePortInfo (Prelude.Maybe Prelude.Text)
instancePortInfo_accessFrom :: (Maybe Text -> f (Maybe Text))
-> InstancePortInfo -> f InstancePortInfo
instancePortInfo_accessFrom = (InstancePortInfo -> Maybe Text)
-> (InstancePortInfo -> Maybe Text -> InstancePortInfo)
-> Lens InstancePortInfo InstancePortInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancePortInfo' {Maybe Text
accessFrom :: Maybe Text
$sel:accessFrom:InstancePortInfo' :: InstancePortInfo -> Maybe Text
accessFrom} -> Maybe Text
accessFrom) (\s :: InstancePortInfo
s@InstancePortInfo' {} Maybe Text
a -> InstancePortInfo
s {$sel:accessFrom:InstancePortInfo' :: Maybe Text
accessFrom = Maybe Text
a} :: InstancePortInfo)
instance Core.FromJSON InstancePortInfo where
parseJSON :: Value -> Parser InstancePortInfo
parseJSON =
String
-> (Object -> Parser InstancePortInfo)
-> Value
-> Parser InstancePortInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstancePortInfo"
( \Object
x ->
Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo
InstancePortInfo'
(Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe Int)
-> Parser
(Maybe [Text]
-> Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
forall (f :: * -> *) a b. Functor 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
"fromPort")
Parser
(Maybe [Text]
-> Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cidrs" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe Text
-> Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe Text)
-> Parser
(Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
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
"commonName")
Parser
(Maybe NetworkProtocol
-> Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe NetworkProtocol)
-> Parser
(Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkProtocol)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"protocol")
Parser
(Maybe [Text]
-> Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe [Text])
-> Parser
(Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"cidrListAliases"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe [Text]
-> Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe [Text])
-> Parser
(Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ipv6Cidrs" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe AccessDirection
-> Maybe PortAccessType
-> Maybe Int
-> Maybe Text
-> InstancePortInfo)
-> Parser (Maybe AccessDirection)
-> Parser
(Maybe PortAccessType
-> Maybe Int -> Maybe Text -> InstancePortInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe AccessDirection)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accessDirection")
Parser
(Maybe PortAccessType
-> Maybe Int -> Maybe Text -> InstancePortInfo)
-> Parser (Maybe PortAccessType)
-> Parser (Maybe Int -> Maybe Text -> InstancePortInfo)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PortAccessType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accessType")
Parser (Maybe Int -> Maybe Text -> InstancePortInfo)
-> Parser (Maybe Int) -> Parser (Maybe Text -> InstancePortInfo)
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
"toPort")
Parser (Maybe Text -> InstancePortInfo)
-> Parser (Maybe Text) -> Parser InstancePortInfo
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
"accessFrom")
)
instance Prelude.Hashable InstancePortInfo
instance Prelude.NFData InstancePortInfo