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 
12 struct RequestEmailValidation
13 {
14 
19  std::string clientSecret;
20 
22  std::string email;
23 
32  int sendAttempt;
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
Kazv::Api::RequestEmailValidation::sendAttempt
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:36
Kazv::Api::RequestEmailValidation::clientSecret
std::string clientSecret
A unique string generated by the client, and used to identify the validation attempt.
Definition: request_email_validation.hpp:23
types.hpp
nlohmann
Definition: location.hpp:26
Kazv::Api::RequestEmailValidation
Definition: request_email_validation.hpp:14
Kazv
Definition: location.hpp:10
Kazv::json
nlohmann::json json
Definition: jsonwrap.hpp:20
Kazv::Api
Definition: location.hpp:10
Kazv::addToJsonIfNeeded
void addToJsonIfNeeded(json &j, std::string name, T &&arg)
Definition: types.hpp:80
nlohmann::adl_serializer< RequestEmailValidation >::to_json
static void to_json(json &jo, const RequestEmailValidation &pod)
Definition: request_email_validation.hpp:47
Kazv::Api::RequestEmailValidation::nextLink
std::optional< std::string > nextLink
Optional.
Definition: request_email_validation.hpp:41
Kazv::Api::RequestEmailValidation::email
std::string email
The email address to validate.
Definition: request_email_validation.hpp:26
nlohmann::adl_serializer< RequestEmailValidation >::from_json
static void from_json(const json &jo, RequestEmailValidation &result)
Definition: request_email_validation.hpp:61