183 std::string
roomId()
const;
277 , std::string _accessToken
279 std::optional<std::string> visibility = std::nullopt, std::optional<std::string> roomAliasName = std::nullopt, std::optional<std::string> name = std::nullopt, std::optional<std::string> topic = std::nullopt, immer::array<std::string> invite = {}, immer::array<Invite3pid> invite3pid = {}, std::optional<std::string> roomVersion = std::nullopt, JsonWrap creationContent = {}, immer::array<StateEvent> initialState = {}, std::optional<std::string> preset = std::nullopt, std::optional<bool> isDirect = std::nullopt, JsonWrap powerLevelContentOverride = {}
286 static BaseJob::Body buildBody(std::optional<std::string> visibility, std::optional<std::string> roomAliasName, std::optional<std::string> name, std::optional<std::string> topic, immer::array<std::string> invite, immer::array<Invite3pid> invite3pid, std::optional<std::string> roomVersion, JsonWrap creationContent, immer::array<StateEvent> initialState, std::optional<std::string> preset, std::optional<bool> isDirect, JsonWrap powerLevelContentOverride);
299 using namespace Kazv;
306 if (! jo.is_object()) { jo = json::object(); }
313 jo[
"medium"s] = pod.
medium;
322 if (jo.contains(
"id_server"s)) {
323 result.
idServer = jo.at(
"id_server"s);
325 if (jo.contains(
"id_access_token"s)) {
328 if (jo.contains(
"medium"s)) {
329 result.
medium = jo.at(
"medium"s);
331 if (jo.contains(
"address"s)) {
332 result.
address = jo.at(
"address"s);
343 if (! jo.is_object()) { jo = json::object(); }
346 jo[
"type"s] = pod.
type;
357 if (jo.contains(
"type"s)) {
358 result.
type = jo.at(
"type"s);
360 if (jo.contains(
"content"s)) {
361 result.
content = jo.at(
"content"s);
363 if (jo.contains(
"state_key"s)) {
364 result.
stateKey = jo.at(
"state_key"s);
Definition: create_room.hpp:171
std::string roomId() const
The created room's ID.
Definition: create_room.cpp:109
bool success() const
Definition: create_room.cpp:98
JobResponse(Response r)
Definition: create_room.cpp:95
Create a new room.
Definition: create_room.hpp:56
static BaseJob::Body buildBody(std::optional< std::string > visibility, std::optional< std::string > roomAliasName, std::optional< std::string > name, std::optional< std::string > topic, immer::array< std::string > invite, immer::array< Invite3pid > invite3pid, std::optional< std::string > roomVersion, JsonWrap creationContent, immer::array< StateEvent > initialState, std::optional< std::string > preset, std::optional< bool > isDirect, JsonWrap powerLevelContentOverride)
Definition: create_room.cpp:21
static BaseJob::Query buildQuery()
Definition: create_room.cpp:13
CreateRoomJob withData(JsonWrap j) &&
Definition: create_room.cpp:81
static constexpr auto needsAuth()
Definition: create_room.hpp:186
CreateRoomJob(std::string serverUrl, std::string _accessToken, std::optional< std::string > visibility=std::nullopt, std::optional< std::string > roomAliasName=std::nullopt, std::optional< std::string > name=std::nullopt, std::optional< std::string > topic=std::nullopt, immer::array< std::string > invite={}, immer::array< Invite3pid > invite3pid={}, std::optional< std::string > roomVersion=std::nullopt, JsonWrap creationContent={}, immer::array< StateEvent > initialState={}, std::optional< std::string > preset=std::nullopt, std::optional< bool > isDirect=std::nullopt, JsonWrap powerLevelContentOverride={})
Create a new room.
Definition: create_room.cpp:61
Definition: basejob.hpp:77
::Kazv::Body Body
Definition: basejob.hpp:100
Definition: jsonwrap.hpp:23
Definition: location.hpp:10
Definition: location.hpp:10
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::json json
Definition: jsonwrap.hpp:20
Definition: location.hpp:27
Create a new room with various configuration options.
Definition: create_room.hpp:102
std::string medium
The kind of address being passed in the address field, for example email.
Definition: create_room.hpp:110
std::string idServer
The hostname+port of the identity server which should be used for third party identifier lookups.
Definition: create_room.hpp:104
std::string idAccessToken
An access token previously registered with the identity server.
Definition: create_room.hpp:108
std::string address
The invitee's third party identifier.
Definition: create_room.hpp:112
Create a new room with various configuration options.
Definition: create_room.hpp:158
std::optional< std::string > stateKey
The state_key of the state event. Defaults to an empty string.
Definition: create_room.hpp:164
JsonWrap content
The content of the event.
Definition: create_room.hpp:162
std::string type
The type of event to send.
Definition: create_room.hpp:160
Definition: basejob.hpp:50
static void from_json(const json &jo, CreateRoomJob::Invite3pid &result)
Definition: create_room.hpp:319
static void to_json(json &jo, const CreateRoomJob::Invite3pid &pod)
Definition: create_room.hpp:304
static void to_json(json &jo, const CreateRoomJob::StateEvent &pod)
Definition: create_room.hpp:341
static void from_json(const json &jo, CreateRoomJob::StateEvent &result)
Definition: create_room.hpp:354