{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.ServiceCatalogAppRegistry.Types.ResourceInfo
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The information about the resource.
--
-- /See:/ 'newResourceInfo' smart constructor.
data ResourceInfo = ResourceInfo'
  { -- | The Amazon resource name (ARN) that specifies the resource across
    -- services.
    ResourceInfo -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the resource.
    ResourceInfo -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The details related to the resource.
    ResourceInfo -> Maybe ResourceDetails
resourceDetails :: Prelude.Maybe ResourceDetails,
    -- | Provides information about the Service Catalog App Registry resource
    -- type.
    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)

-- |
-- Create a value of 'ResourceInfo' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 'resourceInfo_arn' - The Amazon resource name (ARN) that specifies the resource across
-- services.
--
-- 'name', 'resourceInfo_name' - The name of the resource.
--
-- 'resourceDetails', 'resourceInfo_resourceDetails' - The details related to the resource.
--
-- 'resourceType', 'resourceInfo_resourceType' - Provides information about the Service Catalog App Registry resource
-- type.
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
    }

-- | The Amazon resource name (ARN) that specifies the resource across
-- services.
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)

-- | The name of the resource.
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)

-- | The details related to the resource.
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)

-- | Provides information about the Service Catalog App Registry resource
-- type.
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