{-# 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.UpdateRoom
(
UpdateRoom (..),
newUpdateRoom,
updateRoom_profileArn,
updateRoom_providerCalendarId,
updateRoom_roomArn,
updateRoom_roomName,
updateRoom_description,
UpdateRoomResponse (..),
newUpdateRoomResponse,
updateRoomResponse_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 UpdateRoom = UpdateRoom'
{
UpdateRoom -> Maybe Text
profileArn :: Prelude.Maybe Prelude.Text,
UpdateRoom -> Maybe Text
providerCalendarId :: Prelude.Maybe Prelude.Text,
UpdateRoom -> Maybe Text
roomArn :: Prelude.Maybe Prelude.Text,
UpdateRoom -> Maybe Text
roomName :: Prelude.Maybe Prelude.Text,
UpdateRoom -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (UpdateRoom -> UpdateRoom -> Bool
(UpdateRoom -> UpdateRoom -> Bool)
-> (UpdateRoom -> UpdateRoom -> Bool) -> Eq UpdateRoom
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoom -> UpdateRoom -> Bool
$c/= :: UpdateRoom -> UpdateRoom -> Bool
== :: UpdateRoom -> UpdateRoom -> Bool
$c== :: UpdateRoom -> UpdateRoom -> Bool
Prelude.Eq, ReadPrec [UpdateRoom]
ReadPrec UpdateRoom
Int -> ReadS UpdateRoom
ReadS [UpdateRoom]
(Int -> ReadS UpdateRoom)
-> ReadS [UpdateRoom]
-> ReadPrec UpdateRoom
-> ReadPrec [UpdateRoom]
-> Read UpdateRoom
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoom]
$creadListPrec :: ReadPrec [UpdateRoom]
readPrec :: ReadPrec UpdateRoom
$creadPrec :: ReadPrec UpdateRoom
readList :: ReadS [UpdateRoom]
$creadList :: ReadS [UpdateRoom]
readsPrec :: Int -> ReadS UpdateRoom
$creadsPrec :: Int -> ReadS UpdateRoom
Prelude.Read, Int -> UpdateRoom -> ShowS
[UpdateRoom] -> ShowS
UpdateRoom -> String
(Int -> UpdateRoom -> ShowS)
-> (UpdateRoom -> String)
-> ([UpdateRoom] -> ShowS)
-> Show UpdateRoom
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoom] -> ShowS
$cshowList :: [UpdateRoom] -> ShowS
show :: UpdateRoom -> String
$cshow :: UpdateRoom -> String
showsPrec :: Int -> UpdateRoom -> ShowS
$cshowsPrec :: Int -> UpdateRoom -> ShowS
Prelude.Show, (forall x. UpdateRoom -> Rep UpdateRoom x)
-> (forall x. Rep UpdateRoom x -> UpdateRoom) -> Generic UpdateRoom
forall x. Rep UpdateRoom x -> UpdateRoom
forall x. UpdateRoom -> Rep UpdateRoom x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRoom x -> UpdateRoom
$cfrom :: forall x. UpdateRoom -> Rep UpdateRoom x
Prelude.Generic)
newUpdateRoom ::
UpdateRoom
newUpdateRoom :: UpdateRoom
newUpdateRoom =
UpdateRoom' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> UpdateRoom
UpdateRoom'
{ $sel:profileArn:UpdateRoom' :: Maybe Text
profileArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:providerCalendarId:UpdateRoom' :: Maybe Text
providerCalendarId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roomArn:UpdateRoom' :: Maybe Text
roomArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:roomName:UpdateRoom' :: Maybe Text
roomName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:description:UpdateRoom' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
updateRoom_profileArn :: Lens.Lens' UpdateRoom (Prelude.Maybe Prelude.Text)
updateRoom_profileArn :: (Maybe Text -> f (Maybe Text)) -> UpdateRoom -> f UpdateRoom
updateRoom_profileArn = (UpdateRoom -> Maybe Text)
-> (UpdateRoom -> Maybe Text -> UpdateRoom)
-> Lens UpdateRoom UpdateRoom (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoom' {Maybe Text
profileArn :: Maybe Text
$sel:profileArn:UpdateRoom' :: UpdateRoom -> Maybe Text
profileArn} -> Maybe Text
profileArn) (\s :: UpdateRoom
s@UpdateRoom' {} Maybe Text
a -> UpdateRoom
s {$sel:profileArn:UpdateRoom' :: Maybe Text
profileArn = Maybe Text
a} :: UpdateRoom)
updateRoom_providerCalendarId :: Lens.Lens' UpdateRoom (Prelude.Maybe Prelude.Text)
updateRoom_providerCalendarId :: (Maybe Text -> f (Maybe Text)) -> UpdateRoom -> f UpdateRoom
updateRoom_providerCalendarId = (UpdateRoom -> Maybe Text)
-> (UpdateRoom -> Maybe Text -> UpdateRoom)
-> Lens UpdateRoom UpdateRoom (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoom' {Maybe Text
providerCalendarId :: Maybe Text
$sel:providerCalendarId:UpdateRoom' :: UpdateRoom -> Maybe Text
providerCalendarId} -> Maybe Text
providerCalendarId) (\s :: UpdateRoom
s@UpdateRoom' {} Maybe Text
a -> UpdateRoom
s {$sel:providerCalendarId:UpdateRoom' :: Maybe Text
providerCalendarId = Maybe Text
a} :: UpdateRoom)
updateRoom_roomArn :: Lens.Lens' UpdateRoom (Prelude.Maybe Prelude.Text)
updateRoom_roomArn :: (Maybe Text -> f (Maybe Text)) -> UpdateRoom -> f UpdateRoom
updateRoom_roomArn = (UpdateRoom -> Maybe Text)
-> (UpdateRoom -> Maybe Text -> UpdateRoom)
-> Lens UpdateRoom UpdateRoom (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoom' {Maybe Text
roomArn :: Maybe Text
$sel:roomArn:UpdateRoom' :: UpdateRoom -> Maybe Text
roomArn} -> Maybe Text
roomArn) (\s :: UpdateRoom
s@UpdateRoom' {} Maybe Text
a -> UpdateRoom
s {$sel:roomArn:UpdateRoom' :: Maybe Text
roomArn = Maybe Text
a} :: UpdateRoom)
updateRoom_roomName :: Lens.Lens' UpdateRoom (Prelude.Maybe Prelude.Text)
updateRoom_roomName :: (Maybe Text -> f (Maybe Text)) -> UpdateRoom -> f UpdateRoom
updateRoom_roomName = (UpdateRoom -> Maybe Text)
-> (UpdateRoom -> Maybe Text -> UpdateRoom)
-> Lens UpdateRoom UpdateRoom (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoom' {Maybe Text
roomName :: Maybe Text
$sel:roomName:UpdateRoom' :: UpdateRoom -> Maybe Text
roomName} -> Maybe Text
roomName) (\s :: UpdateRoom
s@UpdateRoom' {} Maybe Text
a -> UpdateRoom
s {$sel:roomName:UpdateRoom' :: Maybe Text
roomName = Maybe Text
a} :: UpdateRoom)
updateRoom_description :: Lens.Lens' UpdateRoom (Prelude.Maybe Prelude.Text)
updateRoom_description :: (Maybe Text -> f (Maybe Text)) -> UpdateRoom -> f UpdateRoom
updateRoom_description = (UpdateRoom -> Maybe Text)
-> (UpdateRoom -> Maybe Text -> UpdateRoom)
-> Lens UpdateRoom UpdateRoom (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoom' {Maybe Text
description :: Maybe Text
$sel:description:UpdateRoom' :: UpdateRoom -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateRoom
s@UpdateRoom' {} Maybe Text
a -> UpdateRoom
s {$sel:description:UpdateRoom' :: Maybe Text
description = Maybe Text
a} :: UpdateRoom)
instance Core.AWSRequest UpdateRoom where
type AWSResponse UpdateRoom = UpdateRoomResponse
request :: UpdateRoom -> Request UpdateRoom
request = Service -> UpdateRoom -> Request UpdateRoom
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateRoom
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRoom)))
response =
(Int
-> ResponseHeaders -> () -> Either String (AWSResponse UpdateRoom))
-> Logger
-> Service
-> Proxy UpdateRoom
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateRoom)))
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 -> UpdateRoomResponse
UpdateRoomResponse'
(Int -> UpdateRoomResponse)
-> Either String Int -> Either String UpdateRoomResponse
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 UpdateRoom
instance Prelude.NFData UpdateRoom
instance Core.ToHeaders UpdateRoom where
toHeaders :: UpdateRoom -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateRoom -> 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.UpdateRoom" ::
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 UpdateRoom where
toJSON :: UpdateRoom -> Value
toJSON UpdateRoom' {Maybe Text
description :: Maybe Text
roomName :: Maybe Text
roomArn :: Maybe Text
providerCalendarId :: Maybe Text
profileArn :: Maybe Text
$sel:description:UpdateRoom' :: UpdateRoom -> Maybe Text
$sel:roomName:UpdateRoom' :: UpdateRoom -> Maybe Text
$sel:roomArn:UpdateRoom' :: UpdateRoom -> Maybe Text
$sel:providerCalendarId:UpdateRoom' :: UpdateRoom -> Maybe Text
$sel:profileArn:UpdateRoom' :: UpdateRoom -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ProfileArn" 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
profileArn,
(Text
"ProviderCalendarId" 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
providerCalendarId,
(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,
(Text
"RoomName" 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
roomName,
(Text
"Description" 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
description
]
)
instance Core.ToPath UpdateRoom where
toPath :: UpdateRoom -> ByteString
toPath = ByteString -> UpdateRoom -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateRoom where
toQuery :: UpdateRoom -> QueryString
toQuery = QueryString -> UpdateRoom -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateRoomResponse = UpdateRoomResponse'
{
UpdateRoomResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateRoomResponse -> UpdateRoomResponse -> Bool
(UpdateRoomResponse -> UpdateRoomResponse -> Bool)
-> (UpdateRoomResponse -> UpdateRoomResponse -> Bool)
-> Eq UpdateRoomResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRoomResponse -> UpdateRoomResponse -> Bool
$c/= :: UpdateRoomResponse -> UpdateRoomResponse -> Bool
== :: UpdateRoomResponse -> UpdateRoomResponse -> Bool
$c== :: UpdateRoomResponse -> UpdateRoomResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRoomResponse]
ReadPrec UpdateRoomResponse
Int -> ReadS UpdateRoomResponse
ReadS [UpdateRoomResponse]
(Int -> ReadS UpdateRoomResponse)
-> ReadS [UpdateRoomResponse]
-> ReadPrec UpdateRoomResponse
-> ReadPrec [UpdateRoomResponse]
-> Read UpdateRoomResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRoomResponse]
$creadListPrec :: ReadPrec [UpdateRoomResponse]
readPrec :: ReadPrec UpdateRoomResponse
$creadPrec :: ReadPrec UpdateRoomResponse
readList :: ReadS [UpdateRoomResponse]
$creadList :: ReadS [UpdateRoomResponse]
readsPrec :: Int -> ReadS UpdateRoomResponse
$creadsPrec :: Int -> ReadS UpdateRoomResponse
Prelude.Read, Int -> UpdateRoomResponse -> ShowS
[UpdateRoomResponse] -> ShowS
UpdateRoomResponse -> String
(Int -> UpdateRoomResponse -> ShowS)
-> (UpdateRoomResponse -> String)
-> ([UpdateRoomResponse] -> ShowS)
-> Show UpdateRoomResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRoomResponse] -> ShowS
$cshowList :: [UpdateRoomResponse] -> ShowS
show :: UpdateRoomResponse -> String
$cshow :: UpdateRoomResponse -> String
showsPrec :: Int -> UpdateRoomResponse -> ShowS
$cshowsPrec :: Int -> UpdateRoomResponse -> ShowS
Prelude.Show, (forall x. UpdateRoomResponse -> Rep UpdateRoomResponse x)
-> (forall x. Rep UpdateRoomResponse x -> UpdateRoomResponse)
-> Generic UpdateRoomResponse
forall x. Rep UpdateRoomResponse x -> UpdateRoomResponse
forall x. UpdateRoomResponse -> Rep UpdateRoomResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRoomResponse x -> UpdateRoomResponse
$cfrom :: forall x. UpdateRoomResponse -> Rep UpdateRoomResponse x
Prelude.Generic)
newUpdateRoomResponse ::
Prelude.Int ->
UpdateRoomResponse
newUpdateRoomResponse :: Int -> UpdateRoomResponse
newUpdateRoomResponse Int
pHttpStatus_ =
UpdateRoomResponse' :: Int -> UpdateRoomResponse
UpdateRoomResponse' {$sel:httpStatus:UpdateRoomResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateRoomResponse_httpStatus :: Lens.Lens' UpdateRoomResponse Prelude.Int
updateRoomResponse_httpStatus :: (Int -> f Int) -> UpdateRoomResponse -> f UpdateRoomResponse
updateRoomResponse_httpStatus = (UpdateRoomResponse -> Int)
-> (UpdateRoomResponse -> Int -> UpdateRoomResponse)
-> Lens UpdateRoomResponse UpdateRoomResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRoomResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateRoomResponse' :: UpdateRoomResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateRoomResponse
s@UpdateRoomResponse' {} Int
a -> UpdateRoomResponse
s {$sel:httpStatus:UpdateRoomResponse' :: Int
httpStatus = Int
a} :: UpdateRoomResponse)
instance Prelude.NFData UpdateRoomResponse