libkazv
request_token_response.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 
18  std::string sid;
19 
30  std::optional<std::string> submitUrl;
31 };
32 
33 }
34 namespace nlohmann
35 {
36 using namespace Kazv;
37 using namespace Kazv::Api;
38 template<>
39 struct adl_serializer<RequestTokenResponse> {
40  static void to_json(json& jo, const RequestTokenResponse &pod)
41  {
42  if (! jo.is_object()) { jo = json::object(); }
43 
44 
45  jo["sid"s] = pod.sid;
46 
47 
48  addToJsonIfNeeded(jo, "submit_url"s, pod.submitUrl);
49  }
50  static void from_json(const json &jo, RequestTokenResponse& result)
51  {
52 
53  if (jo.contains("sid"s)) {
54  result.sid = jo.at("sid"s);
55  }
56  if (jo.contains("submit_url"s)) {
57  result.submitUrl = jo.at("submit_url"s);
58  }
59 
60  }
61 };
62  }
63 
64  namespace Kazv::Api
65  {
66 } // 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_token_response.hpp:13
std::string sid
The session ID.
Definition: request_token_response.hpp:18
std::optional< std::string > submitUrl
An optional field containing a URL where the client must submit the validation token to,...
Definition: request_token_response.hpp:30
static void from_json(const json &jo, RequestTokenResponse &result)
Definition: request_token_response.hpp:50
static void to_json(json &jo, const RequestTokenResponse &pod)
Definition: request_token_response.hpp:40