{-# 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.ResilienceHub.Types.UnsupportedResource
-- 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.ResilienceHub.Types.UnsupportedResource 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.ResilienceHub.Types.LogicalResourceId
import Amazonka.ResilienceHub.Types.PhysicalResourceId

-- | Defines a resource that is not supported by Resilience Hub.
--
-- /See:/ 'newUnsupportedResource' smart constructor.
data UnsupportedResource = UnsupportedResource'
  { -- | The logical resource identifier for the unsupported resource.
    UnsupportedResource -> LogicalResourceId
logicalResourceId :: LogicalResourceId,
    -- | The physical resource identifier for the unsupported resource.
    UnsupportedResource -> PhysicalResourceId
physicalResourceId :: PhysicalResourceId,
    -- | The type of resource.
    UnsupportedResource -> Text
resourceType :: Prelude.Text
  }
  deriving (UnsupportedResource -> UnsupportedResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnsupportedResource -> UnsupportedResource -> Bool
$c/= :: UnsupportedResource -> UnsupportedResource -> Bool
== :: UnsupportedResource -> UnsupportedResource -> Bool
$c== :: UnsupportedResource -> UnsupportedResource -> Bool
Prelude.Eq, ReadPrec [UnsupportedResource]
ReadPrec UnsupportedResource
Int -> ReadS UnsupportedResource
ReadS [UnsupportedResource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnsupportedResource]
$creadListPrec :: ReadPrec [UnsupportedResource]
readPrec :: ReadPrec UnsupportedResource
$creadPrec :: ReadPrec UnsupportedResource
readList :: ReadS [UnsupportedResource]
$creadList :: ReadS [UnsupportedResource]
readsPrec :: Int -> ReadS UnsupportedResource
$creadsPrec :: Int -> ReadS UnsupportedResource
Prelude.Read, Int -> UnsupportedResource -> ShowS
[UnsupportedResource] -> ShowS
UnsupportedResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnsupportedResource] -> ShowS
$cshowList :: [UnsupportedResource] -> ShowS
show :: UnsupportedResource -> String
$cshow :: UnsupportedResource -> String
showsPrec :: Int -> UnsupportedResource -> ShowS
$cshowsPrec :: Int -> UnsupportedResource -> ShowS
Prelude.Show, forall x. Rep UnsupportedResource x -> UnsupportedResource
forall x. UnsupportedResource -> Rep UnsupportedResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnsupportedResource x -> UnsupportedResource
$cfrom :: forall x. UnsupportedResource -> Rep UnsupportedResource x
Prelude.Generic)

-- |
-- Create a value of 'UnsupportedResource' 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:
--
-- 'logicalResourceId', 'unsupportedResource_logicalResourceId' - The logical resource identifier for the unsupported resource.
--
-- 'physicalResourceId', 'unsupportedResource_physicalResourceId' - The physical resource identifier for the unsupported resource.
--
-- 'resourceType', 'unsupportedResource_resourceType' - The type of resource.
newUnsupportedResource ::
  -- | 'logicalResourceId'
  LogicalResourceId ->
  -- | 'physicalResourceId'
  PhysicalResourceId ->
  -- | 'resourceType'
  Prelude.Text ->
  UnsupportedResource
newUnsupportedResource :: LogicalResourceId
-> PhysicalResourceId -> Text -> UnsupportedResource
newUnsupportedResource
  LogicalResourceId
pLogicalResourceId_
  PhysicalResourceId
pPhysicalResourceId_
  Text
pResourceType_ =
    UnsupportedResource'
      { $sel:logicalResourceId:UnsupportedResource' :: LogicalResourceId
logicalResourceId =
          LogicalResourceId
pLogicalResourceId_,
        $sel:physicalResourceId:UnsupportedResource' :: PhysicalResourceId
physicalResourceId = PhysicalResourceId
pPhysicalResourceId_,
        $sel:resourceType:UnsupportedResource' :: Text
resourceType = Text
pResourceType_
      }

