{-# 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.DisassociateSkillFromSkillGroup
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Disassociates a skill from a skill group.
module Amazonka.AlexaBusiness.DisassociateSkillFromSkillGroup
  ( -- * Creating a Request
    DisassociateSkillFromSkillGroup (..),
    newDisassociateSkillFromSkillGroup,

    -- * Request Lenses
    disassociateSkillFromSkillGroup_skillGroupArn,
    disassociateSkillFromSkillGroup_skillId,

    -- * Destructuring the Response
    DisassociateSkillFromSkillGroupResponse (..),
    newDisassociateSkillFromSkillGroupResponse,

    -- * Response Lenses
    disassociateSkillFromSkillGroupResponse_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

-- | /See:/ 'newDisassociateSkillFromSkillGroup' smart constructor.
data DisassociateSkillFromSkillGroup = DisassociateSkillFromSkillGroup'
  { -- | The unique identifier of a skill. Required.
    DisassociateSkillFromSkillGroup -> Maybe Text
skillGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of a skill group to associate to a skill.
    DisassociateSkillFromSkillGroup -> Text
skillId :: Prelude.Text
  }
  deriving (DisassociateSkillFromSkillGroup
-> DisassociateSkillFromSkillGroup -> Bool
(DisassociateSkillFromSkillGroup
 -> DisassociateSkillFromSkillGroup -> Bool)
-> (DisassociateSkillFromSkillGroup
    -> DisassociateSkillFromSkillGroup -> Bool)
-> Eq DisassociateSkillFromSkillGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateSkillFromSkillGroup
-> DisassociateSkillFromSkillGroup -> Bool
$c/= :: DisassociateSkillFromSkillGroup
-> DisassociateSkillFromSkillGroup -> Bool
== :: DisassociateSkillFromSkillGroup
-> DisassociateSkillFromSkillGroup -> Bool
$c== :: DisassociateSkillFromSkillGroup
-> DisassociateSkillFromSkillGroup -> Bool
Prelude.Eq, ReadPrec [DisassociateSkillFromSkillGroup]
ReadPrec DisassociateSkillFromSkillGroup
Int -> ReadS DisassociateSkillFromSkillGroup
ReadS [DisassociateSkillFromSkillGroup]
(Int -> ReadS DisassociateSkillFromSkillGroup)
-> ReadS [DisassociateSkillFromSkillGroup]
-> ReadPrec DisassociateSkillFromSkillGroup
-> ReadPrec [DisassociateSkillFromSkillGroup]
-> Read DisassociateSkillFromSkillGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateSkillFromSkillGroup]
$creadListPrec :: ReadPrec [DisassociateSkillFromSkillGroup]
readPrec :: ReadPrec DisassociateSkillFromSkillGroup
$creadPrec :: ReadPrec DisassociateSkillFromSkillGroup
readList :: ReadS [DisassociateSkillFromSkillGroup]
$creadList :: ReadS [DisassociateSkillFromSkillGroup]
readsPrec :: Int -> ReadS DisassociateSkillFromSkillGroup
$creadsPrec :: Int -> ReadS DisassociateSkillFromSkillGroup
Prelude.Read, Int -> DisassociateSkillFromSkillGroup -> ShowS
[DisassociateSkillFromSkillGroup] -> ShowS
DisassociateSkillFromSkillGroup -> String
(Int -> DisassociateSkillFromSkillGroup -> ShowS)
-> (DisassociateSkillFromSkillGroup -> String)
-> ([DisassociateSkillFromSkillGroup] -> ShowS)
-> Show DisassociateSkillFromSkillGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateSkillFromSkillGroup] -> ShowS
$cshowList :: [DisassociateSkillFromSkillGroup] -> ShowS
show :: DisassociateSkillFromSkillGroup -> String
$cshow :: DisassociateSkillFromSkillGroup -> String
showsPrec :: Int -> DisassociateSkillFromSkillGroup -> ShowS
$cshowsPrec :: Int -> DisassociateSkillFromSkillGroup -> ShowS
Prelude.Show, (forall x.
 DisassociateSkillFromSkillGroup
 -> Rep DisassociateSkillFromSkillGroup x)
-> (forall x.
    Rep DisassociateSkillFromSkillGroup x
    -> DisassociateSkillFromSkillGroup)
-> Generic DisassociateSkillFromSkillGroup
forall x.
Rep DisassociateSkillFromSkillGroup x
-> DisassociateSkillFromSkillGroup
forall x.
DisassociateSkillFromSkillGroup
-> Rep DisassociateSkillFromSkillGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateSkillFromSkillGroup x
-> DisassociateSkillFromSkillGroup
$cfrom :: forall x.
DisassociateSkillFromSkillGroup
-> Rep DisassociateSkillFromSkillGroup x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateSkillFromSkillGroup' 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:
--
-- 'skillGroupArn', 'disassociateSkillFromSkillGroup_skillGroupArn' - The unique identifier of a skill. Required.
--
-- 'skillId', 'disassociateSkillFromSkillGroup_skillId' - The ARN of a skill group to associate to a skill.
newDisassociateSkillFromSkillGroup ::
  -- | 'skillId'
  Prelude.Text ->
  DisassociateSkillFromSkillGroup
newDisassociateSkillFromSkillGroup :: Text -> DisassociateSkillFromSkillGroup
newDisassociateSkillFromSkillGroup Text
pSkillId_ =
  DisassociateSkillFromSkillGroup' :: Maybe Text -> Text -> DisassociateSkillFromSkillGroup
DisassociateSkillFromSkillGroup'
    { $sel:skillGroupArn:DisassociateSkillFromSkillGroup' :: Maybe Text
skillGroupArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:skillId:DisassociateSkillFromSkillGroup' :: Text
skillId = Text
pSkillId_
    }

-- | The unique identifier of a skill. Required.
disassociateSkillFromSkillGroup_skillGroupArn :: Lens.Lens' DisassociateSkillFromSkillGroup (Prelude.Maybe Prelude.Text)
disassociateSkillFromSkillGroup_skillGroupArn :: (Maybe Text -> f (Maybe Text))
-> DisassociateSkillFromSkillGroup
-> f DisassociateSkillFromSkillGroup
disassociateSkillFromSkillGroup_skillGroupArn = (DisassociateSkillFromSkillGroup -> Maybe Text)
-> (DisassociateSkillFromSkillGroup
    -> Maybe Text -> DisassociateSkillFromSkillGroup)
-> Lens
     DisassociateSkillFromSkillGroup
     DisassociateSkillFromSkillGroup
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSkillFromSkillGroup' {Maybe Text
skillGroupArn :: Maybe Text
$sel:skillGroupArn:DisassociateSkillFromSkillGroup' :: DisassociateSkillFromSkillGroup -> Maybe Text
skillGroupArn} -> Maybe Text
skillGroupArn) (\s :: DisassociateSkillFromSkillGroup
s@DisassociateSkillFromSkillGroup' {} Maybe Text
a -> DisassociateSkillFromSkillGroup
s {$sel:skillGroupArn:DisassociateSkillFromSkillGroup' :: Maybe Text
skillGroupArn = Maybe Text
a} :: DisassociateSkillFromSkillGroup)

-- | The ARN of a skill group to associate to a skill.
disassociateSkillFromSkillGroup_skillId :: Lens.Lens' DisassociateSkillFromSkillGroup Prelude.Text
disassociateSkillFromSkillGroup_skillId :: (Text -> f Text)
-> DisassociateSkillFromSkillGroup
-> f DisassociateSkillFromSkillGroup
disassociateSkillFromSkillGroup_skillId = (DisassociateSkillFromSkillGroup -> Text)
-> (DisassociateSkillFromSkillGroup
    -> Text -> DisassociateSkillFromSkillGroup)
-> Lens
     DisassociateSkillFromSkillGroup
     DisassociateSkillFromSkillGroup
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSkillFromSkillGroup' {Text
skillId :: Text
$sel:skillId:DisassociateSkillFromSkillGroup' :: DisassociateSkillFromSkillGroup -> Text
skillId} -> Text
skillId) (\s :: DisassociateSkillFromSkillGroup
s@DisassociateSkillFromSkillGroup' {} Text
a -> DisassociateSkillFromSkillGroup
s {$sel:skillId:DisassociateSkillFromSkillGroup' :: Text
skillId = Text
a} :: DisassociateSkillFromSkillGroup)

instance
  Core.AWSRequest
    DisassociateSkillFromSkillGroup
  where
  type
    AWSResponse DisassociateSkillFromSkillGroup =
      DisassociateSkillFromSkillGroupResponse
  request :: DisassociateSkillFromSkillGroup
