{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:nextToken:CampaignsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:item:CampaignsResponse' :: [CampaignResponse]
item = forall a. Monoid a => a
Prelude.mempty
}
campaignsResponse_nextToken :: Lens.Lens' CampaignsResponse (Prelude.Maybe Prelude.Text)
campaignsResponse_nextToken :: Lens' CampaignsResponse (Maybe Text)
campaignsResponse_nextToken = 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 :: Lens' CampaignsResponse [CampaignResponse]
campaignsResponse_item = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Data.FromJSON CampaignsResponse where
parseJSON :: Value -> Parser CampaignsResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"CampaignsResponse"
( \Object
x ->
Maybe Text -> [CampaignResponse] -> CampaignsResponse
CampaignsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Item" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable CampaignsResponse where
hashWithSalt :: Int -> CampaignsResponse -> Int
hashWithSalt Int
_salt CampaignsResponse' {[CampaignResponse]
Maybe Text
item :: [CampaignResponse]
nextToken :: Maybe Text
$sel:item:CampaignsResponse' :: CampaignsResponse -> [CampaignResponse]
$sel:nextToken:CampaignsResponse' :: CampaignsResponse -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [CampaignResponse]
item
instance Prelude.NFData CampaignsResponse where
rnf :: CampaignsResponse -> ()
rnf CampaignsResponse' {[CampaignResponse]
Maybe Text
item :: [CampaignResponse]
nextToken :: Maybe Text
$sel:item:CampaignsResponse' :: CampaignsResponse -> [CampaignResponse]
$sel:nextToken:CampaignsResponse' :: CampaignsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [CampaignResponse]
item