{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.AlexaBusiness.UpdateSkillGroup
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates skill group details by skill group ARN.
module Amazonka.AlexaBusiness.UpdateSkillGroup
  ( -- * Creating a Request
    UpdateSkillGroup (..),
    newUpdateSkillGroup,

    -- * Request Lenses
    updateSkillGroup_description,
    updateSkillGroup_skillGroupArn,
    updateSkillGroup_skillGroupName,

    -- * Destructuring the Response
    UpdateSkillGroupResponse (..),
    newUpdateSkillGroupResponse,

    -- * Response Lenses
    updateSkillGroupResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateSkillGroup' smart constructor.
data UpdateSkillGroup = UpdateSkillGroup'
  { -- | The updated description for the skill group.
    UpdateSkillGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the skill group to update.
    UpdateSkillGroup -> Maybe Text
skillGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The updated name for the skill group.
    UpdateSkillGroup -> Maybe Text
skillGroupName :: Prelude.Maybe Prelude.Text
  }
  deriving (UpdateSkillGroup -> UpdateSkillGroup -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'UpdateSkillGroup' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'description', 'updateSkillGroup_description' - The updated description for the skill group.
--
-- 'skillGroupArn', 'updateSkillGroup_skillGroupArn' - The ARN of the skill group to update.
--
-- 'skillGroupName', 'updateSkillGroup_skillGroupName' - The updated name for the skill group.
newUpdateSkillGroup ::
  UpdateSkillGroup
newUpdateSkillGroup :: UpdateSkillGroup
newUpdateSkillGroup =
  UpdateSkillGroup'
    { $sel:description:UpdateSkillGroup' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:skillGroupArn:UpdateSkillGroup' :: Maybe Text
skillGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:skillGroupName:UpdateSkillGroup' :: Maybe Text
skillGroupName = forall a. Maybe a
Prelude.Nothing
    }

-- | The updated description for the skill group.
updateSkillGroup_description :: Lens.Lens' UpdateSkillGroup (Prelude.Maybe Prelude.Text)
updateSkillGroup_description :: Lens' UpdateSkillGroup (Maybe Text)
updateSkillGroup_description = 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)

-- | The ARN of the skill group to update.
updateSkillGroup_skillGroupArn :: Lens.Lens' UpdateSkillGroup (Prelude.Maybe Prelude.Text)
updateSkillGroup_skillGroupArn :: Lens' UpdateSkillGroup (Maybe Text)
updateSkillGroup_skillGroupArn = 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)

-- | The updated name for the skill group.
updateSkillGroup_skillGroupName :: Lens.Lens' UpdateSkillGroup (Prelude.Maybe Prelude.Text)
updateSkillGroup_skillGroupName :: Lens' UpdateSkillGroup (Maybe Text)
updateSkillGroup_skillGroupName = 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 :: (Service -> Service)
-> UpdateSkillGroup -> Request UpdateSkillGroup
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateSkillGroup
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateSkillGroup)))
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 -> UpdateSkillGroupResponse
UpdateSkillGroupResponse'
            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 UpdateSkillGroup where
  hashWithSalt :: Int -> UpdateSkillGroup -> Int
hashWithSalt Int
_salt UpdateSkillGroup' {Maybe Text
skillGroupName :: Maybe Text
skillGroupArn :: Maybe Text
description :: Maybe Text
$sel:skillGroupName:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:skillGroupArn:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:description:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
skillGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
skillGroupName

instance Prelude.NFData UpdateSkillGroup where
  rnf :: UpdateSkillGroup -> ()
rnf UpdateSkillGroup' {Maybe Text
skillGroupName :: Maybe Text
skillGroupArn :: Maybe Text
description :: Maybe Text
$sel:skillGroupName:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:skillGroupArn:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:description:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
skillGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
skillGroupName

instance Data.ToHeaders UpdateSkillGroup where
  toHeaders :: UpdateSkillGroup -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.UpdateSkillGroup" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON UpdateSkillGroup where
  toJSON :: UpdateSkillGroup -> Value
toJSON UpdateSkillGroup' {Maybe Text
skillGroupName :: Maybe Text
skillGroupArn :: Maybe Text
description :: Maybe Text
$sel:skillGroupName:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:skillGroupArn:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
$sel:description:UpdateSkillGroup' :: UpdateSkillGroup -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Description" 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 Text
description,
            (Key
"SkillGroupArn" 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 Text
skillGroupArn,
            (Key
"SkillGroupName" 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 Text
skillGroupName
          ]
      )

instance Data.ToPath UpdateSkillGroup where
  toPath :: UpdateSkillGroup -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery UpdateSkillGroup where
  toQuery :: UpdateSkillGroup -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateSkillGroupResponse' smart constructor.
data UpdateSkillGroupResponse = UpdateSkillGroupResponse'
  { -- | The response's http status code.
    UpdateSkillGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateSkillGroupResponse -> UpdateSkillGroupResponse -> Bool
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]
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
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.
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)

-- |
-- Create a value of 'UpdateSkillGroupResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'httpStatus', 'updateSkillGroupResponse_httpStatus' - The response's http status code.
newUpdateSkillGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateSkillGroupResponse
newUpdateSkillGroupResponse :: Int -> UpdateSkillGroupResponse
newUpdateSkillGroupResponse Int
pHttpStatus_ =
  UpdateSkillGroupResponse'
    { $sel:httpStatus:UpdateSkillGroupResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
updateSkillGroupResponse_httpStatus :: Lens.Lens' UpdateSkillGroupResponse Prelude.Int
updateSkillGroupResponse_httpStatus :: Lens' UpdateSkillGroupResponse Int
updateSkillGroupResponse_httpStatus = 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 where
  rnf :: UpdateSkillGroupResponse -> ()
rnf UpdateSkillGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateSkillGroupResponse' :: UpdateSkillGroupResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus