{-# 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.NetworkFirewall.Types.Address 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 Address = Address'
{
Address -> Text
addressDefinition :: Prelude.Text
}
deriving (Address -> Address -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Address -> Address -> Bool
$c/= :: Address -> Address -> Bool
== :: Address -> Address -> Bool
$c== :: Address -> Address -> Bool
Prelude.Eq, ReadPrec [Address]
ReadPrec Address
Int -> ReadS Address
ReadS [Address]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Address]
$creadListPrec :: ReadPrec [Address]
readPrec :: ReadPrec Address
$creadPrec :: ReadPrec Address
readList :: ReadS [Address]
$creadList :: ReadS [Address]
readsPrec :: Int -> ReadS Address
$creadsPrec :: Int -> ReadS Address
Prelude.Read, Int -> Address -> ShowS
[Address] -> ShowS
Address -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Address] -> ShowS
$cshowList :: [Address] -> ShowS
show :: Address -> String
$cshow :: Address -> String
showsPrec :: Int -> Address -> ShowS
$cshowsPrec :: Int -> Address -> ShowS
Prelude.Show, forall x. Rep Address x -> Address
forall x. Address -> Rep Address x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Address x -> Address
$cfrom :: forall x. Address -> Rep Address x
Prelude.Generic)
newAddress ::
Prelude.Text ->
Address
newAddress :: Text -> Address
newAddress Text
pAddressDefinition_ =
Address' {$sel:addressDefinition:Address' :: Text
addressDefinition = Text
pAddressDefinition_}
address_addressDefinition :: Lens.Lens' Address Prelude.Text
address_addressDefinition :: Lens' Address Text
address_addressDefinition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Address' {Text
addressDefinition :: Text
$sel:addressDefinition:Address' :: Address -> Text
addressDefinition} -> Text
addressDefinition) (\s :: Address
s@Address' {} Text
a -> Address
s {$sel:addressDefinition:Address' :: Text
addressDefinition = Text
a} :: Address)
instance Data.FromJSON Address where
parseJSON :: Value -> Parser Address
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Address"
( \Object
x ->
Text -> Address
Address' 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
"AddressDefinition")
)
instance Prelude.Hashable Address where
hashWithSalt :: Int -> Address -> Int
hashWithSalt Int
_salt Address' {Text
addressDefinition :: Text
$sel:addressDefinition:Address' :: Address -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
addressDefinition
instance Prelude.NFData Address where
rnf :: Address -> ()
rnf Address' {Text
addressDefinition :: Text
$sel:addressDefinition:Address' :: Address -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
addressDefinition
instance Data.ToJSON Address where
toJSON :: Address -> Value
toJSON Address' {Text
addressDefinition :: Text
$sel:addressDefinition:Address' :: Address -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"AddressDefinition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
addressDefinition)
]
)