{-# 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-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)
--
-- 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_skillGroupArn,
    associateSkillGroupWithRoom_roomArn,

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

    -- * Response Lenses
    associateSkillGroupWithRoomResponse_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:/ 'newAssociateSkillGroupWithRoom' smart constructor.
data AssociateSkillGroupWithRoom = AssociateSkillGroupWithRoom'
  { -- | The ARN of the skill group to associate with a room. Required.
    AssociateSkillGroupWithRoom -> Maybe Text
skillGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the room with which to associate the skill group. Required.
    AssociateSkillGroupWithRoom -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text
  }
  deriving (AssociateSkillGroupWithRoom -> AssociateSkillGroupWithRoom -> Bool
(AssociateSkillGroupWithRoom
 -> AssociateSkillGroupWithRoom -> Bool)
-> (AssociateSkillGroupWithRoom
    -> AssociateSkillGroupWithRoom -> Bool)
-> Eq AssociateSkillGroupWithRoom
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]
(Int -> ReadS AssociateSkillGroupWithRoom)
-> ReadS [AssociateSkillGroupWithRoom]
-> ReadPrec AssociateSkillGroupWithRoom
-> ReadPrec [AssociateSkillGroupWithRoom]
-> Read 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
(Int -> AssociateSkillGroupWithRoom -> ShowS)
-> (AssociateSkillGroupWithRoom -> String)
-> ([AssociateSkillGroupWithRoom] -> ShowS)
-> Show AssociateSkillGroupWithRoom
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.
 AssociateSkillGroupWithRoom -> Rep AssociateSkillGroupWithRoom x)
-> (forall x.
    Rep AssociateSkillGroupWithRoom x -> AssociateSkillGroupWithRoom)
-> Generic AssociateSkillGroupWithRoom
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:
--
-- 'skillGroupArn', 'associateSkillGroupWithRoom_skillGroupArn' - The ARN of the skill group to associate with a room. Required.
--
-- 'roomArn', 'associateSkillGroupWithRoom_roomArn' - The ARN of the room with which to associate the skill group. Required.
newAssociateSkillGroupWithRoom ::
  AssociateSkillGroupWithRoom
newAssociateSkillGroupWithRoom :: AssociateSkillGroupWithRoom
newAssociateSkillGroupWithRoom =
  AssociateSkillGroupWithRoom' :: Maybe Text -> Maybe Text -> AssociateSkillGroupWithRoom
AssociateSkillGroupWithRoom'
    { $sel:skillGroupArn:AssociateSkillGroupWithRoom' :: Maybe Text
skillGroupArn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:roomArn:AssociateSkillGroupWithRoom' :: Maybe Text
roomArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the skill group to associate with a room. Required.
associateSkillGroupWithRoom_skillGroupArn :: Lens.Lens' AssociateSkillGroupWithRoom (Prelude.Maybe Prelude.Text)
associateSkillGroupWithRoom_skillGroupArn :: (Maybe Text -> f (Maybe Text))
-> AssociateSkillGroupWithRoom -> f AssociateSkillGroupWithRoom
associateSkillGroupWithRoom_skillGroupArn = (AssociateSkillGroupWithRoom -> Maybe Text)
-> (AssociateSkillGroupWithRoom
    -> Maybe Text -> AssociateSkillGroupWithRoom)
-> Lens
     AssociateSkillGroupWithRoom
     AssociateSkillGroupWithRoom
     (Maybe Text)
     (Maybe Text)
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)

-- | The ARN of the room with which to associate the skill group. Required.
associateSkillGroupWithRoom_roomArn :: Lens.Lens' AssociateSkillGroupWithRoom (Prelude.Maybe Prelude.Text)
associateSkillGroupWithRoom_roomArn :: (Maybe Text -> f (Maybe Text))
-> AssociateSkillGroupWithRoom -> f AssociateSkillGroupWithRoom
associateSkillGroupWithRoom_roomArn = (AssociateSkillGroupWithRoom -> Maybe Text)
-> (AssociateSkillGroupWithRoom
    -> Maybe Text -> AssociateSkillGroupWithRoom)
-> Lens
     AssociateSkillGroupWithRoom
     AssociateSkillGroupWithRoom
     (Maybe Text)
     (Maybe Text)
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)

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

instance Prelude.NFData AssociateSkillGroupWithRoom

instance Core.ToHeaders AssociateSkillGroupWithRoom where
  toHeaders :: AssociateSkillGroupWithRoom -> ResponseHeaders
toHeaders =
    ResponseHeaders -> AssociateSkillGroupWithRoom -> 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.AssociateSkillGroupWithRoom" ::
                          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 AssociateSkillGroupWithRoom where
  toJSON :: AssociateSkillGroupWithRoom -> Value
toJSON AssociateSkillGroupWithRoom' {Maybe Text
roomArn :: Maybe Text
skillGroupArn :: Maybe Text
$sel:roomArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
$sel:skillGroupArn:AssociateSkillGroupWithRoom' :: AssociateSkillGroupWithRoom -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SkillGroupArn" 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
skillGroupArn,
            (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
          ]
      )

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

instance Core.ToQuery AssociateSkillGroupWithRoom where
  toQuery :: AssociateSkillGroupWithRoom -> QueryString
toQuery = QueryString -> AssociateSkillGroupWithRoom -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(AssociateSkillGroupWithRoomResponse
 -> AssociateSkillGroupWithRoomResponse -> Bool)
-> (AssociateSkillGroupWithRoomResponse
    -> AssociateSkillGroupWithRoomResponse -> Bool)
-> Eq AssociateSkillGroupWithRoomResponse
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]
(Int -> ReadS AssociateSkillGroupWithRoomResponse)
-> ReadS [AssociateSkillGroupWithRoomResponse]
-> ReadPrec AssociateSkillGroupWithRoomResponse
-> ReadPrec [AssociateSkillGroupWithRoomResponse]
-> Read 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
(Int -> AssociateSkillGroupWithRoomResponse -> ShowS)
-> (AssociateSkillGroupWithRoomResponse -> String)
-> ([AssociateSkillGroupWithRoomResponse] -> ShowS)
-> Show AssociateSkillGroupWithRoomResponse
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.
 AssociateSkillGroupWithRoomResponse
 -> Rep AssociateSkillGroupWithRoomResponse x)
-> (forall x.
    Rep AssociateSkillGroupWithRoomResponse x
    -> AssociateSkillGroupWithRoomResponse)
-> Generic AssociateSkillGroupWithRoomResponse
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' :: Int -> AssociateSkillGroupWithRoomResponse
AssociateSkillGroupWithRoomResponse'
    { $sel:httpStatus:AssociateSkillGroupWithRoomResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

-- | The response's http status code.
associateSkillGroupWithRoomResponse_httpStatus :: Lens.Lens' AssociateSkillGroupWithRoomResponse Prelude.Int
associateSkillGroupWithRoomResponse_httpStatus :: (Int -> f Int)
-> AssociateSkillGroupWithRoomResponse
-> f AssociateSkillGroupWithRoomResponse
associateSkillGroupWithRoomResponse_httpStatus = (AssociateSkillGroupWithRoomResponse -> Int)
-> (AssociateSkillGroupWithRoomResponse
    -> Int -> AssociateSkillGroupWithRoomResponse)
-> Lens
     AssociateSkillGroupWithRoomResponse
     AssociateSkillGroupWithRoomResponse
     Int
     Int
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