{-# 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.Pinpoint.Types.CampaignsResponse where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Pinpoint.Types.CampaignResponse
import qualified Amazonka.Prelude as Prelude
data CampaignsResponse = CampaignsResponse'
{
CampaignsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
CampaignsResponse -> [CampaignResponse]
item :: [CampaignResponse]
}
deriving (CampaignsResponse -> CampaignsResponse -> Bool
(CampaignsResponse -> CampaignsResponse -> Bool)
-> (CampaignsResponse -> CampaignsResponse -> Bool)
-> Eq CampaignsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CampaignsResponse -> CampaignsResponse -> Bool
$c/= :: CampaignsResponse -> CampaignsResponse -> Bool
== :: CampaignsResponse -> CampaignsResponse -> Bool
$c== :: CampaignsResponse -> CampaignsResponse -> Bool
Prelude.Eq, ReadPrec [CampaignsResponse]
ReadPrec CampaignsResponse
Int -> ReadS CampaignsResponse
ReadS [CampaignsResponse]
(Int -> ReadS CampaignsResponse)
-> ReadS [CampaignsResponse]
-> ReadPrec CampaignsResponse
-> ReadPrec [CampaignsResponse]
-> Read CampaignsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CampaignsResponse]
$creadListPrec :: ReadPrec [CampaignsResponse]
readPrec :: ReadPrec CampaignsResponse
$creadPrec :: ReadPrec CampaignsResponse
readList :: ReadS [CampaignsResponse]
$creadList :: ReadS [CampaignsResponse]
readsPrec :: Int -> ReadS CampaignsResponse
$creadsPrec :: Int -> ReadS CampaignsResponse
Prelude.Read, Int -> CampaignsResponse -> ShowS
[CampaignsResponse] -> ShowS
CampaignsResponse -> String
(Int -> CampaignsResponse -> ShowS)
-> (CampaignsResponse -> String)
-> ([CampaignsResponse] -> ShowS)
-> Show CampaignsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CampaignsResponse] -> ShowS
$cshowList :: [CampaignsResponse] -> ShowS
show :: CampaignsResponse -> String
$cshow :: CampaignsResponse -> String
showsPrec :: Int -> CampaignsResponse -> ShowS
$cshowsPrec :: Int -> CampaignsResponse -> ShowS
Prelude.Show, (forall x. CampaignsResponse -> Rep CampaignsResponse x)
-> (forall x. Rep CampaignsResponse x -> CampaignsResponse)
-> Generic CampaignsResponse
forall x. Rep CampaignsResponse x -> CampaignsResponse
forall x. CampaignsResponse -> Rep CampaignsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CampaignsResponse x -> CampaignsResponse
$cfrom :: forall x. CampaignsResponse -> Rep CampaignsResponse x
Prelude.Generic)
newCampaignsResponse ::
CampaignsResponse
newCampaignsResponse :: CampaignsResponse
newCampaignsResponse =
CampaignsResponse' :: Maybe Text -> [CampaignResponse] -> CampaignsResponse
CampaignsResponse'
{ $sel:nextToken:CampaignsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:item:CampaignsResponse' :: [CampaignResponse]
item = [CampaignResponse]
forall a. Monoid a => a
Prelude.mempty
}
campaignsResponse_nextToken :: Lens.Lens' CampaignsResponse (Prelude.Maybe Prelude.Text)
campaignsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> CampaignsResponse -> f CampaignsResponse
campaignsResponse_nextToken = (CampaignsResponse -> Maybe Text)
-> (CampaignsResponse -> Maybe Text -> CampaignsResponse)
-> Lens
CampaignsResponse CampaignsResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:CampaignsResponse' :: CampaignsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: CampaignsResponse
s@CampaignsResponse' {} Maybe Text
a -> CampaignsResponse
s {$sel:nextToken:CampaignsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: CampaignsResponse)
campaignsResponse_item :: Lens.Lens' CampaignsResponse [CampaignResponse]
campaignsResponse_item :: ([CampaignResponse] -> f [CampaignResponse])
-> CampaignsResponse -> f CampaignsResponse
campaignsResponse_item = (CampaignsResponse -> [CampaignResponse])
-> (CampaignsResponse -> [CampaignResponse] -> CampaignsResponse)
-> Lens
CampaignsResponse
CampaignsResponse
[CampaignResponse]
[CampaignResponse]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CampaignsResponse' {[CampaignResponse]
item :: [CampaignResponse]
$sel:item:CampaignsResponse' :: CampaignsResponse -> [CampaignResponse]
item} -> [CampaignResponse]
item) (\s :: CampaignsResponse
s@CampaignsResponse' {} [CampaignResponse]
a -> CampaignsResponse
s {$sel:item:CampaignsResponse' :: [CampaignResponse]
item = [CampaignResponse]
a} :: CampaignsResponse) (([CampaignResponse] -> f [CampaignResponse])
-> CampaignsResponse -> f CampaignsResponse)
-> (([CampaignResponse] -> f [CampaignResponse])
-> [CampaignResponse] -> f [CampaignResponse])
-> ([CampaignResponse] -> f [CampaignResponse])
-> CampaignsResponse
-> f CampaignsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CampaignResponse] -> f [CampaignResponse])
-> [CampaignResponse] -> f [CampaignResponse]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON CampaignsResponse where
parseJSON :: Value -> Parser CampaignsResponse
parseJSON =
String
-> (Object -> Parser CampaignsResponse)
-> Value
-> Parser CampaignsResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CampaignsResponse"
( \Object
x ->
Maybe Text -> [CampaignResponse] -> CampaignsResponse
CampaignsResponse'
(Maybe Text -> [CampaignResponse] -> CampaignsResponse)
-> Parser (Maybe Text)
-> Parser ([CampaignResponse] -> CampaignsResponse)
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
"NextToken")
Parser ([CampaignResponse] -> CampaignsResponse)
-> Parser [CampaignResponse] -> Parser CampaignsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [CampaignResponse])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Item" Parser (Maybe [CampaignResponse])
-> [CampaignResponse] -> Parser [CampaignResponse]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [CampaignResponse]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable CampaignsResponse
instance Prelude.NFData CampaignsResponse