{-# 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.AssociateSkillGroupWithRoom
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Associates a skill group with a given room. This enables all skills in
-- the associated skill group on all devices in the room.
module Amazonka.AlexaBusiness.AssociateSkillGroupWithRoom
  ( -- * Creating a Request
    AssociateSkillGroupWithRoom (..),
    newAssociateSkillGroupWithRoom,

    -- * Request Lenses
    associateSkillGroupWithRoom_roomArn,
    associateSkillGroupWithRoom_skillGroupArn,

    -- * Destructuring the Response
    AssociateSkillGroupWithRoomResponse (..),
    newAssociateSkillGroupWithRoomResponse,

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

-- |
-- Create a value of 'AssociateSkillGroupWithRoom' 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', 'associateSkillGroupWithRoom_roomArn' - The ARN of the room with which to associate the skill group. Required.
--
-- 'skillGroupArn', 'associateSkillGroupWithRoom_skillGroupArn' - The ARN of the skill group to associate with a room. Required.
newAssociateSkillGroupWithRoom ::
  AssociateSkillGroupWithRoom
newAssociateSkillGroupWithRoom :: AssociateSkillGroupWithRoom
newAssociateSkillGroupWithRoom =
  AssociateSkillGroupWithRoom'
    { $sel:roomArn:AssociateSkillGroupWithRoom' :: Maybe Text
roomArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:skillGroupArn:AssociateSkillGroupWithRoom' :: Maybe Text
skillGroupArn = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the room with which to associate the skill group. Required.
associateSkillGroupWithRoom_roomArn :: Lens.Lens' AssociateSkillGroupWithRoom (Prelude.Maybe Prelude.Text)
associateSkillGroupWithRoom_roomArn :: Lens' AssociateSkillGroupWithRoom (Maybe Text)
associateSkillGroupWithRoom_roomArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateSkillGroupWithRoom' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: AssociateSkillGroupWithRoom
s@AssociateSkillGroupWithRoom' {} Maybe Text
a -> AssociateSkillGroupWithRoom
s {$sel:roomArn:AssociateSkillGroupWithRoom' :: Maybe Text
roomArn = Maybe Text
a} :: AssociateSkillGroupWithRoom)

-- | The ARN of the skill group to associate with a room. Required.
associateSkillGroupWithRoom_skillGroupArn :: Lens.Lens' AssociateSkillGroupWithRoom (Prelude.Maybe Prelude.Text)
associateSkillGroupWithRoom_skillGroupArn :: Lens' AssociateSkillGroupWithRoom (Maybe Text)
associateSkillGroupWithRoom_skillGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateSkillGroupWithRoom' {Maybe Text
skillGroupArn :: Maybe Text
$sel:skillGroupArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
skillGroupArn} -> Maybe Text
skillGroupArn) (\s :: AssociateSkillGroupWithRoom
s@AssociateSkillGroupWithRoom' {} Maybe Text
a -> AssociateSkillGroupWithRoom
s {$sel:skillGroupArn:AssociateSkillGroupWithRoom' :: Maybe Text
skillGroupArn = Maybe Text
a} :: AssociateSkillGroupWithRoom)

instance Core.AWSRequest AssociateSkillGroupWithRoom where
  type
    AWSResponse AssociateSkillGroupWithRoom =
      AssociateSkillGroupWithRoomResponse
  request :: (Service -> Service)
-> AssociateSkillGroupWithRoom
-> Request AssociateSkillGroupWithRoom
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 AssociateSkillGroupWithRoom
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse AssociateSkillGroupWithRoom)))
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 -> AssociateSkillGroupWithRoomResponse
AssociateSkillGroupWithRoomResponse'
            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 AssociateSkillGroupWithRoom where
  hashWithSalt :: Int -> AssociateSkillGroupWithRoom -> Int
hashWithSalt Int
_salt AssociateSkillGroupWithRoom' {Maybe Text
skillGroupArn :: Maybe Text
roomArn :: Maybe Text
$sel:skillGroupArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
$sel:roomArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> 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` Maybe Text
skillGroupArn

instance Prelude.NFData AssociateSkillGroupWithRoom where
  rnf :: AssociateSkillGroupWithRoom -> ()
rnf AssociateSkillGroupWithRoom' {Maybe Text
skillGroupArn :: Maybe Text
roomArn :: Maybe Text
$sel:skillGroupArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
$sel:roomArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> 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 Maybe Text
skillGroupArn

instance Data.ToHeaders AssociateSkillGroupWithRoom where
  toHeaders :: AssociateSkillGroupWithRoom -> 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.AssociateSkillGroupWithRoom" ::
                          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 AssociateSkillGroupWithRoom where
  toJSON :: AssociateSkillGroupWithRoom -> Value
toJSON AssociateSkillGroupWithRoom' {Maybe Text
skillGroupArn :: Maybe Text
roomArn :: Maybe Text
$sel:skillGroupArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
$sel:roomArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> 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,
            (Key
"SkillGroupArn" 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
skillGroupArn
          ]
      )

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

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

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

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

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

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