{-# 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.DisassociateSkillFromUsers
-- 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)
--
-- Makes a private skill unavailable for enrolled users and prevents them
-- from enabling it on their devices.
module Amazonka.AlexaBusiness.DisassociateSkillFromUsers
  ( -- * Creating a Request
    DisassociateSkillFromUsers (..),
    newDisassociateSkillFromUsers,

    -- * Request Lenses
    disassociateSkillFromUsers_skillId,

    -- * Destructuring the Response
    DisassociateSkillFromUsersResponse (..),
    newDisassociateSkillFromUsersResponse,

    -- * Response Lenses
    disassociateSkillFromUsersResponse_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:/ 'newDisassociateSkillFromUsers' smart constructor.
data DisassociateSkillFromUsers = DisassociateSkillFromUsers'
  { -- | The private skill ID you want to make unavailable for enrolled users.
    DisassociateSkillFromUsers -> Text
skillId :: Prelude.Text
  }
  deriving (DisassociateSkillFromUsers -> DisassociateSkillFromUsers -> Bool
(DisassociateSkillFromUsers -> DisassociateSkillFromUsers -> Bool)
-> (DisassociateSkillFromUsers
    -> DisassociateSkillFromUsers -> Bool)
-> Eq DisassociateSkillFromUsers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DisassociateSkillFromUsers -> DisassociateSkillFromUsers -> Bool
$c/= :: DisassociateSkillFromUsers -> DisassociateSkillFromUsers -> Bool
== :: DisassociateSkillFromUsers -> DisassociateSkillFromUsers -> Bool
$c== :: DisassociateSkillFromUsers -> DisassociateSkillFromUsers -> Bool
Prelude.Eq, ReadPrec [DisassociateSkillFromUsers]
ReadPrec DisassociateSkillFromUsers
Int -> ReadS DisassociateSkillFromUsers
ReadS [DisassociateSkillFromUsers]
(Int -> ReadS DisassociateSkillFromUsers)
-> ReadS [DisassociateSkillFromUsers]
-> ReadPrec DisassociateSkillFromUsers
-> ReadPrec [DisassociateSkillFromUsers]
-> Read DisassociateSkillFromUsers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DisassociateSkillFromUsers]
$creadListPrec :: ReadPrec [DisassociateSkillFromUsers]
readPrec :: ReadPrec DisassociateSkillFromUsers
$creadPrec :: ReadPrec DisassociateSkillFromUsers
readList :: ReadS [DisassociateSkillFromUsers]
$creadList :: ReadS [DisassociateSkillFromUsers]
readsPrec :: Int -> ReadS DisassociateSkillFromUsers
$creadsPrec :: Int -> ReadS DisassociateSkillFromUsers
Prelude.Read, Int -> DisassociateSkillFromUsers -> ShowS
[DisassociateSkillFromUsers] -> ShowS
DisassociateSkillFromUsers -> String
(Int -> DisassociateSkillFromUsers -> ShowS)
-> (DisassociateSkillFromUsers -> String)
-> ([DisassociateSkillFromUsers] -> ShowS)
-> Show DisassociateSkillFromUsers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DisassociateSkillFromUsers] -> ShowS
$cshowList :: [DisassociateSkillFromUsers] -> ShowS
show :: DisassociateSkillFromUsers -> String
$cshow :: DisassociateSkillFromUsers -> String
showsPrec :: Int -> DisassociateSkillFromUsers -> ShowS
$cshowsPrec :: Int -> DisassociateSkillFromUsers -> ShowS
Prelude.Show, (forall x.
 DisassociateSkillFromUsers -> Rep DisassociateSkillFromUsers x)
-> (forall x.
    Rep DisassociateSkillFromUsers x -> DisassociateSkillFromUsers)
-> Generic DisassociateSkillFromUsers
forall x.
Rep DisassociateSkillFromUsers x -> DisassociateSkillFromUsers
forall x.
DisassociateSkillFromUsers -> Rep DisassociateSkillFromUsers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DisassociateSkillFromUsers x -> DisassociateSkillFromUsers
$cfrom :: forall x.
DisassociateSkillFromUsers -> Rep DisassociateSkillFromUsers x
Prelude.Generic)

-- |
-- Create a value of 'DisassociateSkillFromUsers' 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:
--
-- 'skillId', 'disassociateSkillFromUsers_skillId' - The private skill ID you want to make unavailable for enrolled users.
newDisassociateSkillFromUsers ::
  -- | 'skillId'
  Prelude.Text ->
  DisassociateSkillFromUsers
newDisassociateSkillFromUsers :: Text -> DisassociateSkillFromUsers
newDisassociateSkillFromUsers Text
pSkillId_ =
  DisassociateSkillFromUsers' :: Text -> DisassociateSkillFromUsers
DisassociateSkillFromUsers' {$sel:skillId:DisassociateSkillFromUsers' :: Text
skillId = Text
pSkillId_}

-- | The private skill ID you want to make unavailable for enrolled users.
disassociateSkillFromUsers_skillId :: Lens.Lens' DisassociateSkillFromUsers Prelude.Text
disassociateSkillFromUsers_skillId :: (Text -> f Text)
-> DisassociateSkillFromUsers -> f DisassociateSkillFromUsers
disassociateSkillFromUsers_skillId = (DisassociateSkillFromUsers -> Text)
-> (DisassociateSkillFromUsers
    -> Text -> DisassociateSkillFromUsers)
-> Lens
     DisassociateSkillFromUsers DisassociateSkillFromUsers Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DisassociateSkillFromUsers' {Text
skillId :: Text
$sel:skillId:DisassociateSkillFromUsers' :: DisassociateSkillFromUsers -> Text
skillId} -> Text
skillId) (\s :: DisassociateSkillFromUsers
s@DisassociateSkillFromUsers' {} Text
a -> DisassociateSkillFromUsers
s {$sel:skillId:DisassociateSkillFromUsers' :: Text
skillId = Text
a} :: DisassociateSkillFromUsers)

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

instance Prelude.NFData DisassociateSkillFromUsers

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

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

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

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

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

instance
  Prelude.NFData
    DisassociateSkillFromUsersResponse