Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2577522
room_upgrades.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
room_upgrades.cpp
View Options
/******************************************************************************
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
#include
<algorithm>
#include
"room_upgrades.hpp"
namespace
Kazv
::
Api
{
BaseJob
::
Query
UpgradeRoomJob::buildQuery
(
)
{
BaseJob
::
Query
_q
;
return
_q
;
}
BaseJob
::
Body
UpgradeRoomJob::buildBody
(
std
::
string
roomId
,
std
::
string
newVersion
)
{
// ignore unused param
(
void
)(
roomId
);(
void
)(
newVersion
);
json
_data
=
json
::
object
();
_data
[
"new_version"
s
]
=
newVersion
;
return
BaseJob
::
JsonBody
(
_data
);
};
UpgradeRoomJob
::
UpgradeRoomJob
(
std
::
string
serverUrl
,
std
::
string
_accessToken
,
std
::
string
roomId
,
std
::
string
newVersion
)
:
BaseJob
(
std
::
move
(
serverUrl
),
std
::
string
(
"/_matrix/client/v3"
)
+
"/rooms/"
+
roomId
+
"/upgrade"
,
POST
,
std
::
string
(
"UpgradeRoom"
),
_accessToken
,
ReturnType
::
Json
,
buildBody
(
roomId
,
newVersion
)
,
buildQuery
()
,
{}
)
{
}
UpgradeRoomJob
UpgradeRoomJob
::
withData
(
JsonWrap
j
)
&&
{
auto
ret
=
UpgradeRoomJob
(
std
::
move
(
*
this
));
ret
.
attachData
(
j
);
return
ret
;
}
UpgradeRoomJob
UpgradeRoomJob
::
withData
(
JsonWrap
j
)
const
&
{
auto
ret
=
UpgradeRoomJob
(
*
this
);
ret
.
attachData
(
j
);
return
ret
;
}
UpgradeRoomJob
::
JobResponse
::
JobResponse
(
Response
r
)
:
Response
(
std
::
move
(
r
))
{}
bool
UpgradeRoomResponse
::
success
()
const
{
return
Response
::
success
()
&&
isBodyJson
(
body
)
&&
jsonBody
().
get
().
contains
(
"replacement_room"
s
)
;
}
std
::
string
UpgradeRoomResponse
::
replacementRoom
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"replacement_room"
s
))
{
return
jsonBody
().
get
()[
"replacement_room"
s
]
.
template
get
<
std
::
string
>
();}
else
{
return
std
::
string
(
);}
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Tue, Jun 24, 8:48 AM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
234787
Default Alt Text
room_upgrades.cpp (2 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment