{-# 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.DescribeFeedback
(
DescribeFeedback (..),
newDescribeFeedback,
describeFeedback_insightId,
DescribeFeedbackResponse (..),
newDescribeFeedbackResponse,
describeFeedbackResponse_insightFeedback,
describeFeedbackResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.Types
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 DescribeFeedback = DescribeFeedback'
{
DescribeFeedback -> Maybe Text
insightId :: Prelude.Maybe Prelude.Text
}
deriving (DescribeFeedback -> DescribeFeedback -> Bool
(DescribeFeedback -> DescribeFeedback -> Bool)
-> (DescribeFeedback -> DescribeFeedback -> Bool)
-> Eq DescribeFeedback
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFeedback -> DescribeFeedback -> Bool
$c/= :: DescribeFeedback -> DescribeFeedback -> Bool
== :: DescribeFeedback -> DescribeFeedback -> Bool
$c== :: DescribeFeedback -> DescribeFeedback -> Bool
Prelude.Eq, ReadPrec [DescribeFeedback]
ReadPrec DescribeFeedback
Int -> ReadS DescribeFeedback
ReadS [DescribeFeedback]
(Int -> ReadS DescribeFeedback)
-> ReadS [DescribeFeedback]
-> ReadPrec DescribeFeedback
-> ReadPrec [DescribeFeedback]
-> Read DescribeFeedback
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFeedback]
$creadListPrec :: ReadPrec [DescribeFeedback]
readPrec :: ReadPrec DescribeFeedback
$creadPrec :: ReadPrec DescribeFeedback
readList :: ReadS [DescribeFeedback]
$creadList :: ReadS [DescribeFeedback]
readsPrec :: Int -> ReadS DescribeFeedback
$creadsPrec :: Int -> ReadS DescribeFeedback
Prelude.Read, Int -> DescribeFeedback -> ShowS
[DescribeFeedback] -> ShowS
DescribeFeedback -> String
(Int -> DescribeFeedback -> ShowS)
-> (DescribeFeedback -> String)
-> ([DescribeFeedback] -> ShowS)
-> Show DescribeFeedback
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFeedback] -> ShowS
$cshowList :: [DescribeFeedback] -> ShowS
show :: DescribeFeedback -> String
$cshow :: DescribeFeedback -> String
showsPrec :: Int -> DescribeFeedback -> ShowS
$cshowsPrec :: Int -> DescribeFeedback -> ShowS
Prelude.Show, (forall x. DescribeFeedback -> Rep DescribeFeedback x)
-> (forall x. Rep DescribeFeedback x -> DescribeFeedback)
-> Generic DescribeFeedback
forall x. Rep DescribeFeedback x -> DescribeFeedback
forall x. DescribeFeedback -> Rep DescribeFeedback x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeFeedback x -> DescribeFeedback
$cfrom :: forall x. DescribeFeedback -> Rep DescribeFeedback x
Prelude.Generic)
newDescribeFeedback ::
DescribeFeedback
newDescribeFeedback :: DescribeFeedback
newDescribeFeedback =
DescribeFeedback' :: Maybe Text -> DescribeFeedback
DescribeFeedback' {$sel:insightId:DescribeFeedback' :: Maybe Text
insightId = Maybe Text
forall a. Maybe a
Prelude.Nothing}
describeFeedback_insightId :: Lens.Lens' DescribeFeedback (Prelude.Maybe Prelude.Text)
describeFeedback_insightId :: (Maybe Text -> f (Maybe Text))
-> DescribeFeedback -> f DescribeFeedback
describeFeedback_insightId = (DescribeFeedback -> Maybe Text)
-> (DescribeFeedback -> Maybe Text -> DescribeFeedback)
-> Lens DescribeFeedback DescribeFeedback (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFeedback' {Maybe Text
insightId :: Maybe Text
$sel:insightId:DescribeFeedback' :: DescribeFeedback -> Maybe Text
insightId} -> Maybe Text
insightId) (\s :: DescribeFeedback
s@DescribeFeedback' {} Maybe Text
a -> DescribeFeedback
s {$sel:insightId:DescribeFeedback' :: Maybe Text
insightId = Maybe Text
a} :: DescribeFeedback)
instance Core.AWSRequest DescribeFeedback where
type
AWSResponse DescribeFeedback =
DescribeFeedbackResponse
request :: DescribeFeedback -> Request DescribeFeedback
request = Service -> DescribeFeedback -> Request DescribeFeedback
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeFeedback
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeFeedback)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeFeedback))
-> Logger
-> Service
-> Proxy DescribeFeedback
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeFeedback)))
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 InsightFeedback -> Int -> DescribeFeedbackResponse
DescribeFeedbackResponse'
(Maybe InsightFeedback -> Int -> DescribeFeedbackResponse)
-> Either String (Maybe InsightFeedback)
-> Either String (Int -> DescribeFeedbackResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe InsightFeedback)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InsightFeedback")
Either String (Int -> DescribeFeedbackResponse)
-> Either String Int -> Either String DescribeFeedbackResponse
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 DescribeFeedback
instance Prelude.NFData DescribeFeedback
instance Core.ToHeaders DescribeFeedback where
toHeaders :: DescribeFeedback -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeFeedback -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 DescribeFeedback where
toJSON :: DescribeFeedback -> Value
toJSON DescribeFeedback' {Maybe Text
insightId :: Maybe Text
$sel:insightId:DescribeFeedback' :: DescribeFeedback -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"InsightId" 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
insightId]
)
instance Core.ToPath DescribeFeedback where
toPath :: DescribeFeedback -> ByteString
toPath = ByteString -> DescribeFeedback -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/feedback"
instance Core.ToQuery DescribeFeedback where
toQuery :: DescribeFeedback -> QueryString
toQuery = QueryString -> DescribeFeedback -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeFeedbackResponse = DescribeFeedbackResponse'
{ DescribeFeedbackResponse -> Maybe InsightFeedback
insightFeedback :: Prelude.Maybe InsightFeedback,
DescribeFeedbackResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool
(DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool)
-> (DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool)
-> Eq DescribeFeedbackResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool
$c/= :: DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool
== :: DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool
$c== :: DescribeFeedbackResponse -> DescribeFeedbackResponse -> Bool
Prelude.Eq, ReadPrec [DescribeFeedbackResponse]
ReadPrec DescribeFeedbackResponse
Int -> ReadS DescribeFeedbackResponse
ReadS [DescribeFeedbackResponse]
(Int -> ReadS DescribeFeedbackResponse)
-> ReadS [DescribeFeedbackResponse]
-> ReadPrec DescribeFeedbackResponse
-> ReadPrec [DescribeFeedbackResponse]
-> Read DescribeFeedbackResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeFeedbackResponse]
$creadListPrec :: ReadPrec [DescribeFeedbackResponse]
readPrec :: ReadPrec DescribeFeedbackResponse
$creadPrec :: ReadPrec DescribeFeedbackResponse
readList :: ReadS [DescribeFeedbackResponse]
$creadList :: ReadS [DescribeFeedbackResponse]
readsPrec :: Int -> ReadS DescribeFeedbackResponse
$creadsPrec :: Int -> ReadS DescribeFeedbackResponse
Prelude.Read, Int -> DescribeFeedbackResponse -> ShowS
[DescribeFeedbackResponse] -> ShowS
DescribeFeedbackResponse -> String
(Int -> DescribeFeedbackResponse -> ShowS)
-> (DescribeFeedbackResponse -> String)
-> ([DescribeFeedbackResponse] -> ShowS)
-> Show DescribeFeedbackResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeFeedbackResponse] -> ShowS
$cshowList :: [DescribeFeedbackResponse] -> ShowS
show :: DescribeFeedbackResponse -> String
$cshow :: DescribeFeedbackResponse -> String
showsPrec :: Int -> DescribeFeedbackResponse -> ShowS
$cshowsPrec :: Int -> DescribeFeedbackResponse -> ShowS
Prelude.Show, (forall x.
DescribeFeedbackResponse -> Rep DescribeFeedbackResponse x)
-> (forall x.
Rep DescribeFeedbackResponse x -> DescribeFeedbackResponse)
-> Generic DescribeFeedbackResponse
forall x.
Rep DescribeFeedbackResponse x -> DescribeFeedbackResponse
forall x.
DescribeFeedbackResponse -> Rep DescribeFeedbackResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeFeedbackResponse x -> DescribeFeedbackResponse
$cfrom :: forall x.
DescribeFeedbackResponse -> Rep DescribeFeedbackResponse x
Prelude.Generic)
newDescribeFeedbackResponse ::
Prelude.Int ->
DescribeFeedbackResponse
newDescribeFeedbackResponse :: Int -> DescribeFeedbackResponse
newDescribeFeedbackResponse Int
pHttpStatus_ =
DescribeFeedbackResponse' :: Maybe InsightFeedback -> Int -> DescribeFeedbackResponse
DescribeFeedbackResponse'
{ $sel:insightFeedback:DescribeFeedbackResponse' :: Maybe InsightFeedback
insightFeedback =
Maybe InsightFeedback
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DescribeFeedbackResponse' :: Int
httpStatus = Int
pHttpStatus_
}
describeFeedbackResponse_insightFeedback :: Lens.Lens' DescribeFeedbackResponse (Prelude.Maybe InsightFeedback)
describeFeedbackResponse_insightFeedback :: (Maybe InsightFeedback -> f (Maybe InsightFeedback))
-> DescribeFeedbackResponse -> f DescribeFeedbackResponse
describeFeedbackResponse_insightFeedback = (DescribeFeedbackResponse -> Maybe InsightFeedback)
-> (DescribeFeedbackResponse
-> Maybe InsightFeedback -> DescribeFeedbackResponse)
-> Lens
DescribeFeedbackResponse
DescribeFeedbackResponse
(Maybe InsightFeedback)
(Maybe InsightFeedback)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFeedbackResponse' {Maybe InsightFeedback
insightFeedback :: Maybe InsightFeedback
$sel:insightFeedback:DescribeFeedbackResponse' :: DescribeFeedbackResponse -> Maybe InsightFeedback
insightFeedback} -> Maybe InsightFeedback
insightFeedback) (\s :: DescribeFeedbackResponse
s@DescribeFeedbackResponse' {} Maybe InsightFeedback
a -> DescribeFeedbackResponse
s {$sel:insightFeedback:DescribeFeedbackResponse' :: Maybe InsightFeedback
insightFeedback = Maybe InsightFeedback
a} :: DescribeFeedbackResponse)
describeFeedbackResponse_httpStatus :: Lens.Lens' DescribeFeedbackResponse Prelude.Int
describeFeedbackResponse_httpStatus :: (Int -> f Int)
-> DescribeFeedbackResponse -> f DescribeFeedbackResponse
describeFeedbackResponse_httpStatus = (DescribeFeedbackResponse -> Int)
-> (DescribeFeedbackResponse -> Int -> DescribeFeedbackResponse)
-> Lens DescribeFeedbackResponse DescribeFeedbackResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeFeedbackResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeFeedbackResponse' :: DescribeFeedbackResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeFeedbackResponse
s@DescribeFeedbackResponse' {} Int
a -> DescribeFeedbackResponse
s {$sel:httpStatus:DescribeFeedbackResponse' :: Int
httpStatus = Int
a} :: DescribeFeedbackResponse)
instance Prelude.NFData DescribeFeedbackResponse