Kraust 5b8a11546c
[C++] [Client] Added cpp-oatpp-client (#21711)
* Added cpp-oatpp-client.

* Updated pipelines.

* Should match formatting now.

* Moved includes around.

* Ran doc generator.
2025-08-07 10:01:55 +08:00

57 lines
1.7 KiB
C++

/**
* OpenAPI Petstore
* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "oatpp/web/client/HttpRequestExecutor.hpp"
#include "oatpp/parser/json/mapping/ObjectMapper.hpp"
#include "oatpp/network/tcp/client/ConnectionProvider.hpp"
#include "PetApi.hpp"
#include "StoreApi.hpp"
#include "UserApi.hpp"
static int _main_app(void) {
/* create connection provider */
auto connectionProvider = oatpp::network::tcp::client::ConnectionProvider::createShared({"localhost", 8080, oatpp::network::Address::IP_4});
/* create HTTP request executor */
auto requestExecutor = oatpp::web::client::HttpRequestExecutor::createShared(connectionProvider);
/* create JSON object mapper */
auto objectMapper = oatpp::parser::json::mapping::ObjectMapper::createShared();
/* create API client */
auto PetApiClient = org::openapitools::client::api::PetApi::createShared(requestExecutor, objectMapper);
/* create API client */
auto StoreApiClient = org::openapitools::client::api::StoreApi::createShared(requestExecutor, objectMapper);
/* create API client */
auto UserApiClient = org::openapitools::client::api::UserApi::createShared(requestExecutor, objectMapper);
return 0;
}
int main(int argc, char **argv) {
/* Init oatpp Environment */
oatpp::base::Environment::init();
int ret = _main_app();
/* Destroy oatpp Environment */
oatpp::base::Environment::destroy();
return ret;
}