{-# 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.ServiceCatalog.Types.ResourceDetail where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResourceDetail = ResourceDetail'
{
ResourceDetail -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ResourceDetail -> Maybe POSIX
createdTime :: Prelude.Maybe Core.POSIX,
ResourceDetail -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ResourceDetail -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
ResourceDetail -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (ResourceDetail -> ResourceDetail -> Bool
(ResourceDetail -> ResourceDetail -> Bool)
-> (ResourceDetail -> ResourceDetail -> Bool) -> Eq ResourceDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceDetail -> ResourceDetail -> Bool
$c/= :: ResourceDetail -> ResourceDetail -> Bool
== :: ResourceDetail -> ResourceDetail -> Bool
$c== :: ResourceDetail -> ResourceDetail -> Bool
Prelude.Eq, ReadPrec [ResourceDetail]
ReadPrec ResourceDetail
Int -> ReadS ResourceDetail
ReadS [ResourceDetail]
(Int -> ReadS ResourceDetail)
-> ReadS [ResourceDetail]
-> ReadPrec ResourceDetail
-> ReadPrec [ResourceDetail]
-> Read ResourceDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceDetail]
$creadListPrec :: ReadPrec [ResourceDetail]
readPrec :: ReadPrec ResourceDetail
$creadPrec :: ReadPrec ResourceDetail
readList :: ReadS [ResourceDetail]
$creadList :: ReadS [ResourceDetail]
readsPrec :: Int -> ReadS ResourceDetail
$creadsPrec :: Int -> ReadS ResourceDetail
Prelude.Read, Int -> ResourceDetail -> ShowS
[ResourceDetail] -> ShowS
ResourceDetail -> String
(Int -> ResourceDetail -> ShowS)
-> (ResourceDetail -> String)
-> ([ResourceDetail] -> ShowS)
-> Show ResourceDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceDetail] -> ShowS
$cshowList :: [ResourceDetail] -> ShowS
show :: ResourceDetail -> String
$cshow :: ResourceDetail -> String
showsPrec :: Int -> ResourceDetail -> ShowS
$cshowsPrec :: Int -> ResourceDetail -> ShowS
Prelude.Show, (forall x. ResourceDetail -> Rep ResourceDetail x)
-> (forall x. Rep ResourceDetail x -> ResourceDetail)
-> Generic ResourceDetail
forall x. Rep ResourceDetail x -> ResourceDetail
forall x. ResourceDetail -> Rep ResourceDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceDetail x -> ResourceDetail
$cfrom :: forall x. ResourceDetail -> Rep ResourceDetail x
Prelude.Generic)
newResourceDetail ::
ResourceDetail
newResourceDetail :: ResourceDetail
newResourceDetail =
ResourceDetail' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResourceDetail
ResourceDetail'
{ $sel:arn:ResourceDetail' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdTime:ResourceDetail' :: Maybe POSIX
createdTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:name:ResourceDetail' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:ResourceDetail' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:ResourceDetail' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
resourceDetail_arn :: Lens.Lens' ResourceDetail (Prelude.Maybe Prelude.Text)
resourceDetail_arn :: (Maybe Text -> f (Maybe Text))
-> ResourceDetail -> f ResourceDetail
resourceDetail_arn = (ResourceDetail -> Maybe Text)
-> (ResourceDetail -> Maybe Text -> ResourceDetail)
-> Lens ResourceDetail ResourceDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDetail' {Maybe Text
arn :: Maybe Text
$sel:arn:ResourceDetail' :: ResourceDetail -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResourceDetail
s@ResourceDetail' {} Maybe Text
a -> ResourceDetail
s {$sel:arn:ResourceDetail' :: Maybe Text
arn = Maybe Text
a} :: ResourceDetail)
resourceDetail_createdTime :: Lens.Lens' ResourceDetail (Prelude.Maybe Prelude.UTCTime)
resourceDetail_createdTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDetail -> f ResourceDetail
resourceDetail_createdTime = (ResourceDetail -> Maybe POSIX)
-> (ResourceDetail -> Maybe POSIX -> ResourceDetail)
-> Lens ResourceDetail ResourceDetail (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDetail' {Maybe POSIX
createdTime :: Maybe POSIX
$sel:createdTime:ResourceDetail' :: ResourceDetail -> Maybe POSIX
createdTime} -> Maybe POSIX
createdTime) (\s :: ResourceDetail
s@ResourceDetail' {} Maybe POSIX
a -> ResourceDetail
s {$sel:createdTime:ResourceDetail' :: Maybe POSIX
createdTime = Maybe POSIX
a} :: ResourceDetail) ((Maybe POSIX -> f (Maybe POSIX))
-> ResourceDetail -> f ResourceDetail)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceDetail
-> f ResourceDetail
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
resourceDetail_name :: Lens.Lens' ResourceDetail (Prelude.Maybe Prelude.Text)
resourceDetail_name :: (Maybe Text -> f (Maybe Text))
-> ResourceDetail -> f ResourceDetail
resourceDetail_name = (ResourceDetail -> Maybe Text)
-> (ResourceDetail -> Maybe Text -> ResourceDetail)
-> Lens ResourceDetail ResourceDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDetail' {Maybe Text
name :: Maybe Text
$sel:name:ResourceDetail' :: ResourceDetail -> Maybe Text
name} -> Maybe Text
name) (\s :: ResourceDetail
s@ResourceDetail' {} Maybe Text
a -> ResourceDetail
s {$sel:name:ResourceDetail' :: Maybe Text
name = Maybe Text
a} :: ResourceDetail)
resourceDetail_id :: Lens.Lens' ResourceDetail (Prelude.Maybe Prelude.Text)
resourceDetail_id :: (Maybe Text -> f (Maybe Text))
-> ResourceDetail -> f ResourceDetail
resourceDetail_id = (ResourceDetail -> Maybe Text)
-> (ResourceDetail -> Maybe Text -> ResourceDetail)
-> Lens ResourceDetail ResourceDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDetail' {Maybe Text
id :: Maybe Text
$sel:id:ResourceDetail' :: ResourceDetail -> Maybe Text
id} -> Maybe Text
id) (\s :: ResourceDetail
s@ResourceDetail' {} Maybe Text
a -> ResourceDetail
s {$sel:id:ResourceDetail' :: Maybe Text
id = Maybe Text
a} :: ResourceDetail)
resourceDetail_description :: Lens.Lens' ResourceDetail (Prelude.Maybe Prelude.Text)
resourceDetail_description :: (Maybe Text -> f (Maybe Text))
-> ResourceDetail -> f ResourceDetail
resourceDetail_description = (ResourceDetail -> Maybe Text)
-> (ResourceDetail -> Maybe Text -> ResourceDetail)
-> Lens ResourceDetail ResourceDetail (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceDetail' {Maybe Text
description :: Maybe Text
$sel:description:ResourceDetail' :: ResourceDetail -> Maybe Text
description} -> Maybe Text
description) (\s :: ResourceDetail
s@ResourceDetail' {} Maybe Text
a -> ResourceDetail
s {$sel:description:ResourceDetail' :: Maybe Text
description = Maybe Text
a} :: ResourceDetail)
instance Core.FromJSON ResourceDetail where
parseJSON :: Value -> Parser ResourceDetail
parseJSON =
String
-> (Object -> Parser ResourceDetail)
-> Value
-> Parser ResourceDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResourceDetail"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResourceDetail
ResourceDetail'
(Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ResourceDetail)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> ResourceDetail)
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
"ARN")
Parser
(Maybe POSIX
-> Maybe Text -> Maybe Text -> Maybe Text -> ResourceDetail)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text -> Maybe Text -> Maybe Text -> ResourceDetail)
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
"CreatedTime")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> ResourceDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ResourceDetail)
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 -> ResourceDetail)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ResourceDetail)
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
"Id")
Parser (Maybe Text -> ResourceDetail)
-> Parser (Maybe Text) -> Parser ResourceDetail
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
"Description")
)
instance Prelude.Hashable ResourceDetail
instance Prelude.NFData ResourceDetail