-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApiClient.h
More file actions
93 lines (74 loc) · 2.55 KB
/
ApiClient.h
File metadata and controls
93 lines (74 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/**
* Cloudiator REST Api
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: 0.2.0
* Contact: daniel.baur@uni-ulm.de
*
* NOTE: This class is auto generated by the swagger code generator 2.3.0-SNAPSHOT.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
/*
* ApiClient.h
*
* This is an API client responsible for stating the HTTP calls
*/
#ifndef IO_GITHUB_CLOUDIATOR_REST_API_ApiClient_H_
#define IO_GITHUB_CLOUDIATOR_REST_API_ApiClient_H_
#include "ApiConfiguration.h"
#include "ApiException.h"
#include "IHttpBody.h"
#include "HttpContent.h"
#include <memory>
#include <vector>
#include <cpprest/details/basic_types.h>
#include <cpprest/http_client.h>
namespace io {
namespace github {
namespace cloudiator {
namespace rest {
namespace api {
using namespace io::github::cloudiator::rest::model;
class ApiClient
{
public:
ApiClient( std::shared_ptr<ApiConfiguration> configuration = nullptr );
virtual ~ApiClient();
std::shared_ptr<ApiConfiguration> getConfiguration() const;
void setConfiguration(std::shared_ptr<ApiConfiguration> configuration);
static utility::string_t parameterToString(utility::string_t value);
static utility::string_t parameterToString(int32_t value);
static utility::string_t parameterToString(int64_t value);
static utility::string_t parameterToString(float value);
static utility::string_t parameterToString(const utility::datetime &value);
template<class T>
static utility::string_t parameterToArrayString(std::vector<T> value)
{
utility::stringstream_t ss;
for( size_t i = 0; i < value.size(); i++)
{
if( i > 0) ss << utility::conversions::to_string_t(", ");
ss << ApiClient::parameterToString(value[i]);
}
return ss.str();
}
pplx::task<web::http::http_response> callApi(
const utility::string_t& path,
const utility::string_t& method,
const std::map<utility::string_t, utility::string_t>& queryParams,
const std::shared_ptr<IHttpBody> postBody,
const std::map<utility::string_t, utility::string_t>& headerParams,
const std::map<utility::string_t, utility::string_t>& formParams,
const std::map<utility::string_t, std::shared_ptr<HttpContent>>& fileParams,
const utility::string_t& contentType
) const;
protected:
std::shared_ptr<ApiConfiguration> m_Configuration;
};
}
}
}
}
}
#endif /* IO_GITHUB_CLOUDIATOR_REST_API_ApiClient_H_ */