{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EndpointDemographic = EndpointDemographic'
{
EndpointDemographic -> Maybe Text
platform :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
platformVersion :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
locale :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
appVersion :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
model :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
make :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
modelVersion :: Prelude.Maybe Prelude.Text,
EndpointDemographic -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text
}
deriving (EndpointDemographic -> EndpointDemographic -> Bool
(EndpointDemographic -> EndpointDemographic -> Bool)
-> (EndpointDemographic -> EndpointDemographic -> Bool)
-> Eq EndpointDemographic
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]
(Int -> ReadS EndpointDemographic)
-> ReadS [EndpointDemographic]
-> ReadPrec EndpointDemographic
-> ReadPrec [EndpointDemographic]
-> Read 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
(Int -> EndpointDemographic -> ShowS)
-> (EndpointDemographic -> String)
-> ([EndpointDemographic] -> ShowS)
-> Show EndpointDemographic
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. EndpointDemographic -> Rep EndpointDemographic x)
-> (forall x. Rep EndpointDemographic x -> EndpointDemographic)
-> Generic EndpointDemographic
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic
EndpointDemographic'
{ $sel:platform:EndpointDemographic' :: Maybe Text
platform = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:platformVersion:EndpointDemographic' :: Maybe Text
platformVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:locale:EndpointDemographic' :: Maybe Text
locale = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:appVersion:EndpointDemographic' :: Maybe Text
appVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:model:EndpointDemographic' :: Maybe Text
model = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:make:EndpointDemographic' :: Maybe Text
make = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:modelVersion:EndpointDemographic' :: Maybe Text
modelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timezone:EndpointDemographic' :: Maybe Text
timezone = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
endpointDemographic_platform :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_platform :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_platform = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_platformVersion = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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_locale :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_locale :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_locale = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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_appVersion :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_appVersion :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_appVersion = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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_model :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_model :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_model = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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_make :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_make :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_make = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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_modelVersion :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_modelVersion :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_modelVersion = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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_timezone :: Lens.Lens' EndpointDemographic (Prelude.Maybe Prelude.Text)
endpointDemographic_timezone :: (Maybe Text -> f (Maybe Text))
-> EndpointDemographic -> f EndpointDemographic
endpointDemographic_timezone = (EndpointDemographic -> Maybe Text)
-> (EndpointDemographic -> Maybe Text -> EndpointDemographic)
-> Lens
EndpointDemographic EndpointDemographic (Maybe Text) (Maybe Text)
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 Core.FromJSON EndpointDemographic where
parseJSON :: Value -> Parser EndpointDemographic
parseJSON =
String
-> (Object -> Parser EndpointDemographic)
-> Value
-> Parser EndpointDemographic
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EndpointDemographic"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic
EndpointDemographic'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
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
"Platform")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
forall (f :: * -> *) a b. Applicative f => 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
"PlatformVersion")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
forall (f :: * -> *) a b. Applicative f => 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
"Locale")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EndpointDemographic)
forall (f :: * -> *) a b. Applicative f => 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
"AppVersion")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> EndpointDemographic)
forall (f :: * -> *) a b. Applicative f => 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
"Model")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> EndpointDemographic)
forall (f :: * -> *) a b. Applicative f => 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
"Make")
Parser (Maybe Text -> Maybe Text -> EndpointDemographic)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> EndpointDemographic)
forall (f :: * -> *) a b. Applicative f => 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
"ModelVersion")
Parser (Maybe Text -> EndpointDemographic)
-> Parser (Maybe Text) -> Parser EndpointDemographic
forall (f :: * -> *) a b. Applicative f => 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
"Timezone")
)
instance Prelude.Hashable EndpointDemographic
instance Prelude.NFData EndpointDemographic
instance Core.ToJSON EndpointDemographic where
toJSON :: EndpointDemographic -> Value
toJSON EndpointDemographic' {Maybe Text
timezone :: Maybe Text
modelVersion :: Maybe Text
make :: Maybe Text
model :: Maybe Text
appVersion :: Maybe Text
locale :: Maybe Text
platformVersion :: Maybe Text
platform :: Maybe Text
$sel:timezone:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:modelVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:make:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:model:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:appVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:locale:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platformVersion:EndpointDemographic' :: EndpointDemographic -> Maybe Text
$sel:platform:EndpointDemographic' :: EndpointDemographic -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Platform" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platform,
(Text
"PlatformVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
platformVersion,
(Text
"Locale" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
locale,
(Text
"AppVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
appVersion,
(Text
"Model" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
model,
(Text
"Make" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
make,
(Text
"ModelVersion" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
modelVersion,
(Text
"Timezone" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
timezone
]
)