{-# 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.Lens as Lens
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
(AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool)
-> (AssociateDeviceWithRoom -> AssociateDeviceWithRoom -> Bool)
-> Eq AssociateDeviceWithRoom
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]
(Int -> ReadS AssociateDeviceWithRoom)
-> ReadS [AssociateDeviceWithRoom]
-> ReadPrec AssociateDeviceWithRoom
-> ReadPrec [AssociateDeviceWithRoom]
-> Read 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
(Int -> AssociateDeviceWithRoom -> ShowS)
-> (AssociateDeviceWithRoom -> String)
-> ([AssociateDeviceWithRoom] -> ShowS)
-> Show AssociateDeviceWithRoom
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.
AssociateDeviceWithRoom -> Rep AssociateDeviceWithRoom x)
-> (forall x.
Rep AssociateDeviceWithRoom x -> AssociateDeviceWithRoom)
-> Generic AssociateDeviceWithRoom
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' :: Maybe Text -> Maybe Text -> AssociateDeviceWithRoom
AssociateDeviceWithRoom'
{ $sel:deviceArn:AssociateDeviceWithRoom' :: Maybe Text
deviceArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roomArn:AssociateDeviceWithRoom' :: Maybe Text
roomArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
associateDeviceWithRoom_deviceArn :: Lens.Lens' AssociateDeviceWithRoom (Prelude.Maybe Prelude.Text)
associateDeviceWithRoom_deviceArn :: (Maybe Text -> f (Maybe Text))
-> AssociateDeviceWithRoom -> f AssociateDeviceWithRoom
associateDeviceWithRoom_deviceArn = (AssociateDeviceWithRoom -> Maybe Text)
-> (AssociateDeviceWithRoom
-> Maybe Text -> AssociateDeviceWithRoom)
-> Lens
AssociateDeviceWithRoom
AssociateDeviceWithRoom
(Maybe Text)
(Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> AssociateDeviceWithRoom -> f AssociateDeviceWithRoom
associateDeviceWithRoom_roomArn = (AssociateDeviceWithRoom -> Maybe Text)
-> (AssociateDeviceWithRoom
-> Maybe Text -> AssociateDeviceWithRoom)
-> Lens
AssociateDeviceWithRoom
AssociateDeviceWithRoom
(Maybe Text)
(Maybe Text)
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 :: AssociateDeviceWithRoom -> Request AssociateDeviceWithRoom
request = Service
-> AssociateDeviceWithRoom -> Request AssociateDeviceWithRoom
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateDeviceWithRoom
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateDeviceWithRoom)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AssociateDeviceWithRoom))
-> Logger
-> Service
-> Proxy AssociateDeviceWithRoom
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse AssociateDeviceWithRoom)))
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 -> AssociateDeviceWithRoomResponse
AssociateDeviceWithRoomResponse'
(Int -> AssociateDeviceWithRoomResponse)
-> Either String Int
-> Either String AssociateDeviceWithRoomResponse
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 AssociateDeviceWithRoom
instance Prelude.NFData AssociateDeviceWithRoom
instance Core.ToHeaders AssociateDeviceWithRoom where
toHeaders :: AssociateDeviceWithRoom -> ResponseHeaders
toHeaders =
ResponseHeaders -> AssociateDeviceWithRoom -> 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.AssociateDeviceWithRoom" ::
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 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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DeviceArn" 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
deviceArn,
(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 AssociateDeviceWithRoom where
toPath :: AssociateDeviceWithRoom -> ByteString
toPath = ByteString -> AssociateDeviceWithRoom -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery AssociateDeviceWithRoom where
toQuery :: AssociateDeviceWithRoom -> QueryString
toQuery = QueryString -> AssociateDeviceWithRoom -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateDeviceWithRoomResponse = AssociateDeviceWithRoomResponse'
{
AssociateDeviceWithRoomResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool
(AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool)
-> (AssociateDeviceWithRoomResponse
-> AssociateDeviceWithRoomResponse -> Bool)
-> Eq AssociateDeviceWithRoomResponse
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]
(Int -> ReadS AssociateDeviceWithRoomResponse)
-> ReadS [AssociateDeviceWithRoomResponse]
-> ReadPrec AssociateDeviceWithRoomResponse
-> ReadPrec [AssociateDeviceWithRoomResponse]
-> Read 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
(Int -> AssociateDeviceWithRoomResponse -> ShowS)
-> (AssociateDeviceWithRoomResponse -> String)
-> ([AssociateDeviceWithRoomResponse] -> ShowS)
-> Show AssociateDeviceWithRoomResponse
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.
AssociateDeviceWithRoomResponse
-> Rep AssociateDeviceWithRoomResponse x)
-> (forall x.
Rep AssociateDeviceWithRoomResponse x
-> AssociateDeviceWithRoomResponse)
-> Generic AssociateDeviceWithRoomResponse
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' :: Int -> AssociateDeviceWithRoomResponse
AssociateDeviceWithRoomResponse'
{ $sel:httpStatus:AssociateDeviceWithRoomResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateDeviceWithRoomResponse_httpStatus :: Lens.Lens' AssociateDeviceWithRoomResponse Prelude.Int
associateDeviceWithRoomResponse_httpStatus :: (Int -> f Int)
-> AssociateDeviceWithRoomResponse
-> f AssociateDeviceWithRoomResponse
associateDeviceWithRoomResponse_httpStatus = (AssociateDeviceWithRoomResponse -> Int)
-> (AssociateDeviceWithRoomResponse
-> Int -> AssociateDeviceWithRoomResponse)
-> Lens
AssociateDeviceWithRoomResponse
AssociateDeviceWithRoomResponse
Int
Int
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