-> Request DisassociateSkillFromSkillGroup
request = Service
-> DisassociateSkillFromSkillGroup
-> Request DisassociateSkillFromSkillGroup
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DisassociateSkillFromSkillGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DisassociateSkillFromSkillGroup)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DisassociateSkillFromSkillGroup))
-> Logger
-> Service
-> Proxy DisassociateSkillFromSkillGroup
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DisassociateSkillFromSkillGroup)))
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 -> DisassociateSkillFromSkillGroupResponse
DisassociateSkillFromSkillGroupResponse'
            (Int -> DisassociateSkillFromSkillGroupResponse)
-> Either String Int
-> Either String DisassociateSkillFromSkillGroupResponse
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
    DisassociateSkillFromSkillGroup

instance
  Prelude.NFData
    DisassociateSkillFromSkillGroup

instance
  Core.ToHeaders
    DisassociateSkillFromSkillGroup
  where
  toHeaders :: DisassociateSkillFromSkillGroup -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DisassociateSkillFromSkillGroup -> 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.DisassociateSkillFromSkillGroup" ::
                          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 DisassociateSkillFromSkillGroup where
  toJSON :: DisassociateSkillFromSkillGroup -> Value
toJSON DisassociateSkillFromSkillGroup' {Maybe Text
Text
skillId :: Text
skillGroupArn :: Maybe Text
$sel:skillId:DisassociateSkillFromSkillGroup' :: DisassociateSkillFromSkillGroup -> Text
$sel:skillGroupArn:DisassociateSkillFromSkillGroup' :: DisassociateSkillFromSkillGroup -> 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,
            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 DisassociateSkillFromSkillGroup where
  toPath :: DisassociateSkillFromSkillGroup -> ByteString
toPath = ByteString -> DisassociateSkillFromSkillGroup -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newDisassociateSkillFromSkillGroupResponse' smart constructor.
data DisassociateSkillFromSkillGroupResponse = DisassociateSkillFromSkillGroupResponse'
  { -- | The response's http status code.
    DisassociateSkillFromSkillGroupResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DisassociateSkillFromSkillGroupResponse
-> DisassociateSkillFromSkillGroupResponse -> Bool
(DisassociateSkillFromSkillGroupResponse
 -> DisassociateSkillFromSkillGroupResponse -> Bool)
-> (DisassociateSkillFromSkillGroupResponse
    -> DisassociateSkillFromSkillGroupResponse -> Bool)
-> Eq DisassociateSkillFromSkillGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateSkillFromSkillGroupResponse
-> DisassociateSkillFromSkillGroupResponse -> Bool
$c/= :: DisassociateSkillFromSkillGroupResponse
-> DisassociateSkillFromSkillGroupResponse -> Bool
== :: DisassociateSkillFromSkillGroupResponse
-> DisassociateSkillFromSkillGroupResponse -> Bool
$c== :: DisassociateSkillFromSkillGroupResponse
-> DisassociateSkillFromSkillGroupResponse -> Bool
Prelude.Eq, ReadPrec [DisassociateSkillFromSkillGroupResponse]
ReadPrec DisassociateSkillFromSkillGroupResponse
Int -> ReadS DisassociateSkillFromSkillGroupResponse
ReadS [DisassociateSkillFromSkillGroupResponse]
(Int -> ReadS DisassociateSkillFromSkillGroupResponse)
-> ReadS [DisassociateSkillFromSkillGroupResponse]
-> ReadPrec DisassociateSkillFromSkillGroupResponse
-> ReadPrec [DisassociateSkillFromSkillGroupResponse]
-> Read DisassociateSkillFromSkillGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateSkillFromSkillGroupResponse]
$creadListPrec :: ReadPrec [DisassociateSkillFromSkillGroupResponse]
readPrec :: ReadPrec DisassociateSkillFromSkillGroupResponse
$creadPrec :: ReadPrec DisassociateSkillFromSkillGroupResponse
readList :: ReadS [DisassociateSkillFromSkillGroupResponse]
$creadList :: ReadS [DisassociateSkillFromSkillGroupResponse]
readsPrec :: Int -> ReadS DisassociateSkillFromSkillGroupResponse
$creadsPrec :: Int -> ReadS DisassociateSkillFromSkillGroupResponse
Prelude.Read, Int -> DisassociateSkillFromSkillGroupResponse -> ShowS
[DisassociateSkillFromSkillGroupResponse] -> ShowS
DisassociateSkillFromSkillGroupResponse -> String
(Int -> DisassociateSkillFromSkillGroupResponse -> ShowS)
-> (DisassociateSkillFromSkillGroupResponse -> String)
-> ([DisassociateSkillFromSkillGroupResponse] -> ShowS)
-> Show DisassociateSkillFromSkillGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateSkillFromSkillGroupResponse] -> ShowS
$cshowList :: [DisassociateSkillFromSkillGroupResponse] -> ShowS
show :: DisassociateSkillFromSkillGroupResponse -> String
$cshow :: DisassociateSkillFromSkillGroupResponse -> String
showsPrec :: Int -> DisassociateSkillFromSkillGroupResponse -> ShowS
$cshowsPrec :: Int -> DisassociateSkillFromSkillGroupResponse -> ShowS
Prelude.Show, (forall x.
 DisassociateSkillFromSkillGroupResponse
 -> Rep DisassociateSkillFromSkillGroupResponse x)
