{-# 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.PutRoomSkillParameter
-- 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)
--
-- Updates room skill parameter details by room, skill, and parameter key
-- ID. Not all skills have a room skill parameter.
module Amazonka.AlexaBusiness.PutRoomSkillParameter
  ( -- * Creating a Request
    PutRoomSkillParameter (..),
    newPutRoomSkillParameter,

    -- * Request Lenses
    putRoomSkillParameter_roomArn,
    putRoomSkillParameter_skillId,
    putRoomSkillParameter_roomSkillParameter,

    -- * Destructuring the Response
    PutRoomSkillParameterResponse (..),
    newPutRoomSkillParameterResponse,

    -- * Response Lenses
    putRoomSkillParameterResponse_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:/ 'newPutRoomSkillParameter' smart constructor.
data PutRoomSkillParameter = PutRoomSkillParameter'
  { -- | The ARN of the room associated with the room skill parameter. Required.
    PutRoomSkillParameter -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the skill associated with the room skill parameter. Required.
    PutRoomSkillParameter -> Text
skillId :: Prelude.Text,
    -- | The updated room skill parameter. Required.
    PutRoomSkillParameter -> RoomSkillParameter
roomSkillParameter :: RoomSkillParameter
  }
  deriving (PutRoomSkillParameter -> PutRoomSkillParameter -> Bool
(PutRoomSkillParameter -> PutRoomSkillParameter -> Bool)
-> (PutRoomSkillParameter -> PutRoomSkillParameter -> Bool)
-> Eq PutRoomSkillParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRoomSkillParameter -> PutRoomSkillParameter -> Bool
$c/= :: PutRoomSkillParameter -> PutRoomSkillParameter -> Bool
== :: PutRoomSkillParameter -> PutRoomSkillParameter -> Bool
$c== :: PutRoomSkillParameter -> PutRoomSkillParameter -> Bool
Prelude.Eq, ReadPrec [PutRoomSkillParameter]
ReadPrec PutRoomSkillParameter
Int -> ReadS PutRoomSkillParameter
ReadS [PutRoomSkillParameter]
(Int -> ReadS PutRoomSkillParameter)
-> ReadS [PutRoomSkillParameter]
-> ReadPrec PutRoomSkillParameter
-> ReadPrec [PutRoomSkillParameter]
-> Read PutRoomSkillParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRoomSkillParameter]
$creadListPrec :: ReadPrec [PutRoomSkillParameter]
readPrec :: ReadPrec PutRoomSkillParameter
$creadPrec :: ReadPrec PutRoomSkillParameter
readList :: ReadS [PutRoomSkillParameter]
$creadList :: ReadS [PutRoomSkillParameter]
readsPrec :: Int -> ReadS PutRoomSkillParameter
$creadsPrec :: Int -> ReadS PutRoomSkillParameter
Prelude.Read, Int -> PutRoomSkillParameter -> ShowS
[PutRoomSkillParameter] -> ShowS
PutRoomSkillParameter -> String
(Int -> PutRoomSkillParameter -> ShowS)
-> (PutRoomSkillParameter -> String)
-> ([PutRoomSkillParameter] -> ShowS)
-> Show PutRoomSkillParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRoomSkillParameter] -> ShowS
$cshowList :: [PutRoomSkillParameter] -> ShowS
show :: PutRoomSkillParameter -> String
$cshow :: PutRoomSkillParameter -> String
showsPrec :: Int -> PutRoomSkillParameter -> ShowS
$cshowsPrec :: Int -> PutRoomSkillParameter -> ShowS
Prelude.Show, (forall x. PutRoomSkillParameter -> Rep PutRoomSkillParameter x)
-> (forall x. Rep PutRoomSkillParameter x -> PutRoomSkillParameter)
-> Generic PutRoomSkillParameter
forall x. Rep PutRoomSkillParameter x -> PutRoomSkillParameter
forall x. PutRoomSkillParameter -> Rep PutRoomSkillParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRoomSkillParameter x -> PutRoomSkillParameter
$cfrom :: forall x. PutRoomSkillParameter -> Rep PutRoomSkillParameter x
Prelude.Generic)

-- |
-- Create a value of 'PutRoomSkillParameter' 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:
--
-- 'roomArn', 'putRoomSkillParameter_roomArn' - The ARN of the room associated with the room skill parameter. Required.
--
-- 'skillId', 'putRoomSkillParameter_skillId' - The ARN of the skill associated with the room skill parameter. Required.
--
-- 'roomSkillParameter', 'putRoomSkillParameter_roomSkillParameter' - The updated room skill parameter. Required.
newPutRoomSkillParameter ::
  -- | 'skillId'
  Prelude.Text ->
  -- | 'roomSkillParameter'
  RoomSkillParameter ->
  PutRoomSkillParameter
newPutRoomSkillParameter :: Text -> RoomSkillParameter -> PutRoomSkillParameter
newPutRoomSkillParameter
  Text
pSkillId_
  RoomSkillParameter
