{-# 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.GetRoomSkillParameter
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets room skill parameter details by room, skill, and parameter key ARN.
module Amazonka.AlexaBusiness.GetRoomSkillParameter
  ( -- * Creating a Request
    GetRoomSkillParameter (..),
    newGetRoomSkillParameter,

    -- * Request Lenses
    getRoomSkillParameter_roomArn,
    getRoomSkillParameter_skillId,
    getRoomSkillParameter_parameterKey,

    -- * Destructuring the Response
    GetRoomSkillParameterResponse (..),
    newGetRoomSkillParameterResponse,

    -- * Response Lenses
    getRoomSkillParameterResponse_roomSkillParameter,
    getRoomSkillParameterResponse_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:/ 'newGetRoomSkillParameter' smart constructor.
data GetRoomSkillParameter = GetRoomSkillParameter'
  { -- | The ARN of the room from which to get the room skill parameter details.
    GetRoomSkillParameter -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the skill from which to get the room skill parameter details.
    -- Required.
    GetRoomSkillParameter -> Text
skillId :: Prelude.Text,
    -- | The room skill parameter key for which to get details. Required.
    GetRoomSkillParameter -> Text
parameterKey :: Prelude.Text
  }
  deriving (GetRoomSkillParameter -> GetRoomSkillParameter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRoomSkillParameter -> GetRoomSkillParameter -> Bool
$c/= :: GetRoomSkillParameter -> GetRoomSkillParameter -> Bool
== :: GetRoomSkillParameter -> GetRoomSkillParameter -> Bool
$c== :: GetRoomSkillParameter -> GetRoomSkillParameter -> Bool
Prelude.Eq, ReadPrec [GetRoomSkillParameter]
ReadPrec GetRoomSkillParameter
Int -> ReadS GetRoomSkillParameter
ReadS [GetRoomSkillParameter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRoomSkillParameter]
$creadListPrec :: ReadPrec [GetRoomSkillParameter]
readPrec :: ReadPrec GetRoomSkillParameter
$creadPrec :: ReadPrec GetRoomSkillParameter
readList :: ReadS [GetRoomSkillParameter]
$creadList :: ReadS [GetRoomSkillParameter]
readsPrec :: Int -> ReadS GetRoomSkillParameter
$creadsPrec :: Int -> ReadS GetRoomSkillParameter
Prelude.Read, Int -> GetRoomSkillParameter -> ShowS
[GetRoomSkillParameter] -> ShowS
GetRoomSkillParameter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRoomSkillParameter] -> ShowS
$cshowList :: [GetRoomSkillParameter] -> ShowS
show :: GetRoomSkillParameter -> String
$cshow :: GetRoomSkillParameter -> String
showsPrec :: Int -> GetRoomSkillParameter -> ShowS
$cshowsPrec :: Int -> GetRoomSkillParameter -> ShowS
Prelude.Show, forall x. Rep GetRoomSkillParameter x -> GetRoomSkillParameter
forall x. GetRoomSkillParameter -> Rep GetRoomSkillParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetRoomSkillParameter x -> GetRoomSkillParameter
$cfrom :: forall x. GetRoomSkillParameter -> Rep GetRoomSkillParameter x
Prelude.Generic)

-- |
-- Create a value of 'GetRoomSkillParameter' 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', 'getRoomSkillParameter_roomArn' - The ARN of the room from which to get the room skill parameter details.
--
-- 'skillId', 'getRoomSkillParameter_skillId' - The ARN of the skill from which to get the room skill parameter details.
-- Required.
--
-- 'parameterKey', 'getRoomSkillParameter_parameterKey' - The room skill parameter key for which to get details. Required.
newGetRoomSkillParameter ::
  -- | 'skillId'
  Prelude.Text ->
  -- | 'parameterKey'
  Prelude.Text ->
  GetRoomSkillParameter
newGetRoomSkillParameter :: Text -> Text -> GetRoomSkillParameter
newGetRoomSkillParameter Text
pSkillId_ Text
pParameterKey_ =
  GetRoomSkillParameter'
    { $sel:roomArn:GetRoomSkillParameter' :: Maybe Text
roomArn = forall a. Maybe a
Prelude.Nothing,
      $sel:skillId:GetRoomSkillParameter' :: Text
skillId = Text
pSkillId_,
      $sel:parameterKey:GetRoomSkillParameter' :: Text
parameterKey = Text
pParameterKey_
    }

-- | The ARN of the room from which to get the room skill parameter details.
getRoomSkillParameter_roomArn :: Lens.Lens' GetRoomSkillParameter (Prelude.Maybe Prelude.Text)
getRoomSkillParameter_roomArn :: Lens' GetRoomSkillParameter (Maybe Text)
getRoomSkillParameter_roomArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRoomSkillParameter' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:GetRoomSkillParameter' :: GetRoomSkillParameter -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: GetRoomSkillParameter
s@GetRoomSkillParameter' {} Maybe Text
a -> GetRoomSkillParameter
s {$sel:roomArn:GetRoomSkillParameter' :: Maybe Text
roomArn = Maybe Text
a} :: GetRoomSkillParameter)

-- | The ARN of the skill from which to get the room skill parameter details.
-- Required.
getRoomSkillParameter_skillId :: Lens.Lens' GetRoomSkillParameter Prelude.Text
getRoomSkillParameter_skillId :: Lens' GetRoomSkillParameter Text
getRoomSkillParameter_skillId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRoomSkillParameter' {Text
skillId :: Text
$sel:skillId:GetRoomSkillParameter' :: GetRoomSkillParameter -> Text
skillId} -> Text
skillId) (\s :: GetRoomSkillParameter
s@GetRoomSkillParameter' {} Text
a -> GetRoomSkillParameter
s {$sel:skillId:GetRoomSkillParameter' :: Text
skillId = Text
a} :: GetRoomSkillParameter)

-- | The room skill parameter key for which to get details. Required.
getRoomSkillParameter_parameterKey :: Lens.Lens' GetRoomSkillParameter Prelude.Text
getRoomSkillParameter_parameterKey :: Lens' GetRoomSkillParameter Text
getRoomSkillParameter_parameterKey = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRoomSkillParameter' {Text
parameterKey :: Text
$sel:parameterKey:GetRoomSkillParameter' :: GetRoomSkillParameter -> Text
parameterKey} -> Text
parameterKey) (\s :: GetRoomSkillParameter
s@GetRoomSkillParameter' {} Text
a -> GetRoomSkillParameter
s {$sel:parameterKey:GetRoomSkillParameter' :: Text
parameterKey = Text
a} :: GetRoomSkillParameter)

instance Core.AWSRequest GetRoomSkillParameter where
  type
    AWSResponse GetRoomSkillParameter =
      GetRoomSkillParameterResponse
  request :: (Service -> Service)
-> GetRoomSkillParameter -> Request GetRoomSkillParameter
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 GetRoomSkillParameter
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRoomSkillParameter)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RoomSkillParameter -> Int -> GetRoomSkillParameterResponse
GetRoomSkillParameterResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RoomSkillParameter")
            forall (f :: * -> *) a b. Applicative f => 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 GetRoomSkillParameter where
  hashWithSalt :: Int -> GetRoomSkillParameter -> Int
hashWithSalt Int
_salt GetRoomSkillParameter' {Maybe Text
Text
parameterKey :: Text
skillId :: Text
roomArn :: Maybe Text
$sel:parameterKey:GetRoomSkillParameter' :: GetRoomSkillParameter -> Text
$sel:skillId:GetRoomSkillParameter' :: GetRoomSkillParameter -> Text
$sel:roomArn:GetRoomSkillParameter' :: GetRoomSkillParameter -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roomArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
skillId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
parameterKey

instance Prelude.NFData GetRoomSkillParameter where
  rnf :: GetRoomSkillParameter -> ()
rnf GetRoomSkillParameter' {Maybe Text
Text
parameterKey :: Text
skillId :: Text
roomArn :: Maybe Text
$sel:parameterKey:GetRoomSkillParameter' :: GetRoomSkillParameter -> Text
$sel:skillId:GetRoomSkillParameter' :: GetRoomSkillParameter -> Text
$sel:roomArn:GetRoomSkillParameter' :: GetRoomSkillParameter -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roomArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
skillId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
parameterKey

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

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

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

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

-- |
-- Create a value of 'GetRoomSkillParameterResponse' 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:
--
-- 'roomSkillParameter', 'getRoomSkillParameterResponse_roomSkillParameter' - The details of the room skill parameter requested. Required.
--
-- 'httpStatus', 'getRoomSkillParameterResponse_httpStatus' - The response's http status code.
newGetRoomSkillParameterResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRoomSkillParameterResponse
newGetRoomSkillParameterResponse :: Int -> GetRoomSkillParameterResponse
newGetRoomSkillParameterResponse Int
pHttpStatus_ =
  GetRoomSkillParameterResponse'
    { $sel:roomSkillParameter:GetRoomSkillParameterResponse' :: Maybe RoomSkillParameter
roomSkillParameter =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRoomSkillParameterResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The details of the room skill parameter requested. Required.
getRoomSkillParameterResponse_roomSkillParameter :: Lens.Lens' GetRoomSkillParameterResponse (Prelude.Maybe RoomSkillParameter)
getRoomSkillParameterResponse_roomSkillParameter :: Lens' GetRoomSkillParameterResponse (Maybe RoomSkillParameter)
getRoomSkillParameterResponse_roomSkillParameter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRoomSkillParameterResponse' {Maybe RoomSkillParameter
roomSkillParameter :: Maybe RoomSkillParameter
$sel:roomSkillParameter:GetRoomSkillParameterResponse' :: GetRoomSkillParameterResponse -> Maybe RoomSkillParameter
roomSkillParameter} -> Maybe RoomSkillParameter
roomSkillParameter) (\s :: GetRoomSkillParameterResponse
s@GetRoomSkillParameterResponse' {} Maybe RoomSkillParameter
a -> GetRoomSkillParameterResponse
s {$sel:roomSkillParameter:GetRoomSkillParameterResponse' :: Maybe RoomSkillParameter
roomSkillParameter = Maybe RoomSkillParameter
a} :: GetRoomSkillParameterResponse)

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

instance Prelude.NFData GetRoomSkillParameterResponse where
  rnf :: GetRoomSkillParameterResponse -> ()
rnf GetRoomSkillParameterResponse' {Int
Maybe RoomSkillParameter
httpStatus :: Int
roomSkillParameter :: Maybe RoomSkillParameter
$sel:httpStatus:GetRoomSkillParameterResponse' :: GetRoomSkillParameterResponse -> Int
$sel:roomSkillParameter:GetRoomSkillParameterResponse' :: GetRoomSkillParameterResponse -> Maybe RoomSkillParameter
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RoomSkillParameter
roomSkillParameter
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus