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