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"
8 
9 
10 namespace Kazv::Api {
11 
13 {
14 
19  std::string clientSecret;
20 
22  std::string email;
23 
33 
37  std::optional<std::string> nextLink;
38 };
39 
40 }
41 namespace nlohmann
42 {
43 using namespace Kazv;
44 using namespace Kazv::Api;
45 template<>
46 struct adl_serializer<RequestEmailValidation> {
47  static void to_json(json& jo, const RequestEmailValidation &pod)
48  {
49  if (! jo.is_object()) { jo = json::object(); }
50 
51 
52  jo["client_secret"s] = pod.clientSecret;
53 
54  jo["email"s] = pod.email;
55 
56  jo["send_attempt"s] = pod.sendAttempt;
57 
58 
59  addToJsonIfNeeded(jo, "next_link"s, pod.nextLink);
60  }
61  static void from_json(const json &jo, RequestEmailValidation& result)
62  {
63 
64  if (jo.contains("client_secret"s)) {
65  result.clientSecret = jo.at("client_secret"s);
66  }
67  if (jo.contains("email"s)) {
68  result.email = jo.at("email"s);
69  }
70  if (jo.contains("send_attempt"s)) {
71  result.sendAttempt = jo.at("send_attempt"s);
72  }
73  if (jo.contains("next_link"s)) {
74  result.nextLink = jo.at("next_link"s);
75  }
76 
77  }
78 };
79  }
80 
81  namespace Kazv::Api
82  {
83 } // 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
int sendAttempt
The server will only send an email if the send_attempt is a number greater than the most recent one w...
Definition: request_email_validation.hpp:32
std::string email
The email address to validate.
Definition: request_email_validation.hpp:22
std::optional< std::string > nextLink
Optional.
Definition: request_email_validation.hpp:37
std::string clientSecret
A unique string generated by the client, and used to identify the validation attempt.
Definition: request_email_validation.hpp:19
static void from_json(const json &jo, RequestEmailValidation &result)
Definition: request_email_validation.hpp:61
static void to_json(json &jo, const RequestEmailValidation &pod)
Definition: request_email_validation.hpp:47