{-# 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.InstanceNetworking where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Lightsail.Types.InstancePortInfo
import Amazonka.Lightsail.Types.MonthlyTransfer
import qualified Amazonka.Prelude as Prelude
data InstanceNetworking = InstanceNetworking'
{
InstanceNetworking -> Maybe MonthlyTransfer
monthlyTransfer :: Prelude.Maybe MonthlyTransfer,
InstanceNetworking -> Maybe [InstancePortInfo]
ports :: Prelude.Maybe [InstancePortInfo]
}
deriving (InstanceNetworking -> InstanceNetworking -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceNetworking -> InstanceNetworking -> Bool
$c/= :: InstanceNetworking -> InstanceNetworking -> Bool
== :: InstanceNetworking -> InstanceNetworking -> Bool
$c== :: InstanceNetworking -> InstanceNetworking -> Bool
Prelude.Eq, ReadPrec [InstanceNetworking]
ReadPrec InstanceNetworking
Int -> ReadS InstanceNetworking
ReadS [InstanceNetworking]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceNetworking]
$creadListPrec :: ReadPrec [InstanceNetworking]
readPrec :: ReadPrec InstanceNetworking
$creadPrec :: ReadPrec InstanceNetworking
readList :: ReadS [InstanceNetworking]
$creadList :: ReadS [InstanceNetworking]
readsPrec :: Int -> ReadS InstanceNetworking
$creadsPrec :: Int -> ReadS InstanceNetworking
Prelude.Read, Int -> InstanceNetworking -> ShowS
[InstanceNetworking] -> ShowS
InstanceNetworking -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceNetworking] -> ShowS
$cshowList :: [InstanceNetworking] -> ShowS
show :: InstanceNetworking -> String
$cshow :: InstanceNetworking -> String
showsPrec :: Int -> InstanceNetworking -> ShowS
$cshowsPrec :: Int -> InstanceNetworking -> ShowS
Prelude.Show, forall x. Rep InstanceNetworking x -> InstanceNetworking
forall x. InstanceNetworking -> Rep InstanceNetworking x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceNetworking x -> InstanceNetworking
$cfrom :: forall x. InstanceNetworking -> Rep InstanceNetworking x
Prelude.Generic)
newInstanceNetworking ::
InstanceNetworking
newInstanceNetworking :: InstanceNetworking
newInstanceNetworking =
InstanceNetworking'
{ $sel:monthlyTransfer:InstanceNetworking' :: Maybe MonthlyTransfer
monthlyTransfer =
forall a. Maybe a
Prelude.Nothing,
$sel:ports:InstanceNetworking' :: Maybe [InstancePortInfo]
ports = forall a. Maybe a
Prelude.Nothing
}
instanceNetworking_monthlyTransfer :: Lens.Lens' InstanceNetworking (Prelude.Maybe MonthlyTransfer)
instanceNetworking_monthlyTransfer :: Lens' InstanceNetworking (Maybe MonthlyTransfer)
instanceNetworking_monthlyTransfer = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworking' {Maybe MonthlyTransfer
monthlyTransfer :: Maybe MonthlyTransfer
$sel:monthlyTransfer:InstanceNetworking' :: InstanceNetworking -> Maybe MonthlyTransfer
monthlyTransfer} -> Maybe MonthlyTransfer
monthlyTransfer) (\s :: InstanceNetworking
s@InstanceNetworking' {} Maybe MonthlyTransfer
a -> InstanceNetworking
s {$sel:monthlyTransfer:InstanceNetworking' :: Maybe MonthlyTransfer
monthlyTransfer = Maybe MonthlyTransfer
a} :: InstanceNetworking)
instanceNetworking_ports :: Lens.Lens' InstanceNetworking (Prelude.Maybe [InstancePortInfo])
instanceNetworking_ports :: Lens' InstanceNetworking (Maybe [InstancePortInfo])
instanceNetworking_ports = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceNetworking' {Maybe [InstancePortInfo]
ports :: Maybe [InstancePortInfo]
$sel:ports:InstanceNetworking' :: InstanceNetworking -> Maybe [InstancePortInfo]
ports} -> Maybe [InstancePortInfo]
ports) (\s :: InstanceNetworking
s@InstanceNetworking' {} Maybe [InstancePortInfo]
a -> InstanceNetworking
s {$sel:ports:InstanceNetworking' :: Maybe [InstancePortInfo]
ports = Maybe [InstancePortInfo]
a} :: InstanceNetworking) 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 InstanceNetworking where
parseJSON :: Value -> Parser InstanceNetworking
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InstanceNetworking"
( \Object
x ->
Maybe MonthlyTransfer
-> Maybe [InstancePortInfo] -> InstanceNetworking
InstanceNetworking'
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
"monthlyTransfer")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ports" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable InstanceNetworking where
hashWithSalt :: Int -> InstanceNetworking -> Int
hashWithSalt Int
_salt InstanceNetworking' {Maybe [InstancePortInfo]
Maybe MonthlyTransfer
ports :: Maybe [InstancePortInfo]
monthlyTransfer :: Maybe MonthlyTransfer
$sel:ports:InstanceNetworking' :: InstanceNetworking -> Maybe [InstancePortInfo]
$sel:monthlyTransfer:InstanceNetworking' :: InstanceNetworking -> Maybe MonthlyTransfer
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MonthlyTransfer
monthlyTransfer
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [InstancePortInfo]
ports
instance Prelude.NFData InstanceNetworking where
rnf :: InstanceNetworking -> ()
rnf InstanceNetworking' {Maybe [InstancePortInfo]
Maybe MonthlyTransfer
ports :: Maybe [InstancePortInfo]
monthlyTransfer :: Maybe MonthlyTransfer
$sel:ports:InstanceNetworking' :: InstanceNetworking -> Maybe [InstancePortInfo]
$sel:monthlyTransfer:InstanceNetworking' :: InstanceNetworking -> Maybe MonthlyTransfer
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe MonthlyTransfer
monthlyTransfer
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [InstancePortInfo]
ports