forked from loafle/openapi-generator-original
* Add operationId in exception message * add number data type mapping * removing mergetool lines * first draft of cmake file * compiles generated source files with 64 bit cpprest and boost * using glob recurs to add source files * using glob recurse for source files * cmake to build statuc library * add cmake style comments, use project source dir and lib * fix_issue5488: Add supporting files and source files separately * fix_issue5488: Add supporting files and source files separately * fix_issue5488: Add supporting files and source files separately * fix_issue5488 - updated header comments * updated samples
92 lines
2.5 KiB
C++
92 lines
2.5 KiB
C++
/**
|
|
* Swagger Petstore
|
|
* This is a sample server Petstore server. You can find out more about Swagger at <a href=\"http://swagger.io\">http://swagger.io</a> or on irc.freenode.net, #swagger. For this sample, you can use the api key \"special-key\" to test the authorization filters
|
|
*
|
|
* OpenAPI spec version: 1.0.0
|
|
* Contact: apiteam@wordnik.com
|
|
*
|
|
* NOTE: This class is auto generated by the swagger code generator program.
|
|
* 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 ApiClient_H_
|
|
#define 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 swagger {
|
|
namespace client {
|
|
namespace api {
|
|
|
|
using namespace io::swagger::client::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 << U(", ");
|
|
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 /* ApiClient_H_ */
|