{-# 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.StorageGateway.Types.EndpointNetworkConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EndpointNetworkConfiguration = EndpointNetworkConfiguration'
{
EndpointNetworkConfiguration -> Maybe [Text]
ipAddresses :: Prelude.Maybe [Prelude.Text]
}
deriving (EndpointNetworkConfiguration
-> EndpointNetworkConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointNetworkConfiguration
-> EndpointNetworkConfiguration -> Bool
$c/= :: EndpointNetworkConfiguration
-> EndpointNetworkConfiguration -> Bool
== :: EndpointNetworkConfiguration
-> EndpointNetworkConfiguration -> Bool
$c== :: EndpointNetworkConfiguration
-> EndpointNetworkConfiguration -> Bool
Prelude.Eq, ReadPrec [EndpointNetworkConfiguration]
ReadPrec EndpointNetworkConfiguration
Int -> ReadS EndpointNetworkConfiguration
ReadS [EndpointNetworkConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointNetworkConfiguration]
$creadListPrec :: ReadPrec [EndpointNetworkConfiguration]
readPrec :: ReadPrec EndpointNetworkConfiguration
$creadPrec :: ReadPrec EndpointNetworkConfiguration
readList :: ReadS [EndpointNetworkConfiguration]
$creadList :: ReadS [EndpointNetworkConfiguration]
readsPrec :: Int -> ReadS EndpointNetworkConfiguration
$creadsPrec :: Int -> ReadS EndpointNetworkConfiguration
Prelude.Read, Int -> EndpointNetworkConfiguration -> ShowS
[EndpointNetworkConfiguration] -> ShowS
EndpointNetworkConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointNetworkConfiguration] -> ShowS
$cshowList :: [EndpointNetworkConfiguration] -> ShowS
show :: EndpointNetworkConfiguration -> String
$cshow :: EndpointNetworkConfiguration -> String
showsPrec :: Int -> EndpointNetworkConfiguration -> ShowS
$cshowsPrec :: Int -> EndpointNetworkConfiguration -> ShowS
Prelude.Show, forall x.
Rep EndpointNetworkConfiguration x -> EndpointNetworkConfiguration
forall x.
EndpointNetworkConfiguration -> Rep EndpointNetworkConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EndpointNetworkConfiguration x -> EndpointNetworkConfiguration
$cfrom :: forall x.
EndpointNetworkConfiguration -> Rep EndpointNetworkConfiguration x
Prelude.Generic)
newEndpointNetworkConfiguration ::
EndpointNetworkConfiguration
newEndpointNetworkConfiguration :: EndpointNetworkConfiguration
newEndpointNetworkConfiguration =
EndpointNetworkConfiguration'
{ $sel:ipAddresses:EndpointNetworkConfiguration' :: Maybe [Text]
ipAddresses =
forall a. Maybe a
Prelude.Nothing
}
endpointNetworkConfiguration_ipAddresses :: Lens.Lens' EndpointNetworkConfiguration (Prelude.Maybe [Prelude.Text])
endpointNetworkConfiguration_ipAddresses :: Lens' EndpointNetworkConfiguration (Maybe [Text])
endpointNetworkConfiguration_ipAddresses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointNetworkConfiguration' {Maybe [Text]
ipAddresses :: Maybe [Text]
$sel:ipAddresses:EndpointNetworkConfiguration' :: EndpointNetworkConfiguration -> Maybe [Text]
ipAddresses} -> Maybe [Text]
ipAddresses) (\s :: EndpointNetworkConfiguration
s@EndpointNetworkConfiguration' {} Maybe [Text]
a -> EndpointNetworkConfiguration
s {$sel:ipAddresses:EndpointNetworkConfiguration' :: Maybe [Text]
ipAddresses = Maybe [Text]
a} :: EndpointNetworkConfiguration) 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 EndpointNetworkConfiguration where
parseJSON :: Value -> Parser EndpointNetworkConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EndpointNetworkConfiguration"
( \Object
x ->
Maybe [Text] -> EndpointNetworkConfiguration
EndpointNetworkConfiguration'
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
"IpAddresses" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance
Prelude.Hashable
EndpointNetworkConfiguration
where
hashWithSalt :: Int -> EndpointNetworkConfiguration -> Int
hashWithSalt Int
_salt EndpointNetworkConfiguration' {Maybe [Text]
ipAddresses :: Maybe [Text]
$sel:ipAddresses:EndpointNetworkConfiguration' :: EndpointNetworkConfiguration -> Maybe [Text]
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
ipAddresses
instance Prelude.NFData EndpointNetworkConfiguration where
rnf :: EndpointNetworkConfiguration -> ()
rnf EndpointNetworkConfiguration' {Maybe [Text]
ipAddresses :: Maybe [Text]
$sel:ipAddresses:EndpointNetworkConfiguration' :: EndpointNetworkConfiguration -> Maybe [Text]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
ipAddresses
instance Data.ToJSON EndpointNetworkConfiguration where
toJSON :: EndpointNetworkConfiguration -> Value
toJSON EndpointNetworkConfiguration' {Maybe [Text]
ipAddresses :: Maybe [Text]
$sel:ipAddresses:EndpointNetworkConfiguration' :: EndpointNetworkConfiguration -> Maybe [Text]
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"IpAddresses" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
ipAddresses]
)