{-# 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.QuickSight.Types.TwitterParameters where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data =
{
:: Prelude.Text,
:: Prelude.Natural
}
deriving (TwitterParameters -> TwitterParameters -> Bool
(TwitterParameters -> TwitterParameters -> Bool)
-> (TwitterParameters -> TwitterParameters -> Bool)
-> Eq TwitterParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TwitterParameters -> TwitterParameters -> Bool
$c/= :: TwitterParameters -> TwitterParameters -> Bool
== :: TwitterParameters -> TwitterParameters -> Bool
$c== :: TwitterParameters -> TwitterParameters -> Bool
Prelude.Eq, ReadPrec [TwitterParameters]
ReadPrec TwitterParameters
Int -> ReadS TwitterParameters
ReadS [TwitterParameters]
(Int -> ReadS TwitterParameters)
-> ReadS [TwitterParameters]
-> ReadPrec TwitterParameters
-> ReadPrec [TwitterParameters]
-> Read TwitterParameters
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TwitterParameters]
$creadListPrec :: ReadPrec [TwitterParameters]
readPrec :: ReadPrec TwitterParameters
$creadPrec :: ReadPrec TwitterParameters
readList :: ReadS [TwitterParameters]
$creadList :: ReadS [TwitterParameters]
readsPrec :: Int -> ReadS TwitterParameters
$creadsPrec :: Int -> ReadS TwitterParameters
Prelude.Read, Int -> TwitterParameters -> ShowS
[TwitterParameters] -> ShowS
TwitterParameters -> String
(Int -> TwitterParameters -> ShowS)
-> (TwitterParameters -> String)
-> ([TwitterParameters] -> ShowS)
-> Show TwitterParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TwitterParameters] -> ShowS
$cshowList :: [TwitterParameters] -> ShowS
show :: TwitterParameters -> String
$cshow :: TwitterParameters -> String
showsPrec :: Int -> TwitterParameters -> ShowS
$cshowsPrec :: Int -> TwitterParameters -> ShowS
Prelude.Show, (forall x. TwitterParameters -> Rep TwitterParameters x)
-> (forall x. Rep TwitterParameters x -> TwitterParameters)
-> Generic TwitterParameters
forall x. Rep TwitterParameters x -> TwitterParameters
forall x. TwitterParameters -> Rep TwitterParameters x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TwitterParameters x -> TwitterParameters
$cfrom :: forall x. TwitterParameters -> Rep TwitterParameters x
Prelude.Generic)
newTwitterParameters ::
Prelude.Text ->
Prelude.Natural ->
TwitterParameters
Text
pQuery_ Natural
pMaxRows_ =
TwitterParameters' :: Text -> Natural -> TwitterParameters
TwitterParameters'
{ $sel:query:TwitterParameters' :: Text
query = Text
pQuery_,
$sel:maxRows:TwitterParameters' :: Natural
maxRows = Natural
pMaxRows_
}
twitterParameters_query :: Lens.Lens' TwitterParameters Prelude.Text
= (TwitterParameters -> Text)
-> (TwitterParameters -> Text -> TwitterParameters)
-> Lens TwitterParameters TwitterParameters Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TwitterParameters' {Text
query :: Text
$sel:query:TwitterParameters' :: TwitterParameters -> Text
query} -> Text
query) (\s :: TwitterParameters
s@TwitterParameters' {} Text
a -> TwitterParameters
s {$sel:query:TwitterParameters' :: Text
query = Text
a} :: TwitterParameters)
twitterParameters_maxRows :: Lens.Lens' TwitterParameters Prelude.Natural
= (TwitterParameters -> Natural)
-> (TwitterParameters -> Natural -> TwitterParameters)
-> Lens TwitterParameters TwitterParameters Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TwitterParameters' {Natural
maxRows :: Natural
$sel:maxRows:TwitterParameters' :: TwitterParameters -> Natural
maxRows} -> Natural
maxRows) (\s :: TwitterParameters
s@TwitterParameters' {} Natural
a -> TwitterParameters
s {$sel:maxRows:TwitterParameters' :: Natural
maxRows = Natural
a} :: TwitterParameters)
instance Core.FromJSON TwitterParameters where
parseJSON :: Value -> Parser TwitterParameters
parseJSON =
String
-> (Object -> Parser TwitterParameters)
-> Value
-> Parser TwitterParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TwitterParameters"
( \Object
x ->
Text -> Natural -> TwitterParameters
TwitterParameters'
(Text -> Natural -> TwitterParameters)
-> Parser Text -> Parser (Natural -> TwitterParameters)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Query")
Parser (Natural -> TwitterParameters)
-> Parser Natural -> Parser TwitterParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MaxRows")
)
instance Prelude.Hashable TwitterParameters
instance Prelude.NFData TwitterParameters
instance Core.ToJSON TwitterParameters where
toJSON :: TwitterParameters -> Value
toJSON TwitterParameters' {Natural
Text
maxRows :: Natural
query :: Text
$sel:maxRows:TwitterParameters' :: TwitterParameters -> Natural
$sel:query:TwitterParameters' :: TwitterParameters -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Query" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
query),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MaxRows" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
maxRows)
]
)