{-# 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.DescribeRemediationConfigurations
(
DescribeRemediationConfigurations (..),
newDescribeRemediationConfigurations,
describeRemediationConfigurations_configRuleNames,
DescribeRemediationConfigurationsResponse (..),
newDescribeRemediationConfigurationsResponse,
describeRemediationConfigurationsResponse_remediationConfigurations,
describeRemediationConfigurationsResponse_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
data DescribeRemediationConfigurations = DescribeRemediationConfigurations'
{
DescribeRemediationConfigurations -> [Text]
configRuleNames :: [Prelude.Text]
}
deriving (DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool
(DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool)
-> (DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool)
-> Eq DescribeRemediationConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool
$c/= :: DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool
== :: DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool
$c== :: DescribeRemediationConfigurations
-> DescribeRemediationConfigurations -> Bool
Prelude.Eq, ReadPrec [DescribeRemediationConfigurations]
ReadPrec DescribeRemediationConfigurations
Int -> ReadS DescribeRemediationConfigurations
ReadS [DescribeRemediationConfigurations]
(Int -> ReadS DescribeRemediationConfigurations)
-> ReadS [DescribeRemediationConfigurations]
-> ReadPrec DescribeRemediationConfigurations
-> ReadPrec [DescribeRemediationConfigurations]
-> Read DescribeRemediationConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRemediationConfigurations]
$creadListPrec :: ReadPrec [DescribeRemediationConfigurations]
readPrec :: ReadPrec DescribeRemediationConfigurations
$creadPrec :: ReadPrec DescribeRemediationConfigurations
readList :: ReadS [DescribeRemediationConfigurations]
$creadList :: ReadS [DescribeRemediationConfigurations]
readsPrec :: Int -> ReadS DescribeRemediationConfigurations
$creadsPrec :: Int -> ReadS DescribeRemediationConfigurations
Prelude.Read, Int -> DescribeRemediationConfigurations -> ShowS
[DescribeRemediationConfigurations] -> ShowS
DescribeRemediationConfigurations -> String
(Int -> DescribeRemediationConfigurations -> ShowS)
-> (DescribeRemediationConfigurations -> String)
-> ([DescribeRemediationConfigurations] -> ShowS)
-> Show DescribeRemediationConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRemediationConfigurations] -> ShowS
$cshowList :: [DescribeRemediationConfigurations] -> ShowS
show :: DescribeRemediationConfigurations -> String
$cshow :: DescribeRemediationConfigurations -> String
showsPrec :: Int -> DescribeRemediationConfigurations -> ShowS
$cshowsPrec :: Int -> DescribeRemediationConfigurations -> ShowS
Prelude.Show, (forall x.
DescribeRemediationConfigurations
-> Rep DescribeRemediationConfigurations x)
-> (forall x.
Rep DescribeRemediationConfigurations x
-> DescribeRemediationConfigurations)
-> Generic DescribeRemediationConfigurations
forall x.
Rep DescribeRemediationConfigurations x
-> DescribeRemediationConfigurations
forall x.
DescribeRemediationConfigurations
-> Rep DescribeRemediationConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRemediationConfigurations x
-> DescribeRemediationConfigurations
$cfrom :: forall x.
DescribeRemediationConfigurations
-> Rep DescribeRemediationConfigurations x
Prelude.Generic)
newDescribeRemediationConfigurations ::
DescribeRemediationConfigurations
newDescribeRemediationConfigurations :: DescribeRemediationConfigurations
newDescribeRemediationConfigurations =
DescribeRemediationConfigurations' :: [Text] -> DescribeRemediationConfigurations
DescribeRemediationConfigurations'
{ $sel:configRuleNames:DescribeRemediationConfigurations' :: [Text]
configRuleNames =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
describeRemediationConfigurations_configRuleNames :: Lens.Lens' DescribeRemediationConfigurations [Prelude.Text]
describeRemediationConfigurations_configRuleNames :: ([Text] -> f [Text])
-> DescribeRemediationConfigurations
-> f DescribeRemediationConfigurations
describeRemediationConfigurations_configRuleNames = (DescribeRemediationConfigurations -> [Text])
-> (DescribeRemediationConfigurations
-> [Text] -> DescribeRemediationConfigurations)
-> Lens
DescribeRemediationConfigurations
DescribeRemediationConfigurations
[Text]
[Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRemediationConfigurations' {[Text]
configRuleNames :: [Text]
$sel:configRuleNames:DescribeRemediationConfigurations' :: DescribeRemediationConfigurations -> [Text]
configRuleNames} -> [Text]
configRuleNames) (\s :: DescribeRemediationConfigurations
s@DescribeRemediationConfigurations' {} [Text]
a -> DescribeRemediationConfigurations
s {$sel:configRuleNames:DescribeRemediationConfigurations' :: [Text]
configRuleNames = [Text]
a} :: DescribeRemediationConfigurations) (([Text] -> f [Text])
-> DescribeRemediationConfigurations
-> f DescribeRemediationConfigurations)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeRemediationConfigurations
-> f DescribeRemediationConfigurations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.AWSRequest
DescribeRemediationConfigurations
where
type
AWSResponse DescribeRemediationConfigurations =
DescribeRemediationConfigurationsResponse
request :: DescribeRemediationConfigurations
-> Request DescribeRemediationConfigurations
request = Service
-> DescribeRemediationConfigurations
-> Request DescribeRemediationConfigurations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeRemediationConfigurations
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeRemediationConfigurations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeRemediationConfigurations))
-> Logger
-> Service
-> Proxy DescribeRemediationConfigurations
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse DescribeRemediationConfigurations)))
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 [RemediationConfiguration]
-> Int -> DescribeRemediationConfigurationsResponse
DescribeRemediationConfigurationsResponse'
(Maybe [RemediationConfiguration]
-> Int -> DescribeRemediationConfigurationsResponse)
-> Either String (Maybe [RemediationConfiguration])
-> Either String (Int -> DescribeRemediationConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [RemediationConfiguration]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"RemediationConfigurations"
Either String (Maybe (Maybe [RemediationConfiguration]))
-> Maybe [RemediationConfiguration]
-> Either String (Maybe [RemediationConfiguration])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [RemediationConfiguration]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> DescribeRemediationConfigurationsResponse)
-> Either String Int
-> Either String DescribeRemediationConfigurationsResponse
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
DescribeRemediationConfigurations
instance
Prelude.NFData
DescribeRemediationConfigurations
instance
Core.ToHeaders
DescribeRemediationConfigurations
where
toHeaders :: DescribeRemediationConfigurations -> ResponseHeaders
toHeaders =
ResponseHeaders
-> DescribeRemediationConfigurations -> 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.DescribeRemediationConfigurations" ::
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
DescribeRemediationConfigurations
where
toJSON :: DescribeRemediationConfigurations -> Value
toJSON DescribeRemediationConfigurations' {[Text]
configRuleNames :: [Text]
$sel:configRuleNames:DescribeRemediationConfigurations' :: DescribeRemediationConfigurations -> [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ConfigRuleNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
configRuleNames)
]
)
instance
Core.ToPath
DescribeRemediationConfigurations
where
toPath :: DescribeRemediationConfigurations -> ByteString
toPath = ByteString -> DescribeRemediationConfigurations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
DescribeRemediationConfigurations
where
toQuery :: DescribeRemediationConfigurations -> QueryString
toQuery = QueryString -> DescribeRemediationConfigurations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeRemediationConfigurationsResponse = DescribeRemediationConfigurationsResponse'
{
DescribeRemediationConfigurationsResponse
-> Maybe [RemediationConfiguration]
remediationConfigurations :: Prelude.Maybe [RemediationConfiguration],
DescribeRemediationConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool
(DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool)
-> (DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool)
-> Eq DescribeRemediationConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool
$c/= :: DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool
== :: DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool
$c== :: DescribeRemediationConfigurationsResponse
-> DescribeRemediationConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRemediationConfigurationsResponse]
ReadPrec DescribeRemediationConfigurationsResponse
Int -> ReadS DescribeRemediationConfigurationsResponse
ReadS [DescribeRemediationConfigurationsResponse]
(Int -> ReadS DescribeRemediationConfigurationsResponse)
-> ReadS [DescribeRemediationConfigurationsResponse]
-> ReadPrec DescribeRemediationConfigurationsResponse
-> ReadPrec [DescribeRemediationConfigurationsResponse]
-> Read DescribeRemediationConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRemediationConfigurationsResponse]
$creadListPrec :: ReadPrec [DescribeRemediationConfigurationsResponse]
readPrec :: ReadPrec DescribeRemediationConfigurationsResponse
$creadPrec :: ReadPrec DescribeRemediationConfigurationsResponse
readList :: ReadS [DescribeRemediationConfigurationsResponse]
$creadList :: ReadS [DescribeRemediationConfigurationsResponse]
readsPrec :: Int -> ReadS DescribeRemediationConfigurationsResponse
$creadsPrec :: Int -> ReadS DescribeRemediationConfigurationsResponse
Prelude.Read, Int -> DescribeRemediationConfigurationsResponse -> ShowS
[DescribeRemediationConfigurationsResponse] -> ShowS
DescribeRemediationConfigurationsResponse -> String
(Int -> DescribeRemediationConfigurationsResponse -> ShowS)
-> (DescribeRemediationConfigurationsResponse -> String)
-> ([DescribeRemediationConfigurationsResponse] -> ShowS)
-> Show DescribeRemediationConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRemediationConfigurationsResponse] -> ShowS
$cshowList :: [DescribeRemediationConfigurationsResponse] -> ShowS
show :: DescribeRemediationConfigurationsResponse -> String
$cshow :: DescribeRemediationConfigurationsResponse -> String
showsPrec :: Int -> DescribeRemediationConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeRemediationConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
DescribeRemediationConfigurationsResponse
-> Rep DescribeRemediationConfigurationsResponse x)
-> (forall x.
Rep DescribeRemediationConfigurationsResponse x
-> DescribeRemediationConfigurationsResponse)
-> Generic DescribeRemediationConfigurationsResponse
forall x.
Rep DescribeRemediationConfigurationsResponse x
-> DescribeRemediationConfigurationsResponse
forall x.
DescribeRemediationConfigurationsResponse
-> Rep DescribeRemediationConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRemediationConfigurationsResponse x
-> DescribeRemediationConfigurationsResponse
$cfrom :: forall x.
DescribeRemediationConfigurationsResponse
-> Rep DescribeRemediationConfigurationsResponse x
Prelude.Generic)
newDescribeRemediationConfigurationsResponse ::
Prelude.Int ->
DescribeRemediationConfigurationsResponse
newDescribeRemediationConfigurationsResponse :: Int -> DescribeRemediationConfigurationsResponse
newDescribeRemediationConfigurationsResponse
Int
pHttpStatus_ =
DescribeRemediationConfigurationsResponse' :: Maybe [RemediationConfiguration]
-> Int -> DescribeRemediationConfigurationsResponse
DescribeRemediationConfigurationsResponse'
{ $sel:remediationConfigurations:DescribeRemediationConfigurationsResponse' :: Maybe [RemediationConfiguration]
remediationConfigurations =
Maybe [RemediationConfiguration]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeRemediationConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeRemediationConfigurationsResponse_remediationConfigurations :: Lens.Lens' DescribeRemediationConfigurationsResponse (Prelude.Maybe [RemediationConfiguration])
describeRemediationConfigurationsResponse_remediationConfigurations :: (Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> DescribeRemediationConfigurationsResponse
-> f DescribeRemediationConfigurationsResponse
describeRemediationConfigurationsResponse_remediationConfigurations = (DescribeRemediationConfigurationsResponse
-> Maybe [RemediationConfiguration])
-> (DescribeRemediationConfigurationsResponse
-> Maybe [RemediationConfiguration]
-> DescribeRemediationConfigurationsResponse)
-> Lens
DescribeRemediationConfigurationsResponse
DescribeRemediationConfigurationsResponse
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRemediationConfigurationsResponse' {Maybe [RemediationConfiguration]
remediationConfigurations :: Maybe [RemediationConfiguration]
$sel:remediationConfigurations:DescribeRemediationConfigurationsResponse' :: DescribeRemediationConfigurationsResponse
-> Maybe [RemediationConfiguration]
remediationConfigurations} -> Maybe [RemediationConfiguration]
remediationConfigurations) (\s :: DescribeRemediationConfigurationsResponse
s@DescribeRemediationConfigurationsResponse' {} Maybe [RemediationConfiguration]
a -> DescribeRemediationConfigurationsResponse
s {$sel:remediationConfigurations:DescribeRemediationConfigurationsResponse' :: Maybe [RemediationConfiguration]
remediationConfigurations = Maybe [RemediationConfiguration]
a} :: DescribeRemediationConfigurationsResponse) ((Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> DescribeRemediationConfigurationsResponse
-> f DescribeRemediationConfigurationsResponse)
-> ((Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> (Maybe [RemediationConfiguration]
-> f (Maybe [RemediationConfiguration]))
-> DescribeRemediationConfigurationsResponse
-> f DescribeRemediationConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
-> Iso
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
(Maybe [RemediationConfiguration])
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
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
[RemediationConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
describeRemediationConfigurationsResponse_httpStatus :: Lens.Lens' DescribeRemediationConfigurationsResponse Prelude.Int
describeRemediationConfigurationsResponse_httpStatus :: (Int -> f Int)
-> DescribeRemediationConfigurationsResponse
-> f DescribeRemediationConfigurationsResponse
describeRemediationConfigurationsResponse_httpStatus = (DescribeRemediationConfigurationsResponse -> Int)
-> (DescribeRemediationConfigurationsResponse
-> Int -> DescribeRemediationConfigurationsResponse)
-> Lens
DescribeRemediationConfigurationsResponse
DescribeRemediationConfigurationsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRemediationConfigurationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRemediationConfigurationsResponse' :: DescribeRemediationConfigurationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRemediationConfigurationsResponse
s@DescribeRemediationConfigurationsResponse' {} Int
a -> DescribeRemediationConfigurationsResponse
s {$sel:httpStatus:DescribeRemediationConfigurationsResponse' :: Int
httpStatus = Int
a} :: DescribeRemediationConfigurationsResponse)
instance
Prelude.NFData
DescribeRemediationConfigurationsResponse