{-# 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.Macie.Types.FailedS3Resource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Macie.Types.S3Resource
import qualified Amazonka.Prelude as Prelude
data FailedS3Resource = FailedS3Resource'
{
FailedS3Resource -> Maybe Text
errorCode :: Prelude.Maybe Prelude.Text,
FailedS3Resource -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
FailedS3Resource -> Maybe S3Resource
failedItem :: Prelude.Maybe S3Resource
}
deriving (FailedS3Resource -> FailedS3Resource -> Bool
(FailedS3Resource -> FailedS3Resource -> Bool)
-> (FailedS3Resource -> FailedS3Resource -> Bool)
-> Eq FailedS3Resource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailedS3Resource -> FailedS3Resource -> Bool
$c/= :: FailedS3Resource -> FailedS3Resource -> Bool
== :: FailedS3Resource -> FailedS3Resource -> Bool
$c== :: FailedS3Resource -> FailedS3Resource -> Bool
Prelude.Eq, ReadPrec [FailedS3Resource]
ReadPrec FailedS3Resource
Int -> ReadS FailedS3Resource
ReadS [FailedS3Resource]
(Int -> ReadS FailedS3Resource)
-> ReadS [FailedS3Resource]
-> ReadPrec FailedS3Resource
-> ReadPrec [FailedS3Resource]
-> Read FailedS3Resource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailedS3Resource]
$creadListPrec :: ReadPrec [FailedS3Resource]
readPrec :: ReadPrec FailedS3Resource
$creadPrec :: ReadPrec FailedS3Resource
readList :: ReadS [FailedS3Resource]
$creadList :: ReadS [FailedS3Resource]
readsPrec :: Int -> ReadS FailedS3Resource
$creadsPrec :: Int -> ReadS FailedS3Resource
Prelude.Read, Int -> FailedS3Resource -> ShowS
[FailedS3Resource] -> ShowS
FailedS3Resource -> String
(Int -> FailedS3Resource -> ShowS)
-> (FailedS3Resource -> String)
-> ([FailedS3Resource] -> ShowS)
-> Show FailedS3Resource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailedS3Resource] -> ShowS
$cshowList :: [FailedS3Resource] -> ShowS
show :: FailedS3Resource -> String
$cshow :: FailedS3Resource -> String
showsPrec :: Int -> FailedS3Resource -> ShowS
$cshowsPrec :: Int -> FailedS3Resource -> ShowS
Prelude.Show, (forall x. FailedS3Resource -> Rep FailedS3Resource x)
-> (forall x. Rep FailedS3Resource x -> FailedS3Resource)
-> Generic FailedS3Resource
forall x. Rep FailedS3Resource x -> FailedS3Resource
forall x. FailedS3Resource -> Rep FailedS3Resource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailedS3Resource x -> FailedS3Resource
$cfrom :: forall x. FailedS3Resource -> Rep FailedS3Resource x
Prelude.Generic)
newFailedS3Resource ::
FailedS3Resource
newFailedS3Resource :: FailedS3Resource
newFailedS3Resource =
FailedS3Resource' :: Maybe Text -> Maybe Text -> Maybe S3Resource -> FailedS3Resource
FailedS3Resource'
{ $sel:errorCode:FailedS3Resource' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:FailedS3Resource' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failedItem:FailedS3Resource' :: Maybe S3Resource
failedItem = Maybe S3Resource
forall a. Maybe a
Prelude.Nothing
}
failedS3Resource_errorCode :: Lens.Lens' FailedS3Resource (Prelude.Maybe Prelude.Text)
failedS3Resource_errorCode :: (Maybe Text -> f (Maybe Text))
-> FailedS3Resource -> f FailedS3Resource
failedS3Resource_errorCode = (FailedS3Resource -> Maybe Text)
-> (FailedS3Resource -> Maybe Text -> FailedS3Resource)
-> Lens FailedS3Resource FailedS3Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedS3Resource' {Maybe Text
errorCode :: Maybe Text
$sel:errorCode:FailedS3Resource' :: FailedS3Resource -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: FailedS3Resource
s@FailedS3Resource' {} Maybe Text
a -> FailedS3Resource
s {$sel:errorCode:FailedS3Resource' :: Maybe Text
errorCode = Maybe Text
a} :: FailedS3Resource)
failedS3Resource_errorMessage :: Lens.Lens' FailedS3Resource (Prelude.Maybe Prelude.Text)
failedS3Resource_errorMessage :: (Maybe Text -> f (Maybe Text))
-> FailedS3Resource -> f FailedS3Resource
failedS3Resource_errorMessage = (FailedS3Resource -> Maybe Text)
-> (FailedS3Resource -> Maybe Text -> FailedS3Resource)
-> Lens FailedS3Resource FailedS3Resource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedS3Resource' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:FailedS3Resource' :: FailedS3Resource -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: FailedS3Resource
s@FailedS3Resource' {} Maybe Text
a -> FailedS3Resource
s {$sel:errorMessage:FailedS3Resource' :: Maybe Text
errorMessage = Maybe Text
a} :: FailedS3Resource)
failedS3Resource_failedItem :: Lens.Lens' FailedS3Resource (Prelude.Maybe S3Resource)
failedS3Resource_failedItem :: (Maybe S3Resource -> f (Maybe S3Resource))
-> FailedS3Resource -> f FailedS3Resource
failedS3Resource_failedItem = (FailedS3Resource -> Maybe S3Resource)
-> (FailedS3Resource -> Maybe S3Resource -> FailedS3Resource)
-> Lens
FailedS3Resource
FailedS3Resource
(Maybe S3Resource)
(Maybe S3Resource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailedS3Resource' {Maybe S3Resource
failedItem :: Maybe S3Resource
$sel:failedItem:FailedS3Resource' :: FailedS3Resource -> Maybe S3Resource
failedItem} -> Maybe S3Resource
failedItem) (\s :: FailedS3Resource
s@FailedS3Resource' {} Maybe S3Resource
a -> FailedS3Resource
s {$sel:failedItem:FailedS3Resource' :: Maybe S3Resource
failedItem = Maybe S3Resource
a} :: FailedS3Resource)
instance Core.FromJSON FailedS3Resource where
parseJSON :: Value -> Parser FailedS3Resource
parseJSON =
String
-> (Object -> Parser FailedS3Resource)
-> Value
-> Parser FailedS3Resource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FailedS3Resource"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe S3Resource -> FailedS3Resource
FailedS3Resource'
(Maybe Text -> Maybe Text -> Maybe S3Resource -> FailedS3Resource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe S3Resource -> FailedS3Resource)
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
"errorCode")
Parser (Maybe Text -> Maybe S3Resource -> FailedS3Resource)
-> Parser (Maybe Text)
-> Parser (Maybe S3Resource -> FailedS3Resource)
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
"errorMessage")
Parser (Maybe S3Resource -> FailedS3Resource)
-> Parser (Maybe S3Resource) -> Parser FailedS3Resource
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3Resource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"failedItem")
)
instance Prelude.Hashable FailedS3Resource
instance Prelude.NFData FailedS3Resource