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 
12 struct RequestTokenResponse
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
Kazv::Api::RequestTokenResponse
Definition: request_token_response.hpp:14
nlohmann::adl_serializer< RequestTokenResponse >::to_json
static void to_json(json &jo, const RequestTokenResponse &pod)
Definition: request_token_response.hpp:40
types.hpp
nlohmann
Definition: location.hpp:26
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< RequestTokenResponse >::from_json
static void from_json(const json &jo, RequestTokenResponse &result)
Definition: request_token_response.hpp:50
Kazv::Api::RequestTokenResponse::submitUrl
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:34
Kazv::Api::RequestTokenResponse::sid
std::string sid
The session ID.
Definition: request_token_response.hpp:22