{-# 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.Config.Types.RemediationExceptionResourceKey where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RemediationExceptionResourceKey = RemediationExceptionResourceKey'
{
RemediationExceptionResourceKey -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
RemediationExceptionResourceKey -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text
}
deriving (RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool
(RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool)
-> (RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool)
-> Eq RemediationExceptionResourceKey
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool
$c/= :: RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool
== :: RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool
$c== :: RemediationExceptionResourceKey
-> RemediationExceptionResourceKey -> Bool
Prelude.Eq, ReadPrec [RemediationExceptionResourceKey]
ReadPrec RemediationExceptionResourceKey
Int -> ReadS RemediationExceptionResourceKey
ReadS [RemediationExceptionResourceKey]
(Int -> ReadS RemediationExceptionResourceKey)
-> ReadS [RemediationExceptionResourceKey]
-> ReadPrec RemediationExceptionResourceKey
-> ReadPrec [RemediationExceptionResourceKey]
-> Read RemediationExceptionResourceKey
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RemediationExceptionResourceKey]
$creadListPrec :: ReadPrec [RemediationExceptionResourceKey]
readPrec :: ReadPrec RemediationExceptionResourceKey
$creadPrec :: ReadPrec RemediationExceptionResourceKey
readList :: ReadS [RemediationExceptionResourceKey]
$creadList :: ReadS [RemediationExceptionResourceKey]
readsPrec :: Int -> ReadS RemediationExceptionResourceKey
$creadsPrec :: Int -> ReadS RemediationExceptionResourceKey
Prelude.Read, Int -> RemediationExceptionResourceKey -> ShowS
[RemediationExceptionResourceKey] -> ShowS
RemediationExceptionResourceKey -> String
(Int -> RemediationExceptionResourceKey -> ShowS)
-> (RemediationExceptionResourceKey -> String)
-> ([RemediationExceptionResourceKey] -> ShowS)
-> Show RemediationExceptionResourceKey
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RemediationExceptionResourceKey] -> ShowS
$cshowList :: [RemediationExceptionResourceKey] -> ShowS
show :: RemediationExceptionResourceKey -> String
$cshow :: RemediationExceptionResourceKey -> String
showsPrec :: Int -> RemediationExceptionResourceKey -> ShowS
$cshowsPrec :: Int -> RemediationExceptionResourceKey -> ShowS
Prelude.Show, (forall x.
RemediationExceptionResourceKey
-> Rep RemediationExceptionResourceKey x)
-> (forall x.
Rep RemediationExceptionResourceKey x
-> RemediationExceptionResourceKey)
-> Generic RemediationExceptionResourceKey
forall x.
Rep RemediationExceptionResourceKey x
-> RemediationExceptionResourceKey
forall x.
RemediationExceptionResourceKey
-> Rep RemediationExceptionResourceKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RemediationExceptionResourceKey x
-> RemediationExceptionResourceKey
$cfrom :: forall x.
RemediationExceptionResourceKey
-> Rep RemediationExceptionResourceKey x
Prelude.Generic)
newRemediationExceptionResourceKey ::
RemediationExceptionResourceKey
newRemediationExceptionResourceKey :: RemediationExceptionResourceKey
newRemediationExceptionResourceKey =
RemediationExceptionResourceKey' :: Maybe Text -> Maybe Text -> RemediationExceptionResourceKey
RemediationExceptionResourceKey'
{ $sel:resourceId:RemediationExceptionResourceKey' :: Maybe Text
resourceId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:RemediationExceptionResourceKey' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
remediationExceptionResourceKey_resourceId :: Lens.Lens' RemediationExceptionResourceKey (Prelude.Maybe Prelude.Text)
remediationExceptionResourceKey_resourceId :: (Maybe Text -> f (Maybe Text))
-> RemediationExceptionResourceKey
-> f RemediationExceptionResourceKey
remediationExceptionResourceKey_resourceId = (RemediationExceptionResourceKey -> Maybe Text)
-> (RemediationExceptionResourceKey
-> Maybe Text -> RemediationExceptionResourceKey)
-> Lens
RemediationExceptionResourceKey
RemediationExceptionResourceKey
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExceptionResourceKey' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:RemediationExceptionResourceKey' :: RemediationExceptionResourceKey -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: RemediationExceptionResourceKey
s@RemediationExceptionResourceKey' {} Maybe Text
a -> RemediationExceptionResourceKey
s {$sel:resourceId:RemediationExceptionResourceKey' :: Maybe Text
resourceId = Maybe Text
a} :: RemediationExceptionResourceKey)
remediationExceptionResourceKey_resourceType :: Lens.Lens' RemediationExceptionResourceKey (Prelude.Maybe Prelude.Text)
remediationExceptionResourceKey_resourceType :: (Maybe Text -> f (Maybe Text))
-> RemediationExceptionResourceKey
-> f RemediationExceptionResourceKey
remediationExceptionResourceKey_resourceType = (RemediationExceptionResourceKey -> Maybe Text)
-> (RemediationExceptionResourceKey
-> Maybe Text -> RemediationExceptionResourceKey)
-> Lens
RemediationExceptionResourceKey
RemediationExceptionResourceKey
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RemediationExceptionResourceKey' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:RemediationExceptionResourceKey' :: RemediationExceptionResourceKey -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: RemediationExceptionResourceKey
s@RemediationExceptionResourceKey' {} Maybe Text
a -> RemediationExceptionResourceKey
s {$sel:resourceType:RemediationExceptionResourceKey' :: Maybe Text
resourceType = Maybe Text
a} :: RemediationExceptionResourceKey)
instance
Core.FromJSON
RemediationExceptionResourceKey
where
parseJSON :: Value -> Parser RemediationExceptionResourceKey
parseJSON =
String
-> (Object -> Parser RemediationExceptionResourceKey)
-> Value
-> Parser RemediationExceptionResourceKey
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RemediationExceptionResourceKey"
( \Object
x ->
Maybe Text -> Maybe Text -> RemediationExceptionResourceKey
RemediationExceptionResourceKey'
(Maybe Text -> Maybe Text -> RemediationExceptionResourceKey)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> RemediationExceptionResourceKey)
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
"ResourceId")
Parser (Maybe Text -> RemediationExceptionResourceKey)
-> Parser (Maybe Text) -> Parser RemediationExceptionResourceKey
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
"ResourceType")
)
instance
Prelude.Hashable
RemediationExceptionResourceKey
instance
Prelude.NFData
RemediationExceptionResourceKey
instance Core.ToJSON RemediationExceptionResourceKey where
toJSON :: RemediationExceptionResourceKey -> Value
toJSON RemediationExceptionResourceKey' {Maybe Text
resourceType :: Maybe Text
resourceId :: Maybe Text
$sel:resourceType:RemediationExceptionResourceKey' :: RemediationExceptionResourceKey -> Maybe Text
$sel:resourceId:RemediationExceptionResourceKey' :: RemediationExceptionResourceKey -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceId,
(Text
"ResourceType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
resourceType
]
)