{-# 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 #-}
module Amazonka.AlexaBusiness.AssociateDeviceWithRoom
(
AssociateDeviceWithRoom (..),
newAssociateDeviceWithRoom,
associateDeviceWithRoom_deviceArn,
associateDeviceWithRoom_roomArn,
AssociateDeviceWithRoomResponse (..),
newAssociateDeviceWithRoomResponse,
associateDeviceWithRoomResponse_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
data AssociateDeviceWithRoom = AssociateDeviceWithRoom'
{
AssociateDeviceWithRoom -> Maybe Text
deviceArn :: Prelude.Maybe Prelude.Text,
AssociateDeviceWithRoom -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text
}
deriving (AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool
$c/= :: AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool
== :: AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool
$c== :: AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool
Prelude.Eq, ReadPrec [AssociateDeviceWithRoom]
ReadPrec AssociateDeviceWithRoom
Int -> ReadS AssociateDeviceWithRoom
ReadS [AssociateDeviceWithRoom]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateDeviceWithRoom]
$creadListPrec :: ReadPrec [AssociateDeviceWithRoom]
readPrec :: ReadPrec AssociateDeviceWithRoom
$creadPrec :: ReadPrec AssociateDeviceWithRoom
readList :: ReadS [AssociateDeviceWithRoom]
$creadList :: ReadS [AssociateDeviceWithRoom]
readsPrec :: Int -> ReadS AssociateDeviceWithRoom
$creadsPrec :: Int -> ReadS AssociateDeviceWithRoom
Prelude.Read, Int -> AssociateDeviceWithRoom -> ShowS
[AssociateDeviceWithRoom] -> ShowS
AssociateDeviceWithRoom -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateDeviceWithRoom] -> ShowS
$cshowList :: [AssociateDeviceWithRoom] -> ShowS
show :: AssociateDeviceWithRoom -> String
$cshow :: AssociateDeviceWithRoom -> String
showsPrec :: Int -> AssociateDeviceWithRoom -> ShowS
$cshowsPrec :: Int -> AssociateDeviceWithRoom -> ShowS
Prelude.Show, forall x. Rep AssociateDeviceWithRoom x -> AssociateDeviceWithRoom
forall x. AssociateDeviceWithRoom -> Rep AssociateDeviceWithRoom x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AssociateDeviceWithRoom x -> AssociateDeviceWithRoom
$cfrom :: forall x. AssociateDeviceWithRoom -> Rep AssociateDeviceWithRoom x
Prelude.Generic)
newAssociateDeviceWithRoom ::
AssociateDeviceWithRoom
newAssociateDeviceWithRoom :: AssociateDeviceWithRoom
newAssociateDeviceWithRoom =
AssociateDeviceWithRoom'
{ $sel:deviceArn:AssociateDeviceWithRoom' :: Maybe Text
deviceArn =
forall a. Maybe a
Prelude.Nothing,
$sel:roomArn:AssociateDeviceWithRoom' :: Maybe Text
roomArn = forall a. Maybe a
Prelude.Nothing
}
associateDeviceWithRoom_deviceArn :: Lens.Lens' AssociateDeviceWithRoom (Prelude.Maybe Prelude.Text)
associateDeviceWithRoom_deviceArn :: Lens' AssociateDeviceWithRoom (Maybe Text)
associateDeviceWithRoom_deviceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDeviceWithRoom' {Maybe Text
deviceArn :: Maybe Text
$sel:deviceArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
deviceArn} -> Maybe Text
deviceArn) (\s :: AssociateDeviceWithRoom
s@AssociateDeviceWithRoom' {} Maybe Text
a -> AssociateDeviceWithRoom
s {$sel:deviceArn:AssociateDeviceWithRoom' :: Maybe Text
deviceArn = Maybe Text
a} :: AssociateDeviceWithRoom)
associateDeviceWithRoom_roomArn :: Lens.Lens' AssociateDeviceWithRoom (Prelude.Maybe Prelude.Text)
associateDeviceWithRoom_roomArn :: Lens' AssociateDeviceWithRoom (Maybe Text)
associateDeviceWithRoom_roomArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDeviceWithRoom' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: AssociateDeviceWithRoom
s@AssociateDeviceWithRoom' {} Maybe Text
a -> AssociateDeviceWithRoom
s {$sel:roomArn:AssociateDeviceWithRoom' :: Maybe Text
roomArn = Maybe Text
a} :: AssociateDeviceWithRoom)
instance Core.AWSRequest AssociateDeviceWithRoom where
type
AWSResponse AssociateDeviceWithRoom =
AssociateDeviceWithRoomResponse
request :: (Service -> Service)
-> AssociateDeviceWithRoom -> Request AssociateDeviceWithRoom
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 AssociateDeviceWithRoom
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateDeviceWithRoom)))
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 -> AssociateDeviceWithRoomResponse
AssociateDeviceWithRoomResponse'
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 AssociateDeviceWithRoom where
hashWithSalt :: Int -> AssociateDeviceWithRoom -> Int
hashWithSalt Int
_salt AssociateDeviceWithRoom' {Maybe Text
roomArn :: Maybe Text
deviceArn :: Maybe Text
$sel:roomArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
$sel:deviceArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
roomArn
instance Prelude.NFData AssociateDeviceWithRoom where
rnf :: AssociateDeviceWithRoom -> ()
rnf AssociateDeviceWithRoom' {Maybe Text
roomArn :: Maybe Text
deviceArn :: Maybe Text
$sel:roomArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
$sel:deviceArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
roomArn
instance Data.ToHeaders AssociateDeviceWithRoom where
toHeaders :: AssociateDeviceWithRoom -> 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.AssociateDeviceWithRoom" ::
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 AssociateDeviceWithRoom where
toJSON :: AssociateDeviceWithRoom -> Value
toJSON AssociateDeviceWithRoom' {Maybe Text
roomArn :: Maybe Text
deviceArn :: Maybe Text
$sel:roomArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
$sel:deviceArn:AssociateDeviceWithRoom' :: AssociateDeviceWithRoom -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DeviceArn" 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
deviceArn,
(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
]
)
instance Data.ToPath AssociateDeviceWithRoom where
toPath :: AssociateDeviceWithRoom -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery AssociateDeviceWithRoom where
toQuery :: AssociateDeviceWithRoom -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociateDeviceWithRoomResponse = AssociateDeviceWithRoomResponse'
{
AssociateDeviceWithRoomResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool
$c/= :: AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool
== :: AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool
$c== :: AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool
Prelude.Eq, ReadPrec [AssociateDeviceWithRoomResponse]
ReadPrec AssociateDeviceWithRoomResponse
Int -> ReadS AssociateDeviceWithRoomResponse
ReadS [AssociateDeviceWithRoomResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateDeviceWithRoomResponse]
$creadListPrec :: ReadPrec [AssociateDeviceWithRoomResponse]
readPrec :: ReadPrec AssociateDeviceWithRoomResponse
$creadPrec :: ReadPrec AssociateDeviceWithRoomResponse
readList :: ReadS [AssociateDeviceWithRoomResponse]
$creadList :: ReadS [AssociateDeviceWithRoomResponse]
readsPrec :: Int -> ReadS AssociateDeviceWithRoomResponse
$creadsPrec :: Int -> ReadS AssociateDeviceWithRoomResponse
Prelude.Read, Int -> AssociateDeviceWithRoomResponse -> ShowS
[AssociateDeviceWithRoomResponse] -> ShowS
AssociateDeviceWithRoomResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateDeviceWithRoomResponse] -> ShowS
$cshowList :: [AssociateDeviceWithRoomResponse] -> ShowS
show :: AssociateDeviceWithRoomResponse -> String
$cshow :: AssociateDeviceWithRoomResponse -> String
showsPrec :: Int -> AssociateDeviceWithRoomResponse -> ShowS
$cshowsPrec :: Int -> AssociateDeviceWithRoomResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateDeviceWithRoomResponse x
-> AssociateDeviceWithRoomResponse
forall x.
AssociateDeviceWithRoomResponse
-> Rep AssociateDeviceWithRoomResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateDeviceWithRoomResponse x
-> AssociateDeviceWithRoomResponse
$cfrom :: forall x.
AssociateDeviceWithRoomResponse
-> Rep AssociateDeviceWithRoomResponse x
Prelude.Generic)
newAssociateDeviceWithRoomResponse ::
Prelude.Int ->
AssociateDeviceWithRoomResponse
newAssociateDeviceWithRoomResponse :: Int -> AssociateDeviceWithRoomResponse
newAssociateDeviceWithRoomResponse Int
pHttpStatus_ =
AssociateDeviceWithRoomResponse'
{ $sel:httpStatus:AssociateDeviceWithRoomResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateDeviceWithRoomResponse_httpStatus :: Lens.Lens' AssociateDeviceWithRoomResponse Prelude.Int
associateDeviceWithRoomResponse_httpStatus :: Lens' AssociateDeviceWithRoomResponse Int
associateDeviceWithRoomResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDeviceWithRoomResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateDeviceWithRoomResponse' :: AssociateDeviceWithRoomResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateDeviceWithRoomResponse
s@AssociateDeviceWithRoomResponse' {} Int
a -> AssociateDeviceWithRoomResponse
s {$sel:httpStatus:AssociateDeviceWithRoomResponse' :: Int
httpStatus = Int
a} :: AssociateDeviceWithRoomResponse)
instance
Prelude.NFData
AssociateDeviceWithRoomResponse
where
rnf :: AssociateDeviceWithRoomResponse -> ()
rnf AssociateDeviceWithRoomResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateDeviceWithRoomResponse' :: AssociateDeviceWithRoomResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus