{-# 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.AssociateSkillWithUsers
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Makes a private skill available for enrolled users to enable on their
-- devices.
module Amazonka.AlexaBusiness.AssociateSkillWithUsers
  ( -- * Creating a Request
    AssociateSkillWithUsers (..),
    newAssociateSkillWithUsers,

    -- * Request Lenses
    associateSkillWithUsers_skillId,

    -- * Destructuring the Response
    AssociateSkillWithUsersResponse (..),
    newAssociateSkillWithUsersResponse,

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

-- |
-- Create a value of 'AssociateSkillWithUsers' 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', 'associateSkillWithUsers_skillId' - The private skill ID you want to make available to enrolled users.
newAssociateSkillWithUsers ::
  -- | 'skillId'
  Prelude.Text ->
  AssociateSkillWithUsers
newAssociateSkillWithUsers :: Text -> AssociateSkillWithUsers
newAssociateSkillWithUsers Text
pSkillId_ =
  AssociateSkillWithUsers' {$sel:skillId:AssociateSkillWithUsers' :: Text
skillId = Text
pSkillId_}

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

instance Core.AWSRequest AssociateSkillWithUsers where
  type
    AWSResponse AssociateSkillWithUsers =
      AssociateSkillWithUsersResponse
  request :: (Service -> Service)
-> AssociateSkillWithUsers -> Request AssociateSkillWithUsers
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 AssociateSkillWithUsers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateSkillWithUsers)))
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 -> AssociateSkillWithUsersResponse
AssociateSkillWithUsersResponse'
            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 AssociateSkillWithUsers where
  hashWithSalt :: Int -> AssociateSkillWithUsers -> Int
hashWithSalt Int
_salt AssociateSkillWithUsers' {Text
skillId :: Text
$sel:skillId:AssociateSkillWithUsers' :: AssociateSkillWithUsers -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
skillId

instance Prelude.NFData AssociateSkillWithUsers where
  rnf :: AssociateSkillWithUsers -> ()
rnf AssociateSkillWithUsers' {Text
skillId :: Text
$sel:skillId:AssociateSkillWithUsers' :: AssociateSkillWithUsers -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
skillId

instance Data.ToHeaders AssociateSkillWithUsers where
  toHeaders :: AssociateSkillWithUsers -> 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.AssociateSkillWithUsers" ::
                          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 AssociateSkillWithUsers where
  toJSON :: AssociateSkillWithUsers -> Value
toJSON AssociateSkillWithUsers' {Text
skillId :: Text
$sel:skillId:AssociateSkillWithUsers' :: AssociateSkillWithUsers -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"SkillId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
skillId)]
      )

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

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

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

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

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

instance
  Prelude.NFData
    AssociateSkillWithUsersResponse
  where
  rnf :: AssociateSkillWithUsersResponse -> ()
rnf AssociateSkillWithUsersResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateSkillWithUsersResponse' :: AssociateSkillWithUsersResponse -> Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus