{-# 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.SegmentDemographics 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.SetDimension
import qualified Amazonka.Prelude as Prelude
data SegmentDemographics = SegmentDemographics'
{
SegmentDemographics -> Maybe SetDimension
appVersion :: Prelude.Maybe SetDimension,
SegmentDemographics -> Maybe SetDimension
channel :: Prelude.Maybe SetDimension,
SegmentDemographics -> Maybe SetDimension
deviceType :: Prelude.Maybe SetDimension,
SegmentDemographics -> Maybe SetDimension
make :: Prelude.Maybe SetDimension,
SegmentDemographics -> Maybe SetDimension
model :: Prelude.Maybe SetDimension,
SegmentDemographics -> Maybe SetDimension
platform :: Prelude.Maybe SetDimension
}
deriving (SegmentDemographics -> SegmentDemographics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentDemographics -> SegmentDemographics -> Bool
$c/= :: SegmentDemographics -> SegmentDemographics -> Bool
== :: SegmentDemographics -> SegmentDemographics -> Bool
$c== :: SegmentDemographics -> SegmentDemographics -> Bool
Prelude.Eq, ReadPrec [SegmentDemographics]
ReadPrec SegmentDemographics
Int -> ReadS SegmentDemographics
ReadS [SegmentDemographics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentDemographics]
$creadListPrec :: ReadPrec [SegmentDemographics]
readPrec :: ReadPrec SegmentDemographics
$creadPrec :: ReadPrec SegmentDemographics
readList :: ReadS [SegmentDemographics]
$creadList :: ReadS [SegmentDemographics]
readsPrec :: Int -> ReadS SegmentDemographics
$creadsPrec :: Int -> ReadS SegmentDemographics
Prelude.Read, Int -> SegmentDemographics -> ShowS
[SegmentDemographics] -> ShowS
SegmentDemographics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentDemographics] -> ShowS
$cshowList :: [SegmentDemographics] -> ShowS
show :: SegmentDemographics -> String
$cshow :: SegmentDemographics -> String
showsPrec :: Int -> SegmentDemographics -> ShowS
$cshowsPrec :: Int -> SegmentDemographics -> ShowS
Prelude.Show, forall x. Rep SegmentDemographics x -> SegmentDemographics
forall x. SegmentDemographics -> Rep SegmentDemographics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentDemographics x -> SegmentDemographics
$cfrom :: forall x. SegmentDemographics -> Rep SegmentDemographics x
Prelude.Generic)
newSegmentDemographics ::
SegmentDemographics
newSegmentDemographics :: SegmentDemographics
newSegmentDemographics =
SegmentDemographics'
{ $sel:appVersion:SegmentDemographics' :: Maybe SetDimension
appVersion = forall a. Maybe a
Prelude.Nothing,
$sel:channel:SegmentDemographics' :: Maybe SetDimension
channel = forall a. Maybe a
Prelude.Nothing,
$sel:deviceType:SegmentDemographics' :: Maybe SetDimension
deviceType = forall a. Maybe a
Prelude.Nothing,
$sel:make:SegmentDemographics' :: Maybe SetDimension
make = forall a. Maybe a
Prelude.Nothing,
$sel:model:SegmentDemographics' :: Maybe SetDimension
model = forall a. Maybe a
Prelude.Nothing,
$sel:platform:SegmentDemographics' :: Maybe SetDimension
platform = forall a. Maybe a
Prelude.Nothing
}
segmentDemographics_appVersion :: Lens.Lens' SegmentDemographics (Prelude.Maybe SetDimension)
segmentDemographics_appVersion :: Lens' SegmentDemographics (Maybe SetDimension)
segmentDemographics_appVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentDemographics' {Maybe SetDimension
appVersion :: Maybe SetDimension
$sel:appVersion:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
appVersion} -> Maybe SetDimension
appVersion) (\s :: SegmentDemographics
s@SegmentDemographics' {} Maybe SetDimension
a -> SegmentDemographics
s {$sel:appVersion:SegmentDemographics' :: Maybe SetDimension
appVersion = Maybe SetDimension
a} :: SegmentDemographics)
segmentDemographics_channel :: Lens.Lens' SegmentDemographics (Prelude.Maybe SetDimension)
segmentDemographics_channel :: Lens' SegmentDemographics (Maybe SetDimension)
segmentDemographics_channel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentDemographics' {Maybe SetDimension
channel :: Maybe SetDimension
$sel:channel:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
channel} -> Maybe SetDimension
channel) (\s :: SegmentDemographics
s@SegmentDemographics' {} Maybe SetDimension
a -> SegmentDemographics
s {$sel:channel:SegmentDemographics' :: Maybe SetDimension
channel = Maybe SetDimension
a} :: SegmentDemographics)
segmentDemographics_deviceType :: Lens.Lens' SegmentDemographics (Prelude.Maybe SetDimension)
segmentDemographics_deviceType :: Lens' SegmentDemographics (Maybe SetDimension)
segmentDemographics_deviceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentDemographics' {Maybe SetDimension
deviceType :: Maybe SetDimension
$sel:deviceType:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
deviceType} -> Maybe SetDimension
deviceType) (\s :: SegmentDemographics
s@SegmentDemographics' {} Maybe SetDimension
a -> SegmentDemographics
s {$sel:deviceType:SegmentDemographics' :: Maybe SetDimension
deviceType = Maybe SetDimension
a} :: SegmentDemographics)
segmentDemographics_make :: Lens.Lens' SegmentDemographics (Prelude.Maybe SetDimension)
segmentDemographics_make :: Lens' SegmentDemographics (Maybe SetDimension)
segmentDemographics_make = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentDemographics' {Maybe SetDimension
make :: Maybe SetDimension
$sel:make:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
make} -> Maybe SetDimension
make) (\s :: SegmentDemographics
s@SegmentDemographics' {} Maybe SetDimension
a -> SegmentDemographics
s {$sel:make:SegmentDemographics' :: Maybe SetDimension
make = Maybe SetDimension
a} :: SegmentDemographics)
segmentDemographics_model :: Lens.Lens' SegmentDemographics (Prelude.Maybe SetDimension)
segmentDemographics_model :: Lens' SegmentDemographics (Maybe SetDimension)
segmentDemographics_model = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentDemographics' {Maybe SetDimension
model :: Maybe SetDimension
$sel:model:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
model} -> Maybe SetDimension
model) (\s :: SegmentDemographics
s@SegmentDemographics' {} Maybe SetDimension
a -> SegmentDemographics
s {$sel:model:SegmentDemographics' :: Maybe SetDimension
model = Maybe SetDimension
a} :: SegmentDemographics)
segmentDemographics_platform :: Lens.Lens' SegmentDemographics (Prelude.Maybe SetDimension)
segmentDemographics_platform :: Lens' SegmentDemographics (Maybe SetDimension)
segmentDemographics_platform = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentDemographics' {Maybe SetDimension
platform :: Maybe SetDimension
$sel:platform:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
platform} -> Maybe SetDimension
platform) (\s :: SegmentDemographics
s@SegmentDemographics' {} Maybe SetDimension
a -> SegmentDemographics
s {$sel:platform:SegmentDemographics' :: Maybe SetDimension
platform = Maybe SetDimension
a} :: SegmentDemographics)
instance Data.FromJSON SegmentDemographics where
parseJSON :: Value -> Parser SegmentDemographics
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SegmentDemographics"
( \Object
x ->
Maybe SetDimension
-> Maybe SetDimension
-> Maybe SetDimension
-> Maybe SetDimension
-> Maybe SetDimension
-> Maybe SetDimension
-> SegmentDemographics
SegmentDemographics'
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
"AppVersion")
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
"Channel")
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
"DeviceType")
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
"Make")
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
"Model")
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
"Platform")
)
instance Prelude.Hashable SegmentDemographics where
hashWithSalt :: Int -> SegmentDemographics -> Int
hashWithSalt Int
_salt SegmentDemographics' {Maybe SetDimension
platform :: Maybe SetDimension
model :: Maybe SetDimension
make :: Maybe SetDimension
deviceType :: Maybe SetDimension
channel :: Maybe SetDimension
appVersion :: Maybe SetDimension
$sel:platform:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:model:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:make:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:deviceType:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:channel:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:appVersion:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetDimension
appVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetDimension
channel
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetDimension
deviceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetDimension
make
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetDimension
model
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SetDimension
platform
instance Prelude.NFData SegmentDemographics where
rnf :: SegmentDemographics -> ()
rnf SegmentDemographics' {Maybe SetDimension
platform :: Maybe SetDimension
model :: Maybe SetDimension
make :: Maybe SetDimension
deviceType :: Maybe SetDimension
channel :: Maybe SetDimension
appVersion :: Maybe SetDimension
$sel:platform:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:model:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:make:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:deviceType:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:channel:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:appVersion:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe SetDimension
appVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SetDimension
channel
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SetDimension
deviceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SetDimension
make
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SetDimension
model
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SetDimension
platform
instance Data.ToJSON SegmentDemographics where
toJSON :: SegmentDemographics -> Value
toJSON SegmentDemographics' {Maybe SetDimension
platform :: Maybe SetDimension
model :: Maybe SetDimension
make :: Maybe SetDimension
deviceType :: Maybe SetDimension
channel :: Maybe SetDimension
appVersion :: Maybe SetDimension
$sel:platform:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:model:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:make:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:deviceType:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:channel:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
$sel:appVersion:SegmentDemographics' :: SegmentDemographics -> Maybe SetDimension
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AppVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetDimension
appVersion,
(Key
"Channel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetDimension
channel,
(Key
"DeviceType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetDimension
deviceType,
(Key
"Make" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetDimension
make,
(Key
"Model" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetDimension
model,
(Key
"Platform" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SetDimension
platform
]
)