libkazv
request_email_validation.hpp
Go to the documentation of this file.
1 /******************************************************************************
2  * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
3  */
4 
5 #pragma once
6 
7 #include "types.hpp"
9 
10 namespace Kazv::Api {
11 
13 {
14 
21  std::optional<std::string> idServer;
22 
28  std::optional<std::string> idAccessToken;
29 };
30 
31 }
32 namespace nlohmann
33 {
34 using namespace Kazv;
35 using namespace Kazv::Api;
36 template<>
37 struct adl_serializer<EmailValidationData> {
38  static void to_json(json& jo, const EmailValidationData &pod)
39  {
40  if (! jo.is_object()) { jo = json::object(); }
41  jo = static_cast<const RequestEmailValidation &>(pod);
42 
43 
44  addToJsonIfNeeded(jo, "id_server"s, pod.idServer);
45 
46  addToJsonIfNeeded(jo, "id_access_token"s, pod.idAccessToken);
47  }
48  static void from_json(const json &jo, EmailValidationData& result)
49  {
50  static_cast<RequestEmailValidation &>(result) = jo;
51  if (jo.contains("id_server"s)) {
52  result.idServer = jo.at("id_server"s);
53  }
54  if (jo.contains("id_access_token"s)) {
55  result.idAccessToken = jo.at("id_access_token"s);
56  }
57 
58  }
59 };
60  }
61 
62  namespace Kazv::Api
63  {
64 } // namespace Kazv::Api
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
Definition: request_email_validation.hpp:13
std::optional< std::string > idAccessToken
An access token previously registered with the identity server.
Definition: request_email_validation.hpp:28
std::optional< std::string > idServer
The hostname of the identity server to communicate with.
Definition: request_email_validation.hpp:21
Definition: request_email_validation.hpp:13
static void from_json(const json &jo, EmailValidationData &result)
Definition: request_email_validation.hpp:48
static void to_json(json &jo, const EmailValidationData &pod)
Definition: request_email_validation.hpp:38