{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.Config.PutRemediationExceptions
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- A remediation exception is when a specific resource is no longer
-- considered for auto-remediation. This API adds a new exception or
-- updates an existing exception for a specific resource with a specific
-- Config rule.
--
-- Config generates a remediation exception when a problem occurs executing
-- a remediation action to a specific resource. Remediation exceptions
-- blocks auto-remediation until the exception is cleared.
module Amazonka.Config.PutRemediationExceptions
  ( -- * Creating a Request
    PutRemediationExceptions (..),
    newPutRemediationExceptions,

    -- * Request Lenses
    putRemediationExceptions_message,
    putRemediationExceptions_expirationTime,
    putRemediationExceptions_configRuleName,
    putRemediationExceptions_resourceKeys,

    -- * Destructuring the Response
    PutRemediationExceptionsResponse (..),
    newPutRemediationExceptionsResponse,

    -- * Response Lenses
    putRemediationExceptionsResponse_failedBatches,
    putRemediationExceptionsResponse_httpStatus,
  )
where

import Amazonka.Config.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newPutRemediationExceptions' smart constructor.
data PutRemediationExceptions = PutRemediationExceptions'
  { -- | The message contains an explanation of the exception.
    PutRemediationExceptions -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
    -- | The exception is automatically deleted after the expiration date.
    PutRemediationExceptions -> Maybe POSIX
expirationTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the Config rule for which you want to create remediation
    -- exception.
    PutRemediationExceptions -> Text
configRuleName :: Prelude.Text,
    -- | An exception list of resource exception keys to be processed with the
    -- current request. Config adds exception for each resource key. For
    -- example, Config adds 3 exceptions for 3 resource keys.
    PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
resourceKeys :: Prelude.NonEmpty RemediationExceptionResourceKey
  }
  deriving (PutRemediationExceptions -> PutRemediationExceptions -> Bool
(PutRemediationExceptions -> PutRemediationExceptions -> Bool)
-> (PutRemediationExceptions -> PutRemediationExceptions -> Bool)
-> Eq PutRemediationExceptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRemediationExceptions -> PutRemediationExceptions -> Bool
$c/= :: PutRemediationExceptions -> PutRemediationExceptions -> Bool
== :: PutRemediationExceptions -> PutRemediationExceptions -> Bool
$c== :: PutRemediationExceptions -> PutRemediationExceptions -> Bool
Prelude.Eq, ReadPrec [PutRemediationExceptions]
ReadPrec PutRemediationExceptions
Int -> ReadS PutRemediationExceptions
ReadS [PutRemediationExceptions]
(Int -> ReadS PutRemediationExceptions)
-> ReadS [PutRemediationExceptions]
-> ReadPrec PutRemediationExceptions
-> ReadPrec [PutRemediationExceptions]
-> Read PutRemediationExceptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRemediationExceptions]
$creadListPrec :: ReadPrec [PutRemediationExceptions]
readPrec :: ReadPrec PutRemediationExceptions
$creadPrec :: ReadPrec PutRemediationExceptions
readList :: ReadS [PutRemediationExceptions]
$creadList :: ReadS [PutRemediationExceptions]
readsPrec :: Int -> ReadS PutRemediationExceptions
$creadsPrec :: Int -> ReadS PutRemediationExceptions
Prelude.Read, Int -> PutRemediationExceptions -> ShowS
[PutRemediationExceptions] -> ShowS
PutRemediationExceptions -> String
(Int -> PutRemediationExceptions -> ShowS)
-> (PutRemediationExceptions -> String)
-> ([PutRemediationExceptions] -> ShowS)
-> Show PutRemediationExceptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRemediationExceptions] -> ShowS
$cshowList :: [PutRemediationExceptions] -> ShowS
show :: PutRemediationExceptions -> String
$cshow :: PutRemediationExceptions -> String
showsPrec :: Int -> PutRemediationExceptions -> ShowS
$cshowsPrec :: Int -> PutRemediationExceptions -> ShowS
Prelude.Show, (forall x.
 PutRemediationExceptions -> Rep PutRemediationExceptions x)
-> (forall x.
    Rep PutRemediationExceptions x -> PutRemediationExceptions)
-> Generic PutRemediationExceptions
forall x.
Rep PutRemediationExceptions x -> PutRemediationExceptions
forall x.
PutRemediationExceptions -> Rep PutRemediationExceptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutRemediationExceptions x -> PutRemediationExceptions
$cfrom :: forall x.
PutRemediationExceptions -> Rep PutRemediationExceptions x
Prelude.Generic)

-- |
-- Create a value of 'PutRemediationExceptions' 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:
--
-- 'message', 'putRemediationExceptions_message' - The message contains an explanation of the exception.
--
-- 'expirationTime', 'putRemediationExceptions_expirationTime' - The exception is automatically deleted after the expiration date.
--
-- 'configRuleName', 'putRemediationExceptions_configRuleName' - The name of the Config rule for which you want to create remediation
-- exception.
--
-- 'resourceKeys', 'putRemediationExceptions_resourceKeys' - An exception list of resource exception keys to be processed with the
-- current request. Config adds exception for each resource key. For
-- example, Config adds 3 exceptions for 3 resource keys.
newPutRemediationExceptions ::
  -- | 'configRuleName'
  Prelude.Text ->
  -- | 'resourceKeys'
  Prelude.NonEmpty RemediationExceptionResourceKey ->
  PutRemediationExceptions
newPutRemediationExceptions :: Text
-> NonEmpty RemediationExceptionResourceKey
-> PutRemediationExceptions
newPutRemediationExceptions
  Text
pConfigRuleName_
  NonEmpty RemediationExceptionResourceKey
pResourceKeys_ =
    PutRemediationExceptions' :: Maybe Text
-> Maybe POSIX
-> Text
-> NonEmpty RemediationExceptionResourceKey
-> PutRemediationExceptions
PutRemediationExceptions'
      { $sel:message:PutRemediationExceptions' :: Maybe Text
message =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:expirationTime:PutRemediationExceptions' :: Maybe POSIX
expirationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
        $sel:configRuleName:PutRemediationExceptions' :: Text
configRuleName = Text
pConfigRuleName_,
        $sel:resourceKeys:PutRemediationExceptions' :: NonEmpty RemediationExceptionResourceKey
resourceKeys = Tagged
  (NonEmpty RemediationExceptionResourceKey)
  (Identity (NonEmpty RemediationExceptionResourceKey))
-> Tagged
     (NonEmpty RemediationExceptionResourceKey)
     (Identity (NonEmpty RemediationExceptionResourceKey))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged
   (NonEmpty RemediationExceptionResourceKey)
   (Identity (NonEmpty RemediationExceptionResourceKey))
 -> Tagged
      (NonEmpty RemediationExceptionResourceKey)
      (Identity (NonEmpty RemediationExceptionResourceKey)))
-> NonEmpty RemediationExceptionResourceKey
-> NonEmpty RemediationExceptionResourceKey
forall t b. AReview t b -> b -> t
Lens.# NonEmpty RemediationExceptionResourceKey
pResourceKeys_
      }

-- | The message contains an explanation of the exception.
putRemediationExceptions_message :: Lens.Lens' PutRemediationExceptions (Prelude.Maybe Prelude.Text)
putRemediationExceptions_message :: (Maybe Text -> f (Maybe Text))
-> PutRemediationExceptions -> f PutRemediationExceptions
putRemediationExceptions_message = (PutRemediationExceptions -> Maybe Text)
-> (PutRemediationExceptions
    -> Maybe Text -> PutRemediationExceptions)
-> Lens
     PutRemediationExceptions
     PutRemediationExceptions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRemediationExceptions' {Maybe Text
message :: Maybe Text
$sel:message:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe Text
message} -> Maybe Text
message) (\s :: PutRemediationExceptions
s@PutRemediationExceptions' {} Maybe Text
a -> PutRemediationExceptions
s {$sel:message:PutRemediationExceptions' :: Maybe Text
message = Maybe Text
a} :: PutRemediationExceptions)

-- | The exception is automatically deleted after the expiration date.
putRemediationExceptions_expirationTime :: Lens.Lens' PutRemediationExceptions (Prelude.Maybe Prelude.UTCTime)
putRemediationExceptions_expirationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PutRemediationExceptions -> f PutRemediationExceptions
putRemediationExceptions_expirationTime = (PutRemediationExceptions -> Maybe POSIX)
-> (PutRemediationExceptions
    -> Maybe POSIX -> PutRemediationExceptions)
-> Lens
     PutRemediationExceptions
     PutRemediationExceptions
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRemediationExceptions' {Maybe POSIX
expirationTime :: Maybe POSIX
$sel:expirationTime:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe POSIX
expirationTime} -> Maybe POSIX
expirationTime) (\s :: PutRemediationExceptions
s@PutRemediationExceptions' {} Maybe POSIX
a -> PutRemediationExceptions
s {$sel:expirationTime:PutRemediationExceptions' :: Maybe POSIX
expirationTime = Maybe POSIX
a} :: PutRemediationExceptions) ((Maybe POSIX -> f (Maybe POSIX))
 -> PutRemediationExceptions -> f PutRemediationExceptions)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PutRemediationExceptions
-> f PutRemediationExceptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the Config rule for which you want to create remediation
-- exception.
putRemediationExceptions_configRuleName :: Lens.Lens' PutRemediationExceptions Prelude.Text
putRemediationExceptions_configRuleName :: (Text -> f Text)
-> PutRemediationExceptions -> f PutRemediationExceptions
putRemediationExceptions_configRuleName = (PutRemediationExceptions -> Text)
-> (PutRemediationExceptions -> Text -> PutRemediationExceptions)
-> Lens PutRemediationExceptions PutRemediationExceptions Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRemediationExceptions' {Text
configRuleName :: Text
$sel:configRuleName:PutRemediationExceptions' :: PutRemediationExceptions -> Text
configRuleName} -> Text
configRuleName) (\s :: PutRemediationExceptions
s@PutRemediationExceptions' {} Text
a -> PutRemediationExceptions
s {$sel:configRuleName:PutRemediationExceptions' :: Text
configRuleName = Text
a} :: PutRemediationExceptions)

-- | An exception list of resource exception keys to be processed with the
-- current request. Config adds exception for each resource key. For
-- example, Config adds 3 exceptions for 3 resource keys.
putRemediationExceptions_resourceKeys :: Lens.Lens' PutRemediationExceptions (Prelude.NonEmpty RemediationExceptionResourceKey)
putRemediationExceptions_resourceKeys :: (NonEmpty RemediationExceptionResourceKey
 -> f (NonEmpty RemediationExceptionResourceKey))
-> PutRemediationExceptions -> f PutRemediationExceptions
putRemediationExceptions_resourceKeys = (PutRemediationExceptions
 -> NonEmpty RemediationExceptionResourceKey)
-> (PutRemediationExceptions
    -> NonEmpty RemediationExceptionResourceKey
    -> PutRemediationExceptions)
-> Lens
     PutRemediationExceptions
     PutRemediationExceptions
     (NonEmpty RemediationExceptionResourceKey)
     (NonEmpty RemediationExceptionResourceKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRemediationExceptions' {NonEmpty RemediationExceptionResourceKey
resourceKeys :: NonEmpty RemediationExceptionResourceKey
$sel:resourceKeys:PutRemediationExceptions' :: PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
resourceKeys} -> NonEmpty RemediationExceptionResourceKey
resourceKeys) (\s :: PutRemediationExceptions
s@PutRemediationExceptions' {} NonEmpty RemediationExceptionResourceKey
a -> PutRemediationExceptions
s {$sel:resourceKeys:PutRemediationExceptions' :: NonEmpty RemediationExceptionResourceKey
resourceKeys = NonEmpty RemediationExceptionResourceKey
a} :: PutRemediationExceptions) ((NonEmpty RemediationExceptionResourceKey
  -> f (NonEmpty RemediationExceptionResourceKey))
 -> PutRemediationExceptions -> f PutRemediationExceptions)
-> ((NonEmpty RemediationExceptionResourceKey
     -> f (NonEmpty RemediationExceptionResourceKey))
    -> NonEmpty RemediationExceptionResourceKey
    -> f (NonEmpty RemediationExceptionResourceKey))
-> (NonEmpty RemediationExceptionResourceKey
    -> f (NonEmpty RemediationExceptionResourceKey))
-> PutRemediationExceptions
-> f PutRemediationExceptions
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty RemediationExceptionResourceKey
 -> f (NonEmpty RemediationExceptionResourceKey))
-> NonEmpty RemediationExceptionResourceKey
-> f (NonEmpty RemediationExceptionResourceKey)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest PutRemediationExceptions where
  type
    AWSResponse PutRemediationExceptions =
      PutRemediationExceptionsResponse
  request :: PutRemediationExceptions -> Request PutRemediationExceptions
request = Service
-> PutRemediationExceptions -> Request PutRemediationExceptions
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutRemediationExceptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutRemediationExceptions)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutRemediationExceptions))
-> Logger
-> Service
-> Proxy PutRemediationExceptions
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutRemediationExceptions)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [FailedRemediationExceptionBatch]
-> Int -> PutRemediationExceptionsResponse
PutRemediationExceptionsResponse'
            (Maybe [FailedRemediationExceptionBatch]
 -> Int -> PutRemediationExceptionsResponse)
-> Either String (Maybe [FailedRemediationExceptionBatch])
-> Either String (Int -> PutRemediationExceptionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Either String (Maybe (Maybe [FailedRemediationExceptionBatch]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"FailedBatches" Either String (Maybe (Maybe [FailedRemediationExceptionBatch]))
-> Maybe [FailedRemediationExceptionBatch]
-> Either String (Maybe [FailedRemediationExceptionBatch])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FailedRemediationExceptionBatch]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> PutRemediationExceptionsResponse)
-> Either String Int
-> Either String PutRemediationExceptionsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable PutRemediationExceptions

instance Prelude.NFData PutRemediationExceptions

instance Core.ToHeaders PutRemediationExceptions where
  toHeaders :: PutRemediationExceptions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutRemediationExceptions -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StarlingDoveService.PutRemediationExceptions" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON PutRemediationExceptions where
  toJSON :: PutRemediationExceptions -> Value
toJSON PutRemediationExceptions' {Maybe Text
Maybe POSIX
NonEmpty RemediationExceptionResourceKey
Text
resourceKeys :: NonEmpty RemediationExceptionResourceKey
configRuleName :: Text
expirationTime :: Maybe POSIX
message :: Maybe Text
$sel:resourceKeys:PutRemediationExceptions' :: PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
$sel:configRuleName:PutRemediationExceptions' :: PutRemediationExceptions -> Text
$sel:expirationTime:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe POSIX
$sel:message:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Message" 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
message,
            (Text
"ExpirationTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
expirationTime,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ConfigRuleName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
configRuleName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceKeys" Text -> NonEmpty RemediationExceptionResourceKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty RemediationExceptionResourceKey
resourceKeys)
          ]
      )

instance Core.ToPath PutRemediationExceptions where
  toPath :: PutRemediationExceptions -> ByteString
toPath = ByteString -> PutRemediationExceptions -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery PutRemediationExceptions where
  toQuery :: PutRemediationExceptions -> QueryString
toQuery = QueryString -> PutRemediationExceptions -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newPutRemediationExceptionsResponse' smart constructor.
data PutRemediationExceptionsResponse = PutRemediationExceptionsResponse'
  { -- | Returns a list of failed remediation exceptions batch objects. Each
    -- object in the batch consists of a list of failed items and failure
    -- messages.
    PutRemediationExceptionsResponse
-> Maybe [FailedRemediationExceptionBatch]
failedBatches :: Prelude.Maybe [FailedRemediationExceptionBatch],
    -- | The response's http status code.
    PutRemediationExceptionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (PutRemediationExceptionsResponse
-> PutRemediationExceptionsResponse -> Bool
(PutRemediationExceptionsResponse
 -> PutRemediationExceptionsResponse -> Bool)
-> (PutRemediationExceptionsResponse
    -> PutRemediationExceptionsResponse -> Bool)
-> Eq PutRemediationExceptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRemediationExceptionsResponse
-> PutRemediationExceptionsResponse -> Bool
$c/= :: PutRemediationExceptionsResponse
-> PutRemediationExceptionsResponse -> Bool
== :: PutRemediationExceptionsResponse
-> PutRemediationExceptionsResponse -> Bool
$c== :: PutRemediationExceptionsResponse
-> PutRemediationExceptionsResponse -> Bool
Prelude.Eq, ReadPrec [PutRemediationExceptionsResponse]
ReadPrec PutRemediationExceptionsResponse
Int -> ReadS PutRemediationExceptionsResponse
ReadS [PutRemediationExceptionsResponse]
(Int -> ReadS PutRemediationExceptionsResponse)
-> ReadS [PutRemediationExceptionsResponse]
-> ReadPrec PutRemediationExceptionsResponse
-> ReadPrec [PutRemediationExceptionsResponse]
-> Read PutRemediationExceptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRemediationExceptionsResponse]
$creadListPrec :: ReadPrec [PutRemediationExceptionsResponse]
readPrec :: ReadPrec PutRemediationExceptionsResponse
$creadPrec :: ReadPrec PutRemediationExceptionsResponse
readList :: ReadS [PutRemediationExceptionsResponse]
$creadList :: ReadS [PutRemediationExceptionsResponse]
readsPrec :: Int -> ReadS PutRemediationExceptionsResponse
$creadsPrec :: Int -> ReadS PutRemediationExceptionsResponse
Prelude.Read, Int -> PutRemediationExceptionsResponse -> ShowS
[PutRemediationExceptionsResponse] -> ShowS
PutRemediationExceptionsResponse -> String
(Int -> PutRemediationExceptionsResponse -> ShowS)
-> (PutRemediationExceptionsResponse -> String)
-> ([PutRemediationExceptionsResponse] -> ShowS)
-> Show PutRemediationExceptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRemediationExceptionsResponse] -> ShowS
$cshowList :: [PutRemediationExceptionsResponse] -> ShowS
show :: PutRemediationExceptionsResponse -> String
$cshow :: PutRemediationExceptionsResponse -> String
showsPrec :: Int -> PutRemediationExceptionsResponse -> ShowS
$cshowsPrec :: Int -> PutRemediationExceptionsResponse -> ShowS
Prelude.Show, (forall x.
 PutRemediationExceptionsResponse
 -> Rep PutRemediationExceptionsResponse x)
-> (forall x.
    Rep PutRemediationExceptionsResponse x
    -> PutRemediationExceptionsResponse)
-> Generic PutRemediationExceptionsResponse
forall x.
Rep PutRemediationExceptionsResponse x
-> PutRemediationExceptionsResponse
forall x.
PutRemediationExceptionsResponse
-> Rep PutRemediationExceptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutRemediationExceptionsResponse x
-> PutRemediationExceptionsResponse
$cfrom :: forall x.
PutRemediationExceptionsResponse
-> Rep PutRemediationExceptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutRemediationExceptionsResponse' 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:
--
-- 'failedBatches', 'putRemediationExceptionsResponse_failedBatches' - Returns a list of failed remediation exceptions batch objects. Each
-- object in the batch consists of a list of failed items and failure
-- messages.
--
-- 'httpStatus', 'putRemediationExceptionsResponse_httpStatus' - The response's http status code.
newPutRemediationExceptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  PutRemediationExceptionsResponse
newPutRemediationExceptionsResponse :: Int -> PutRemediationExceptionsResponse
newPutRemediationExceptionsResponse Int
pHttpStatus_ =
  PutRemediationExceptionsResponse' :: Maybe [FailedRemediationExceptionBatch]
-> Int -> PutRemediationExceptionsResponse
PutRemediationExceptionsResponse'
    { $sel:failedBatches:PutRemediationExceptionsResponse' :: Maybe [FailedRemediationExceptionBatch]
failedBatches =
        Maybe [FailedRemediationExceptionBatch]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:PutRemediationExceptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Returns a list of failed remediation exceptions batch objects. Each
-- object in the batch consists of a list of failed items and failure
-- messages.
putRemediationExceptionsResponse_failedBatches :: Lens.Lens' PutRemediationExceptionsResponse (Prelude.Maybe [FailedRemediationExceptionBatch])
putRemediationExceptionsResponse_failedBatches :: (Maybe [FailedRemediationExceptionBatch]
 -> f (Maybe [FailedRemediationExceptionBatch]))
-> PutRemediationExceptionsResponse
-> f PutRemediationExceptionsResponse
putRemediationExceptionsResponse_failedBatches = (PutRemediationExceptionsResponse
 -> Maybe [FailedRemediationExceptionBatch])
-> (PutRemediationExceptionsResponse
    -> Maybe [FailedRemediationExceptionBatch]
    -> PutRemediationExceptionsResponse)
-> Lens
     PutRemediationExceptionsResponse
     PutRemediationExceptionsResponse
     (Maybe [FailedRemediationExceptionBatch])
     (Maybe [FailedRemediationExceptionBatch])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRemediationExceptionsResponse' {Maybe [FailedRemediationExceptionBatch]
failedBatches :: Maybe [FailedRemediationExceptionBatch]
$sel:failedBatches:PutRemediationExceptionsResponse' :: PutRemediationExceptionsResponse
-> Maybe [FailedRemediationExceptionBatch]
failedBatches} -> Maybe [FailedRemediationExceptionBatch]
failedBatches) (\s :: PutRemediationExceptionsResponse
s@PutRemediationExceptionsResponse' {} Maybe [FailedRemediationExceptionBatch]
a -> PutRemediationExceptionsResponse
s {$sel:failedBatches:PutRemediationExceptionsResponse' :: Maybe [FailedRemediationExceptionBatch]
failedBatches = Maybe [FailedRemediationExceptionBatch]
a} :: PutRemediationExceptionsResponse) ((Maybe [FailedRemediationExceptionBatch]
  -> f (Maybe [FailedRemediationExceptionBatch]))
 -> PutRemediationExceptionsResponse
 -> f PutRemediationExceptionsResponse)
-> ((Maybe [FailedRemediationExceptionBatch]
     -> f (Maybe [FailedRemediationExceptionBatch]))
    -> Maybe [FailedRemediationExceptionBatch]
    -> f (Maybe [FailedRemediationExceptionBatch]))
-> (Maybe [FailedRemediationExceptionBatch]
    -> f (Maybe [FailedRemediationExceptionBatch]))
-> PutRemediationExceptionsResponse
-> f PutRemediationExceptionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [FailedRemediationExceptionBatch]
  [FailedRemediationExceptionBatch]
  [FailedRemediationExceptionBatch]
  [FailedRemediationExceptionBatch]
-> Iso
     (Maybe [FailedRemediationExceptionBatch])
     (Maybe [FailedRemediationExceptionBatch])
     (Maybe [FailedRemediationExceptionBatch])
     (Maybe [FailedRemediationExceptionBatch])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [FailedRemediationExceptionBatch]
  [FailedRemediationExceptionBatch]
  [FailedRemediationExceptionBatch]
  [FailedRemediationExceptionBatch]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
putRemediationExceptionsResponse_httpStatus :: Lens.Lens' PutRemediationExceptionsResponse Prelude.Int
putRemediationExceptionsResponse_httpStatus :: (Int -> f Int)
-> PutRemediationExceptionsResponse
-> f PutRemediationExceptionsResponse
putRemediationExceptionsResponse_httpStatus = (PutRemediationExceptionsResponse -> Int)
-> (PutRemediationExceptionsResponse
    -> Int -> PutRemediationExceptionsResponse)
-> Lens
     PutRemediationExceptionsResponse
     PutRemediationExceptionsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRemediationExceptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutRemediationExceptionsResponse' :: PutRemediationExceptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutRemediationExceptionsResponse
s@PutRemediationExceptionsResponse' {} Int
a -> PutRemediationExceptionsResponse
s {$sel:httpStatus:PutRemediationExceptionsResponse' :: Int
httpStatus = Int
a} :: PutRemediationExceptionsResponse)

instance
  Prelude.NFData
    PutRemediationExceptionsResponse