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