{-# 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.ServiceCatalogAppRegistry.Types.ResourceInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.ServiceCatalogAppRegistry.Types.ResourceDetails
import Amazonka.ServiceCatalogAppRegistry.Types.ResourceType
data ResourceInfo = ResourceInfo'
{
ResourceInfo -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ResourceInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ResourceInfo -> Maybe ResourceDetails
resourceDetails :: Prelude.Maybe ResourceDetails,
ResourceInfo -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType
}
deriving (ResourceInfo -> ResourceInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceInfo -> ResourceInfo -> Bool
$c/= :: ResourceInfo -> ResourceInfo -> Bool
== :: ResourceInfo -> ResourceInfo -> Bool
$c== :: ResourceInfo -> ResourceInfo -> Bool
Prelude.Eq, ReadPrec [ResourceInfo]
ReadPrec ResourceInfo
Int -> ReadS ResourceInfo
ReadS [ResourceInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceInfo]
$creadListPrec :: ReadPrec [ResourceInfo]
readPrec :: ReadPrec ResourceInfo
$creadPrec :: ReadPrec ResourceInfo
readList :: ReadS [ResourceInfo]
$creadList :: ReadS [ResourceInfo]
readsPrec :: Int -> ReadS ResourceInfo
$creadsPrec :: Int -> ReadS ResourceInfo
Prelude.Read, Int -> ResourceInfo -> ShowS
[ResourceInfo] -> ShowS
ResourceInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceInfo] -> ShowS
$cshowList :: [ResourceInfo] -> ShowS
show :: ResourceInfo -> String
$cshow :: ResourceInfo -> String
showsPrec :: Int -> ResourceInfo -> ShowS
$cshowsPrec :: Int -> ResourceInfo -> ShowS
Prelude.Show, forall x. Rep ResourceInfo x -> ResourceInfo
forall x. ResourceInfo -> Rep ResourceInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceInfo x -> ResourceInfo
$cfrom :: forall x. ResourceInfo -> Rep ResourceInfo x
Prelude.Generic)
newResourceInfo ::
ResourceInfo
newResourceInfo :: ResourceInfo
newResourceInfo =
ResourceInfo'
{ $sel:arn:ResourceInfo' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:name:ResourceInfo' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:resourceDetails:ResourceInfo' :: Maybe ResourceDetails
resourceDetails = forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:ResourceInfo' :: Maybe ResourceType
resourceType = forall a. Maybe a
Prelude.Nothing
}
resourceInfo_arn :: Lens.Lens' ResourceInfo (Prelude.Maybe Prelude.Text)
resourceInfo_arn :: Lens' ResourceInfo (Maybe Text)
resourceInfo_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceInfo' {Maybe Text
arn :: Maybe Text
$sel:arn:ResourceInfo' :: ResourceInfo -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ResourceInfo
s@ResourceInfo' {} Maybe Text
a -> ResourceInfo
s {$sel:arn:ResourceInfo' :: Maybe Text
arn = Maybe Text
a} :: ResourceInfo)
resourceInfo_name :: Lens.Lens' ResourceInfo (Prelude.Maybe Prelude.Text)
resourceInfo_name :: Lens' ResourceInfo (Maybe Text)
resourceInfo_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceInfo' {Maybe Text
name :: Maybe Text
$sel:name:ResourceInfo' :: ResourceInfo -> Maybe Text
name} -> Maybe Text
name) (\s :: ResourceInfo
s@ResourceInfo' {} Maybe Text
a -> ResourceInfo
s {$sel:name:ResourceInfo' :: Maybe Text
name = Maybe Text
a} :: ResourceInfo)
resourceInfo_resourceDetails :: Lens.Lens' ResourceInfo (Prelude.Maybe ResourceDetails)
resourceInfo_resourceDetails :: Lens' ResourceInfo (Maybe ResourceDetails)
resourceInfo_resourceDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceInfo' {Maybe ResourceDetails
resourceDetails :: Maybe ResourceDetails
$sel:resourceDetails:ResourceInfo' :: ResourceInfo -> Maybe ResourceDetails
resourceDetails} -> Maybe ResourceDetails
resourceDetails) (\s :: ResourceInfo
s@ResourceInfo' {} Maybe ResourceDetails
a -> ResourceInfo
s {$sel:resourceDetails:ResourceInfo' :: Maybe ResourceDetails
resourceDetails = Maybe ResourceDetails
a} :: ResourceInfo)
resourceInfo_resourceType :: Lens.Lens' ResourceInfo (Prelude.Maybe ResourceType)
resourceInfo_resourceType :: Lens' ResourceInfo (Maybe ResourceType)
resourceInfo_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceInfo' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:ResourceInfo' :: ResourceInfo -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: ResourceInfo
s@ResourceInfo' {} Maybe ResourceType
a -> ResourceInfo
s {$sel:resourceType:ResourceInfo' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: ResourceInfo)
instance Data.FromJSON ResourceInfo where
parseJSON :: Value -> Parser ResourceInfo
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResourceInfo"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe ResourceDetails
-> Maybe ResourceType
-> ResourceInfo
ResourceInfo'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceDetails")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"resourceType")
)
instance Prelude.Hashable ResourceInfo where
hashWithSalt :: Int -> ResourceInfo -> Int
hashWithSalt Int
_salt ResourceInfo' {Maybe Text
Maybe ResourceDetails
Maybe ResourceType
resourceType :: Maybe ResourceType
resourceDetails :: Maybe ResourceDetails
name :: Maybe Text
arn :: Maybe Text
$sel:resourceType:ResourceInfo' :: ResourceInfo -> Maybe ResourceType
$sel:resourceDetails:ResourceInfo' :: ResourceInfo -> Maybe ResourceDetails
$sel:name:ResourceInfo' :: ResourceInfo -> Maybe Text
$sel:arn:ResourceInfo' :: ResourceInfo -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceDetails
resourceDetails
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceType
resourceType
instance Prelude.NFData ResourceInfo where
rnf :: ResourceInfo -> ()
rnf ResourceInfo' {Maybe Text
Maybe ResourceDetails
Maybe ResourceType
resourceType :: Maybe ResourceType
resourceDetails :: Maybe ResourceDetails
name :: Maybe Text
arn :: Maybe Text
$sel:resourceType:ResourceInfo' :: ResourceInfo -> Maybe ResourceType
$sel:resourceDetails:ResourceInfo' :: ResourceInfo -> Maybe ResourceDetails
$sel:name:ResourceInfo' :: ResourceInfo -> Maybe Text
$sel:arn:ResourceInfo' :: ResourceInfo -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceDetails
resourceDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
resourceType