{-# 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.EndpointDemographic where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EndpointDemographic = EndpointDemographic'
{
EndpointDemographic -> Maybe Text
appVersion :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
make :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
model :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
modelVersion :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text
}
deriving (EndpointDemographic -> EndpointDemographic -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndpointDemographic -> EndpointDemographic -> Bool
$c/= :: EndpointDemographic -> EndpointDemographic -> Bool
== :: EndpointDemographic -> EndpointDemographic -> Bool
$c== :: EndpointDemographic -> EndpointDemographic -> Bool
Prelude.Eq, ReadPrec [EndpointDemographic]
ReadPrec EndpointDemographic
Int -> ReadS EndpointDemographic
ReadS [EndpointDemographic]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndpointDemographic]
$creadListPrec :: ReadPrec [EndpointDemographic]
readPrec :: ReadPrec EndpointDemographic
$creadPrec :: ReadPrec EndpointDemographic
readList :: ReadS [EndpointDemographic]
$creadList :: ReadS [EndpointDemographic]
readsPrec :: Int -> ReadS EndpointDemographic
$creadsPrec :: Int -> ReadS EndpointDemographic
Prelude.Read, Int -> EndpointDemographic -> ShowS
[EndpointDemographic] -> ShowS
EndpointDemographic -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndpointDemographic] -> ShowS
$cshowList :: [EndpointDemographic] -> ShowS
show :: EndpointDemographic -> String
$cshow :: EndpointDemographic -> String
showsPrec :: Int -> EndpointDemographic -> ShowS
$cshowsPrec :: Int -> EndpointDemographic -> ShowS
Prelude.Show, forall x. Rep EndpointDemographic x -> EndpointDemographic
forall x. EndpointDemographic -> Rep EndpointDemographic x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndpointDemographic x -> EndpointDemographic
$cfrom :: forall x. EndpointDemographic -> Rep EndpointDemographic x
Prelude.Generic)
newEndpointDemographic ::
EndpointDemographic
newEndpointDemographic :: EndpointDemographic
newEndpointDemographic =
EndpointDemographic'
{ $sel:appVersion:EndpointDemographic' :: Maybe Text
appVersion = forall a. Maybe a
Prelude.Nothing,
$sel:locale:EndpointDemographic' :: Maybe Text
locale = forall a. Maybe a
Prelude.Nothing,
$sel:make:EndpointDemographic' :: Maybe Text
make = forall a. Maybe a
Prelude.Nothing,
$sel:model:EndpointDemographic' :: Maybe Text
model = forall a. Maybe a
Prelude.Nothing,
$sel:modelVersion:EndpointDemographic' :: Maybe Text
modelVersion = forall a. Maybe a
Prelude.Nothing,
$sel:platform:EndpointDemographic' :: Maybe Text
platform = forall a. Maybe a
Prelude.Nothing,
$sel:platformVersion:EndpointDemographic' :: Maybe Text
platformVersion = forall a. Maybe a
Prelude.Nothing,
$sel:timezone:EndpointDemographic' :: Maybe Text
timezone = forall a. Maybe a
Prelude.Nothing
}
endpointDemographic_appVersion :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_appVersion :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_appVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
appVersion :: Maybe Text
$sel:appVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
appVersion} -> Maybe Text
appVersion) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:appVersion:EndpointDemographic' :: Maybe Text
appVersion = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_locale :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_locale :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_locale = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
locale :: Maybe Text
$sel:locale:EndpointDemographic' :: EndpointDemographic -> Maybe Text
locale} -> Maybe Text
locale) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:locale:EndpointDemographic' :: Maybe Text
locale = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_make :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_make :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_make = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
make :: Maybe Text
$sel:make:EndpointDemographic' :: EndpointDemographic -> Maybe Text
make} -> Maybe Text
make) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:make:EndpointDemographic' :: Maybe Text
make = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_model :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_model :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_model = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
model :: Maybe Text
$sel:model:EndpointDemographic' :: EndpointDemographic -> Maybe Text
model} -> Maybe Text
model) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:model:EndpointDemographic' :: Maybe Text
model = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_modelVersion :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_modelVersion :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_modelVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
modelVersion :: Maybe Text
$sel:modelVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
modelVersion} -> Maybe Text
modelVersion) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:modelVersion:EndpointDemographic' :: Maybe Text
modelVersion = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_platform :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_platform :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_platform = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
platform :: Maybe Text
$sel:platform:EndpointDemographic' :: EndpointDemographic -> Maybe Text
platform} -> Maybe Text
platform) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:platform:EndpointDemographic' :: Maybe Text
platform = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_platformVersion :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_platformVersion :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_platformVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
platformVersion :: Maybe Text
$sel:platformVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
platformVersion} -> Maybe Text
platformVersion) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:platformVersion:EndpointDemographic' :: Maybe Text
platformVersion = Maybe Text
a} :: EndpointDemographic)
endpointDemographic_timezone :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_timezone :: Lens' EndpointDemographic (Maybe Text)
endpointDemographic_timezone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndpointDemographic' {Maybe Text
timezone :: Maybe Text
$sel:timezone:EndpointDemographic' :: EndpointDemographic -> Maybe Text
timezone} -> Maybe Text
timezone) (\s :: EndpointDemographic
s@EndpointDemographic' {} Maybe Text
a -> EndpointDemographic
s {$sel:timezone:EndpointDemographic' :: Maybe Text
timezone = Maybe Text
a} :: EndpointDemographic)
instance Data.FromJSON EndpointDemographic where
parseJSON :: Value -> Parser EndpointDemographic
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EndpointDemographic"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic
EndpointDemographic'
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
"Locale")
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
"ModelVersion")
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")
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
"PlatformVersion")
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
"Timezone")
)
instance Prelude.Hashable EndpointDemographic where
hashWithSalt :: Int -> EndpointDemographic -> Int
hashWithSalt Int
_salt EndpointDemographic' {Maybe Text
timezone :: Maybe Text
platformVersion :: Maybe Text
platform :: Maybe Text
modelVersion :: Maybe Text
model :: Maybe Text
make :: Maybe Text
locale :: Maybe Text
appVersion :: Maybe Text
$sel:timezone:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platformVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platform:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:modelVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:model:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:make:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:locale:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:appVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
appVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
locale
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
make
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
model
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
modelVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platform
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
platformVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timezone
instance Prelude.NFData EndpointDemographic where
rnf :: EndpointDemographic -> ()
rnf EndpointDemographic' {Maybe Text
timezone :: Maybe Text
platformVersion :: Maybe Text
platform :: Maybe Text
modelVersion :: Maybe Text
model :: Maybe Text
make :: Maybe Text
locale :: Maybe Text
appVersion :: Maybe Text
$sel:timezone:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platformVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platform:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:modelVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:model:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:make:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:locale:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:appVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
appVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
locale
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
make
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
model
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
modelVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platform
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
platformVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timezone
instance Data.ToJSON EndpointDemographic where
toJSON :: EndpointDemographic -> Value
toJSON EndpointDemographic' {Maybe Text
timezone :: Maybe Text
platformVersion :: Maybe Text
platform :: Maybe Text
modelVersion :: Maybe Text
model :: Maybe Text
make :: Maybe Text
locale :: Maybe Text
appVersion :: Maybe Text
$sel:timezone:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platformVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platform:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:modelVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:model:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:make:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:locale:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:appVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
..} =
[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 Text
appVersion,
(Key
"Locale" 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 Text
locale,
(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 Text
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 Text
model,
(Key
"ModelVersion" 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 Text
modelVersion,
(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 Text
platform,
(Key
"PlatformVersion" 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 Text
platformVersion,
(Key
"Timezone" 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 Text
timezone
]
)