{-# 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.DevOpsGuru.PutFeedback
(
PutFeedback (..),
newPutFeedback,
putFeedback_insightFeedback,
PutFeedbackResponse (..),
newPutFeedbackResponse,
putFeedbackResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data PutFeedback = PutFeedback'
{
PutFeedback -> Maybe InsightFeedback
insightFeedback :: Prelude.Maybe InsightFeedback
}
deriving (PutFeedback -> PutFeedback -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFeedback -> PutFeedback -> Bool
$c/= :: PutFeedback -> PutFeedback -> Bool
== :: PutFeedback -> PutFeedback -> Bool
$c== :: PutFeedback -> PutFeedback -> Bool
Prelude.Eq, ReadPrec [PutFeedback]
ReadPrec PutFeedback
Int -> ReadS PutFeedback
ReadS [PutFeedback]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFeedback]
$creadListPrec :: ReadPrec [PutFeedback]
readPrec :: ReadPrec PutFeedback
$creadPrec :: ReadPrec PutFeedback
readList :: ReadS [PutFeedback]
$creadList :: ReadS [PutFeedback]
readsPrec :: Int -> ReadS PutFeedback
$creadsPrec :: Int -> ReadS PutFeedback
Prelude.Read, Int -> PutFeedback -> ShowS
[PutFeedback] -> ShowS
PutFeedback -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFeedback] -> ShowS
$cshowList :: [PutFeedback] -> ShowS
show :: PutFeedback -> String
$cshow :: PutFeedback -> String
showsPrec :: Int -> PutFeedback -> ShowS
$cshowsPrec :: Int -> PutFeedback -> ShowS
Prelude.Show, forall x. Rep PutFeedback x -> PutFeedback
forall x. PutFeedback -> Rep PutFeedback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutFeedback x -> PutFeedback
$cfrom :: forall x. PutFeedback -> Rep PutFeedback x
Prelude.Generic)
newPutFeedback ::
PutFeedback
newPutFeedback :: PutFeedback
newPutFeedback =
PutFeedback' {$sel:insightFeedback:PutFeedback' :: Maybe InsightFeedback
insightFeedback = forall a. Maybe a
Prelude.Nothing}
putFeedback_insightFeedback :: Lens.Lens' PutFeedback (Prelude.Maybe InsightFeedback)
putFeedback_insightFeedback :: Lens' PutFeedback (Maybe InsightFeedback)
putFeedback_insightFeedback = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFeedback' {Maybe InsightFeedback
insightFeedback :: Maybe InsightFeedback
$sel:insightFeedback:PutFeedback' :: PutFeedback -> Maybe InsightFeedback
insightFeedback} -> Maybe InsightFeedback
insightFeedback) (\s :: PutFeedback
s@PutFeedback' {} Maybe InsightFeedback
a -> PutFeedback
s {$sel:insightFeedback:PutFeedback' :: Maybe InsightFeedback
insightFeedback = Maybe InsightFeedback
a} :: PutFeedback)
instance Core.AWSRequest PutFeedback where
type AWSResponse PutFeedback = PutFeedbackResponse
request :: (Service -> Service) -> PutFeedback -> Request PutFeedback
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy PutFeedback
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutFeedback)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutFeedbackResponse
PutFeedbackResponse'
forall (f :: * -> *) a b. Functor 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 PutFeedback where
hashWithSalt :: Int -> PutFeedback -> Int
hashWithSalt Int
_salt PutFeedback' {Maybe InsightFeedback
insightFeedback :: Maybe InsightFeedback
$sel:insightFeedback:PutFeedback' :: PutFeedback -> Maybe InsightFeedback
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InsightFeedback
insightFeedback
instance Prelude.NFData PutFeedback where
rnf :: PutFeedback -> ()
rnf PutFeedback' {Maybe InsightFeedback
insightFeedback :: Maybe InsightFeedback
$sel:insightFeedback:PutFeedback' :: PutFeedback -> Maybe InsightFeedback
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe InsightFeedback
insightFeedback
instance Data.ToHeaders PutFeedback where
toHeaders :: PutFeedback -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON PutFeedback where
toJSON :: PutFeedback -> Value
toJSON PutFeedback' {Maybe InsightFeedback
insightFeedback :: Maybe InsightFeedback
$sel:insightFeedback:PutFeedback' :: PutFeedback -> Maybe InsightFeedback
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"InsightFeedback" 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 InsightFeedback
insightFeedback
]
)
instance Data.ToPath PutFeedback where
toPath :: PutFeedback -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/feedback"
instance Data.ToQuery PutFeedback where
toQuery :: PutFeedback -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutFeedbackResponse = PutFeedbackResponse'
{
PutFeedbackResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutFeedbackResponse -> PutFeedbackResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutFeedbackResponse -> PutFeedbackResponse -> Bool
$c/= :: PutFeedbackResponse -> PutFeedbackResponse -> Bool
== :: PutFeedbackResponse -> PutFeedbackResponse -> Bool
$c== :: PutFeedbackResponse -> PutFeedbackResponse -> Bool
Prelude.Eq, ReadPrec [PutFeedbackResponse]
ReadPrec PutFeedbackResponse
Int -> ReadS PutFeedbackResponse
ReadS [PutFeedbackResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutFeedbackResponse]
$creadListPrec :: ReadPrec [PutFeedbackResponse]
readPrec :: ReadPrec PutFeedbackResponse
$creadPrec :: ReadPrec PutFeedbackResponse
readList :: ReadS [PutFeedbackResponse]
$creadList :: ReadS [PutFeedbackResponse]
readsPrec :: Int -> ReadS PutFeedbackResponse
$creadsPrec :: Int -> ReadS PutFeedbackResponse
Prelude.Read, Int -> PutFeedbackResponse -> ShowS
[PutFeedbackResponse] -> ShowS
PutFeedbackResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutFeedbackResponse] -> ShowS
$cshowList :: [PutFeedbackResponse] -> ShowS
show :: PutFeedbackResponse -> String
$cshow :: PutFeedbackResponse -> String
showsPrec :: Int -> PutFeedbackResponse -> ShowS
$cshowsPrec :: Int -> PutFeedbackResponse -> ShowS
Prelude.Show, forall x. Rep PutFeedbackResponse x -> PutFeedbackResponse
forall x. PutFeedbackResponse -> Rep PutFeedbackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutFeedbackResponse x -> PutFeedbackResponse
$cfrom :: forall x. PutFeedbackResponse -> Rep PutFeedbackResponse x
Prelude.Generic)
newPutFeedbackResponse ::
Prelude.Int ->
PutFeedbackResponse
newPutFeedbackResponse :: Int -> PutFeedbackResponse
newPutFeedbackResponse Int
pHttpStatus_ =
PutFeedbackResponse' {$sel:httpStatus:PutFeedbackResponse' :: Int
httpStatus = Int
pHttpStatus_}
putFeedbackResponse_httpStatus :: Lens.Lens' PutFeedbackResponse Prelude.Int
putFeedbackResponse_httpStatus :: Lens' PutFeedbackResponse Int
putFeedbackResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutFeedbackResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutFeedbackResponse' :: PutFeedbackResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutFeedbackResponse
s@PutFeedbackResponse' {} Int
a -> PutFeedbackResponse
s {$sel:httpStatus:PutFeedbackResponse' :: Int
httpStatus = Int
a} :: PutFeedbackResponse)
instance Prelude.NFData PutFeedbackResponse where
rnf :: PutFeedbackResponse -> ()
rnf PutFeedbackResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutFeedbackResponse' :: PutFeedbackResponse -> Int
..} = forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus