Page MenuHomePhorge

request_email_validation.hpp
No OneTemporary

Size
2 KB
Referenced Files
None
Subscribers
None

request_email_validation.hpp

/******************************************************************************
* THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
*/
#pragma once
#include "types.hpp"
namespace Kazv {
struct RequestEmailValidation
{
/// A unique string generated by the client, and used to identify the
/// validation attempt. It must be a string consisting of the characters
/// ``[0-9a-zA-Z.=_-]``. Its length must not exceed 255 characters and it
/// must not be empty.
std::string clientSecret;
/// The email address to validate.
std::string email;
/// The server will only send an email if the ``send_attempt``
/// is a number greater than the most recent one which it has seen,
/// scoped to that ``email`` + ``client_secret`` pair. This is to
/// avoid repeatedly sending the same email in the case of request
/// retries between the POSTing user and the identity server.
/// The client should increment this value if they desire a new
/// email (e.g. a reminder) to be sent. If they do not, the server
/// should respond with success but not resend the email.
int sendAttempt;
/// Optional. When the validation is completed, the identity server will
/// redirect the user to this URL. This option is ignored when submitting
/// 3PID validation information through a POST request.
std::string nextLink;
};
}
namespace nlohmann
{
using namespace Kazv;
template<>
struct adl_serializer<RequestEmailValidation> {
static void to_json(json& jo, const RequestEmailValidation &pod)
{
jo["client_secret"s] = pod.clientSecret;
jo["email"s] = pod.email;
jo["send_attempt"s] = pod.sendAttempt;
addToJsonIfNeeded(jo, "next_link"s, pod.nextLink);
}
static void from_json(const json &jo, RequestEmailValidation& result)
{
if (jo.contains("client_secret"s)) {
result.clientSecret = jo.at("client_secret"s);
}
if (jo.contains("email"s)) {
result.email = jo.at("email"s);
}
if (jo.contains("send_attempt"s)) {
result.sendAttempt = jo.at("send_attempt"s);
}
if (jo.contains("next_link"s)) {
result.nextLink = jo.at("next_link"s);
}
}
};
}
namespace Kazv
{
} // namespace Kazv

File Metadata

Mime Type
text/x-c++
Expires
Mon, Jun 29, 9:36 AM (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1633966
Default Alt Text
request_email_validation.hpp (2 KB)

Event Timeline