{-# 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.WorkMail.Types.DnsRecord 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 DnsRecord = DnsRecord'
{
DnsRecord -> Maybe Text
hostname :: Prelude.Maybe Prelude.Text,
DnsRecord -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
DnsRecord -> Maybe Text
value :: Prelude.Maybe Prelude.Text
}
deriving (DnsRecord -> DnsRecord -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DnsRecord -> DnsRecord -> Bool
$c/= :: DnsRecord -> DnsRecord -> Bool
== :: DnsRecord -> DnsRecord -> Bool
$c== :: DnsRecord -> DnsRecord -> Bool
Prelude.Eq, ReadPrec [DnsRecord]
ReadPrec DnsRecord
Int -> ReadS DnsRecord
ReadS [DnsRecord]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DnsRecord]
$creadListPrec :: ReadPrec [DnsRecord]
readPrec :: ReadPrec DnsRecord
$creadPrec :: ReadPrec DnsRecord
readList :: ReadS [DnsRecord]
$creadList :: ReadS [DnsRecord]
readsPrec :: Int -> ReadS DnsRecord
$creadsPrec :: Int -> ReadS DnsRecord
Prelude.Read, Int -> DnsRecord -> ShowS
[DnsRecord] -> ShowS
DnsRecord -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DnsRecord] -> ShowS
$cshowList :: [DnsRecord] -> ShowS
show :: DnsRecord -> String
$cshow :: DnsRecord -> String
showsPrec :: Int -> DnsRecord -> ShowS
$cshowsPrec :: Int -> DnsRecord -> ShowS
Prelude.Show, forall x. Rep DnsRecord x -> DnsRecord
forall x. DnsRecord -> Rep DnsRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DnsRecord x -> DnsRecord
$cfrom :: forall x. DnsRecord -> Rep DnsRecord x
Prelude.Generic)
newDnsRecord ::
DnsRecord
newDnsRecord :: DnsRecord
newDnsRecord =
DnsRecord'
{ $sel:hostname:DnsRecord' :: Maybe Text
hostname = forall a. Maybe a
Prelude.Nothing,
$sel:type':DnsRecord' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing,
$sel:value:DnsRecord' :: Maybe Text
value = forall a. Maybe a
Prelude.Nothing
}
dnsRecord_hostname :: Lens.Lens' DnsRecord (Prelude.Maybe Prelude.Text)
dnsRecord_hostname :: Lens' DnsRecord (Maybe Text)
dnsRecord_hostname = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DnsRecord' {Maybe Text
hostname :: Maybe Text
$sel:hostname:DnsRecord' :: DnsRecord -> Maybe Text
hostname} -> Maybe Text
hostname) (\s :: DnsRecord
s@DnsRecord' {} Maybe Text
a -> DnsRecord
s {$sel:hostname:DnsRecord' :: Maybe Text
hostname = Maybe Text
a} :: DnsRecord)
dnsRecord_type :: Lens.Lens' DnsRecord (Prelude.Maybe Prelude.Text)
dnsRecord_type :: Lens' DnsRecord (Maybe Text)
dnsRecord_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DnsRecord' {Maybe Text
type' :: Maybe Text
$sel:type':DnsRecord' :: DnsRecord -> Maybe Text
type'} -> Maybe Text
type') (\s :: DnsRecord
s@DnsRecord' {} Maybe Text
a -> DnsRecord
s {$sel:type':DnsRecord' :: Maybe Text
type' = Maybe Text
a} :: DnsRecord)
dnsRecord_value :: Lens.Lens' DnsRecord (Prelude.Maybe Prelude.Text)
dnsRecord_value :: Lens' DnsRecord (Maybe Text)
dnsRecord_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DnsRecord' {Maybe Text
value :: Maybe Text
$sel:value:DnsRecord' :: DnsRecord -> Maybe Text
value} -> Maybe Text
value) (\s :: DnsRecord
s@DnsRecord' {} Maybe Text
a -> DnsRecord
s {$sel:value:DnsRecord' :: Maybe Text
value = Maybe Text
a} :: DnsRecord)
instance Data.FromJSON DnsRecord where
parseJSON :: Value -> Parser DnsRecord
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DnsRecord"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> DnsRecord
DnsRecord'
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
"Hostname")
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
"Type")
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
"Value")
)
instance Prelude.Hashable DnsRecord where
hashWithSalt :: Int -> DnsRecord -> Int
hashWithSalt Int
_salt DnsRecord' {Maybe Text
value :: Maybe Text
type' :: Maybe Text
hostname :: Maybe Text
$sel:value:DnsRecord' :: DnsRecord -> Maybe Text
$sel:type':DnsRecord' :: DnsRecord -> Maybe Text
$sel:hostname:DnsRecord' :: DnsRecord -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hostname
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
value
instance Prelude.NFData DnsRecord where
rnf :: DnsRecord -> ()
rnf DnsRecord' {Maybe Text
value :: Maybe Text
type' :: Maybe Text
hostname :: Maybe Text
$sel:value:DnsRecord' :: DnsRecord -> Maybe Text
$sel:type':DnsRecord' :: DnsRecord -> Maybe Text
$sel:hostname:DnsRecord' :: DnsRecord -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hostname
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
value