{-# 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.AlexaBusiness.RejectSkill
(
RejectSkill (..),
newRejectSkill,
rejectSkill_skillId,
RejectSkillResponse (..),
newRejectSkillResponse,
rejectSkillResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.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 RejectSkill = RejectSkill'
{
RejectSkill -> Text
skillId :: Prelude.Text
}
deriving (RejectSkill -> RejectSkill -> Bool
(RejectSkill -> RejectSkill -> Bool)
-> (RejectSkill -> RejectSkill -> Bool) -> Eq RejectSkill
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectSkill -> RejectSkill -> Bool
$c/= :: RejectSkill -> RejectSkill -> Bool
== :: RejectSkill -> RejectSkill -> Bool
$c== :: RejectSkill -> RejectSkill -> Bool
Prelude.Eq, ReadPrec [RejectSkill]
ReadPrec RejectSkill
Int -> ReadS RejectSkill
ReadS [RejectSkill]
(Int -> ReadS RejectSkill)
-> ReadS [RejectSkill]
-> ReadPrec RejectSkill
-> ReadPrec [RejectSkill]
-> Read RejectSkill
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectSkill]
$creadListPrec :: ReadPrec [RejectSkill]
readPrec :: ReadPrec RejectSkill
$creadPrec :: ReadPrec RejectSkill
readList :: ReadS [RejectSkill]
$creadList :: ReadS [RejectSkill]
readsPrec :: Int -> ReadS RejectSkill
$creadsPrec :: Int -> ReadS RejectSkill
Prelude.Read, Int -> RejectSkill -> ShowS
[RejectSkill] -> ShowS
RejectSkill -> String
(Int -> RejectSkill -> ShowS)
-> (RejectSkill -> String)
-> ([RejectSkill] -> ShowS)
-> Show RejectSkill
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectSkill] -> ShowS
$cshowList :: [RejectSkill] -> ShowS
show :: RejectSkill -> String
$cshow :: RejectSkill -> String
showsPrec :: Int -> RejectSkill -> ShowS
$cshowsPrec :: Int -> RejectSkill -> ShowS
Prelude.Show, (forall x. RejectSkill -> Rep RejectSkill x)
-> (forall x. Rep RejectSkill x -> RejectSkill)
-> Generic RejectSkill
forall x. Rep RejectSkill x -> RejectSkill
forall x. RejectSkill -> Rep RejectSkill x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RejectSkill x -> RejectSkill
$cfrom :: forall x. RejectSkill -> Rep RejectSkill x
Prelude.Generic)
newRejectSkill ::
Prelude.Text ->
RejectSkill
newRejectSkill :: Text -> RejectSkill
newRejectSkill Text
pSkillId_ =
RejectSkill' :: Text -> RejectSkill
RejectSkill' {$sel:skillId:RejectSkill' :: Text
skillId = Text
pSkillId_}
rejectSkill_skillId :: Lens.Lens' RejectSkill Prelude.Text
rejectSkill_skillId :: (Text -> f Text) -> RejectSkill -> f RejectSkill
rejectSkill_skillId = (RejectSkill -> Text)
-> (RejectSkill -> Text -> RejectSkill)
-> Lens RejectSkill RejectSkill Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectSkill' {Text
skillId :: Text
$sel:skillId:RejectSkill' :: RejectSkill -> Text
skillId} -> Text
skillId) (\s :: RejectSkill
s@RejectSkill' {} Text
a -> RejectSkill
s {$sel:skillId:RejectSkill' :: Text
skillId = Text
a} :: RejectSkill)
instance Core.AWSRequest RejectSkill where
type AWSResponse RejectSkill = RejectSkillResponse
request :: RejectSkill -> Request RejectSkill
request = Service -> RejectSkill -> Request RejectSkill
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RejectSkill
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RejectSkill)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse RejectSkill))
-> Logger
-> Service
-> Proxy RejectSkill
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse RejectSkill)))
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 -> RejectSkillResponse
RejectSkillResponse'
(Int -> RejectSkillResponse)
-> Either String Int -> Either String RejectSkillResponse
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 RejectSkill
instance Prelude.NFData RejectSkill
instance Core.ToHeaders RejectSkill where
toHeaders :: RejectSkill -> ResponseHeaders
toHeaders =
ResponseHeaders -> RejectSkill -> 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
"AlexaForBusiness.RejectSkill" ::
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 RejectSkill where
toJSON :: RejectSkill -> Value
toJSON RejectSkill' {Text
skillId :: Text
$sel:skillId:RejectSkill' :: RejectSkill -> 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
"SkillId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
skillId)]
)
instance Core.ToPath RejectSkill where
toPath :: RejectSkill -> ByteString
toPath = ByteString -> RejectSkill -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RejectSkill where
toQuery :: RejectSkill -> QueryString
toQuery = QueryString -> RejectSkill -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RejectSkillResponse = RejectSkillResponse'
{
RejectSkillResponse -> Int
httpStatus :: Prelude.Int
}
deriving (RejectSkillResponse -> RejectSkillResponse -> Bool
(RejectSkillResponse -> RejectSkillResponse -> Bool)
-> (RejectSkillResponse -> RejectSkillResponse -> Bool)
-> Eq RejectSkillResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RejectSkillResponse -> RejectSkillResponse -> Bool
$c/= :: RejectSkillResponse -> RejectSkillResponse -> Bool
== :: RejectSkillResponse -> RejectSkillResponse -> Bool
$c== :: RejectSkillResponse -> RejectSkillResponse -> Bool
Prelude.Eq, ReadPrec [RejectSkillResponse]
ReadPrec RejectSkillResponse
Int -> ReadS RejectSkillResponse
ReadS [RejectSkillResponse]
(Int -> ReadS RejectSkillResponse)
-> ReadS [RejectSkillResponse]
-> ReadPrec RejectSkillResponse
-> ReadPrec [RejectSkillResponse]
-> Read RejectSkillResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RejectSkillResponse]
$creadListPrec :: ReadPrec [RejectSkillResponse]
readPrec :: ReadPrec RejectSkillResponse
$creadPrec :: ReadPrec RejectSkillResponse
readList :: ReadS [RejectSkillResponse]
$creadList :: ReadS [RejectSkillResponse]
readsPrec :: Int -> ReadS RejectSkillResponse
$creadsPrec :: Int -> ReadS RejectSkillResponse
Prelude.Read, Int -> RejectSkillResponse -> ShowS
[RejectSkillResponse] -> ShowS
RejectSkillResponse -> String
(Int -> RejectSkillResponse -> ShowS)
-> (RejectSkillResponse -> String)
-> ([RejectSkillResponse] -> ShowS)
-> Show RejectSkillResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RejectSkillResponse] -> ShowS
$cshowList :: [RejectSkillResponse] -> ShowS
show :: RejectSkillResponse -> String
$cshow :: RejectSkillResponse -> String
showsPrec :: Int -> RejectSkillResponse -> ShowS
$cshowsPrec :: Int -> RejectSkillResponse -> ShowS
Prelude.Show, (forall x. RejectSkillResponse -> Rep RejectSkillResponse x)
-> (forall x. Rep RejectSkillResponse x -> RejectSkillResponse)
-> Generic RejectSkillResponse
forall x. Rep RejectSkillResponse x -> RejectSkillResponse
forall x. RejectSkillResponse -> Rep RejectSkillResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RejectSkillResponse x -> RejectSkillResponse
$cfrom :: forall x. RejectSkillResponse -> Rep RejectSkillResponse x
Prelude.Generic)
newRejectSkillResponse ::
Prelude.Int ->
RejectSkillResponse
newRejectSkillResponse :: Int -> RejectSkillResponse
newRejectSkillResponse Int
pHttpStatus_ =
RejectSkillResponse' :: Int -> RejectSkillResponse
RejectSkillResponse' {$sel:httpStatus:RejectSkillResponse' :: Int
httpStatus = Int
pHttpStatus_}
rejectSkillResponse_httpStatus :: Lens.Lens' RejectSkillResponse Prelude.Int
rejectSkillResponse_httpStatus :: (Int -> f Int) -> RejectSkillResponse -> f RejectSkillResponse
rejectSkillResponse_httpStatus = (RejectSkillResponse -> Int)
-> (RejectSkillResponse -> Int -> RejectSkillResponse)
-> Lens RejectSkillResponse RejectSkillResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RejectSkillResponse' {Int
httpStatus :: Int
$sel:httpStatus:RejectSkillResponse' :: RejectSkillResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RejectSkillResponse
s@RejectSkillResponse' {} Int
a -> RejectSkillResponse
s {$sel:httpStatus:RejectSkillResponse' :: Int
httpStatus = Int
a} :: RejectSkillResponse)
instance Prelude.NFData RejectSkillResponse