{-# 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 #-}
module Amazonka.Config.PutRemediationExceptions
(
PutRemediationExceptions (..),
newPutRemediationExceptions,
putRemediationExceptions_expirationTime,
putRemediationExceptions_message,
putRemediationExceptions_configRuleName,
putRemediationExceptions_resourceKeys,
PutRemediationExceptionsResponse (..),
newPutRemediationExceptionsResponse,
putRemediationExceptionsResponse_failedBatches,
putRemediationExceptionsResponse_httpStatus,
)
where
import Amazonka.Config.Types
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 qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutRemediationExceptions = PutRemediationExceptions'
{
PutRemediationExceptions -> Maybe POSIX
expirationTime :: Prelude.Maybe Data.POSIX,
PutRemediationExceptions -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
PutRemediationExceptions -> Text
configRuleName :: Prelude.Text,
PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
resourceKeys :: Prelude.NonEmpty RemediationExceptionResourceKey
}
deriving (PutRemediationExceptions -> PutRemediationExceptions -> Bool
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]
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
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.
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)
newPutRemediationExceptions ::
Prelude.Text ->
Prelude.NonEmpty RemediationExceptionResourceKey ->
PutRemediationExceptions
newPutRemediationExceptions :: Text
-> NonEmpty RemediationExceptionResourceKey
-> PutRemediationExceptions
newPutRemediationExceptions
Text
pConfigRuleName_
NonEmpty RemediationExceptionResourceKey
pResourceKeys_ =
PutRemediationExceptions'
{ $sel:expirationTime:PutRemediationExceptions' :: Maybe POSIX
expirationTime =
forall a. Maybe a
Prelude.Nothing,
$sel:message:PutRemediationExceptions' :: Maybe Text
message = forall a. Maybe a
Prelude.Nothing,
$sel:configRuleName:PutRemediationExceptions' :: Text
configRuleName = Text
pConfigRuleName_,
$sel:resourceKeys:PutRemediationExceptions' :: NonEmpty RemediationExceptionResourceKey
resourceKeys = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty RemediationExceptionResourceKey
pResourceKeys_
}
putRemediationExceptions_expirationTime :: Lens.Lens' PutRemediationExceptions (Prelude.Maybe Prelude.UTCTime)
putRemediationExceptions_expirationTime :: Lens' PutRemediationExceptions (Maybe UTCTime)
putRemediationExceptions_expirationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
putRemediationExceptions_message :: Lens.Lens' PutRemediationExceptions (Prelude.Maybe Prelude.Text)
putRemediationExceptions_message :: Lens' PutRemediationExceptions (Maybe Text)
putRemediationExceptions_message = 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)
putRemediationExceptions_configRuleName :: Lens.Lens' PutRemediationExceptions Prelude.Text
putRemediationExceptions_configRuleName :: Lens' PutRemediationExceptions Text
putRemediationExceptions_configRuleName = 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)
putRemediationExceptions_resourceKeys :: Lens.Lens' PutRemediationExceptions (Prelude.NonEmpty RemediationExceptionResourceKey)
putRemediationExceptions_resourceKeys :: Lens'
PutRemediationExceptions (NonEmpty RemediationExceptionResourceKey)
putRemediationExceptions_resourceKeys = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: (Service -> Service)
-> PutRemediationExceptions -> Request PutRemediationExceptions
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutRemediationExceptions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutRemediationExceptions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [FailedRemediationExceptionBatch]
-> Int -> PutRemediationExceptionsResponse
PutRemediationExceptionsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"FailedBatches" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutRemediationExceptions where
hashWithSalt :: Int -> PutRemediationExceptions -> Int
hashWithSalt Int
_salt PutRemediationExceptions' {Maybe Text
Maybe POSIX
NonEmpty RemediationExceptionResourceKey
Text
resourceKeys :: NonEmpty RemediationExceptionResourceKey
configRuleName :: Text
message :: Maybe Text
expirationTime :: Maybe POSIX
$sel:resourceKeys:PutRemediationExceptions' :: PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
$sel:configRuleName:PutRemediationExceptions' :: PutRemediationExceptions -> Text
$sel:message:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe Text
$sel:expirationTime:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
expirationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
message
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configRuleName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty RemediationExceptionResourceKey
resourceKeys
instance Prelude.NFData PutRemediationExceptions where
rnf :: PutRemediationExceptions -> ()
rnf PutRemediationExceptions' {Maybe Text
Maybe POSIX
NonEmpty RemediationExceptionResourceKey
Text
resourceKeys :: NonEmpty RemediationExceptionResourceKey
configRuleName :: Text
message :: Maybe Text
expirationTime :: Maybe POSIX
$sel:resourceKeys:PutRemediationExceptions' :: PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
$sel:configRuleName:PutRemediationExceptions' :: PutRemediationExceptions -> Text
$sel:message:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe Text
$sel:expirationTime:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
expirationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
message
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
configRuleName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty RemediationExceptionResourceKey
resourceKeys
instance Data.ToHeaders PutRemediationExceptions where
toHeaders :: PutRemediationExceptions -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"StarlingDoveService.PutRemediationExceptions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutRemediationExceptions where
toJSON :: PutRemediationExceptions -> Value
toJSON PutRemediationExceptions' {Maybe Text
Maybe POSIX
NonEmpty RemediationExceptionResourceKey
Text
resourceKeys :: NonEmpty RemediationExceptionResourceKey
configRuleName :: Text
message :: Maybe Text
expirationTime :: Maybe POSIX
$sel:resourceKeys:PutRemediationExceptions' :: PutRemediationExceptions
-> NonEmpty RemediationExceptionResourceKey
$sel:configRuleName:PutRemediationExceptions' :: PutRemediationExceptions -> Text
$sel:message:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe Text
$sel:expirationTime:PutRemediationExceptions' :: PutRemediationExceptions -> Maybe POSIX
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ExpirationTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
expirationTime,
(Key
"Message" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
message,
forall a. a -> Maybe a
Prelude.Just
(Key
"ConfigRuleName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
configRuleName),
forall a. a -> Maybe a
Prelude.Just (Key
"ResourceKeys" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty RemediationExceptionResourceKey
resourceKeys)
]
)
instance Data.ToPath PutRemediationExceptions where
toPath :: PutRemediationExceptions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutRemediationExceptions where
toQuery :: PutRemediationExceptions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutRemediationExceptionsResponse = PutRemediationExceptionsResponse'
{
PutRemediationExceptionsResponse
-> Maybe [FailedRemediationExceptionBatch]
failedBatches :: Prelude.Maybe [FailedRemediationExceptionBatch],
PutRemediationExceptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutRemediationExceptionsResponse
-> PutRemediationExceptionsResponse -> Bool
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]
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
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.
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)
newPutRemediationExceptionsResponse ::
Prelude.Int ->
PutRemediationExceptionsResponse
newPutRemediationExceptionsResponse :: Int -> PutRemediationExceptionsResponse
newPutRemediationExceptionsResponse Int
pHttpStatus_ =
PutRemediationExceptionsResponse'
{ $sel:failedBatches:PutRemediationExceptionsResponse' :: Maybe [FailedRemediationExceptionBatch]
failedBatches =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:PutRemediationExceptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
putRemediationExceptionsResponse_failedBatches :: Lens.Lens' PutRemediationExceptionsResponse (Prelude.Maybe [FailedRemediationExceptionBatch])
putRemediationExceptionsResponse_failedBatches :: Lens'
PutRemediationExceptionsResponse
(Maybe [FailedRemediationExceptionBatch])
putRemediationExceptionsResponse_failedBatches = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putRemediationExceptionsResponse_httpStatus :: Lens.Lens' PutRemediationExceptionsResponse Prelude.Int
putRemediationExceptionsResponse_httpStatus :: Lens' PutRemediationExceptionsResponse Int
putRemediationExceptionsResponse_httpStatus = 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
where
rnf :: PutRemediationExceptionsResponse -> ()
rnf PutRemediationExceptionsResponse' {Int
Maybe [FailedRemediationExceptionBatch]
httpStatus :: Int
failedBatches :: Maybe [FailedRemediationExceptionBatch]
$sel:httpStatus:PutRemediationExceptionsResponse' :: PutRemediationExceptionsResponse -> Int
$sel:failedBatches:PutRemediationExceptionsResponse' :: PutRemediationExceptionsResponse
-> Maybe [FailedRemediationExceptionBatch]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [FailedRemediationExceptionBatch]
failedBatches
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus