{-# 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.CognitoIdentityProvider.Types.EventContextDataType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventContextDataType = EventContextDataType'
{
EventContextDataType -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
EventContextDataType -> Maybe Text
country :: Prelude.Maybe Prelude.Text,
EventContextDataType -> Maybe Text
city :: Prelude.Maybe Prelude.Text,
EventContextDataType -> Maybe Text
deviceName :: Prelude.Maybe Prelude.Text,
EventContextDataType -> Maybe Text
timezone :: Prelude.Maybe Prelude.Text
}
deriving (EventContextDataType -> EventContextDataType -> Bool
(EventContextDataType -> EventContextDataType -> Bool)
-> (EventContextDataType -> EventContextDataType -> Bool)
-> Eq EventContextDataType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventContextDataType -> EventContextDataType -> Bool
$c/= :: EventContextDataType -> EventContextDataType -> Bool
== :: EventContextDataType -> EventContextDataType -> Bool
$c== :: EventContextDataType -> EventContextDataType -> Bool
Prelude.Eq, ReadPrec [EventContextDataType]
ReadPrec EventContextDataType
Int -> ReadS EventContextDataType
ReadS [EventContextDataType]
(Int -> ReadS EventContextDataType)
-> ReadS [EventContextDataType]
-> ReadPrec EventContextDataType
-> ReadPrec [EventContextDataType]
-> Read EventContextDataType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventContextDataType]
$creadListPrec :: ReadPrec [EventContextDataType]
readPrec :: ReadPrec EventContextDataType
$creadPrec :: ReadPrec EventContextDataType
readList :: ReadS [EventContextDataType]
$creadList :: ReadS [EventContextDataType]
readsPrec :: Int -> ReadS EventContextDataType
$creadsPrec :: Int -> ReadS EventContextDataType
Prelude.Read, Int -> EventContextDataType -> ShowS
[EventContextDataType] -> ShowS
EventContextDataType -> String
(Int -> EventContextDataType -> ShowS)
-> (EventContextDataType -> String)
-> ([EventContextDataType] -> ShowS)
-> Show EventContextDataType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventContextDataType] -> ShowS
$cshowList :: [EventContextDataType] -> ShowS
show :: EventContextDataType -> String
$cshow :: EventContextDataType -> String
showsPrec :: Int -> EventContextDataType -> ShowS
$cshowsPrec :: Int -> EventContextDataType -> ShowS
Prelude.Show, (forall x. EventContextDataType -> Rep EventContextDataType x)
-> (forall x. Rep EventContextDataType x -> EventContextDataType)
-> Generic EventContextDataType
forall x. Rep EventContextDataType x -> EventContextDataType
forall x. EventContextDataType -> Rep EventContextDataType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventContextDataType x -> EventContextDataType
$cfrom :: forall x. EventContextDataType -> Rep EventContextDataType x
Prelude.Generic)
newEventContextDataType ::
EventContextDataType
newEventContextDataType :: EventContextDataType
newEventContextDataType =
EventContextDataType' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EventContextDataType
EventContextDataType'
{ $sel:ipAddress:EventContextDataType' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:country:EventContextDataType' :: Maybe Text
country = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:city:EventContextDataType' :: Maybe Text
city = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:deviceName:EventContextDataType' :: Maybe Text
deviceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timezone:EventContextDataType' :: Maybe Text
timezone = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
eventContextDataType_ipAddress :: Lens.Lens' EventContextDataType (Prelude.Maybe Prelude.Text)
eventContextDataType_ipAddress :: (Maybe Text -> f (Maybe Text))
-> EventContextDataType -> f EventContextDataType
eventContextDataType_ipAddress = (EventContextDataType -> Maybe Text)
-> (EventContextDataType -> Maybe Text -> EventContextDataType)
-> Lens
EventContextDataType EventContextDataType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventContextDataType' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:EventContextDataType' :: EventContextDataType -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: EventContextDataType
s@EventContextDataType' {} Maybe Text
a -> EventContextDataType
s {$sel:ipAddress:EventContextDataType' :: Maybe Text
ipAddress = Maybe Text
a} :: EventContextDataType)
eventContextDataType_country :: Lens.Lens' EventContextDataType (Prelude.Maybe Prelude.Text)
eventContextDataType_country :: (Maybe Text -> f (Maybe Text))
-> EventContextDataType -> f EventContextDataType
eventContextDataType_country = (EventContextDataType -> Maybe Text)
-> (EventContextDataType -> Maybe Text -> EventContextDataType)
-> Lens
EventContextDataType EventContextDataType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventContextDataType' {Maybe Text
country :: Maybe Text
$sel:country:EventContextDataType' :: EventContextDataType -> Maybe Text
country} -> Maybe Text
country) (\s :: EventContextDataType
s@EventContextDataType' {} Maybe Text
a -> EventContextDataType
s {$sel:country:EventContextDataType' :: Maybe Text
country = Maybe Text
a} :: EventContextDataType)
eventContextDataType_city :: Lens.Lens' EventContextDataType (Prelude.Maybe Prelude.Text)
eventContextDataType_city :: (Maybe Text -> f (Maybe Text))
-> EventContextDataType -> f EventContextDataType
eventContextDataType_city = (EventContextDataType -> Maybe Text)
-> (EventContextDataType -> Maybe Text -> EventContextDataType)
-> Lens
EventContextDataType EventContextDataType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventContextDataType' {Maybe Text
city :: Maybe Text
$sel:city:EventContextDataType' :: EventContextDataType -> Maybe Text
city} -> Maybe Text
city) (\s :: EventContextDataType
s@EventContextDataType' {} Maybe Text
a -> EventContextDataType
s {$sel:city:EventContextDataType' :: Maybe Text
city = Maybe Text
a} :: EventContextDataType)
eventContextDataType_deviceName :: Lens.Lens' EventContextDataType (Prelude.Maybe Prelude.Text)
eventContextDataType_deviceName :: (Maybe Text -> f (Maybe Text))
-> EventContextDataType -> f EventContextDataType
eventContextDataType_deviceName = (EventContextDataType -> Maybe Text)
-> (EventContextDataType -> Maybe Text -> EventContextDataType)
-> Lens
EventContextDataType EventContextDataType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventContextDataType' {Maybe Text
deviceName :: Maybe Text
$sel:deviceName:EventContextDataType' :: EventContextDataType -> Maybe Text
deviceName} -> Maybe Text
deviceName) (\s :: EventContextDataType
s@EventContextDataType' {} Maybe Text
a -> EventContextDataType
s {$sel:deviceName:EventContextDataType' :: Maybe Text
deviceName = Maybe Text
a} :: EventContextDataType)
eventContextDataType_timezone :: Lens.Lens' EventContextDataType (Prelude.Maybe Prelude.Text)
eventContextDataType_timezone :: (Maybe Text -> f (Maybe Text))
-> EventContextDataType -> f EventContextDataType
eventContextDataType_timezone = (EventContextDataType -> Maybe Text)
-> (EventContextDataType -> Maybe Text -> EventContextDataType)
-> Lens
EventContextDataType EventContextDataType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventContextDataType' {Maybe Text
timezone :: Maybe Text
$sel:timezone:EventContextDataType' :: EventContextDataType -> Maybe Text
timezone} -> Maybe Text
timezone) (\s :: EventContextDataType
s@EventContextDataType' {} Maybe Text
a -> EventContextDataType
s {$sel:timezone:EventContextDataType' :: Maybe Text
timezone = Maybe Text
a} :: EventContextDataType)
instance Core.FromJSON EventContextDataType where
parseJSON :: Value -> Parser EventContextDataType
parseJSON =
String
-> (Object -> Parser EventContextDataType)
-> Value
-> Parser EventContextDataType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EventContextDataType"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EventContextDataType
EventContextDataType'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> EventContextDataType)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EventContextDataType)
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
"IpAddress")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> EventContextDataType)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> EventContextDataType)
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
"Country")
Parser
(Maybe Text -> Maybe Text -> Maybe Text -> EventContextDataType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> EventContextDataType)
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
"City")
Parser (Maybe Text -> Maybe Text -> EventContextDataType)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> EventContextDataType)
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
"DeviceName")
Parser (Maybe Text -> EventContextDataType)
-> Parser (Maybe Text) -> Parser EventContextDataType
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 EventContextDataType
instance Prelude.NFData EventContextDataType