{-# 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.AuditManager.Types.URL where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data URL = URL'
{
URL -> Maybe Text
link :: Prelude.Maybe Prelude.Text,
URL -> Maybe Text
hyperlinkName :: Prelude.Maybe Prelude.Text
}
deriving (URL -> URL -> Bool
(URL -> URL -> Bool) -> (URL -> URL -> Bool) -> Eq URL
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: URL -> URL -> Bool
$c/= :: URL -> URL -> Bool
== :: URL -> URL -> Bool
$c== :: URL -> URL -> Bool
Prelude.Eq, ReadPrec [URL]
ReadPrec URL
Int -> ReadS URL
ReadS [URL]
(Int -> ReadS URL)
-> ReadS [URL] -> ReadPrec URL -> ReadPrec [URL] -> Read URL
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [URL]
$creadListPrec :: ReadPrec [URL]
readPrec :: ReadPrec URL
$creadPrec :: ReadPrec URL
readList :: ReadS [URL]
$creadList :: ReadS [URL]
readsPrec :: Int -> ReadS URL
$creadsPrec :: Int -> ReadS URL
Prelude.Read, Int -> URL -> ShowS
[URL] -> ShowS
URL -> String
(Int -> URL -> ShowS)
-> (URL -> String) -> ([URL] -> ShowS) -> Show URL
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [URL] -> ShowS
$cshowList :: [URL] -> ShowS
show :: URL -> String
$cshow :: URL -> String
showsPrec :: Int -> URL -> ShowS
$cshowsPrec :: Int -> URL -> ShowS
Prelude.Show, (forall x. URL -> Rep URL x)
-> (forall x. Rep URL x -> URL) -> Generic URL
forall x. Rep URL x -> URL
forall x. URL -> Rep URL x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep URL x -> URL
$cfrom :: forall x. URL -> Rep URL x
Prelude.Generic)
newURL ::
URL
newURL :: URL
newURL =
URL' :: Maybe Text -> Maybe Text -> URL
URL'
{ $sel:link:URL' :: Maybe Text
link = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:hyperlinkName:URL' :: Maybe Text
hyperlinkName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
url_link :: Lens.Lens' URL (Prelude.Maybe Prelude.Text)
url_link :: (Maybe Text -> f (Maybe Text)) -> URL -> f URL
url_link = (URL -> Maybe Text)
-> (URL -> Maybe Text -> URL)
-> Lens URL URL (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\URL' {Maybe Text
link :: Maybe Text
$sel:link:URL' :: URL -> Maybe Text
link} -> Maybe Text
link) (\s :: URL
s@URL' {} Maybe Text
a -> URL
s {$sel:link:URL' :: Maybe Text
link = Maybe Text
a} :: URL)
url_hyperlinkName :: Lens.Lens' URL (Prelude.Maybe Prelude.Text)
url_hyperlinkName :: (Maybe Text -> f (Maybe Text)) -> URL -> f URL
url_hyperlinkName = (URL -> Maybe Text)
-> (URL -> Maybe Text -> URL)
-> Lens URL URL (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\URL' {Maybe Text
hyperlinkName :: Maybe Text
$sel:hyperlinkName:URL' :: URL -> Maybe Text
hyperlinkName} -> Maybe Text
hyperlinkName) (\s :: URL
s@URL' {} Maybe Text
a -> URL
s {$sel:hyperlinkName:URL' :: Maybe Text
hyperlinkName = Maybe Text
a} :: URL)
instance Core.FromJSON URL where
parseJSON :: Value -> Parser URL
parseJSON =
String -> (Object -> Parser URL) -> Value -> Parser URL
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"URL"
( \Object
x ->
Maybe Text -> Maybe Text -> URL
URL'
(Maybe Text -> Maybe Text -> URL)
-> Parser (Maybe Text) -> Parser (Maybe Text -> URL)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"link")
Parser (Maybe Text -> URL) -> Parser (Maybe Text) -> Parser URL
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hyperlinkName")
)
instance Prelude.Hashable URL
instance Prelude.NFData URL