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