{-# 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.FMS.Types.AppsListData where
import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.App
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AppsListData = AppsListData'
{
AppsListData -> Maybe Text
listUpdateToken :: Prelude.Maybe Prelude.Text,
AppsListData -> Maybe Text
listId :: Prelude.Maybe Prelude.Text,
AppsListData -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
AppsListData -> Maybe (HashMap Text [App])
previousAppsList :: Prelude.Maybe (Prelude.HashMap Prelude.Text [App]),
AppsListData -> Maybe POSIX
createTime :: Prelude.Maybe Core.POSIX,
AppsListData -> Text
listName :: Prelude.Text,
AppsListData -> [App]
appsList :: [App]
}
deriving (AppsListData -> AppsListData -> Bool
(AppsListData -> AppsListData -> Bool)
-> (AppsListData -> AppsListData -> Bool) -> Eq AppsListData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AppsListData -> AppsListData -> Bool
$c/= :: AppsListData -> AppsListData -> Bool
== :: AppsListData -> AppsListData -> Bool
$c== :: AppsListData -> AppsListData -> Bool
Prelude.Eq, ReadPrec [AppsListData]
ReadPrec AppsListData
Int -> ReadS AppsListData
ReadS [AppsListData]
(Int -> ReadS AppsListData)
-> ReadS [AppsListData]
-> ReadPrec AppsListData
-> ReadPrec [AppsListData]
-> Read AppsListData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AppsListData]
$creadListPrec :: ReadPrec [AppsListData]
readPrec :: ReadPrec AppsListData
$creadPrec :: ReadPrec AppsListData
readList :: ReadS [AppsListData]
$creadList :: ReadS [AppsListData]
readsPrec :: Int -> ReadS AppsListData
$creadsPrec :: Int -> ReadS AppsListData
Prelude.Read, Int -> AppsListData -> ShowS
[AppsListData] -> ShowS
AppsListData -> String
(Int -> AppsListData -> ShowS)
-> (AppsListData -> String)
-> ([AppsListData] -> ShowS)
-> Show AppsListData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AppsListData] -> ShowS
$cshowList :: [AppsListData] -> ShowS
show :: AppsListData -> String
$cshow :: AppsListData -> String
showsPrec :: Int -> AppsListData -> ShowS
$cshowsPrec :: Int -> AppsListData -> ShowS
Prelude.Show, (forall x. AppsListData -> Rep AppsListData x)
-> (forall x. Rep AppsListData x -> AppsListData)
-> Generic AppsListData
forall x. Rep AppsListData x -> AppsListData
forall x. AppsListData -> Rep AppsListData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AppsListData x -> AppsListData
$cfrom :: forall x. AppsListData -> Rep AppsListData x
Prelude.Generic)
newAppsListData ::
Prelude.Text ->
AppsListData
newAppsListData :: Text -> AppsListData
newAppsListData Text
pListName_ =
AppsListData' :: Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData
AppsListData'
{ $sel:listUpdateToken:AppsListData' :: Maybe Text
listUpdateToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:listId:AppsListData' :: Maybe Text
listId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdateTime:AppsListData' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:previousAppsList:AppsListData' :: Maybe (HashMap Text [App])
previousAppsList = Maybe (HashMap Text [App])
forall a. Maybe a
Prelude.Nothing,
$sel:createTime:AppsListData' :: Maybe POSIX
createTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:listName:AppsListData' :: Text
listName = Text
pListName_,
$sel:appsList:AppsListData' :: [App]
appsList = [App]
forall a. Monoid a => a
Prelude.mempty
}
appsListData_listUpdateToken :: Lens.Lens' AppsListData (Prelude.Maybe Prelude.Text)
appsListData_listUpdateToken :: (Maybe Text -> f (Maybe Text)) -> AppsListData -> f AppsListData
appsListData_listUpdateToken = (AppsListData -> Maybe Text)
-> (AppsListData -> Maybe Text -> AppsListData)
-> Lens AppsListData AppsListData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {Maybe Text
listUpdateToken :: Maybe Text
$sel:listUpdateToken:AppsListData' :: AppsListData -> Maybe Text
listUpdateToken} -> Maybe Text
listUpdateToken) (\s :: AppsListData
s@AppsListData' {} Maybe Text
a -> AppsListData
s {$sel:listUpdateToken:AppsListData' :: Maybe Text
listUpdateToken = Maybe Text
a} :: AppsListData)
appsListData_listId :: Lens.Lens' AppsListData (Prelude.Maybe Prelude.Text)
appsListData_listId :: (Maybe Text -> f (Maybe Text)) -> AppsListData -> f AppsListData
appsListData_listId = (AppsListData -> Maybe Text)
-> (AppsListData -> Maybe Text -> AppsListData)
-> Lens AppsListData AppsListData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {Maybe Text
listId :: Maybe Text
$sel:listId:AppsListData' :: AppsListData -> Maybe Text
listId} -> Maybe Text
listId) (\s :: AppsListData
s@AppsListData' {} Maybe Text
a -> AppsListData
s {$sel:listId:AppsListData' :: Maybe Text
listId = Maybe Text
a} :: AppsListData)
appsListData_lastUpdateTime :: Lens.Lens' AppsListData (Prelude.Maybe Prelude.UTCTime)
appsListData_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AppsListData -> f AppsListData
appsListData_lastUpdateTime = (AppsListData -> Maybe POSIX)
-> (AppsListData -> Maybe POSIX -> AppsListData)
-> Lens AppsListData AppsListData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:AppsListData' :: AppsListData -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: AppsListData
s@AppsListData' {} Maybe POSIX
a -> AppsListData
s {$sel:lastUpdateTime:AppsListData' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: AppsListData) ((Maybe POSIX -> f (Maybe POSIX))
-> AppsListData -> f AppsListData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AppsListData
-> f AppsListData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
appsListData_previousAppsList :: Lens.Lens' AppsListData (Prelude.Maybe (Prelude.HashMap Prelude.Text [App]))
appsListData_previousAppsList :: (Maybe (HashMap Text [App]) -> f (Maybe (HashMap Text [App])))
-> AppsListData -> f AppsListData
appsListData_previousAppsList = (AppsListData -> Maybe (HashMap Text [App]))
-> (AppsListData -> Maybe (HashMap Text [App]) -> AppsListData)
-> Lens
AppsListData
AppsListData
(Maybe (HashMap Text [App]))
(Maybe (HashMap Text [App]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {Maybe (HashMap Text [App])
previousAppsList :: Maybe (HashMap Text [App])
$sel:previousAppsList:AppsListData' :: AppsListData -> Maybe (HashMap Text [App])
previousAppsList} -> Maybe (HashMap Text [App])
previousAppsList) (\s :: AppsListData
s@AppsListData' {} Maybe (HashMap Text [App])
a -> AppsListData
s {$sel:previousAppsList:AppsListData' :: Maybe (HashMap Text [App])
previousAppsList = Maybe (HashMap Text [App])
a} :: AppsListData) ((Maybe (HashMap Text [App]) -> f (Maybe (HashMap Text [App])))
-> AppsListData -> f AppsListData)
-> ((Maybe (HashMap Text [App]) -> f (Maybe (HashMap Text [App])))
-> Maybe (HashMap Text [App]) -> f (Maybe (HashMap Text [App])))
-> (Maybe (HashMap Text [App]) -> f (Maybe (HashMap Text [App])))
-> AppsListData
-> f AppsListData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text [App])
(HashMap Text [App])
(HashMap Text [App])
(HashMap Text [App])
-> Iso
(Maybe (HashMap Text [App]))
(Maybe (HashMap Text [App]))
(Maybe (HashMap Text [App]))
(Maybe (HashMap Text [App]))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text [App])
(HashMap Text [App])
(HashMap Text [App])
(HashMap Text [App])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
appsListData_createTime :: Lens.Lens' AppsListData (Prelude.Maybe Prelude.UTCTime)
appsListData_createTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AppsListData -> f AppsListData
appsListData_createTime = (AppsListData -> Maybe POSIX)
-> (AppsListData -> Maybe POSIX -> AppsListData)
-> Lens AppsListData AppsListData (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {Maybe POSIX
createTime :: Maybe POSIX
$sel:createTime:AppsListData' :: AppsListData -> Maybe POSIX
createTime} -> Maybe POSIX
createTime) (\s :: AppsListData
s@AppsListData' {} Maybe POSIX
a -> AppsListData
s {$sel:createTime:AppsListData' :: Maybe POSIX
createTime = Maybe POSIX
a} :: AppsListData) ((Maybe POSIX -> f (Maybe POSIX))
-> AppsListData -> f AppsListData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AppsListData
-> f AppsListData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
appsListData_listName :: Lens.Lens' AppsListData Prelude.Text
appsListData_listName :: (Text -> f Text) -> AppsListData -> f AppsListData
appsListData_listName = (AppsListData -> Text)
-> (AppsListData -> Text -> AppsListData)
-> Lens AppsListData AppsListData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {Text
listName :: Text
$sel:listName:AppsListData' :: AppsListData -> Text
listName} -> Text
listName) (\s :: AppsListData
s@AppsListData' {} Text
a -> AppsListData
s {$sel:listName:AppsListData' :: Text
listName = Text
a} :: AppsListData)
appsListData_appsList :: Lens.Lens' AppsListData [App]
appsListData_appsList :: ([App] -> f [App]) -> AppsListData -> f AppsListData
appsListData_appsList = (AppsListData -> [App])
-> (AppsListData -> [App] -> AppsListData)
-> Lens AppsListData AppsListData [App] [App]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListData' {[App]
appsList :: [App]
$sel:appsList:AppsListData' :: AppsListData -> [App]
appsList} -> [App]
appsList) (\s :: AppsListData
s@AppsListData' {} [App]
a -> AppsListData
s {$sel:appsList:AppsListData' :: [App]
appsList = [App]
a} :: AppsListData) (([App] -> f [App]) -> AppsListData -> f AppsListData)
-> (([App] -> f [App]) -> [App] -> f [App])
-> ([App] -> f [App])
-> AppsListData
-> f AppsListData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([App] -> f [App]) -> [App] -> f [App]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON AppsListData where
parseJSON :: Value -> Parser AppsListData
parseJSON =
String
-> (Object -> Parser AppsListData) -> Value -> Parser AppsListData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AppsListData"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData
AppsListData'
(Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData)
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
"ListUpdateToken")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData)
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
"ListId")
Parser
(Maybe POSIX
-> Maybe (HashMap Text [App])
-> Maybe POSIX
-> Text
-> [App]
-> AppsListData)
-> Parser (Maybe POSIX)
-> Parser
(Maybe (HashMap Text [App])
-> Maybe POSIX -> Text -> [App] -> AppsListData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LastUpdateTime")
Parser
(Maybe (HashMap Text [App])
-> Maybe POSIX -> Text -> [App] -> AppsListData)
-> Parser (Maybe (HashMap Text [App]))
-> Parser (Maybe POSIX -> Text -> [App] -> AppsListData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text [App])))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PreviousAppsList"
Parser (Maybe (Maybe (HashMap Text [App])))
-> Maybe (HashMap Text [App])
-> Parser (Maybe (HashMap Text [App]))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text [App])
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe POSIX -> Text -> [App] -> AppsListData)
-> Parser (Maybe POSIX) -> Parser (Text -> [App] -> AppsListData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreateTime")
Parser (Text -> [App] -> AppsListData)
-> Parser Text -> Parser ([App] -> AppsListData)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ListName")
Parser ([App] -> AppsListData)
-> Parser [App] -> Parser AppsListData
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [App])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AppsList" Parser (Maybe [App]) -> [App] -> Parser [App]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [App]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable AppsListData
instance Prelude.NFData AppsListData
instance Core.ToJSON AppsListData where
toJSON :: AppsListData -> Value
toJSON AppsListData' {[App]
Maybe Text
Maybe (HashMap Text [App])
Maybe POSIX
Text
appsList :: [App]
listName :: Text
createTime :: Maybe POSIX
previousAppsList :: Maybe (HashMap Text [App])
lastUpdateTime :: Maybe POSIX
listId :: Maybe Text
listUpdateToken :: Maybe Text
$sel:appsList:AppsListData' :: AppsListData -> [App]
$sel:listName:AppsListData' :: AppsListData -> Text
$sel:createTime:AppsListData' :: AppsListData -> Maybe POSIX
$sel:previousAppsList:AppsListData' :: AppsListData -> Maybe (HashMap Text [App])
$sel:lastUpdateTime:AppsListData' :: AppsListData -> Maybe POSIX
$sel:listId:AppsListData' :: AppsListData -> Maybe Text
$sel:listUpdateToken:AppsListData' :: AppsListData -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ListUpdateToken" 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
listUpdateToken,
(Text
"ListId" 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
listId,
(Text
"LastUpdateTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastUpdateTime,
(Text
"PreviousAppsList" Text -> HashMap Text [App] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text [App] -> Pair)
-> Maybe (HashMap Text [App]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text [App])
previousAppsList,
(Text
"CreateTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
createTime,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ListName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
listName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"AppsList" Text -> [App] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [App]
appsList)
]
)