pRoomSkillParameter_ =
    PutRoomSkillParameter' :: Maybe Text -> Text -> RoomSkillParameter -> PutRoomSkillParameter
PutRoomSkillParameter'
      { $sel:roomArn:PutRoomSkillParameter' :: Maybe Text
roomArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:skillId:PutRoomSkillParameter' :: Text
skillId = Text
pSkillId_,
        $sel:roomSkillParameter:PutRoomSkillParameter' :: RoomSkillParameter
roomSkillParameter = RoomSkillParameter
pRoomSkillParameter_
      }

-- | The ARN of the room associated with the room skill parameter. Required.
putRoomSkillParameter_roomArn :: Lens.Lens' PutRoomSkillParameter (Prelude.Maybe Prelude.Text)
putRoomSkillParameter_roomArn :: (Maybe Text -> f (Maybe Text))
-> PutRoomSkillParameter -> f PutRoomSkillParameter
putRoomSkillParameter_roomArn = (PutRoomSkillParameter -> Maybe Text)
-> (PutRoomSkillParameter -> Maybe Text -> PutRoomSkillParameter)
-> Lens
     PutRoomSkillParameter
     PutRoomSkillParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRoomSkillParameter' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:PutRoomSkillParameter' :: PutRoomSkillParameter -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: PutRoomSkillParameter
s@PutRoomSkillParameter' {} Maybe Text
a -> PutRoomSkillParameter
s {$sel:roomArn:PutRoomSkillParameter' :: Maybe Text
roomArn = Maybe Text
a} :: PutRoomSkillParameter)

-- | The ARN of the skill associated with the room skill parameter. Required.
putRoomSkillParameter_skillId :: Lens.Lens' PutRoomSkillParameter Prelude.Text
putRoomSkillParameter_skillId :: (Text -> f Text)
-> PutRoomSkillParameter -> f PutRoomSkillParameter
putRoomSkillParameter_skillId = (PutRoomSkillParameter -> Text)
-> (PutRoomSkillParameter -> Text -> PutRoomSkillParameter)
-> Lens PutRoomSkillParameter PutRoomSkillParameter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRoomSkillParameter' {Text
skillId :: Text
$sel:skillId:PutRoomSkillParameter' :: PutRoomSkillParameter -> Text
skillId} -> Text
skillId) (\s :: PutRoomSkillParameter
s@PutRoomSkillParameter' {} Text
a -> PutRoomSkillParameter
s {$sel:skillId:PutRoomSkillParameter' :: Text
skillId = Text
a} :: PutRoomSkillParameter)

-- | The updated room skill parameter. Required.
putRoomSkillParameter_roomSkillParameter :: Lens.Lens' PutRoomSkillParameter RoomSkillParameter
putRoomSkillParameter_roomSkillParameter :: (RoomSkillParameter -> f RoomSkillParameter)
-> PutRoomSkillParameter -> f PutRoomSkillParameter
putRoomSkillParameter_roomSkillParameter = (PutRoomSkillParameter -> RoomSkillParameter)
-> (PutRoomSkillParameter
    -> RoomSkillParameter -> PutRoomSkillParameter)
-> Lens
     PutRoomSkillParameter
     PutRoomSkillParameter
     RoomSkillParameter
     RoomSkillParameter
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRoomSkillParameter' {RoomSkillParameter
roomSkillParameter :: RoomSkillParameter
$sel:roomSkillParameter:PutRoomSkillParameter' :: PutRoomSkillParameter -> RoomSkillParameter
roomSkillParameter} -> RoomSkillParameter
roomSkillParameter) (\s :: PutRoomSkillParameter
s@PutRoomSkillParameter' {} RoomSkillParameter
a -> PutRoomSkillParameter
s {$sel:roomSkillParameter:PutRoomSkillParameter' :: RoomSkillParameter
roomSkillParameter = RoomSkillParameter
a} :: PutRoomSkillParameter)

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

instance Prelude.NFData PutRoomSkillParameter

instance Core.ToHeaders PutRoomSkillParameter where
  toHeaders :: PutRoomSkillParameter -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutRoomSkillParameter -> 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.PutRoomSkillParameter" ::
                          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 PutRoomSkillParameter where
  toJSON :: PutRoomSkillParameter -> Value
toJSON PutRoomSkillParameter' {Maybe Text
Text
RoomSkillParameter
roomSkillParameter :: RoomSkillParameter
skillId :: Text
roomArn :: Maybe Text
$sel:roomSkillParameter:PutRoomSkillParameter' :: PutRoomSkillParameter -> RoomSkillParameter
$sel:skillId:PutRoomSkillParameter' :: PutRoomSkillParameter -> Text
$sel:roomArn:PutRoomSkillParameter' :: PutRoomSkillParameter -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RoomArn" 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
roomArn,
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"RoomSkillParameter" Text -> RoomSkillParameter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RoomSkillParameter
roomSkillParameter)
          ]
      )

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

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

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

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

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

instance Prelude.NFData PutRoomSkillParameterResponse