{-# 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.Mobile.Types.ProjectDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Mobile.Types.ProjectState
import Amazonka.Mobile.Types.Resource
import qualified Amazonka.Prelude as Prelude
data ProjectDetails = ProjectDetails'
{ ProjectDetails -> Maybe ProjectState
state :: Prelude.Maybe ProjectState,
ProjectDetails -> Maybe [Resource]
resources :: Prelude.Maybe [Resource],
ProjectDetails -> Maybe POSIX
createdDate :: Prelude.Maybe Core.POSIX,
ProjectDetails -> Maybe Text
consoleUrl :: Prelude.Maybe Prelude.Text,
ProjectDetails -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ProjectDetails -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
ProjectDetails -> Maybe Text
projectId :: Prelude.Maybe Prelude.Text,
ProjectDetails -> Maybe POSIX
lastUpdatedDate :: Prelude.Maybe Core.POSIX
}
deriving (ProjectDetails -> ProjectDetails -> Bool
(ProjectDetails -> ProjectDetails -> Bool)
-> (ProjectDetails -> ProjectDetails -> Bool) -> Eq ProjectDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProjectDetails -> ProjectDetails -> Bool
$c/= :: ProjectDetails -> ProjectDetails -> Bool
== :: ProjectDetails -> ProjectDetails -> Bool
$c== :: ProjectDetails -> ProjectDetails -> Bool
Prelude.Eq, ReadPrec [ProjectDetails]
ReadPrec ProjectDetails
Int -> ReadS ProjectDetails
ReadS [ProjectDetails]
(Int -> ReadS ProjectDetails)
-> ReadS [ProjectDetails]
-> ReadPrec ProjectDetails
-> ReadPrec [ProjectDetails]
-> Read ProjectDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProjectDetails]
$creadListPrec :: ReadPrec [ProjectDetails]
readPrec :: ReadPrec ProjectDetails
$creadPrec :: ReadPrec ProjectDetails
readList :: ReadS [ProjectDetails]
$creadList :: ReadS [ProjectDetails]
readsPrec :: Int -> ReadS ProjectDetails
$creadsPrec :: Int -> ReadS ProjectDetails
Prelude.Read, Int -> ProjectDetails -> ShowS
[ProjectDetails] -> ShowS
ProjectDetails -> String
(Int -> ProjectDetails -> ShowS)
-> (ProjectDetails -> String)
-> ([ProjectDetails] -> ShowS)
-> Show ProjectDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProjectDetails] -> ShowS
$cshowList :: [ProjectDetails] -> ShowS
show :: ProjectDetails -> String
$cshow :: ProjectDetails -> String
showsPrec :: Int -> ProjectDetails -> ShowS
$cshowsPrec :: Int -> ProjectDetails -> ShowS
Prelude.Show, (forall x. ProjectDetails -> Rep ProjectDetails x)
-> (forall x. Rep ProjectDetails x -> ProjectDetails)
-> Generic ProjectDetails
forall x. Rep ProjectDetails x -> ProjectDetails
forall x. ProjectDetails -> Rep ProjectDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProjectDetails x -> ProjectDetails
$cfrom :: forall x. ProjectDetails -> Rep ProjectDetails x
Prelude.Generic)
newProjectDetails ::
ProjectDetails
newProjectDetails :: ProjectDetails
newProjectDetails =
ProjectDetails' :: Maybe ProjectState
-> Maybe [Resource]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails
ProjectDetails'
{ $sel:state:ProjectDetails' :: Maybe ProjectState
state = Maybe ProjectState
forall a. Maybe a
Prelude.Nothing,
$sel:resources:ProjectDetails' :: Maybe [Resource]
resources = Maybe [Resource]
forall a. Maybe a
Prelude.Nothing,
$sel:createdDate:ProjectDetails' :: Maybe POSIX
createdDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:consoleUrl:ProjectDetails' :: Maybe Text
consoleUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:name:ProjectDetails' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:region:ProjectDetails' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:projectId:ProjectDetails' :: Maybe Text
projectId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:lastUpdatedDate:ProjectDetails' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
projectDetails_state :: Lens.Lens' ProjectDetails (Prelude.Maybe ProjectState)
projectDetails_state :: (Maybe ProjectState -> f (Maybe ProjectState))
-> ProjectDetails -> f ProjectDetails
projectDetails_state = (ProjectDetails -> Maybe ProjectState)
-> (ProjectDetails -> Maybe ProjectState -> ProjectDetails)
-> Lens
ProjectDetails
ProjectDetails
(Maybe ProjectState)
(Maybe ProjectState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe ProjectState
state :: Maybe ProjectState
$sel:state:ProjectDetails' :: ProjectDetails -> Maybe ProjectState
state} -> Maybe ProjectState
state) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe ProjectState
a -> ProjectDetails
s {$sel:state:ProjectDetails' :: Maybe ProjectState
state = Maybe ProjectState
a} :: ProjectDetails)
projectDetails_resources :: Lens.Lens' ProjectDetails (Prelude.Maybe [Resource])
projectDetails_resources :: (Maybe [Resource] -> f (Maybe [Resource]))
-> ProjectDetails -> f ProjectDetails
projectDetails_resources = (ProjectDetails -> Maybe [Resource])
-> (ProjectDetails -> Maybe [Resource] -> ProjectDetails)
-> Lens
ProjectDetails ProjectDetails (Maybe [Resource]) (Maybe [Resource])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe [Resource]
resources :: Maybe [Resource]
$sel:resources:ProjectDetails' :: ProjectDetails -> Maybe [Resource]
resources} -> Maybe [Resource]
resources) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe [Resource]
a -> ProjectDetails
s {$sel:resources:ProjectDetails' :: Maybe [Resource]
resources = Maybe [Resource]
a} :: ProjectDetails) ((Maybe [Resource] -> f (Maybe [Resource]))
-> ProjectDetails -> f ProjectDetails)
-> ((Maybe [Resource] -> f (Maybe [Resource]))
-> Maybe [Resource] -> f (Maybe [Resource]))
-> (Maybe [Resource] -> f (Maybe [Resource]))
-> ProjectDetails
-> f ProjectDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Resource] [Resource] [Resource] [Resource]
-> Iso
(Maybe [Resource])
(Maybe [Resource])
(Maybe [Resource])
(Maybe [Resource])
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 [Resource] [Resource] [Resource] [Resource]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
projectDetails_createdDate :: Lens.Lens' ProjectDetails (Prelude.Maybe Prelude.UTCTime)
projectDetails_createdDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectDetails -> f ProjectDetails
projectDetails_createdDate = (ProjectDetails -> Maybe POSIX)
-> (ProjectDetails -> Maybe POSIX -> ProjectDetails)
-> Lens ProjectDetails ProjectDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe POSIX
createdDate :: Maybe POSIX
$sel:createdDate:ProjectDetails' :: ProjectDetails -> Maybe POSIX
createdDate} -> Maybe POSIX
createdDate) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe POSIX
a -> ProjectDetails
s {$sel:createdDate:ProjectDetails' :: Maybe POSIX
createdDate = Maybe POSIX
a} :: ProjectDetails) ((Maybe POSIX -> f (Maybe POSIX))
-> ProjectDetails -> f ProjectDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectDetails
-> f ProjectDetails
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
projectDetails_consoleUrl :: Lens.Lens' ProjectDetails (Prelude.Maybe Prelude.Text)
projectDetails_consoleUrl :: (Maybe Text -> f (Maybe Text))
-> ProjectDetails -> f ProjectDetails
projectDetails_consoleUrl = (ProjectDetails -> Maybe Text)
-> (ProjectDetails -> Maybe Text -> ProjectDetails)
-> Lens ProjectDetails ProjectDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe Text
consoleUrl :: Maybe Text
$sel:consoleUrl:ProjectDetails' :: ProjectDetails -> Maybe Text
consoleUrl} -> Maybe Text
consoleUrl) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe Text
a -> ProjectDetails
s {$sel:consoleUrl:ProjectDetails' :: Maybe Text
consoleUrl = Maybe Text
a} :: ProjectDetails)
projectDetails_name :: Lens.Lens' ProjectDetails (Prelude.Maybe Prelude.Text)
projectDetails_name :: (Maybe Text -> f (Maybe Text))
-> ProjectDetails -> f ProjectDetails
projectDetails_name = (ProjectDetails -> Maybe Text)
-> (ProjectDetails -> Maybe Text -> ProjectDetails)
-> Lens ProjectDetails ProjectDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe Text
name :: Maybe Text
$sel:name:ProjectDetails' :: ProjectDetails -> Maybe Text
name} -> Maybe Text
name) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe Text
a -> ProjectDetails
s {$sel:name:ProjectDetails' :: Maybe Text
name = Maybe Text
a} :: ProjectDetails)
projectDetails_region :: Lens.Lens' ProjectDetails (Prelude.Maybe Prelude.Text)
projectDetails_region :: (Maybe Text -> f (Maybe Text))
-> ProjectDetails -> f ProjectDetails
projectDetails_region = (ProjectDetails -> Maybe Text)
-> (ProjectDetails -> Maybe Text -> ProjectDetails)
-> Lens ProjectDetails ProjectDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe Text
region :: Maybe Text
$sel:region:ProjectDetails' :: ProjectDetails -> Maybe Text
region} -> Maybe Text
region) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe Text
a -> ProjectDetails
s {$sel:region:ProjectDetails' :: Maybe Text
region = Maybe Text
a} :: ProjectDetails)
projectDetails_projectId :: Lens.Lens' ProjectDetails (Prelude.Maybe Prelude.Text)
projectDetails_projectId :: (Maybe Text -> f (Maybe Text))
-> ProjectDetails -> f ProjectDetails
projectDetails_projectId = (ProjectDetails -> Maybe Text)
-> (ProjectDetails -> Maybe Text -> ProjectDetails)
-> Lens ProjectDetails ProjectDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe Text
projectId :: Maybe Text
$sel:projectId:ProjectDetails' :: ProjectDetails -> Maybe Text
projectId} -> Maybe Text
projectId) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe Text
a -> ProjectDetails
s {$sel:projectId:ProjectDetails' :: Maybe Text
projectId = Maybe Text
a} :: ProjectDetails)
projectDetails_lastUpdatedDate :: Lens.Lens' ProjectDetails (Prelude.Maybe Prelude.UTCTime)
projectDetails_lastUpdatedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectDetails -> f ProjectDetails
projectDetails_lastUpdatedDate = (ProjectDetails -> Maybe POSIX)
-> (ProjectDetails -> Maybe POSIX -> ProjectDetails)
-> Lens ProjectDetails ProjectDetails (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProjectDetails' {Maybe POSIX
lastUpdatedDate :: Maybe POSIX
$sel:lastUpdatedDate:ProjectDetails' :: ProjectDetails -> Maybe POSIX
lastUpdatedDate} -> Maybe POSIX
lastUpdatedDate) (\s :: ProjectDetails
s@ProjectDetails' {} Maybe POSIX
a -> ProjectDetails
s {$sel:lastUpdatedDate:ProjectDetails' :: Maybe POSIX
lastUpdatedDate = Maybe POSIX
a} :: ProjectDetails) ((Maybe POSIX -> f (Maybe POSIX))
-> ProjectDetails -> f ProjectDetails)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ProjectDetails
-> f ProjectDetails
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
instance Core.FromJSON ProjectDetails where
parseJSON :: Value -> Parser ProjectDetails
parseJSON =
String
-> (Object -> Parser ProjectDetails)
-> Value
-> Parser ProjectDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProjectDetails"
( \Object
x ->
Maybe ProjectState
-> Maybe [Resource]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails
ProjectDetails'
(Maybe ProjectState
-> Maybe [Resource]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
-> Parser (Maybe ProjectState)
-> Parser
(Maybe [Resource]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ProjectState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
Parser
(Maybe [Resource]
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
-> Parser (Maybe [Resource])
-> Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Resource]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resources" Parser (Maybe (Maybe [Resource]))
-> Maybe [Resource] -> Parser (Maybe [Resource])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Resource]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
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
"createdDate")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> ProjectDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> ProjectDetails)
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
"consoleUrl")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe POSIX -> ProjectDetails)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe Text -> Maybe POSIX -> ProjectDetails)
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
"name")
Parser (Maybe Text -> Maybe Text -> Maybe POSIX -> ProjectDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe POSIX -> ProjectDetails)
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
"region")
Parser (Maybe Text -> Maybe POSIX -> ProjectDetails)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> ProjectDetails)
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
"projectId")
Parser (Maybe POSIX -> ProjectDetails)
-> Parser (Maybe POSIX) -> Parser ProjectDetails
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
"lastUpdatedDate")
)
instance Prelude.Hashable ProjectDetails
instance Prelude.NFData ProjectDetails