{-# 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.SegmentsResponse 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.SegmentResponse
import qualified Amazonka.Prelude as Prelude
data SegmentsResponse = SegmentsResponse'
{
SegmentsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
SegmentsResponse -> [SegmentResponse]
item :: [SegmentResponse]
}
deriving (SegmentsResponse -> SegmentsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentsResponse -> SegmentsResponse -> Bool
$c/= :: SegmentsResponse -> SegmentsResponse -> Bool
== :: SegmentsResponse -> SegmentsResponse -> Bool
$c== :: SegmentsResponse -> SegmentsResponse -> Bool
Prelude.Eq, ReadPrec [SegmentsResponse]
ReadPrec SegmentsResponse
Int -> ReadS SegmentsResponse
ReadS [SegmentsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentsResponse]
$creadListPrec :: ReadPrec [SegmentsResponse]
readPrec :: ReadPrec SegmentsResponse
$creadPrec :: ReadPrec SegmentsResponse
readList :: ReadS [SegmentsResponse]
$creadList :: ReadS [SegmentsResponse]
readsPrec :: Int -> ReadS SegmentsResponse
$creadsPrec :: Int -> ReadS SegmentsResponse
Prelude.Read, Int -> SegmentsResponse -> ShowS
[SegmentsResponse] -> ShowS
SegmentsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentsResponse] -> ShowS
$cshowList :: [SegmentsResponse] -> ShowS
show :: SegmentsResponse -> String
$cshow :: SegmentsResponse -> String
showsPrec :: Int -> SegmentsResponse -> ShowS
$cshowsPrec :: Int -> SegmentsResponse -> ShowS
Prelude.Show, forall x. Rep SegmentsResponse x -> SegmentsResponse
forall x. SegmentsResponse -> Rep SegmentsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentsResponse x -> SegmentsResponse
$cfrom :: forall x. SegmentsResponse -> Rep SegmentsResponse x
Prelude.Generic)
newSegmentsResponse ::
SegmentsResponse
newSegmentsResponse :: SegmentsResponse
newSegmentsResponse =
SegmentsResponse'
{ $sel:nextToken:SegmentsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:item:SegmentsResponse' :: [SegmentResponse]
item = forall a. Monoid a => a
Prelude.mempty
}
segmentsResponse_nextToken :: Lens.Lens' SegmentsResponse (Prelude.Maybe Prelude.Text)
segmentsResponse_nextToken :: Lens' SegmentsResponse (Maybe Text)
segmentsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SegmentsResponse' :: SegmentsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SegmentsResponse
s@SegmentsResponse' {} Maybe Text
a -> SegmentsResponse
s {$sel:nextToken:SegmentsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SegmentsResponse)
segmentsResponse_item :: Lens.Lens' SegmentsResponse [SegmentResponse]
segmentsResponse_item :: Lens' SegmentsResponse [SegmentResponse]
segmentsResponse_item = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentsResponse' {[SegmentResponse]
item :: [SegmentResponse]
$sel:item:SegmentsResponse' :: SegmentsResponse -> [SegmentResponse]
item} -> [SegmentResponse]
item) (\s :: SegmentsResponse
s@SegmentsResponse' {} [SegmentResponse]
a -> SegmentsResponse
s {$sel:item:SegmentsResponse' :: [SegmentResponse]
item = [SegmentResponse]
a} :: SegmentsResponse) 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 SegmentsResponse where
parseJSON :: Value -> Parser SegmentsResponse
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SegmentsResponse"
( \Object
x ->
Maybe Text -> [SegmentResponse] -> SegmentsResponse
SegmentsResponse'
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 SegmentsResponse where
hashWithSalt :: Int -> SegmentsResponse -> Int
hashWithSalt Int
_salt SegmentsResponse' {[SegmentResponse]
Maybe Text
item :: [SegmentResponse]
nextToken :: Maybe Text
$sel:item:SegmentsResponse' :: SegmentsResponse -> [SegmentResponse]
$sel:nextToken:SegmentsResponse' :: SegmentsResponse -> 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` [SegmentResponse]
item
instance Prelude.NFData SegmentsResponse where
rnf :: SegmentsResponse -> ()
rnf SegmentsResponse' {[SegmentResponse]
Maybe Text
item :: [SegmentResponse]
nextToken :: Maybe Text
$sel:item:SegmentsResponse' :: SegmentsResponse -> [SegmentResponse]
$sel:nextToken:SegmentsResponse' :: SegmentsResponse -> 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 [SegmentResponse]
item