{-# 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.CertificateManager.Types.ResourceRecord where
import Amazonka.CertificateManager.Types.RecordType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceRecord = ResourceRecord'
{
ResourceRecord -> Text
name :: Prelude.Text,
ResourceRecord -> RecordType
type' :: RecordType,
ResourceRecord -> Text
value :: Prelude.Text
}
deriving (ResourceRecord -> ResourceRecord -> Bool
(ResourceRecord -> ResourceRecord -> Bool)
-> (ResourceRecord -> ResourceRecord -> Bool) -> Eq ResourceRecord
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceRecord -> ResourceRecord -> Bool
$c/= :: ResourceRecord -> ResourceRecord -> Bool
== :: ResourceRecord -> ResourceRecord -> Bool
$c== :: ResourceRecord -> ResourceRecord -> Bool
Prelude.Eq, ReadPrec [ResourceRecord]
ReadPrec ResourceRecord
Int -> ReadS ResourceRecord
ReadS [ResourceRecord]
(Int -> ReadS ResourceRecord)
-> ReadS [ResourceRecord]
-> ReadPrec ResourceRecord
-> ReadPrec [ResourceRecord]
-> Read ResourceRecord
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceRecord]
$creadListPrec :: ReadPrec [ResourceRecord]
readPrec :: ReadPrec ResourceRecord
$creadPrec :: ReadPrec ResourceRecord
readList :: ReadS [ResourceRecord]
$creadList :: ReadS [ResourceRecord]
readsPrec :: Int -> ReadS ResourceRecord
$creadsPrec :: Int -> ReadS ResourceRecord
Prelude.Read, Int -> ResourceRecord -> ShowS
[ResourceRecord] -> ShowS
ResourceRecord -> String
(Int -> ResourceRecord -> ShowS)
-> (ResourceRecord -> String)
-> ([ResourceRecord] -> ShowS)
-> Show ResourceRecord
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceRecord] -> ShowS
$cshowList :: [ResourceRecord] -> ShowS
show :: ResourceRecord -> String
$cshow :: ResourceRecord -> String
showsPrec :: Int -> ResourceRecord -> ShowS
$cshowsPrec :: Int -> ResourceRecord -> ShowS
Prelude.Show, (forall x. ResourceRecord -> Rep ResourceRecord x)
-> (forall x. Rep ResourceRecord x -> ResourceRecord)
-> Generic ResourceRecord
forall x. Rep ResourceRecord x -> ResourceRecord
forall x. ResourceRecord -> Rep ResourceRecord x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceRecord x -> ResourceRecord
$cfrom :: forall x. ResourceRecord -> Rep ResourceRecord x
Prelude.Generic)
newResourceRecord ::
Prelude.Text ->
RecordType ->
Prelude.Text ->
ResourceRecord
newResourceRecord :: Text -> RecordType -> Text -> ResourceRecord
newResourceRecord Text
pName_ RecordType
pType_ Text
pValue_ =
ResourceRecord' :: Text -> RecordType -> Text -> ResourceRecord
ResourceRecord'
{ $sel:name:ResourceRecord' :: Text
name = Text
pName_,
$sel:type':ResourceRecord' :: RecordType
type' = RecordType
pType_,
$sel:value:ResourceRecord' :: Text
value = Text
pValue_
}
resourceRecord_name :: Lens.Lens' ResourceRecord Prelude.Text
resourceRecord_name :: (Text -> f Text) -> ResourceRecord -> f ResourceRecord
resourceRecord_name = (ResourceRecord -> Text)
-> (ResourceRecord -> Text -> ResourceRecord)
-> Lens ResourceRecord ResourceRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceRecord' {Text
name :: Text
$sel:name:ResourceRecord' :: ResourceRecord -> Text
name} -> Text
name) (\s :: ResourceRecord
s@ResourceRecord' {} Text
a -> ResourceRecord
s {$sel:name:ResourceRecord' :: Text
name = Text
a} :: ResourceRecord)
resourceRecord_type :: Lens.Lens' ResourceRecord RecordType
resourceRecord_type :: (RecordType -> f RecordType) -> ResourceRecord -> f ResourceRecord
resourceRecord_type = (ResourceRecord -> RecordType)
-> (ResourceRecord -> RecordType -> ResourceRecord)
-> Lens ResourceRecord ResourceRecord RecordType RecordType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceRecord' {RecordType
type' :: RecordType
$sel:type':ResourceRecord' :: ResourceRecord -> RecordType
type'} -> RecordType
type') (\s :: ResourceRecord
s@ResourceRecord' {} RecordType
a -> ResourceRecord
s {$sel:type':ResourceRecord' :: RecordType
type' = RecordType
a} :: ResourceRecord)
resourceRecord_value :: Lens.Lens' ResourceRecord Prelude.Text
resourceRecord_value :: (Text -> f Text) -> ResourceRecord -> f ResourceRecord
resourceRecord_value = (ResourceRecord -> Text)
-> (ResourceRecord -> Text -> ResourceRecord)
-> Lens ResourceRecord ResourceRecord Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceRecord' {Text
value :: Text
$sel:value:ResourceRecord' :: ResourceRecord -> Text
value} -> Text
value) (\s :: ResourceRecord
s@ResourceRecord' {} Text
a -> ResourceRecord
s {$sel:value:ResourceRecord' :: Text
value = Text
a} :: ResourceRecord)
instance Core.FromJSON ResourceRecord where
parseJSON :: Value -> Parser ResourceRecord
parseJSON =
String
-> (Object -> Parser ResourceRecord)
-> Value
-> Parser ResourceRecord
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceRecord"
( \Object
x ->
Text -> RecordType -> Text -> ResourceRecord
ResourceRecord'
(Text -> RecordType -> Text -> ResourceRecord)
-> Parser Text -> Parser (RecordType -> Text -> ResourceRecord)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser (RecordType -> Text -> ResourceRecord)
-> Parser RecordType -> Parser (Text -> ResourceRecord)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser RecordType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Type")
Parser (Text -> ResourceRecord)
-> Parser Text -> Parser ResourceRecord
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Value")
)
instance Prelude.Hashable ResourceRecord
instance Prelude.NFData ResourceRecord