libkazv
refresh.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 "basejob.hpp"
8 
9 
10 namespace Kazv::Api {
11 
32 class RefreshJob : public BaseJob {
33 public:
34 
35 
36 
37 class JobResponse : public Response
38 {
39 
40 public:
42  bool success() const;
43 
44  // Result properties
45 
46 
47 
48 
50 std::string accessToken() const;
51 
52 
56 std::optional<std::string> refreshToken() const;
57 
58 
62 std::optional<int> expiresInMs() const;
63 
64 };
65  static constexpr auto needsAuth() {
66  return
67  false;
68  }
69 
70 
71 // Construction/destruction
72 
78  explicit RefreshJob(std::string serverUrl
79 
80  ,
81  std::optional<std::string> refreshToken = std::nullopt
82  );
83 
84 
86  );
87 
88  static BaseJob::Body buildBody(std::optional<std::string> refreshToken);
89 
90 
91 
92 
93 
95  RefreshJob withData(JsonWrap j) const &;
96  };
98  }
99  namespace nlohmann
100  {
101  using namespace Kazv;
102  using namespace Kazv::Api;
103 
104  }
105 
106  namespace Kazv::Api
107  {
108 
109 } // namespace Kazv::Api
Kazv::Api::RefreshJob::needsAuth
static constexpr auto needsAuth()
Definition: refresh.hpp:69
Kazv::Api::RefreshJob::JobResponse::JobResponse
JobResponse(Response r)
Definition: refresh.cpp:75
Kazv::Api::RefreshJob::JobResponse::refreshToken
std::optional< std::string > refreshToken() const
The new refresh token to use when the access token needs to be refreshed again.
Definition: refresh.cpp:100
nlohmann
Definition: location.hpp:26
Kazv::Api::RefreshJob::JobResponse::success
bool success() const
Definition: refresh.cpp:78
Kazv
Definition: location.hpp:10
Kazv::BaseJob::Query
Definition: basejob.hpp:90
Kazv::Api::RefreshJob::JobResponse
Definition: refresh.hpp:41
Kazv::Api::RefreshJob
Refresh an access token.
Definition: refresh.hpp:34
Kazv::Api::RefreshJob::RefreshJob
RefreshJob(std::string serverUrl, std::optional< std::string > refreshToken=std::nullopt)
Refresh an access token.
Definition: refresh.cpp:41
Kazv::Api
Definition: location.hpp:10
Kazv::Api::RefreshJob::JobResponse::accessToken
std::string accessToken() const
The new access token to use.
Definition: refresh.cpp:89
basejob.hpp
Kazv::JsonWrap
Definition: jsonwrap.hpp:22
Kazv::Api::RefreshJob::withData
RefreshJob withData(JsonWrap j) &&
Definition: refresh.cpp:61
Kazv::BaseJob::Body
::Kazv::Body Body
Definition: basejob.hpp:100
Kazv::Api::RefreshJob::JobResponse::expiresInMs
std::optional< int > expiresInMs() const
The lifetime of the access token, in milliseconds.
Definition: refresh.cpp:111
Kazv::Api::RefreshJob::buildBody
static BaseJob::Body buildBody(std::optional< std::string > refreshToken)
Definition: refresh.cpp:23
Kazv::Api::RefreshJob::buildQuery
static BaseJob::Query buildQuery()
Definition: refresh.cpp:15
Kazv::Response
Definition: basejob.hpp:50