Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F140521
users.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
users.cpp
View Options
/******************************************************************************
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
#include
<algorithm>
#include
"users.hpp"
namespace
Kazv
::
Api
{
BaseJob
::
Query
SearchUserDirectoryJob::buildQuery
(
)
{
BaseJob
::
Query
_q
;
return
_q
;
}
BaseJob
::
Body
SearchUserDirectoryJob::buildBody
(
std
::
string
searchTerm
,
std
::
optional
<
int
>
limit
)
{
// ignore unused param
(
void
)(
searchTerm
);(
void
)(
limit
);
json
_data
=
json
::
object
();
_data
[
"search_term"
s
]
=
searchTerm
;
addToJsonIfNeeded
(
_data
,
"limit"
s
,
limit
);
return
BaseJob
::
JsonBody
(
_data
);
};
SearchUserDirectoryJob
::
SearchUserDirectoryJob
(
std
::
string
serverUrl
,
std
::
string
_accessToken
,
std
::
string
searchTerm
,
std
::
optional
<
int
>
limit
)
:
BaseJob
(
std
::
move
(
serverUrl
),
std
::
string
(
"/_matrix/client/v3"
)
+
"/user_directory/search"
,
POST
,
std
::
string
(
"SearchUserDirectory"
),
_accessToken
,
ReturnType
::
Json
,
buildBody
(
searchTerm
,
limit
)
,
buildQuery
()
,
{}
)
{
}
SearchUserDirectoryJob
SearchUserDirectoryJob
::
withData
(
JsonWrap
j
)
&&
{
auto
ret
=
SearchUserDirectoryJob
(
std
::
move
(
*
this
));
ret
.
attachData
(
j
);
return
ret
;
}
SearchUserDirectoryJob
SearchUserDirectoryJob
::
withData
(
JsonWrap
j
)
const
&
{
auto
ret
=
SearchUserDirectoryJob
(
*
this
);
ret
.
attachData
(
j
);
return
ret
;
}
SearchUserDirectoryJob
::
JobResponse
::
JobResponse
(
Response
r
)
:
Response
(
std
::
move
(
r
))
{}
bool
SearchUserDirectoryResponse
::
success
()
const
{
return
Response
::
success
()
&&
isBodyJson
(
body
)
&&
jsonBody
().
get
().
contains
(
"results"
s
)
&&
jsonBody
().
get
().
contains
(
"limited"
s
)
;
}
immer
::
array
<
SearchUserDirectoryJob
::
User
>
SearchUserDirectoryResponse
::
results
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"results"
s
))
{
return
jsonBody
().
get
()[
"results"
s
]
.
template
get
<
immer
::
array
<
User
>>
();}
else
{
return
immer
::
array
<
User
>
(
);}
}
bool
SearchUserDirectoryResponse
::
limited
()
const
{
if
(
jsonBody
().
get
()
.
contains
(
"limited"
s
))
{
return
jsonBody
().
get
()[
"limited"
s
]
.
template
get
<
bool
>
();}
else
{
return
bool
(
);}
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Jan 19, 11:41 PM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
55516
Default Alt Text
users.cpp (2 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment