libkazv
request_msisdn_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 
23  std::string country;
24 
26  std::string phoneNumber;
27 
36 
40  std::optional<std::string> nextLink;
41 };
42 
43 }
44 namespace nlohmann
45 {
46 using namespace Kazv;
47 using namespace Kazv::Api;
48 template<>
49 struct adl_serializer<RequestMsisdnValidation> {
50  static void to_json(json& jo, const RequestMsisdnValidation &pod)
51  {
52  if (! jo.is_object()) { jo = json::object(); }
53 
54 
55  jo["client_secret"s] = pod.clientSecret;
56 
57  jo["country"s] = pod.country;
58 
59  jo["phone_number"s] = pod.phoneNumber;
60 
61  jo["send_attempt"s] = pod.sendAttempt;
62 
63 
64  addToJsonIfNeeded(jo, "next_link"s, pod.nextLink);
65  }
66  static void from_json(const json &jo, RequestMsisdnValidation& result)
67  {
68 
69  if (jo.contains("client_secret"s)) {
70  result.clientSecret = jo.at("client_secret"s);
71  }
72  if (jo.contains("country"s)) {
73  result.country = jo.at("country"s);
74  }
75  if (jo.contains("phone_number"s)) {
76  result.phoneNumber = jo.at("phone_number"s);
77  }
78  if (jo.contains("send_attempt"s)) {
79  result.sendAttempt = jo.at("send_attempt"s);
80  }
81  if (jo.contains("next_link"s)) {
82  result.nextLink = jo.at("next_link"s);
83  }
84 
85  }
86 };
87  }
88 
89  namespace Kazv::Api
90  {
91 } // 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_msisdn_validation.hpp:13
std::string country
The two-letter uppercase ISO-3166-1 alpha-2 country code that the number in phone_number should be pa...
Definition: request_msisdn_validation.hpp:23
std::optional< std::string > nextLink
Optional.
Definition: request_msisdn_validation.hpp:40
std::string clientSecret
A unique string generated by the client, and used to identify the validation attempt.
Definition: request_msisdn_validation.hpp:19
std::string phoneNumber
The phone number to validate.
Definition: request_msisdn_validation.hpp:26
int sendAttempt
The server will only send an SMS if the send_attempt is a number greater than the most recent one whi...
Definition: request_msisdn_validation.hpp:35
static void from_json(const json &jo, RequestMsisdnValidation &result)
Definition: request_msisdn_validation.hpp:66
static void to_json(json &jo, const RequestMsisdnValidation &pod)
Definition: request_msisdn_validation.hpp:50