-- | The logical resource identifier for the unsupported resource.
unsupportedResource_logicalResourceId :: Lens.Lens' UnsupportedResource LogicalResourceId
unsupportedResource_logicalResourceId :: Lens' UnsupportedResource LogicalResourceId
unsupportedResource_logicalResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsupportedResource' {LogicalResourceId
logicalResourceId :: LogicalResourceId
$sel:logicalResourceId:UnsupportedResource' :: UnsupportedResource -> LogicalResourceId
logicalResourceId} -> LogicalResourceId
logicalResourceId) (\s :: UnsupportedResource
s@UnsupportedResource' {} LogicalResourceId
a -> UnsupportedResource
s {$sel:logicalResourceId:UnsupportedResource' :: LogicalResourceId
logicalResourceId = LogicalResourceId
a} :: UnsupportedResource)

-- | The physical resource identifier for the unsupported resource.
unsupportedResource_physicalResourceId :: Lens.Lens' UnsupportedResource PhysicalResourceId
unsupportedResource_physicalResourceId :: Lens' UnsupportedResource PhysicalResourceId
unsupportedResource_physicalResourceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsupportedResource' {PhysicalResourceId
physicalResourceId :: PhysicalResourceId
$sel:physicalResourceId:UnsupportedResource' :: UnsupportedResource -> PhysicalResourceId
physicalResourceId} -> PhysicalResourceId
physicalResourceId) (\s :: UnsupportedResource
s@UnsupportedResource' {} PhysicalResourceId
a -> UnsupportedResource
s {$sel:physicalResourceId:UnsupportedResource' :: PhysicalResourceId
physicalResourceId = PhysicalResourceId
a} :: UnsupportedResource)

-- | The type of resource.
unsupportedResource_resourceType :: Lens.Lens' UnsupportedResource Prelude.Text
unsupportedResource_resourceType :: Lens' UnsupportedResource Text
unsupportedResource_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UnsupportedResource' {Text
resourceType :: Text
$sel:resourceType:UnsupportedResource' :: UnsupportedResource -> Text
resourceType} -> Text
resourceType) (\s :: UnsupportedResource
s@UnsupportedResource' {} Text
a -> UnsupportedResource
s {$sel:resourceType:UnsupportedResource' :: Text
resourceType = Text
a} :: UnsupportedResource)

instance Data.FromJSON UnsupportedResource where
  parseJSON :: Value -> Parser UnsupportedResource
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"UnsupportedResource"
      ( \Object
x ->
          LogicalResourceId
-> PhysicalResourceId -> Text -> UnsupportedResource
UnsupportedResource'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"logicalResourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"physicalResourceId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"resourceType")
      )

instance Prelude.Hashable UnsupportedResource where
  hashWithSalt :: Int -> UnsupportedResource -> Int
hashWithSalt Int
_salt UnsupportedResource' {Text
LogicalResourceId
PhysicalResourceId
resourceType :: Text
physicalResourceId :: PhysicalResourceId
logicalResourceId :: LogicalResourceId
$sel:resourceType:UnsupportedResource' :: UnsupportedResource -> Text
$sel:physicalResourceId:UnsupportedResource' :: UnsupportedResource -> PhysicalResourceId
$sel:logicalResourceId:UnsupportedResource' :: UnsupportedResource -> LogicalResourceId
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LogicalResourceId
logicalResourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PhysicalResourceId
physicalResourceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceType

instance Prelude.NFData UnsupportedResource where
  rnf :: UnsupportedResource -> ()
rnf UnsupportedResource' {Text
LogicalResourceId
PhysicalResourceId
resourceType :: Text
physicalResourceId :: PhysicalResourceId
logicalResourceId :: LogicalResourceId
$sel:resourceType:UnsupportedResource' :: UnsupportedResource -> Text
$sel:physicalResourceId:UnsupportedResource' :: UnsupportedResource -> PhysicalResourceId
$sel:logicalResourceId:UnsupportedResource' :: UnsupportedResource -> LogicalResourceId
..} =
    forall a. NFData a => a -> ()
Prelude.rnf LogicalResourceId
logicalResourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PhysicalResourceId
physicalResourceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceType