libkazv
Loading...
Searching...
No Matches
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
10namespace Kazv::Api {
11
32class RefreshJob : public BaseJob {
33public:
34
35
36
37class JobResponse : public Response
38{
39
40public:
42 bool success() const;
43
44 // Result properties
45
46
47
48
50std::string accessToken() const;
51
52
56std::optional<std::string> refreshToken() const;
57
58
62std::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
Definition refresh.hpp:38
std::string accessToken() const
The new access token to use.
Definition refresh.cpp:87
std::optional< std::string > refreshToken() const
The new refresh token to use when the access token needs to be refreshed again.
Definition refresh.cpp:98
bool success() const
Definition refresh.cpp:76
std::optional< int > expiresInMs() const
The lifetime of the access token, in milliseconds.
Definition refresh.cpp:109
Refresh an access token.
Definition refresh.hpp:32
static BaseJob::Body buildBody(std::optional< std::string > refreshToken)
Definition refresh.cpp:21
static BaseJob::Query buildQuery()
Definition refresh.cpp:13
static constexpr auto needsAuth()
Definition refresh.hpp:65
RefreshJob withData(JsonWrap j) &&
Definition refresh.cpp:59
Definition basejob.hpp:94
Definition basejob.hpp:68
::Kazv::Body Body
Definition basejob.hpp:103
Definition jsonwrap.hpp:23
Definition location.hpp:10
Definition location.hpp:10
Definition location.hpp:27
Definition basejob.hpp:49