{-# 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.UserContextDataType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data UserContextDataType = UserContextDataType'
{
UserContextDataType -> Maybe Text
encodedData :: Prelude.Maybe Prelude.Text
}
deriving (UserContextDataType -> UserContextDataType -> Bool
(UserContextDataType -> UserContextDataType -> Bool)
-> (UserContextDataType -> UserContextDataType -> Bool)
-> Eq UserContextDataType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserContextDataType -> UserContextDataType -> Bool
$c/= :: UserContextDataType -> UserContextDataType -> Bool
== :: UserContextDataType -> UserContextDataType -> Bool
$c== :: UserContextDataType -> UserContextDataType -> Bool
Prelude.Eq, ReadPrec [UserContextDataType]
ReadPrec UserContextDataType
Int -> ReadS UserContextDataType
ReadS [UserContextDataType]
(Int -> ReadS UserContextDataType)
-> ReadS [UserContextDataType]
-> ReadPrec UserContextDataType
-> ReadPrec [UserContextDataType]
-> Read UserContextDataType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserContextDataType]
$creadListPrec :: ReadPrec [UserContextDataType]
readPrec :: ReadPrec UserContextDataType
$creadPrec :: ReadPrec UserContextDataType
readList :: ReadS [UserContextDataType]
$creadList :: ReadS [UserContextDataType]
readsPrec :: Int -> ReadS UserContextDataType
$creadsPrec :: Int -> ReadS UserContextDataType
Prelude.Read, Int -> UserContextDataType -> ShowS
[UserContextDataType] -> ShowS
UserContextDataType -> String
(Int -> UserContextDataType -> ShowS)
-> (UserContextDataType -> String)
-> ([UserContextDataType] -> ShowS)
-> Show UserContextDataType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserContextDataType] -> ShowS
$cshowList :: [UserContextDataType] -> ShowS
show :: UserContextDataType -> String
$cshow :: UserContextDataType -> String
showsPrec :: Int -> UserContextDataType -> ShowS
$cshowsPrec :: Int -> UserContextDataType -> ShowS
Prelude.Show, (forall x. UserContextDataType -> Rep UserContextDataType x)
-> (forall x. Rep UserContextDataType x -> UserContextDataType)
-> Generic UserContextDataType
forall x. Rep UserContextDataType x -> UserContextDataType
forall x. UserContextDataType -> Rep UserContextDataType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserContextDataType x -> UserContextDataType
$cfrom :: forall x. UserContextDataType -> Rep UserContextDataType x
Prelude.Generic)
newUserContextDataType ::
UserContextDataType
newUserContextDataType :: UserContextDataType
newUserContextDataType =
UserContextDataType' :: Maybe Text -> UserContextDataType
UserContextDataType' {$sel:encodedData:UserContextDataType' :: Maybe Text
encodedData = Maybe Text
forall a. Maybe a
Prelude.Nothing}
userContextDataType_encodedData :: Lens.Lens' UserContextDataType (Prelude.Maybe Prelude.Text)
userContextDataType_encodedData :: (Maybe Text -> f (Maybe Text))
-> UserContextDataType -> f UserContextDataType
userContextDataType_encodedData = (UserContextDataType -> Maybe Text)
-> (UserContextDataType -> Maybe Text -> UserContextDataType)
-> Lens
UserContextDataType UserContextDataType (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserContextDataType' {Maybe Text
encodedData :: Maybe Text
$sel:encodedData:UserContextDataType' :: UserContextDataType -> Maybe Text
encodedData} -> Maybe Text
encodedData) (\s :: UserContextDataType
s@UserContextDataType' {} Maybe Text
a -> UserContextDataType
s {$sel:encodedData:UserContextDataType' :: Maybe Text
encodedData = Maybe Text
a} :: UserContextDataType)
instance Prelude.Hashable UserContextDataType
instance Prelude.NFData UserContextDataType
instance Core.ToJSON UserContextDataType where
toJSON :: UserContextDataType -> Value
toJSON UserContextDataType' {Maybe Text
encodedData :: Maybe Text
$sel:encodedData:UserContextDataType' :: UserContextDataType -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"EncodedData" 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
encodedData]
)