{-# 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.QueryInfo where
import Amazonka.Config.Types.FieldInfo
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data QueryInfo = QueryInfo'
{
QueryInfo -> Maybe [FieldInfo]
selectFields :: Prelude.Maybe [FieldInfo]
}
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 [FieldInfo] -> QueryInfo
QueryInfo' {$sel:selectFields:QueryInfo' :: Maybe [FieldInfo]
selectFields = Maybe [FieldInfo]
forall a. Maybe a
Prelude.Nothing}
queryInfo_selectFields :: Lens.Lens' QueryInfo (Prelude.Maybe [FieldInfo])
queryInfo_selectFields :: (Maybe [FieldInfo] -> f (Maybe [FieldInfo]))
-> QueryInfo -> f QueryInfo
queryInfo_selectFields = (QueryInfo -> Maybe [FieldInfo])
-> (QueryInfo -> Maybe [FieldInfo] -> QueryInfo)
-> Lens QueryInfo QueryInfo (Maybe [FieldInfo]) (Maybe [FieldInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueryInfo' {Maybe [FieldInfo]
selectFields :: Maybe [FieldInfo]
$sel:selectFields:QueryInfo' :: QueryInfo -> Maybe [FieldInfo]
selectFields} -> Maybe [FieldInfo]
selectFields) (\s :: QueryInfo
s@QueryInfo' {} Maybe [FieldInfo]
a -> QueryInfo
s {$sel:selectFields:QueryInfo' :: Maybe [FieldInfo]
selectFields = Maybe [FieldInfo]
a} :: QueryInfo) ((Maybe [FieldInfo] -> f (Maybe [FieldInfo]))
-> QueryInfo -> f QueryInfo)
-> ((Maybe [FieldInfo] -> f (Maybe [FieldInfo]))
-> Maybe [FieldInfo] -> f (Maybe [FieldInfo]))
-> (Maybe [FieldInfo] -> f (Maybe [FieldInfo]))
-> QueryInfo
-> f QueryInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FieldInfo] [FieldInfo] [FieldInfo] [FieldInfo]
-> Iso
(Maybe [FieldInfo])
(Maybe [FieldInfo])
(Maybe [FieldInfo])
(Maybe [FieldInfo])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [FieldInfo] [FieldInfo] [FieldInfo] [FieldInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
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 [FieldInfo] -> QueryInfo
QueryInfo'
(Maybe [FieldInfo] -> QueryInfo)
-> Parser (Maybe [FieldInfo]) -> Parser QueryInfo
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [FieldInfo]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SelectFields" Parser (Maybe (Maybe [FieldInfo]))
-> Maybe [FieldInfo] -> Parser (Maybe [FieldInfo])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [FieldInfo]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable QueryInfo
instance Prelude.NFData QueryInfo