{-# 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.ResourceExplorer2.Types.SupportedResourceType
-- 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.ResourceExplorer2.Types.SupportedResourceType 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

-- | A structure that describes a resource type supported by Amazon Web
-- Services Resource Explorer.
--
-- /See:/ 'newSupportedResourceType' smart constructor.
data SupportedResourceType = SupportedResourceType'
  { -- | The unique identifier of the resource type.
    SupportedResourceType -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Service that is associated with the resource type. This
    -- is the primary service that lets you create and interact with resources
    -- of this type.
    SupportedResourceType -> Maybe Text
service :: Prelude.Maybe Prelude.Text
  }
  deriving (SupportedResourceType -> SupportedResourceType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SupportedResourceType -> SupportedResourceType -> Bool
$c/= :: SupportedResourceType -> SupportedResourceType -> Bool
== :: SupportedResourceType -> SupportedResourceType -> Bool
$c== :: SupportedResourceType -> SupportedResourceType -> Bool
Prelude.Eq, ReadPrec [SupportedResourceType]
ReadPrec SupportedResourceType
Int -> ReadS SupportedResourceType
ReadS [SupportedResourceType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SupportedResourceType]
$creadListPrec :: ReadPrec [SupportedResourceType]
readPrec :: ReadPrec SupportedResourceType
$creadPrec :: ReadPrec SupportedResourceType
readList :: ReadS [SupportedResourceType]
$creadList :: ReadS [SupportedResourceType]
readsPrec :: Int -> ReadS SupportedResourceType
$creadsPrec :: Int -> ReadS SupportedResourceType
Prelude.Read, Int -> SupportedResourceType -> ShowS
[SupportedResourceType] -> ShowS
SupportedResourceType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SupportedResourceType] -> ShowS
$cshowList :: [SupportedResourceType] -> ShowS
show :: SupportedResourceType -> String
$cshow :: SupportedResourceType -> String
showsPrec :: Int -> SupportedResourceType -> ShowS
$cshowsPrec :: Int -> SupportedResourceType -> ShowS
Prelude.Show, forall x. Rep SupportedResourceType x -> SupportedResourceType
forall x. SupportedResourceType -> Rep SupportedResourceType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SupportedResourceType x -> SupportedResourceType
$cfrom :: forall x. SupportedResourceType -> Rep SupportedResourceType x
Prelude.Generic)

-- |
-- Create a value of 'SupportedResourceType' 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:
--
-- 'resourceType', 'supportedResourceType_resourceType' - The unique identifier of the resource type.
--
-- 'service', 'supportedResourceType_service' - The Amazon Web Service that is associated with the resource type. This
-- is the primary service that lets you create and interact with resources
-- of this type.
newSupportedResourceType ::
  SupportedResourceType
newSupportedResourceType :: SupportedResourceType
newSupportedResourceType =
  SupportedResourceType'
    { $sel:resourceType:SupportedResourceType' :: Maybe Text
resourceType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:service:SupportedResourceType' :: Maybe Text
service = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier of the resource type.
supportedResourceType_resourceType :: Lens.Lens' SupportedResourceType (Prelude.Maybe Prelude.Text)
supportedResourceType_resourceType :: Lens' SupportedResourceType (Maybe Text)
supportedResourceType_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedResourceType' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:SupportedResourceType' :: SupportedResourceType -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: SupportedResourceType
s@SupportedResourceType' {} Maybe Text
a -> SupportedResourceType
s {$sel:resourceType:SupportedResourceType' :: Maybe Text
resourceType = Maybe Text
a} :: SupportedResourceType)

-- | The Amazon Web Service that is associated with the resource type. This
-- is the primary service that lets you create and interact with resources
-- of this type.
supportedResourceType_service :: Lens.Lens' SupportedResourceType (Prelude.Maybe Prelude.Text)
supportedResourceType_service :: Lens' SupportedResourceType (Maybe Text)
supportedResourceType_service = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SupportedResourceType' {Maybe Text
service :: Maybe Text
$sel:service:SupportedResourceType' :: SupportedResourceType -> Maybe Text
service} -> Maybe Text
service) (\s :: SupportedResourceType
s@SupportedResourceType' {} Maybe Text
a -> SupportedResourceType
s {$sel:service:SupportedResourceType' :: Maybe Text
service = Maybe Text
a} :: SupportedResourceType)

instance Data.FromJSON SupportedResourceType where
  parseJSON :: Value -> Parser SupportedResourceType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SupportedResourceType"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> SupportedResourceType
SupportedResourceType'
            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
"ResourceType")
            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
"Service")
      )

instance Prelude.Hashable SupportedResourceType where
  hashWithSalt :: Int -> SupportedResourceType -> Int
hashWithSalt Int
_salt SupportedResourceType' {Maybe Text
service :: Maybe Text
resourceType :: Maybe Text
$sel:service:SupportedResourceType' :: SupportedResourceType -> Maybe Text
$sel:resourceType:SupportedResourceType' :: SupportedResourceType -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
service

instance Prelude.NFData SupportedResourceType where
  rnf :: SupportedResourceType -> ()
rnf SupportedResourceType' {Maybe Text
service :: Maybe Text
resourceType :: Maybe Text
$sel:service:SupportedResourceType' :: SupportedResourceType -> Maybe Text
$sel:resourceType:SupportedResourceType' :: SupportedResourceType -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
service