{-# 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.Lens as Lens
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
(SegmentsResponse -> SegmentsResponse -> Bool)
-> (SegmentsResponse -> SegmentsResponse -> Bool)
-> Eq SegmentsResponse
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]
(Int -> ReadS SegmentsResponse)
-> ReadS [SegmentsResponse]
-> ReadPrec SegmentsResponse
-> ReadPrec [SegmentsResponse]
-> Read 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
(Int -> SegmentsResponse -> ShowS)
-> (SegmentsResponse -> String)
-> ([SegmentsResponse] -> ShowS)
-> Show SegmentsResponse
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. SegmentsResponse -> Rep SegmentsResponse x)
-> (forall x. Rep SegmentsResponse x -> SegmentsResponse)
-> Generic SegmentsResponse
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' :: Maybe Text -> [SegmentResponse] -> SegmentsResponse
SegmentsResponse'
{ $sel:nextToken:SegmentsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:item:SegmentsResponse' :: [SegmentResponse]
item = [SegmentResponse]
forall a. Monoid a => a
Prelude.mempty
}
segmentsResponse_nextToken :: Lens.Lens' SegmentsResponse (Prelude.Maybe Prelude.Text)
segmentsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> SegmentsResponse -> f SegmentsResponse
segmentsResponse_nextToken = (SegmentsResponse -> Maybe Text)
-> (SegmentsResponse -> Maybe Text -> SegmentsResponse)
-> Lens SegmentsResponse SegmentsResponse (Maybe Text) (Maybe Text)
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 :: ([SegmentResponse] -> f [SegmentResponse])
-> SegmentsResponse -> f SegmentsResponse
segmentsResponse_item = (SegmentsResponse -> [SegmentResponse])
-> (SegmentsResponse -> [SegmentResponse] -> SegmentsResponse)
-> Lens
SegmentsResponse
SegmentsResponse
[SegmentResponse]
[SegmentResponse]
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) (([SegmentResponse] -> f [SegmentResponse])
-> SegmentsResponse -> f SegmentsResponse)
-> (([SegmentResponse] -> f [SegmentResponse])
-> [SegmentResponse] -> f [SegmentResponse])
-> ([SegmentResponse] -> f [SegmentResponse])
-> SegmentsResponse
-> f SegmentsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SegmentResponse] -> f [SegmentResponse])
-> [SegmentResponse] -> f [SegmentResponse]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON SegmentsResponse where
parseJSON :: Value -> Parser SegmentsResponse
parseJSON =
String
-> (Object -> Parser SegmentsResponse)
-> Value
-> Parser SegmentsResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SegmentsResponse"
( \Object
x ->
Maybe Text -> [SegmentResponse] -> SegmentsResponse
SegmentsResponse'
(Maybe Text -> [SegmentResponse] -> SegmentsResponse)
-> Parser (Maybe Text)
-> Parser ([SegmentResponse] -> SegmentsResponse)
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 ([SegmentResponse] -> SegmentsResponse)
-> Parser [SegmentResponse] -> Parser SegmentsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [SegmentResponse])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Item" Parser (Maybe [SegmentResponse])
-> [SegmentResponse] -> Parser [SegmentResponse]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [SegmentResponse]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable SegmentsResponse
instance Prelude.NFData SegmentsResponse