{-# 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.UpdateSkillGroup
(
UpdateSkillGroup (..),
newUpdateSkillGroup,
updateSkillGroup_skillGroupArn,
updateSkillGroup_description,
updateSkillGroup_skillGroupName,
UpdateSkillGroupResponse (..),
newUpdateSkillGroupResponse,
updateSkillGroupResponse_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 UpdateSkillGroup = UpdateSkillGroup'
{
UpdateSkillGroup -> Maybe Text
skillGroupArn :: Prelude.Maybe Prelude.Text,
UpdateSkillGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
UpdateSkillGroup -> Maybe Text
skillGroupName :: Prelude.Maybe Prelude.Text
}
deriving (UpdateSkillGroup -> UpdateSkillGroup -> Bool
(UpdateSkillGroup -> UpdateSkillGroup -> Bool)
-> (UpdateSkillGroup -> UpdateSkillGroup -> Bool)
-> Eq UpdateSkillGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSkillGroup -> UpdateSkillGroup -> Bool
$c/= :: UpdateSkillGroup -> UpdateSkillGroup -> Bool
== :: UpdateSkillGroup -> UpdateSkillGroup -> Bool
$c== :: UpdateSkillGroup -> UpdateSkillGroup -> Bool
Prelude.Eq, ReadPrec [UpdateSkillGroup]
ReadPrec UpdateSkillGroup
Int -> ReadS UpdateSkillGroup
ReadS [UpdateSkillGroup]
(Int -> ReadS UpdateSkillGroup)
-> ReadS [UpdateSkillGroup]
-> ReadPrec UpdateSkillGroup
-> ReadPrec [UpdateSkillGroup]
-> Read UpdateSkillGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSkillGroup]
$creadListPrec :: ReadPrec [UpdateSkillGroup]
readPrec :: ReadPrec UpdateSkillGroup
$creadPrec :: ReadPrec UpdateSkillGroup
readList :: ReadS [UpdateSkillGroup]
$creadList :: ReadS [UpdateSkillGroup]
readsPrec :: Int -> ReadS UpdateSkillGroup
$creadsPrec :: Int -> ReadS UpdateSkillGroup
Prelude.Read, Int -> UpdateSkillGroup -> ShowS
[UpdateSkillGroup] -> ShowS
UpdateSkillGroup -> String
(Int -> UpdateSkillGroup -> ShowS)
-> (UpdateSkillGroup -> String)
-> ([UpdateSkillGroup] -> ShowS)
-> Show UpdateSkillGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSkillGroup] -> ShowS
$cshowList :: [UpdateSkillGroup] -> ShowS
show :: UpdateSkillGroup -> String
$cshow :: UpdateSkillGroup -> String
showsPrec :: Int -> UpdateSkillGroup -> ShowS
$cshowsPrec :: Int -> UpdateSkillGroup -> ShowS
Prelude.Show, (forall x. UpdateSkillGroup -> Rep UpdateSkillGroup x)
-> (forall x. Rep UpdateSkillGroup x -> UpdateSkillGroup)
-> Generic UpdateSkillGroup
forall x. Rep UpdateSkillGroup x -> UpdateSkillGroup
forall x. UpdateSkillGroup -> Rep UpdateSkillGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateSkillGroup x -> UpdateSkillGroup
$cfrom :: forall x. UpdateSkillGroup -> Rep UpdateSkillGroup x
Prelude.Generic)
newUpdateSkillGroup ::
UpdateSkillGroup
newUpdateSkillGroup :: UpdateSkillGroup
newUpdateSkillGroup =
UpdateSkillGroup' :: Maybe Text -> Maybe Text -> Maybe Text -> UpdateSkillGroup
UpdateSkillGroup'
{ $sel:skillGroupArn:UpdateSkillGroup' :: Maybe Text
skillGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateSkillGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:skillGroupName:UpdateSkillGroup' :: Maybe Text
skillGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
updateSkillGroup_skillGroupArn :: Lens.Lens' UpdateSkillGroup (Prelude.Maybe Prelude.Text)
updateSkillGroup_skillGroupArn :: (Maybe Text -> f (Maybe Text))
-> UpdateSkillGroup -> f UpdateSkillGroup
updateSkillGroup_skillGroupArn = (UpdateSkillGroup -> Maybe Text)
-> (UpdateSkillGroup -> Maybe Text -> UpdateSkillGroup)
-> Lens UpdateSkillGroup UpdateSkillGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSkillGroup' {Maybe Text
skillGroupArn :: Maybe Text
$sel:skillGroupArn:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
skillGroupArn} -> Maybe Text
skillGroupArn) (\s :: UpdateSkillGroup
s@UpdateSkillGroup' {} Maybe Text
a -> UpdateSkillGroup
s {$sel:skillGroupArn:UpdateSkillGroup' :: Maybe Text
skillGroupArn = Maybe Text
a} :: UpdateSkillGroup)
updateSkillGroup_description :: Lens.Lens' UpdateSkillGroup (Prelude.Maybe Prelude.Text)
updateSkillGroup_description :: (Maybe Text -> f (Maybe Text))
-> UpdateSkillGroup -> f UpdateSkillGroup
updateSkillGroup_description = (UpdateSkillGroup -> Maybe Text)
-> (UpdateSkillGroup -> Maybe Text -> UpdateSkillGroup)
-> Lens UpdateSkillGroup UpdateSkillGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSkillGroup' {Maybe Text
description :: Maybe Text
$sel:description:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateSkillGroup
s@UpdateSkillGroup' {} Maybe Text
a -> UpdateSkillGroup
s {$sel:description:UpdateSkillGroup' :: Maybe Text
description = Maybe Text
a} :: UpdateSkillGroup)
updateSkillGroup_skillGroupName :: Lens.Lens' UpdateSkillGroup (Prelude.Maybe Prelude.Text)
updateSkillGroup_skillGroupName :: (Maybe Text -> f (Maybe Text))
-> UpdateSkillGroup -> f UpdateSkillGroup
updateSkillGroup_skillGroupName = (UpdateSkillGroup -> Maybe Text)
-> (UpdateSkillGroup -> Maybe Text -> UpdateSkillGroup)
-> Lens UpdateSkillGroup UpdateSkillGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSkillGroup' {Maybe Text
skillGroupName :: Maybe Text
$sel:skillGroupName:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
skillGroupName} -> Maybe Text
skillGroupName) (\s :: UpdateSkillGroup
s@UpdateSkillGroup' {} Maybe Text
a -> UpdateSkillGroup
s {$sel:skillGroupName:UpdateSkillGroup' :: Maybe Text
skillGroupName = Maybe Text
a} :: UpdateSkillGroup)
instance Core.AWSRequest UpdateSkillGroup where
type
AWSResponse UpdateSkillGroup =
UpdateSkillGroupResponse
request :: UpdateSkillGroup -> Request UpdateSkillGroup
request = Service -> UpdateSkillGroup -> Request UpdateSkillGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateSkillGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateSkillGroup)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateSkillGroup))
-> Logger
-> Service
-> Proxy UpdateSkillGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateSkillGroup)))
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 -> UpdateSkillGroupResponse
UpdateSkillGroupResponse'
(Int -> UpdateSkillGroupResponse)
-> Either String Int -> Either String UpdateSkillGroupResponse
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 UpdateSkillGroup
instance Prelude.NFData UpdateSkillGroup
instance Core.ToHeaders UpdateSkillGroup where
toHeaders :: UpdateSkillGroup -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateSkillGroup -> 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.UpdateSkillGroup" ::
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 UpdateSkillGroup where
toJSON :: UpdateSkillGroup -> Value
toJSON UpdateSkillGroup' {Maybe Text
skillGroupName :: Maybe Text
description :: Maybe Text
skillGroupArn :: Maybe Text
$sel:skillGroupName:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:description:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:skillGroupArn:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SkillGroupArn" 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
skillGroupArn,
(Text
"Description" 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
description,
(Text
"SkillGroupName" 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
skillGroupName
]
)
instance Core.ToPath UpdateSkillGroup where
toPath :: UpdateSkillGroup -> ByteString
toPath = ByteString -> UpdateSkillGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateSkillGroup where
toQuery :: UpdateSkillGroup -> QueryString
toQuery = QueryString -> UpdateSkillGroup -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateSkillGroupResponse = UpdateSkillGroupResponse'
{
UpdateSkillGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool
(UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool)
-> (UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool)
-> Eq UpdateSkillGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool
$c/= :: UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool
== :: UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool
$c== :: UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool
Prelude.Eq, ReadPrec [UpdateSkillGroupResponse]
ReadPrec UpdateSkillGroupResponse
Int -> ReadS UpdateSkillGroupResponse
ReadS [UpdateSkillGroupResponse]
(Int -> ReadS UpdateSkillGroupResponse)
-> ReadS [UpdateSkillGroupResponse]
-> ReadPrec UpdateSkillGroupResponse
-> ReadPrec [UpdateSkillGroupResponse]
-> Read UpdateSkillGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateSkillGroupResponse]
$creadListPrec :: ReadPrec [UpdateSkillGroupResponse]
readPrec :: ReadPrec UpdateSkillGroupResponse
$creadPrec :: ReadPrec UpdateSkillGroupResponse
readList :: ReadS [UpdateSkillGroupResponse]
$creadList :: ReadS [UpdateSkillGroupResponse]
readsPrec :: Int -> ReadS UpdateSkillGroupResponse
$creadsPrec :: Int -> ReadS UpdateSkillGroupResponse
Prelude.Read, Int -> UpdateSkillGroupResponse -> ShowS
[UpdateSkillGroupResponse] -> ShowS
UpdateSkillGroupResponse -> String
(Int -> UpdateSkillGroupResponse -> ShowS)
-> (UpdateSkillGroupResponse -> String)
-> ([UpdateSkillGroupResponse] -> ShowS)
-> Show UpdateSkillGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateSkillGroupResponse] -> ShowS
$cshowList :: [UpdateSkillGroupResponse] -> ShowS
show :: UpdateSkillGroupResponse -> String
$cshow :: UpdateSkillGroupResponse -> String
showsPrec :: Int -> UpdateSkillGroupResponse -> ShowS
$cshowsPrec :: Int -> UpdateSkillGroupResponse -> ShowS
Prelude.Show, (forall x.
UpdateSkillGroupResponse -> Rep UpdateSkillGroupResponse x)
-> (forall x.
Rep UpdateSkillGroupResponse x -> UpdateSkillGroupResponse)
-> Generic UpdateSkillGroupResponse
forall x.
Rep UpdateSkillGroupResponse x -> UpdateSkillGroupResponse
forall x.
UpdateSkillGroupResponse -> Rep UpdateSkillGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateSkillGroupResponse x -> UpdateSkillGroupResponse
$cfrom :: forall x.
UpdateSkillGroupResponse -> Rep UpdateSkillGroupResponse x
Prelude.Generic)
newUpdateSkillGroupResponse ::
Prelude.Int ->
UpdateSkillGroupResponse
newUpdateSkillGroupResponse :: Int -> UpdateSkillGroupResponse
newUpdateSkillGroupResponse Int
pHttpStatus_ =
UpdateSkillGroupResponse' :: Int -> UpdateSkillGroupResponse
UpdateSkillGroupResponse'
{ $sel:httpStatus:UpdateSkillGroupResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateSkillGroupResponse_httpStatus :: Lens.Lens' UpdateSkillGroupResponse Prelude.Int
updateSkillGroupResponse_httpStatus :: (Int -> f Int)
-> UpdateSkillGroupResponse -> f UpdateSkillGroupResponse
updateSkillGroupResponse_httpStatus = (UpdateSkillGroupResponse -> Int)
-> (UpdateSkillGroupResponse -> Int -> UpdateSkillGroupResponse)
-> Lens UpdateSkillGroupResponse UpdateSkillGroupResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateSkillGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSkillGroupResponse' :: UpdateSkillGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateSkillGroupResponse
s@UpdateSkillGroupResponse' {} Int
a -> UpdateSkillGroupResponse
s {$sel:httpStatus:UpdateSkillGroupResponse' :: Int
httpStatus = Int
a} :: UpdateSkillGroupResponse)
instance Prelude.NFData UpdateSkillGroupResponse