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