-> (forall x.
    Rep DisassociateSkillFromSkillGroupResponse x
    -> DisassociateSkillFromSkillGroupResponse)
-> Generic DisassociateSkillFromSkillGroupResponse
forall x.
Rep DisassociateSkillFromSkillGroupResponse x
-> DisassociateSkillFromSkillGroupResponse
forall x.
DisassociateSkillFromSkillGroupResponse
-> Rep DisassociateSkillFromSkillGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateSkillFromSkillGroupResponse x
-> DisassociateSkillFromSkillGroupResponse
$cfrom :: forall x.
DisassociateSkillFromSkillGroupResponse
-> Rep DisassociateSkillFromSkillGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateSkillFromSkillGroupResponse' 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', 'disassociateSkillFromSkillGroupResponse_httpStatus' - The response's http status code.
newDisassociateSkillFromSkillGroupResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DisassociateSkillFromSkillGroupResponse
newDisassociateSkillFromSkillGroupResponse :: Int -> DisassociateSkillFromSkillGroupResponse
newDisassociateSkillFromSkillGroupResponse
  Int
pHttpStatus_ =
    DisassociateSkillFromSkillGroupResponse' :: Int -> DisassociateSkillFromSkillGroupResponse
DisassociateSkillFromSkillGroupResponse'
      { $sel:httpStatus:DisassociateSkillFromSkillGroupResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | The response's http status code.
disassociateSkillFromSkillGroupResponse_httpStatus :: Lens.Lens' DisassociateSkillFromSkillGroupResponse Prelude.Int
disassociateSkillFromSkillGroupResponse_httpStatus :: (Int -> f Int)
-> DisassociateSkillFromSkillGroupResponse
-> f DisassociateSkillFromSkillGroupResponse
disassociateSkillFromSkillGroupResponse_httpStatus = (DisassociateSkillFromSkillGroupResponse -> Int)
-> (DisassociateSkillFromSkillGroupResponse
    -> Int -> DisassociateSkillFromSkillGroupResponse)
-> Lens
     DisassociateSkillFromSkillGroupResponse
     DisassociateSkillFromSkillGroupResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSkillFromSkillGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:DisassociateSkillFromSkillGroupResponse' :: DisassociateSkillFromSkillGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DisassociateSkillFromSkillGroupResponse
s@DisassociateSkillFromSkillGroupResponse' {} Int
a -> DisassociateSkillFromSkillGroupResponse
s {$sel:httpStatus:DisassociateSkillFromSkillGroupResponse' :: Int
httpStatus = Int
a} :: DisassociateSkillFromSkillGroupResponse)

instance
  Prelude.NFData
    DisassociateSkillFromSkillGroupResponse