Commit 0e4df31e authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

Merge branch 'remove_smf_client' into 'develop'

Remove SMF_client lib

See merge request oai/cn5g/oai-cn5g-amf!127
parents 1f899261 0367f459
......@@ -38,10 +38,6 @@ include_directories(${SRC_TOP_DIR}/sbi/amf_server)
include_directories(${SRC_TOP_DIR}/sbi/amf_server/api)
include_directories(${SRC_TOP_DIR}/sbi/amf_server/impl)
include_directories(${SRC_TOP_DIR}/sbi/amf_server/model)
include_directories(${SRC_TOP_DIR}/sbi/smf_client)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/api)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/inputs)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/model)
include_directories(${SRC_TOP_DIR}/sctp)
include_directories(${SRC_TOP_DIR}/secu_algorithms/5gaka)
include_directories(${SRC_TOP_DIR}/secu_algorithms/nas_enc_int)
......
......@@ -305,7 +305,6 @@ ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/common ${CMAKE_CURRENT_BI
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/amf-app ${CMAKE_CURRENT_BINARY_DIR}/amf-app)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/contexts ${CMAKE_CURRENT_BINARY_DIR}/contexts)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/sbi/amf_server ${CMAKE_CURRENT_BINARY_DIR}/sbi/amf_server)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/sbi/smf_client ${CMAKE_CURRENT_BINARY_DIR}/sbi/smf_client)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/sctp ${CMAKE_CURRENT_BINARY_DIR}/sctp)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/utils ${CMAKE_CURRENT_BINARY_DIR}/utils)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../../src/secu_algorithms/5gaka ${CMAKE_CURRENT_BINARY_DIR}/secu_algorithms/5gaka)
......@@ -333,9 +332,6 @@ include_directories(${SRC_TOP_DIR}/sbi/amf_server)
include_directories(${SRC_TOP_DIR}/sbi/amf_server/api)
include_directories(${SRC_TOP_DIR}/sbi/amf_server/impl)
include_directories(${SRC_TOP_DIR}/sbi/amf_server/model)
include_directories(${SRC_TOP_DIR}/sbi/smf_client)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/api)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/model)
include_directories(${SRC_TOP_DIR}/sctp)
include_directories(${SRC_TOP_DIR}/secu_algorithms/5gaka)
include_directories(${SRC_TOP_DIR}/secu_algorithms/nas_enc_int)
......@@ -355,4 +351,4 @@ IF(STATIC_LINKING)
ENDIF(STATIC_LINKING)
target_link_libraries(amf ${ASAN}
-Wl,--start-group 3GPP_COMMON_TYPES AMF CONTEXTS AMF_SCTP AMF_SECU_5GAKA AMF_SECU_NAS AMF_UTILS AMF_SBI_CLIENT AMF_SBI_SERVER config++ sctp pthread ${NETTLE_LIBRARIES} ${MySQL_LIBRARY} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} nghttp2_asio boost_system boost_thread boost_chrono ssl crypt cpprest gmp pistache curl)
-Wl,--start-group 3GPP_COMMON_TYPES AMF CONTEXTS AMF_SCTP AMF_SECU_5GAKA AMF_SECU_NAS AMF_UTILS AMF_SBI_SERVER config++ sctp pthread ${NETTLE_LIBRARIES} ${MySQL_LIBRARY} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} nghttp2_asio boost_system boost_thread boost_chrono ssl crypt cpprest gmp pistache curl)
build/
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "ApiClient.h"
#include "MultipartFormData.h"
#include "ModelBase.h"
#include <sstream>
#include <limits>
#include <iomanip>
template<typename T>
utility::string_t toString(const T value) {
utility::ostringstream_t out;
out << std::setprecision(std::numeric_limits<T>::digits10) << std::fixed
<< value;
return out.str();
}
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
ApiClient::ApiClient(std::shared_ptr<ApiConfiguration> configuration)
: m_Configuration(configuration) {}
ApiClient::~ApiClient() {}
const ApiClient::ResponseHandlerType& ApiClient::getResponseHandler() const {
return m_ResponseHandler;
}
void ApiClient::setResponseHandler(const ResponseHandlerType& responseHandler) {
m_ResponseHandler = responseHandler;
}
std::shared_ptr<ApiConfiguration> ApiClient::getConfiguration() const {
return m_Configuration;
}
void ApiClient::setConfiguration(
std::shared_ptr<ApiConfiguration> configuration) {
m_Configuration = configuration;
}
utility::string_t ApiClient::parameterToString(utility::string_t value) {
return value;
}
utility::string_t ApiClient::parameterToString(int64_t value) {
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
utility::string_t ApiClient::parameterToString(int32_t value) {
std::stringstream valueAsStringStream;
valueAsStringStream << value;
return utility::conversions::to_string_t(valueAsStringStream.str());
}
utility::string_t ApiClient::parameterToString(float value) {
return utility::conversions::to_string_t(toString(value));
}
utility::string_t ApiClient::parameterToString(double value) {
return utility::conversions::to_string_t(toString(value));
}
utility::string_t ApiClient::parameterToString(const utility::datetime& value) {
return utility::conversions::to_string_t(
value.to_string(utility::datetime::ISO_8601));
}
pplx::task<web::http::http_response> ApiClient::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 {
std::cout << "API CLIENT CALL API " << m_Configuration->getBaseUrl()
<< std::endl;
if (postBody != nullptr && formParams.size() != 0) {
throw ApiException(
400,
utility::conversions::to_string_t("Cannot have body and form params"));
}
if (postBody != nullptr && fileParams.size() != 0) {
throw ApiException(
400,
utility::conversions::to_string_t("Cannot have body and file params"));
}
if (fileParams.size() > 0 &&
contentType != utility::conversions::to_string_t("multipart/form-data")) {
throw ApiException(
400, utility::conversions::to_string_t(
"Operations with file parameters must be called with "
"multipart/form-data"));
}
web::http::client::http_client client(
m_Configuration->getBaseUrl(), m_Configuration->getHttpConfig());
web::http::http_request request;
for (auto& kvp : headerParams) {
request.headers().add(kvp.first, kvp.second);
}
if (fileParams.size() > 0) {
MultipartFormData uploadData;
for (auto& kvp : formParams) {
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
}
for (auto& kvp : fileParams) {
uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second));
}
std::stringstream data;
uploadData.writeTo(data);
auto bodyString = data.str();
auto length = bodyString.size();
request.set_body(
concurrency::streams::bytestream::open_istream(std::move(bodyString)),
length,
utility::conversions::to_string_t("multipart/form-data; boundary=") +
uploadData.getBoundary());
} else {
if (postBody != nullptr) {
std::stringstream data;
postBody->writeTo(data);
auto bodyString = data.str();
auto length = bodyString.size();
request.set_body(
concurrency::streams::bytestream::open_istream(std::move(bodyString)),
length, contentType);
} else {
if (contentType ==
utility::conversions::to_string_t("application/json")) {
web::json::value body_data = web::json::value::object();
for (auto& kvp : formParams) {
body_data[kvp.first] = ModelBase::toJson(kvp.second);
}
if (!formParams.empty()) {
request.set_body(body_data);
}
} else {
web::http::uri_builder formData;
for (auto& kvp : formParams) {
formData.append_query(kvp.first, kvp.second);
}
if (!formParams.empty()) {
request.set_body(
formData.query(), utility::conversions::to_string_t(
"application/x-www-form-urlencoded"));
}
}
}
}
web::http::uri_builder builder(path);
for (auto& kvp : queryParams) {
builder.append_query(kvp.first, kvp.second);
}
request.set_request_uri(builder.to_uri());
request.set_method(method);
if (!request.headers().has(web::http::header_names::user_agent)) {
request.headers().add(
web::http::header_names::user_agent, m_Configuration->getUserAgent());
}
std::cout << "API CLIENT CALL API" << m_Configuration->getBaseUrl()
<< std::endl;
return client.request(request);
}
} // namespace api
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiClient.h
*
* This is an API client responsible for stating the HTTP calls
*/
#ifndef OAI_SMF_API_ApiClient_H_
#define OAI_SMF_API_ApiClient_H_
#include "ApiConfiguration.h"
#include "ApiException.h"
#include "IHttpBody.h"
#include "HttpContent.h"
#include <memory>
#include <vector>
#include <functional>
#if defined(_WIN32) || defined(_WIN64)
#undef U
#endif
#include <cpprest/details/basic_types.h>
#include <cpprest/http_client.h>
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
class ApiClient {
public:
ApiClient(std::shared_ptr<ApiConfiguration> configuration = nullptr);
virtual ~ApiClient();
typedef std::function<void(
web::http::status_code, const web::http::http_headers&)>
ResponseHandlerType;
const ResponseHandlerType& getResponseHandler() const;
void setResponseHandler(const ResponseHandlerType& responseHandler);
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(double value);
static utility::string_t parameterToString(const utility::datetime& value);
template<class T>
static utility::string_t parameterToString(const std::vector<T>& value);
template<class T>
static utility::string_t parameterToString(const std::shared_ptr<T>& value);
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:
ResponseHandlerType m_ResponseHandler;
std::shared_ptr<ApiConfiguration> m_Configuration;
};
template<class T>
utility::string_t ApiClient::parameterToString(const 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();
}
template<class T>
utility::string_t ApiClient::parameterToString(
const std::shared_ptr<T>& value) {
return parameterToString(*value.get());
}
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_ApiClient_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "ApiConfiguration.h"
namespace oai {
namespace smf {
namespace api {
ApiConfiguration::ApiConfiguration() {}
ApiConfiguration::~ApiConfiguration() {}
web::http::client::http_client_config& ApiConfiguration::getHttpConfig() {
return m_HttpConfig;
}
void ApiConfiguration::setHttpConfig(
web::http::client::http_client_config& value) {
m_HttpConfig = value;
}
utility::string_t ApiConfiguration::getBaseUrl() const {
return m_BaseUrl;
}
void ApiConfiguration::setBaseUrl(const utility::string_t value) {
m_BaseUrl = value;
}
utility::string_t ApiConfiguration::getUserAgent() const {
return m_UserAgent;
}
void ApiConfiguration::setUserAgent(const utility::string_t value) {
m_UserAgent = value;
}
std::map<utility::string_t, utility::string_t>&
ApiConfiguration::getDefaultHeaders() {
return m_DefaultHeaders;
}
utility::string_t ApiConfiguration::getApiKey(
const utility::string_t& prefix) const {
auto result = m_ApiKeys.find(prefix);
if (result != m_ApiKeys.end()) {
return result->second;
}
return utility::conversions::to_string_t("");
}
void ApiConfiguration::setApiKey(
const utility::string_t& prefix, const utility::string_t& apiKey) {
m_ApiKeys[prefix] = apiKey;
}
} // namespace api
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiConfiguration.h
*
* This class represents a single item of a multipart-formdata request.
*/
#ifndef OAI_SMF_API_ApiConfiguration_H_
#define OAI_SMF_API_ApiConfiguration_H_
#include <map>
#include <cpprest/details/basic_types.h>
#include <cpprest/http_client.h>
namespace oai {
namespace smf {
namespace api {
class ApiConfiguration {
public:
ApiConfiguration();
virtual ~ApiConfiguration();
web::http::client::http_client_config& getHttpConfig();
void setHttpConfig(web::http::client::http_client_config& value);
utility::string_t getBaseUrl() const;
void setBaseUrl(const utility::string_t value);
utility::string_t getUserAgent() const;
void setUserAgent(const utility::string_t value);
std::map<utility::string_t, utility::string_t>& getDefaultHeaders();
utility::string_t getApiKey(const utility::string_t& prefix) const;
void setApiKey(
const utility::string_t& prefix, const utility::string_t& apiKey);
protected:
utility::string_t m_BaseUrl;
std::map<utility::string_t, utility::string_t> m_DefaultHeaders;
std::map<utility::string_t, utility::string_t> m_ApiKeys;
web::http::client::http_client_config m_HttpConfig;
utility::string_t m_UserAgent;
};
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_ApiConfiguration_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "ApiException.h"
namespace oai {
namespace smf {
namespace api {
ApiException::ApiException(
int errorCode, const utility::string_t& message,
std::shared_ptr<std::istream> content /*= nullptr*/)
: web::http::http_exception(errorCode, message), m_Content(content) {}
ApiException::ApiException(
int errorCode, const utility::string_t& message,
std::map<utility::string_t, utility::string_t>& headers,
std::shared_ptr<std::istream> content /*= nullptr*/)
: web::http::http_exception(errorCode, message),
m_Content(content),
m_Headers(headers) {}
ApiException::~ApiException() {}
std::shared_ptr<std::istream> ApiException::getContent() const {
return m_Content;
}
std::map<utility::string_t, utility::string_t>& ApiException::getHeaders() {
return m_Headers;
}
} // namespace api
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ApiException.h
*
* This is the exception being thrown in case the api call was not successful
*/
#ifndef OAI_SMF_API_ApiException_H_
#define OAI_SMF_API_ApiException_H_
#include <memory>
#include <map>
#include <cpprest/details/basic_types.h>
#include <cpprest/http_msg.h>
namespace oai {
namespace smf {
namespace api {
class ApiException : public web::http::http_exception {
public:
ApiException(
int errorCode, const utility::string_t& message,
std::shared_ptr<std::istream> content = nullptr);
ApiException(
int errorCode, const utility::string_t& message,
std::map<utility::string_t, utility::string_t>& headers,
std::shared_ptr<std::istream> content = nullptr);
virtual ~ApiException();
std::map<utility::string_t, utility::string_t>& getHeaders();
std::shared_ptr<std::istream> getContent() const;
protected:
std::shared_ptr<std::istream> m_Content;
std::map<utility::string_t, utility::string_t> m_Headers;
};
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_ApiBase_H_ */
################################################################################
# Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The OpenAirInterface Software Alliance licenses this file to You under
# the OAI Public License, Version 1.1 (the "License"); you may not use this file
# except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.openairinterface.org/?page_id=698
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
include_directories(${SRC_TOP_DIR}/common)
include_directories(${SRC_TOP_DIR}/common/unicode)
include_directories(${SRC_TOP_DIR}/contexts)
include_directories(${SRC_TOP_DIR}/nas/common)
include_directories(${SRC_TOP_DIR}/utils)
include_directories(${SRC_TOP_DIR}/utils/bstr)
include_directories(${SRC_TOP_DIR}/sbi/smf_client)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/api)
include_directories(${SRC_TOP_DIR}/sbi/smf_client/model)
add_library (AMF_SBI_CLIENT STATIC
${CMAKE_CURRENT_SOURCE_DIR}/ApiClient.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ApiConfiguration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ApiException.cpp
${CMAKE_CURRENT_SOURCE_DIR}/HttpContent.cpp
${CMAKE_CURRENT_SOURCE_DIR}/JsonBody.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ModelBase.cpp
${CMAKE_CURRENT_SOURCE_DIR}/MultipartFormData.cpp
${CMAKE_CURRENT_SOURCE_DIR}/Object.cpp
)
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "HttpContent.h"
namespace oai {
namespace smf {
namespace model {
HttpContent::HttpContent() {}
HttpContent::~HttpContent() {}
utility::string_t HttpContent::getContentDisposition() {
return m_ContentDisposition;
}
void HttpContent::setContentDisposition(const utility::string_t& value) {
m_ContentDisposition = value;
}
utility::string_t HttpContent::getName() {
return m_Name;
}
void HttpContent::setName(const utility::string_t& value) {
m_Name = value;
}
utility::string_t HttpContent::getFileName() {
return m_FileName;
}
void HttpContent::setFileName(const utility::string_t& value) {
m_FileName = value;
}
utility::string_t HttpContent::getContentType() {
return m_ContentType;
}
void HttpContent::setContentType(const utility::string_t& value) {
m_ContentType = value;
}
std::shared_ptr<std::istream> HttpContent::getData() {
return m_Data;
}
void HttpContent::setData(std::shared_ptr<std::istream> value) {
m_Data = value;
}
void HttpContent::writeTo(std::ostream& stream) {
m_Data->seekg(0, m_Data->beg);
stream << m_Data->rdbuf();
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* HttpContent.h
*
* This class represents a single item of a multipart-formdata request.
*/
#ifndef OAI_SMF_MODEL_HttpContent_H_
#define OAI_SMF_MODEL_HttpContent_H_
#include <memory>
#include <cpprest/details/basic_types.h>
namespace oai {
namespace smf {
namespace model {
class HttpContent {
public:
HttpContent();
virtual ~HttpContent();
virtual utility::string_t getContentDisposition();
virtual void setContentDisposition(const utility::string_t& value);
virtual utility::string_t getName();
virtual void setName(const utility::string_t& value);
virtual utility::string_t getFileName();
virtual void setFileName(const utility::string_t& value);
virtual utility::string_t getContentType();
virtual void setContentType(const utility::string_t& value);
virtual std::shared_ptr<std::istream> getData();
virtual void setData(std::shared_ptr<std::istream> value);
virtual void writeTo(std::ostream& stream);
protected:
// NOTE: no utility::string_t here because those strings can only contain
// ascii
utility::string_t m_ContentDisposition;
utility::string_t m_Name;
utility::string_t m_FileName;
utility::string_t m_ContentType;
std::shared_ptr<std::istream> m_Data;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_HttpContent_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IHttpBody.h
*
* This is the interface for contents that can be sent to a remote HTTP server.
*/
#ifndef OAI_SMF_MODEL_IHttpBody_H_
#define OAI_SMF_MODEL_IHttpBody_H_
#include <iostream>
namespace oai {
namespace smf {
namespace model {
class IHttpBody {
public:
virtual ~IHttpBody() {}
virtual void writeTo(std::ostream& stream) = 0;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_IHttpBody_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "JsonBody.h"
namespace oai {
namespace smf {
namespace model {
JsonBody::JsonBody(const web::json::value& json) : m_Json(json) {}
JsonBody::~JsonBody() {}
void JsonBody::writeTo(std::ostream& target) {
m_Json.serialize(target);
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* JsonBody.h
*
* This is a JSON http body which can be submitted via http
*/
#ifndef OAI_SMF_MODEL_JsonBody_H_
#define OAI_SMF_MODEL_JsonBody_H_
#include "IHttpBody.h"
#include <cpprest/json.h>
namespace oai {
namespace smf {
namespace model {
class JsonBody : public IHttpBody {
public:
JsonBody(const web::json::value& value);
virtual ~JsonBody();
void writeTo(std::ostream& target) override;
protected:
web::json::value m_Json;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_JsonBody_H_ */
This diff is collapsed.
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* ModelBase.h
*
* This is the base class for all model classes
*/
#ifndef OAI_SMF_MODEL_ModelBase_H_
#define OAI_SMF_MODEL_ModelBase_H_
#include "HttpContent.h"
#include "MultipartFormData.h"
#include <cpprest/details/basic_types.h>
#include <cpprest/json.h>
#include <vector>
namespace oai {
namespace smf {
namespace model {
class ModelBase {
public:
ModelBase();
virtual ~ModelBase();
virtual void validate() = 0;
virtual web::json::value toJson() const = 0;
virtual void fromJson(const web::json::value& json) = 0;
virtual void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const = 0;
virtual void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) = 0;
static web::json::value toJson(const utility::string_t& value);
static web::json::value toJson(const utility::datetime& value);
static web::json::value toJson(std::shared_ptr<HttpContent> value);
static web::json::value toJson(std::shared_ptr<ModelBase> value);
static web::json::value toJson(int32_t value);
static web::json::value toJson(int64_t value);
static web::json::value toJson(double value);
static web::json::value toJson(bool value);
template<class T>
static web::json::value toJson(const std::vector<T>& value);
static int64_t int64_tFromJson(const web::json::value& val);
static int32_t int32_tFromJson(const web::json::value& val);
static float floatFromJson(const web::json::value& val);
static utility::string_t stringFromJson(const web::json::value& val);
static utility::datetime dateFromJson(const web::json::value& val);
static double doubleFromJson(const web::json::value& val);
static bool boolFromJson(const web::json::value& val);
static std::shared_ptr<HttpContent> fileFromJson(const web::json::value& val);
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, const utility::string_t& value,
const utility::string_t& contentType =
utility::conversions::to_string_t(""));
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, const utility::datetime& value,
const utility::string_t& contentType =
utility::conversions::to_string_t(""));
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, std::shared_ptr<HttpContent> value);
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, const web::json::value& value,
const utility::string_t& contentType =
utility::conversions::to_string_t("application/json"));
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, int32_t value,
const utility::string_t& contentType =
utility::conversions::to_string_t(""));
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, int64_t value,
const utility::string_t& contentType =
utility::conversions::to_string_t(""));
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, double value,
const utility::string_t& contentType =
utility::conversions::to_string_t(""));
template<class T>
static std::shared_ptr<HttpContent> toHttpContent(
const utility::string_t& name, const std::vector<T>& value,
const utility::string_t& contentType =
utility::conversions::to_string_t(""));
static int64_t int64_tFromHttpContent(std::shared_ptr<HttpContent> val);
static int32_t int32_tFromHttpContent(std::shared_ptr<HttpContent> val);
static float floatFromHttpContent(std::shared_ptr<HttpContent> val);
static utility::string_t stringFromHttpContent(
std::shared_ptr<HttpContent> val);
static utility::datetime dateFromHttpContent(
std::shared_ptr<HttpContent> val);
static bool boolFromHttpContent(std::shared_ptr<HttpContent> val);
static double doubleFromHttpContent(std::shared_ptr<HttpContent> val);
static web::json::value valueFromHttpContent(
std::shared_ptr<HttpContent> val);
static utility::string_t toBase64(utility::string_t value);
static utility::string_t toBase64(std::shared_ptr<std::istream> value);
static std::shared_ptr<std::istream> fromBase64(
const utility::string_t& encoded);
};
template<class T>
web::json::value ModelBase::toJson(const std::vector<T>& value) {
std::vector<web::json::value> ret;
for (auto& x : value) {
ret.push_back(toJson(x));
}
return web::json::value::array(ret);
}
template<class T>
std::shared_ptr<HttpContent> ModelBase::toHttpContent(
const utility::string_t& name, const std::vector<T>& value,
const utility::string_t& contentType) {
web::json::value json_array = ModelBase::toJson(value);
std::shared_ptr<HttpContent> content(new HttpContent);
content->setName(name);
content->setContentDisposition(
utility::conversions::to_string_t("form-data"));
content->setContentType(contentType);
content->setData(std::shared_ptr<std::istream>(new std::stringstream(
utility::conversions::to_utf8string(json_array.serialize()))));
return content;
}
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_ModelBase_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "MultipartFormData.h"
#include "ModelBase.h"
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
namespace oai {
namespace smf {
namespace model {
MultipartFormData::MultipartFormData() {
utility::stringstream_t uuidString;
uuidString << boost::uuids::random_generator()();
m_Boundary = uuidString.str();
}
MultipartFormData::MultipartFormData(const utility::string_t& boundary)
: m_Boundary(boundary) {}
MultipartFormData::~MultipartFormData() {}
utility::string_t MultipartFormData::getBoundary() {
return m_Boundary;
}
void MultipartFormData::add(std::shared_ptr<HttpContent> content) {
m_Contents.push_back(content);
m_ContentLookup[content->getName()] = content;
}
bool MultipartFormData::hasContent(const utility::string_t& name) const {
return m_ContentLookup.find(name) != m_ContentLookup.end();
}
std::shared_ptr<HttpContent> MultipartFormData::getContent(
const utility::string_t& name) const {
auto result = m_ContentLookup.find(name);
if (result == m_ContentLookup.end()) {
return std::shared_ptr<HttpContent>(nullptr);
}
return result->second;
}
void MultipartFormData::writeTo(std::ostream& target) {
for (size_t i = 0; i < m_Contents.size(); i++) {
std::shared_ptr<HttpContent> content = m_Contents[i];
// boundary
target << "\r\n"
<< "--" << utility::conversions::to_utf8string(m_Boundary) << "\r\n";
// headers
target << "Content-Disposition: "
<< utility::conversions::to_utf8string(
content->getContentDisposition());
if (content->getName().size() > 0) {
target << "; name=\""
<< utility::conversions::to_utf8string(content->getName()) << "\"";
}
if (content->getFileName().size() > 0) {
target << "; filename=\""
<< utility::conversions::to_utf8string(content->getFileName())
<< "\"";
}
target << "\r\n";
if (content->getContentType().size() > 0) {
target << "Content-Type: "
<< utility::conversions::to_utf8string(content->getContentType())
<< "\r\n";
}
target << "\r\n";
// body
std::shared_ptr<std::istream> data = content->getData();
data->seekg(0, data->end);
std::vector<char> dataBytes(data->tellg());
data->seekg(0, data->beg);
data->read(&dataBytes[0], dataBytes.size());
std::copy(
dataBytes.begin(), dataBytes.end(),
std::ostreambuf_iterator<char>(target));
}
target << "\r\n--" << utility::conversions::to_utf8string(m_Boundary)
<< "--\r\n";
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* MultipartFormData.h
*
* This class represents a container for building
* application/x-multipart-formdata requests.
*/
#ifndef OAI_SMF_MODEL_MultipartFormData_H_
#define OAI_SMF_MODEL_MultipartFormData_H_
#include "IHttpBody.h"
#include "HttpContent.h"
#include <vector>
#include <map>
#include <memory>
#include <cpprest/details/basic_types.h>
namespace oai {
namespace smf {
namespace model {
class MultipartFormData : public IHttpBody {
public:
MultipartFormData();
MultipartFormData(const utility::string_t& boundary);
virtual ~MultipartFormData();
virtual void add(std::shared_ptr<HttpContent> content);
virtual utility::string_t getBoundary();
virtual std::shared_ptr<HttpContent> getContent(
const utility::string_t& name) const;
virtual bool hasContent(const utility::string_t& name) const;
virtual void writeTo(std::ostream& target);
protected:
std::vector<std::shared_ptr<HttpContent>> m_Contents;
utility::string_t m_Boundary;
std::map<utility::string_t, std::shared_ptr<HttpContent>> m_ContentLookup;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_MultipartFormData_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Object.h"
namespace oai {
namespace smf {
namespace model {
Object::Object() {
m_object = web::json::value::object();
}
Object::~Object() {}
void Object::validate() {
// TODO: implement validation
}
web::json::value Object::toJson() const {
return m_object;
}
void Object::fromJson(const web::json::value& val) {
if (val.is_object()) {
m_object = val;
}
}
void Object::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("object"), m_object));
}
void Object::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
m_object = ModelBase::valueFromHttpContent(multipart->getContent(
namePrefix + utility::conversions::to_string_t("object")));
}
web::json::value Object::getValue(const utility::string_t& key) const {
return m_object.at(key);
}
void Object::setValue(
const utility::string_t& key, const web::json::value& value) {
m_object[key] = value;
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Object.h
*
* This is the implementation of a JSON object.
*/
#ifndef OAI_SMF_MODEL_Object_H_
#define OAI_SMF_MODEL_Object_H_
#include "ModelBase.h"
#include <cpprest/details/basic_types.h>
#include <cpprest/json.h>
namespace oai {
namespace smf {
namespace model {
class Object : public ModelBase {
public:
Object();
virtual ~Object();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// Object manipulation
web::json::value getValue(const utility::string_t& key) const;
void setValue(const utility::string_t& key, const web::json::value& value);
private:
web::json::value m_object;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_Object_H_ */
# C++ API client
SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client.
- API version: 1.1.0.alpha-1
- Package version:
- Build package: org.openapitools.codegen.languages.CppRestSdkClientCodegen
- API namespace: oai.smf.api
- Model namespace: oai.smf.model
## Installation
### Prerequisites
Install [cpprestsdk](https://github.com/Microsoft/cpprestsdk).
- Windows: `vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows`
- Mac: `brew install cpprestsdk`
- Linux: `sudo apt-get install libcpprest-dev`
### Build
```sh
cmake -DCPPREST_ROOT=/usr -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib"
make
```
### Build on Windows with Visual Studio (VS2017)
- Right click on folder containing source code
- Select 'Open in visual studio'
- Once visual studio opens, CMake should show up in top menu bar.
- Select CMake > Build All.
*Note: If the CMake menu item doesn't show up in Visual Studio, CMake
for Visual Studio must be installed. In this case, open the 'Visual Studio
Installer' application. Select 'modify' Visual Studio 2017. Make sure
'Desktop Development with C++' is installed, and specifically that 'Visual
C++ tools for CMake' is selected in the 'Installation Details' section.
Also be sure to review the CMakeLists.txt file. Edits are likely required.*
## Author
This diff is collapsed.
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IndividualPDUSessionHSMFApi.h
*
*
*/
#ifndef OAI_SMF_API_IndividualPDUSessionHSMFApi_H_
#define OAI_SMF_API_IndividualPDUSessionHSMFApi_H_
#include "../ApiClient.h"
#include "HsmfUpdateData.h"
#include "HsmfUpdateError.h"
#include "HsmfUpdatedData.h"
#include "ProblemDetails.h"
#include "ReleaseData.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
class IndividualPDUSessionHSMFApi {
public:
explicit IndividualPDUSessionHSMFApi(std::shared_ptr<ApiClient> apiClient);
virtual ~IndividualPDUSessionHSMFApi();
/// <summary>
/// Release
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="pduSessionRef">PDU session reference</param>
/// <param name="releaseData">representation of the data to be sent to H-SMF
/// when releasing the PDU session (optional)</param>
pplx::task<void> releasePduSession(
utility::string_t pduSessionRef,
boost::optional<std::shared_ptr<ReleaseData>> releaseData);
/// <summary>
/// Update (initiated by V-SMF)
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="pduSessionRef">PDU session reference</param>
/// <param name="hsmfUpdateData">representation of the updates to apply to the
/// PDU session</param>
pplx::task<std::shared_ptr<HsmfUpdatedData>> updatePduSession(
utility::string_t pduSessionRef,
std::shared_ptr<HsmfUpdateData> hsmfUpdateData);
protected:
std::shared_ptr<ApiClient> m_ApiClient;
};
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_IndividualPDUSessionHSMFApi_H_ */
This diff is collapsed.
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* IndividualSMContextApi.h
*
*
*/
#ifndef OAI_SMF_API_IndividualSMContextApi_H_
#define OAI_SMF_API_IndividualSMContextApi_H_
#include "../ApiClient.h"
#include "ProblemDetails.h"
#include "SmContextReleaseData.h"
#include "SmContextRetrieveData.h"
#include "SmContextRetrievedData.h"
#include "SmContextUpdateData.h"
#include "SmContextUpdateError.h"
#include "SmContextUpdatedData.h"
#include <cpprest/details/basic_types.h>
#include <boost/optional.hpp>
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
class IndividualSMContextApi {
public:
explicit IndividualSMContextApi(std::shared_ptr<ApiClient> apiClient);
virtual ~IndividualSMContextApi();
/// <summary>
/// Release SM Context
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="smContextRef">SM context reference</param>
/// <param name="smContextReleaseData">representation of the data to be sent
/// to the SMF when releasing the SM context (optional)</param>
pplx::task<void> releaseSmContext(
utility::string_t smContextRef,
boost::optional<std::shared_ptr<SmContextReleaseData>>
smContextReleaseData);
/// <summary>
/// Retrieve SM Context
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="smContextRef">SM context reference</param>
/// <param name="smContextRetrieveData">parameters used to retrieve the SM
/// context (optional)</param>
pplx::task<std::shared_ptr<SmContextRetrievedData>> retrieveSmContext(
utility::string_t smContextRef,
boost::optional<std::shared_ptr<SmContextRetrieveData>>
smContextRetrieveData);
/// <summary>
/// Update SM Context
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="smContextRef">SM context reference</param>
/// <param name="smContextUpdateData">representation of the updates to apply
/// to the SM context</param>
pplx::task<std::shared_ptr<SmContextUpdatedData>> updateSmContext(
utility::string_t smContextRef,
std::shared_ptr<SmContextUpdateData> smContextUpdateData);
protected:
std::shared_ptr<ApiClient> m_ApiClient;
};
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_IndividualSMContextApi_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "PDUSessionsCollectionApi.h"
#include "IHttpBody.h"
#include "JsonBody.h"
#include "MultipartFormData.h"
#include <unordered_set>
#include <boost/algorithm/string/replace.hpp>
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
PDUSessionsCollectionApi::PDUSessionsCollectionApi(
std::shared_ptr<ApiClient> apiClient)
: m_ApiClient(apiClient) {}
PDUSessionsCollectionApi::~PDUSessionsCollectionApi() {}
pplx::task<std::shared_ptr<PduSessionCreatedData>>
PDUSessionsCollectionApi::postPduSessions(
std::shared_ptr<PduSessionCreateData> pduSessionCreateData) {
// verify the required parameter 'pduSessionCreateData' is set
if (pduSessionCreateData == nullptr) {
throw ApiException(
400, utility::conversions::to_string_t(
"Missing required parameter 'pduSessionCreateData' when "
"calling PDUSessionsCollectionApi->postPduSessions"));
}
std::shared_ptr<ApiConfiguration> localVarApiConfiguration(
m_ApiClient->getConfiguration());
utility::string_t localVarPath =
utility::conversions::to_string_t("/pdu-sessions");
std::map<utility::string_t, utility::string_t> localVarQueryParams;
std::map<utility::string_t, utility::string_t> localVarHeaderParams(
localVarApiConfiguration->getDefaultHeaders());
std::map<utility::string_t, utility::string_t> localVarFormParams;
std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;
std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
localVarResponseHttpContentTypes.insert(
utility::conversions::to_string_t("application/json"));
localVarResponseHttpContentTypes.insert(
utility::conversions::to_string_t("multipart/related"));
localVarResponseHttpContentTypes.insert(
utility::conversions::to_string_t("application/problem+json"));
utility::string_t localVarResponseHttpContentType;
// use JSON if possible
if (localVarResponseHttpContentTypes.size() == 0) {
localVarResponseHttpContentType =
utility::conversions::to_string_t("application/json");
}
// JSON
else if (
localVarResponseHttpContentTypes.find(utility::conversions::to_string_t(
"application/json")) != localVarResponseHttpContentTypes.end()) {
localVarResponseHttpContentType =
utility::conversions::to_string_t("application/json");
}
// multipart formdata
else if (
localVarResponseHttpContentTypes.find(utility::conversions::to_string_t(
"multipart/form-data")) != localVarResponseHttpContentTypes.end()) {
localVarResponseHttpContentType =
utility::conversions::to_string_t("multipart/form-data");
} else {
throw ApiException(
400, utility::conversions::to_string_t(
"PDUSessionsCollectionApi->postPduSessions does not produce "
"any supported media type"));
}
localVarHeaderParams[utility::conversions::to_string_t("Accept")] =
localVarResponseHttpContentType;
std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;
localVarConsumeHttpContentTypes.insert(
utility::conversions::to_string_t("application/json"));
localVarConsumeHttpContentTypes.insert(
utility::conversions::to_string_t("multipart/related"));
std::shared_ptr<IHttpBody> localVarHttpBody;
utility::string_t localVarRequestHttpContentType;
// use JSON if possible
if (localVarConsumeHttpContentTypes.size() == 0 ||
localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t(
"application/json")) != localVarConsumeHttpContentTypes.end()) {
localVarRequestHttpContentType =
utility::conversions::to_string_t("application/json");
web::json::value localVarJson;
localVarJson = ModelBase::toJson(pduSessionCreateData);
localVarHttpBody = std::shared_ptr<IHttpBody>(new JsonBody(localVarJson));
}
// multipart formdata
else if (
localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t(
"multipart/form-data")) != localVarConsumeHttpContentTypes.end()) {
localVarRequestHttpContentType =
utility::conversions::to_string_t("multipart/form-data");
std::shared_ptr<MultipartFormData> localVarMultipart(new MultipartFormData);
if (pduSessionCreateData.get()) {
pduSessionCreateData->toMultipart(
localVarMultipart,
utility::conversions::to_string_t("pduSessionCreateData"));
}
localVarHttpBody = localVarMultipart;
localVarRequestHttpContentType +=
utility::conversions::to_string_t("; boundary=") +
localVarMultipart->getBoundary();
} else {
throw ApiException(
415, utility::conversions::to_string_t(
"PDUSessionsCollectionApi->postPduSessions does not consume "
"any supported media type"));
}
// authentication (oAuth2ClientCredentials) required
// oauth2 authentication is added automatically as part of the
// http_client_config
return m_ApiClient
->callApi(
localVarPath, utility::conversions::to_string_t("POST"),
localVarQueryParams, localVarHttpBody, localVarHeaderParams,
localVarFormParams, localVarFileParams,
localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse) {
if (m_ApiClient->getResponseHandler()) {
m_ApiClient->getResponseHandler()(
localVarResponse.status_code(), localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (localVarResponse.status_code() >= 400) {
throw ApiException(
localVarResponse.status_code(),
utility::conversions::to_string_t(
"error calling postPduSessions: ") +
localVarResponse.reason_phrase(),
std::make_shared<std::stringstream>(
localVarResponse.extract_utf8string(true).get()));
}
// check response content type
if (localVarResponse.headers().has(
utility::conversions::to_string_t("Content-Type"))) {
utility::string_t localVarContentType =
localVarResponse
.headers()[utility::conversions::to_string_t("Content-Type")];
if (localVarContentType.find(localVarResponseHttpContentType) ==
std::string::npos) {
throw ApiException(
500,
utility::conversions::to_string_t(
"error calling postPduSessions: unexpected response "
"type: ") +
localVarContentType,
std::make_shared<std::stringstream>(
localVarResponse.extract_utf8string(true).get()));
}
}
return localVarResponse.extract_string();
})
.then([=](utility::string_t localVarResponse) {
std::shared_ptr<PduSessionCreatedData> localVarResult(
new PduSessionCreatedData());
if (localVarResponseHttpContentType ==
utility::conversions::to_string_t("application/json")) {
web::json::value localVarJson =
web::json::value::parse(localVarResponse);
localVarResult->fromJson(localVarJson);
}
// else if(localVarResponseHttpContentType ==
// utility::conversions::to_string_t("multipart/form-data"))
// {
// TODO multipart response parsing
// }
else {
throw ApiException(
500,
utility::conversions::to_string_t(
"error calling postPduSessions: unsupported response type"));
}
return localVarResult;
});
}
} // namespace api
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* PDUSessionsCollectionApi.h
*
*
*/
#ifndef OAI_SMF_API_PDUSessionsCollectionApi_H_
#define OAI_SMF_API_PDUSessionsCollectionApi_H_
#include "../ApiClient.h"
#include "PduSessionCreateData.h"
#include "PduSessionCreateError.h"
#include "PduSessionCreatedData.h"
#include "ProblemDetails.h"
#include <boost/optional.hpp>
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
class PDUSessionsCollectionApi {
public:
explicit PDUSessionsCollectionApi(std::shared_ptr<ApiClient> apiClient);
virtual ~PDUSessionsCollectionApi();
/// <summary>
/// Create
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="pduSessionCreateData">representation of the PDU session to be
/// created in the H-SMF</param>
pplx::task<std::shared_ptr<PduSessionCreatedData>> postPduSessions(
std::shared_ptr<PduSessionCreateData> pduSessionCreateData);
protected:
std::shared_ptr<ApiClient> m_ApiClient;
};
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_PDUSessionsCollectionApi_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "SMContextsCollectionApi.h"
#include "IHttpBody.h"
#include "JsonBody.h"
#include "MultipartFormData.h"
#include <unordered_set>
#include <cpprest/http_client.h>
#include <cpprest/filestream.h>
#include "logger.hpp"
#include "amf_n11.hpp"
#include <boost/algorithm/string/replace.hpp>
extern amf_application::amf_n11* amf_n11_inst;
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
SMContextsCollectionApi::SMContextsCollectionApi(
std::shared_ptr<ApiClient> apiClient)
: m_ApiClient(apiClient) {}
SMContextsCollectionApi::~SMContextsCollectionApi() {}
pplx::task<std::shared_ptr<SmContextCreatedData>>
SMContextsCollectionApi::postSmContexts(
std::shared_ptr<SmContextMessage> smContextMessage) {
// verify the required parameter 'smContextMessage' is set
if (smContextMessage == nullptr) {
throw ApiException(
400, utility::conversions::to_string_t(
"Missing required parameter 'smContextMessage' when calling "
"SMContextsCollectionApi->postSmContexts"));
}
std::shared_ptr<ApiConfiguration> localVarApiConfiguration(
m_ApiClient->getConfiguration());
utility::string_t localVarPath =
utility::conversions::to_string_t("/sm-contexts");
std::map<utility::string_t, utility::string_t> localVarQueryParams;
std::map<utility::string_t, utility::string_t> localVarHeaderParams(
localVarApiConfiguration->getDefaultHeaders());
std::map<utility::string_t, utility::string_t> localVarFormParams;
std::map<utility::string_t, std::shared_ptr<HttpContent>> localVarFileParams;
std::unordered_set<utility::string_t> localVarResponseHttpContentTypes;
localVarResponseHttpContentTypes.insert(
utility::conversions::to_string_t("application/json"));
// localVarResponseHttpContentTypes.insert(
// utility::conversions::to_string_t("multipart/related") );
// localVarResponseHttpContentTypes.insert(
// utility::conversions::to_string_t("application/problem+json") );
utility::string_t localVarResponseHttpContentType;
// use JSON if possible
if (localVarResponseHttpContentTypes.size() == 0) {
localVarResponseHttpContentType =
utility::conversions::to_string_t("application/json");
}
// JSON
else if (
localVarResponseHttpContentTypes.find(utility::conversions::to_string_t(
"application/json")) != localVarResponseHttpContentTypes.end()) {
localVarResponseHttpContentType =
utility::conversions::to_string_t("application/json");
}
// multipart formdata
else if (
localVarResponseHttpContentTypes.find(utility::conversions::to_string_t(
"multipart/form-data")) != localVarResponseHttpContentTypes.end()) {
localVarResponseHttpContentType =
utility::conversions::to_string_t("multipart/form-data");
} else {
throw ApiException(
400, utility::conversions::to_string_t(
"SMContextsCollectionApi->postSmContexts does not produce any "
"supported media type"));
}
localVarHeaderParams[utility::conversions::to_string_t("Accept")] =
localVarResponseHttpContentType;
std::unordered_set<utility::string_t> localVarConsumeHttpContentTypes;
localVarConsumeHttpContentTypes.insert(
utility::conversions::to_string_t("multipart/related"));
// localVarConsumeHttpContentTypes.insert(
// utility::conversions::to_string_t("application/json") );
std::shared_ptr<IHttpBody> localVarHttpBody;
utility::string_t localVarRequestHttpContentType;
// use JSON if possible
if (localVarConsumeHttpContentTypes.size() == 0 ||
localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t(
"application/json")) != localVarConsumeHttpContentTypes.end()) {
localVarRequestHttpContentType =
utility::conversions::to_string_t("application/json");
web::json::value localVarJson;
localVarJson = ModelBase::toJson(smContextMessage);
auto supi = localVarJson[U("jsonData")][U("supi")];
std::cout << supi << std::endl;
localVarHttpBody = std::shared_ptr<IHttpBody>(new JsonBody(localVarJson));
}
// multipart formdata
else if (
localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t(
"multipart/related")) != localVarConsumeHttpContentTypes.end()) {
localVarRequestHttpContentType =
utility::conversions::to_string_t("multipart/related");
std::shared_ptr<MultipartFormData> localVarMultipart(new MultipartFormData);
if (smContextMessage.get()) {
smContextMessage->toMultipart(
localVarMultipart,
utility::conversions::to_string_t("smContextMessage"));
}
localVarHttpBody = localVarMultipart;
localVarRequestHttpContentType +=
utility::conversions::to_string_t("; boundary=") +
localVarMultipart->getBoundary();
} else {
throw ApiException(
415, utility::conversions::to_string_t(
"SMContextsCollectionApi->postSmContexts does not consume any "
"supported media type"));
}
// authentication (oAuth2ClientCredentials) required
// oauth2 authentication is added automatically as part of the
// http_client_config
return m_ApiClient
->callApi(
localVarPath, utility::conversions::to_string_t("POST"),
localVarQueryParams, localVarHttpBody, localVarHeaderParams,
localVarFormParams, localVarFileParams,
localVarRequestHttpContentType)
.then([=](web::http::http_response localVarResponse) {
if (m_ApiClient->getResponseHandler()) {
m_ApiClient->getResponseHandler()(
localVarResponse.status_code(), localVarResponse.headers());
}
// 1xx - informational : OK
// 2xx - successful : OK
// 3xx - redirection : OK
// 4xx - client error : not OK
// 5xx - client error : not OK
if (localVarResponse.status_code() >= 400) {
// amf_n11_inst->handle_post_sm_context_response_error_400();
throw ApiException(
localVarResponse.status_code(),
utility::conversions::to_string_t(
"error calling postSmContexts: ") +
localVarResponse.reason_phrase(),
std::make_shared<std::stringstream>(
localVarResponse.extract_utf8string(true).get()));
}
// check response content type
if (localVarResponse.headers().has(
utility::conversions::to_string_t("Content-Type"))) {
utility::string_t localVarContentType =
localVarResponse
.headers()[utility::conversions::to_string_t("Content-Type")];
if (localVarContentType.find(localVarResponseHttpContentType) ==
std::string::npos) {
Logger::amf_app().error("response 500");
throw ApiException(
500,
utility::conversions::to_string_t(
"error calling postSmContexts: unexpected response "
"type: ") +
localVarContentType,
std::make_shared<std::stringstream>(
localVarResponse.extract_utf8string(true).get()));
}
}
return localVarResponse.extract_string();
})
.then([=](utility::string_t localVarResponse) {
std::shared_ptr<SmContextCreatedData> localVarResult(
new SmContextCreatedData());
if (localVarResponseHttpContentType ==
utility::conversions::to_string_t("application/json")) {
web::json::value localVarJson =
web::json::value::parse(localVarResponse);
localVarResult->fromJson(localVarJson);
}
// else if(localVarResponseHttpContentType ==
// utility::conversions::to_string_t("multipart/form-data"))
// {
// TODO multipart response parsing
// }
else {
throw ApiException(
500,
utility::conversions::to_string_t(
"error calling postSmContexts: unsupported response type"));
}
return localVarResult;
});
}
} // namespace api
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* SMContextsCollectionApi.h
*
*
*/
#ifndef OAI_SMF_API_SMContextsCollectionApi_H_
#define OAI_SMF_API_SMContextsCollectionApi_H_
#include "../ApiClient.h"
#include "SmContextMessage.h"
#include "ProblemDetails.h"
#include "SmContextCreateError.h"
#include "SmContextCreatedData.h"
#include <boost/optional.hpp>
namespace oai {
namespace smf {
namespace api {
using namespace oai::smf::model;
class SMContextsCollectionApi {
public:
explicit SMContextsCollectionApi(std::shared_ptr<ApiClient> apiClient);
virtual ~SMContextsCollectionApi();
/// <summary>
/// Create SM Context
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="SmContextMessage"></param>
pplx::task<std::shared_ptr<SmContextCreatedData>> postSmContexts(
std::shared_ptr<SmContextMessage> smContextMessage);
protected:
std::shared_ptr<ApiClient> m_ApiClient;
};
} // namespace api
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_API_SMContextsCollectionApi_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AccessType.h"
namespace oai {
namespace smf {
namespace model {
AccessType::AccessType() {
m_value = {};
}
AccessType::~AccessType() {}
void AccessType::validate() {
// TODO: implement validation
}
web::json::value AccessType::toJson() const {
web::json::value val = web::json::value::object();
if (m_value == eAccessType::AccessType_3GPP_ACCESS)
val = web::json::value::string(U("3GPP_ACCESS"));
if (m_value == eAccessType::AccessType_NON_3GPP_ACCESS)
val = web::json::value::string(U("NON_3GPP_ACCESS"));
return val;
}
void AccessType::fromJson(const web::json::value& val) {
auto s = val.as_string();
if (s == utility::conversions::to_string_t("3GPP_ACCESS"))
m_value = eAccessType::AccessType_3GPP_ACCESS;
if (s == utility::conversions::to_string_t("NON_3GPP_ACCESS"))
m_value = eAccessType::AccessType_NON_3GPP_ACCESS;
}
void AccessType::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
utility::string_t s;
if (m_value == eAccessType::AccessType_3GPP_ACCESS)
s = utility::conversions::to_string_t("3GPP_ACCESS");
if (m_value == eAccessType::AccessType_NON_3GPP_ACCESS)
s = utility::conversions::to_string_t("NON_3GPP_ACCESS");
multipart->add(ModelBase::toHttpContent(namePrefix, s));
}
void AccessType::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
{
utility::string_t s;
s = ModelBase::stringFromHttpContent(multipart->getContent(namePrefix));
eAccessType v;
if (s == utility::conversions::to_string_t("3GPP_ACCESS"))
v = eAccessType::AccessType_3GPP_ACCESS;
if (s == utility::conversions::to_string_t("NON_3GPP_ACCESS"))
v = eAccessType::AccessType_NON_3GPP_ACCESS;
setValue(v);
}
}
AccessType::eAccessType AccessType::getValue() const {
return m_value;
}
void AccessType::setValue(AccessType::eAccessType const value) {
m_value = value;
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AccessType.h
*
*
*/
#ifndef OAI_SMF_MODEL_AccessType_H_
#define OAI_SMF_MODEL_AccessType_H_
#include "../ModelBase.h"
namespace oai {
namespace smf {
namespace model {
class AccessType : public ModelBase {
public:
AccessType();
virtual ~AccessType();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
enum class eAccessType {
AccessType_3GPP_ACCESS,
AccessType_NON_3GPP_ACCESS,
};
eAccessType getValue() const;
void setValue(eAccessType const value);
protected:
eAccessType m_value;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_AccessType_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "AdditionalQosFlowInfo.h"
namespace oai {
namespace smf {
namespace model {
AdditionalQosFlowInfo::AdditionalQosFlowInfo() {}
AdditionalQosFlowInfo::~AdditionalQosFlowInfo() {}
void AdditionalQosFlowInfo::validate() {
// TODO: implement validation
}
web::json::value AdditionalQosFlowInfo::toJson() const {
web::json::value val = web::json::value::object();
return val;
}
void AdditionalQosFlowInfo::fromJson(const web::json::value& val) {}
void AdditionalQosFlowInfo::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
void AdditionalQosFlowInfo::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* AdditionalQosFlowInfo.h
*
*
*/
#ifndef OAI_SMF_MODEL_AdditionalQosFlowInfo_H_
#define OAI_SMF_MODEL_AdditionalQosFlowInfo_H_
#include "../ModelBase.h"
namespace oai {
namespace smf {
namespace model {
/// <summary>
///
/// </summary>
class AdditionalQosFlowInfo : public ModelBase {
public:
AdditionalQosFlowInfo();
virtual ~AdditionalQosFlowInfo();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// AdditionalQosFlowInfo members
protected:
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_AdditionalQosFlowInfo_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Ambr.h"
namespace oai {
namespace smf {
namespace model {
Ambr::Ambr() {
m_Uplink = utility::conversions::to_string_t("");
m_Downlink = utility::conversions::to_string_t("");
}
Ambr::~Ambr() {}
void Ambr::validate() {
// TODO: implement validation
}
web::json::value Ambr::toJson() const {
web::json::value val = web::json::value::object();
val[utility::conversions::to_string_t("uplink")] =
ModelBase::toJson(m_Uplink);
val[utility::conversions::to_string_t("downlink")] =
ModelBase::toJson(m_Downlink);
return val;
}
void Ambr::fromJson(const web::json::value& val) {
setUplink(ModelBase::stringFromJson(
val.at(utility::conversions::to_string_t("uplink"))));
setDownlink(ModelBase::stringFromJson(
val.at(utility::conversions::to_string_t("downlink"))));
}
void Ambr::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("uplink"), m_Uplink));
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("downlink"), m_Downlink));
}
void Ambr::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
setUplink(ModelBase::stringFromHttpContent(
multipart->getContent(utility::conversions::to_string_t("uplink"))));
setDownlink(ModelBase::stringFromHttpContent(
multipart->getContent(utility::conversions::to_string_t("downlink"))));
}
utility::string_t Ambr::getUplink() const {
return m_Uplink;
}
void Ambr::setUplink(const utility::string_t& value) {
m_Uplink = value;
}
utility::string_t Ambr::getDownlink() const {
return m_Downlink;
}
void Ambr::setDownlink(const utility::string_t& value) {
m_Downlink = value;
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Ambr.h
*
*
*/
#ifndef OAI_SMF_MODEL_Ambr_H_
#define OAI_SMF_MODEL_Ambr_H_
#include "../ModelBase.h"
#include <cpprest/details/basic_types.h>
namespace oai {
namespace smf {
namespace model {
/// <summary>
///
/// </summary>
class Ambr : public ModelBase {
public:
Ambr();
virtual ~Ambr();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// Ambr members
/// <summary>
///
/// </summary>
utility::string_t getUplink() const;
void setUplink(const utility::string_t& value);
/// <summary>
///
/// </summary>
utility::string_t getDownlink() const;
void setDownlink(const utility::string_t& value);
protected:
utility::string_t m_Uplink;
utility::string_t m_Downlink;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_Ambr_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Arp.h"
namespace oai {
namespace smf {
namespace model {
Arp::Arp() {
m_PriorityLevel = 0;
}
Arp::~Arp() {}
void Arp::validate() {
// TODO: implement validation
}
web::json::value Arp::toJson() const {
web::json::value val = web::json::value::object();
val[utility::conversions::to_string_t("priorityLevel")] =
ModelBase::toJson(m_PriorityLevel);
val[utility::conversions::to_string_t("preemptCap")] =
ModelBase::toJson(m_PreemptCap);
val[utility::conversions::to_string_t("preemptVuln")] =
ModelBase::toJson(m_PreemptVuln);
return val;
}
void Arp::fromJson(const web::json::value& val) {
setPriorityLevel(ModelBase::int32_tFromJson(
val.at(utility::conversions::to_string_t("priorityLevel"))));
std::shared_ptr<PreemptionCapability> newPreemptCap(
new PreemptionCapability());
newPreemptCap->fromJson(
val.at(utility::conversions::to_string_t("preemptCap")));
setPreemptCap(newPreemptCap);
std::shared_ptr<PreemptionVulnerability> newPreemptVuln(
new PreemptionVulnerability());
newPreemptVuln->fromJson(
val.at(utility::conversions::to_string_t("preemptVuln")));
setPreemptVuln(newPreemptVuln);
}
void Arp::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("priorityLevel"),
m_PriorityLevel));
m_PreemptCap->toMultipart(
multipart, utility::conversions::to_string_t("preemptCap."));
m_PreemptVuln->toMultipart(
multipart, utility::conversions::to_string_t("preemptVuln."));
}
void Arp::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
setPriorityLevel(ModelBase::int32_tFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("priorityLevel"))));
std::shared_ptr<PreemptionCapability> newPreemptCap(
new PreemptionCapability());
newPreemptCap->fromMultiPart(
multipart, utility::conversions::to_string_t("preemptCap."));
setPreemptCap(newPreemptCap);
std::shared_ptr<PreemptionVulnerability> newPreemptVuln(
new PreemptionVulnerability());
newPreemptVuln->fromMultiPart(
multipart, utility::conversions::to_string_t("preemptVuln."));
setPreemptVuln(newPreemptVuln);
}
int32_t Arp::getPriorityLevel() const {
return m_PriorityLevel;
}
void Arp::setPriorityLevel(int32_t value) {
m_PriorityLevel = value;
}
std::shared_ptr<PreemptionCapability> Arp::getPreemptCap() const {
return m_PreemptCap;
}
void Arp::setPreemptCap(const std::shared_ptr<PreemptionCapability>& value) {
m_PreemptCap = value;
}
std::shared_ptr<PreemptionVulnerability> Arp::getPreemptVuln() const {
return m_PreemptVuln;
}
void Arp::setPreemptVuln(
const std::shared_ptr<PreemptionVulnerability>& value) {
m_PreemptVuln = value;
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Arp.h
*
*
*/
#ifndef OAI_SMF_MODEL_Arp_H_
#define OAI_SMF_MODEL_Arp_H_
#include "../ModelBase.h"
#include "PreemptionCapability.h"
#include "PreemptionVulnerability.h"
namespace oai {
namespace smf {
namespace model {
/// <summary>
///
/// </summary>
class Arp : public ModelBase {
public:
Arp();
virtual ~Arp();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// Arp members
/// <summary>
/// nullable true shall not be used for this attribute
/// </summary>
int32_t getPriorityLevel() const;
void setPriorityLevel(int32_t value);
/// <summary>
///
/// </summary>
std::shared_ptr<PreemptionCapability> getPreemptCap() const;
void setPreemptCap(const std::shared_ptr<PreemptionCapability>& value);
/// <summary>
///
/// </summary>
std::shared_ptr<PreemptionVulnerability> getPreemptVuln() const;
void setPreemptVuln(const std::shared_ptr<PreemptionVulnerability>& value);
protected:
int32_t m_PriorityLevel;
std::shared_ptr<PreemptionCapability> m_PreemptCap;
std::shared_ptr<PreemptionVulnerability> m_PreemptVuln;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_Arp_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "BackupAmfInfo.h"
namespace oai {
namespace smf {
namespace model {
BackupAmfInfo::BackupAmfInfo() {
m_BackupAmf = utility::conversions::to_string_t("");
m_GuamiListIsSet = false;
}
BackupAmfInfo::~BackupAmfInfo() {}
void BackupAmfInfo::validate() {
// TODO: implement validation
}
web::json::value BackupAmfInfo::toJson() const {
web::json::value val = web::json::value::object();
val[utility::conversions::to_string_t("backupAmf")] =
ModelBase::toJson(m_BackupAmf);
{
std::vector<web::json::value> jsonArray;
for (auto& item : m_GuamiList) {
jsonArray.push_back(ModelBase::toJson(item));
}
if (jsonArray.size() > 0) {
val[utility::conversions::to_string_t("guamiList")] =
web::json::value::array(jsonArray);
}
}
return val;
}
void BackupAmfInfo::fromJson(const web::json::value& val) {
setBackupAmf(ModelBase::stringFromJson(
val.at(utility::conversions::to_string_t("backupAmf"))));
{
m_GuamiList.clear();
std::vector<web::json::value> jsonArray;
if (val.has_field(utility::conversions::to_string_t("guamiList"))) {
for (auto& item :
val.at(utility::conversions::to_string_t("guamiList")).as_array()) {
if (item.is_null()) {
m_GuamiList.push_back(std::shared_ptr<Guami>(nullptr));
} else {
std::shared_ptr<Guami> newItem(new Guami());
newItem->fromJson(item);
m_GuamiList.push_back(newItem);
}
}
}
}
}
void BackupAmfInfo::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("backupAmf"),
m_BackupAmf));
{
std::vector<web::json::value> jsonArray;
for (auto& item : m_GuamiList) {
jsonArray.push_back(ModelBase::toJson(item));
}
if (jsonArray.size() > 0) {
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("guamiList"),
web::json::value::array(jsonArray),
utility::conversions::to_string_t("application/json")));
}
}
}
void BackupAmfInfo::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
setBackupAmf(ModelBase::stringFromHttpContent(
multipart->getContent(utility::conversions::to_string_t("backupAmf"))));
{
m_GuamiList.clear();
if (multipart->hasContent(utility::conversions::to_string_t("guamiList"))) {
web::json::value jsonArray = web::json::value::parse(
ModelBase::stringFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("guamiList"))));
for (auto& item : jsonArray.as_array()) {
if (item.is_null()) {
m_GuamiList.push_back(std::shared_ptr<Guami>(nullptr));
} else {
std::shared_ptr<Guami> newItem(new Guami());
newItem->fromJson(item);
m_GuamiList.push_back(newItem);
}
}
}
}
}
utility::string_t BackupAmfInfo::getBackupAmf() const {
return m_BackupAmf;
}
void BackupAmfInfo::setBackupAmf(const utility::string_t& value) {
m_BackupAmf = value;
}
std::vector<std::shared_ptr<Guami>>& BackupAmfInfo::getGuamiList() {
return m_GuamiList;
}
void BackupAmfInfo::setGuamiList(
const std::vector<std::shared_ptr<Guami>>& value) {
m_GuamiList = value;
m_GuamiListIsSet = true;
}
bool BackupAmfInfo::guamiListIsSet() const {
return m_GuamiListIsSet;
}
void BackupAmfInfo::unsetGuamiList() {
m_GuamiListIsSet = false;
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* BackupAmfInfo.h
*
*
*/
#ifndef OAI_SMF_MODEL_BackupAmfInfo_H_
#define OAI_SMF_MODEL_BackupAmfInfo_H_
#include "../ModelBase.h"
#include <cpprest/details/basic_types.h>
#include <vector>
#include "Guami.h"
namespace oai {
namespace smf {
namespace model {
/// <summary>
///
/// </summary>
class BackupAmfInfo : public ModelBase {
public:
BackupAmfInfo();
virtual ~BackupAmfInfo();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// BackupAmfInfo members
/// <summary>
///
/// </summary>
utility::string_t getBackupAmf() const;
void setBackupAmf(const utility::string_t& value);
/// <summary>
///
/// </summary>
std::vector<std::shared_ptr<Guami>>& getGuamiList();
bool guamiListIsSet() const;
void unsetGuamiList();
void setGuamiList(const std::vector<std::shared_ptr<Guami>>& value);
protected:
utility::string_t m_BackupAmf;
std::vector<std::shared_ptr<Guami>> m_GuamiList;
bool m_GuamiListIsSet;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_BackupAmfInfo_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Cause.h"
namespace oai {
namespace smf {
namespace model {
Cause::Cause() {}
Cause::~Cause() {}
void Cause::validate() {
// TODO: implement validation
}
web::json::value Cause::toJson() const {
web::json::value val = web::json::value::object();
return val;
}
void Cause::fromJson(const web::json::value& val) {}
void Cause::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
void Cause::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Cause.h
*
* Possible values are - REL_DUE_TO_HO - EPS_FALLBACK - REL_DUE_TO_UP_SEC -
* DNN_CONGESTION - S_NSSAI_CONGESTION - REL_DUE_TO_REACTIVATION -
* 5G_AN_NOT_RESPONDING - REL_DUE_TO_SLICE_NOT_AVAILABLE -
* REL_DUE_TO_DUPLICATE_SESSION_ID - PDU_SESSION_STATUS_MISMATCH - HO_FAILURE -
* INSUFFICIENT_UP_RESOURCES - PDU_SESSION_HANDED_OVER
*/
#ifndef OAI_SMF_MODEL_Cause_H_
#define OAI_SMF_MODEL_Cause_H_
#include "../ModelBase.h"
namespace oai {
namespace smf {
namespace model {
/// <summary>
/// Possible values are - REL_DUE_TO_HO - EPS_FALLBACK - REL_DUE_TO_UP_SEC -
/// DNN_CONGESTION - S_NSSAI_CONGESTION - REL_DUE_TO_REACTIVATION -
/// 5G_AN_NOT_RESPONDING - REL_DUE_TO_SLICE_NOT_AVAILABLE -
/// REL_DUE_TO_DUPLICATE_SESSION_ID - PDU_SESSION_STATUS_MISMATCH - HO_FAILURE -
/// INSUFFICIENT_UP_RESOURCES - PDU_SESSION_HANDED_OVER
/// </summary>
class Cause : public ModelBase {
public:
Cause();
virtual ~Cause();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// Cause members
protected:
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_Cause_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "DnnSelectionMode.h"
namespace oai {
namespace smf {
namespace model {
DnnSelectionMode::DnnSelectionMode() {}
DnnSelectionMode::~DnnSelectionMode() {}
void DnnSelectionMode::validate() {
// TODO: implement validation
}
web::json::value DnnSelectionMode::toJson() const {
web::json::value val = web::json::value::object();
return val;
}
void DnnSelectionMode::fromJson(const web::json::value& val) {}
void DnnSelectionMode::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
void DnnSelectionMode::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* DnnSelectionMode.h
*
* Possible values are - VERIFIED - UE_DNN_NOT_VERIFIED - NW_DNN_NOT_VERIFIED
*/
#ifndef OAI_SMF_MODEL_DnnSelectionMode_H_
#define OAI_SMF_MODEL_DnnSelectionMode_H_
#include "../ModelBase.h"
namespace oai {
namespace smf {
namespace model {
/// <summary>
/// Possible values are - VERIFIED - UE_DNN_NOT_VERIFIED - NW_DNN_NOT_VERIFIED
/// </summary>
class DnnSelectionMode : public ModelBase {
public:
DnnSelectionMode();
virtual ~DnnSelectionMode();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// DnnSelectionMode members
protected:
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_DnnSelectionMode_H_ */
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "Dynamic5Qi.h"
namespace oai {
namespace smf {
namespace model {
Dynamic5Qi::Dynamic5Qi() {
m_PriorityLevel = 0;
m_PacketDelayBudget = 0;
m_PacketErrRate = utility::conversions::to_string_t("");
m_AverWindow = 0;
m_AverWindowIsSet = false;
m_MaxDataBurstVol = 0;
m_MaxDataBurstVolIsSet = false;
}
Dynamic5Qi::~Dynamic5Qi() {}
void Dynamic5Qi::validate() {
// TODO: implement validation
}
web::json::value Dynamic5Qi::toJson() const {
web::json::value val = web::json::value::object();
val[utility::conversions::to_string_t("resourceType")] =
ModelBase::toJson(m_ResourceType);
val[utility::conversions::to_string_t("priorityLevel")] =
ModelBase::toJson(m_PriorityLevel);
val[utility::conversions::to_string_t("packetDelayBudget")] =
ModelBase::toJson(m_PacketDelayBudget);
val[utility::conversions::to_string_t("packetErrRate")] =
ModelBase::toJson(m_PacketErrRate);
if (m_AverWindowIsSet) {
val[utility::conversions::to_string_t("averWindow")] =
ModelBase::toJson(m_AverWindow);
}
if (m_MaxDataBurstVolIsSet) {
val[utility::conversions::to_string_t("maxDataBurstVol")] =
ModelBase::toJson(m_MaxDataBurstVol);
}
return val;
}
void Dynamic5Qi::fromJson(const web::json::value& val) {
std::shared_ptr<QosResourceType> newResourceType(new QosResourceType());
newResourceType->fromJson(
val.at(utility::conversions::to_string_t("resourceType")));
setResourceType(newResourceType);
setPriorityLevel(ModelBase::int32_tFromJson(
val.at(utility::conversions::to_string_t("priorityLevel"))));
setPacketDelayBudget(ModelBase::int32_tFromJson(
val.at(utility::conversions::to_string_t("packetDelayBudget"))));
setPacketErrRate(ModelBase::stringFromJson(
val.at(utility::conversions::to_string_t("packetErrRate"))));
if (val.has_field(utility::conversions::to_string_t("averWindow"))) {
const web::json::value& fieldValue =
val.at(utility::conversions::to_string_t("averWindow"));
if (!fieldValue.is_null()) {
setAverWindow(ModelBase::int32_tFromJson(fieldValue));
}
}
if (val.has_field(utility::conversions::to_string_t("maxDataBurstVol"))) {
const web::json::value& fieldValue =
val.at(utility::conversions::to_string_t("maxDataBurstVol"));
if (!fieldValue.is_null()) {
setMaxDataBurstVol(ModelBase::int32_tFromJson(fieldValue));
}
}
}
void Dynamic5Qi::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
m_ResourceType->toMultipart(
multipart, utility::conversions::to_string_t("resourceType."));
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("priorityLevel"),
m_PriorityLevel));
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("packetDelayBudget"),
m_PacketDelayBudget));
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("packetErrRate"),
m_PacketErrRate));
if (m_AverWindowIsSet) {
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("averWindow"),
m_AverWindow));
}
if (m_MaxDataBurstVolIsSet) {
multipart->add(ModelBase::toHttpContent(
namePrefix + utility::conversions::to_string_t("maxDataBurstVol"),
m_MaxDataBurstVol));
}
}
void Dynamic5Qi::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
std::shared_ptr<QosResourceType> newResourceType(new QosResourceType());
newResourceType->fromMultiPart(
multipart, utility::conversions::to_string_t("resourceType."));
setResourceType(newResourceType);
setPriorityLevel(ModelBase::int32_tFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("priorityLevel"))));
setPacketDelayBudget(ModelBase::int32_tFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("packetDelayBudget"))));
setPacketErrRate(ModelBase::stringFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("packetErrRate"))));
if (multipart->hasContent(utility::conversions::to_string_t("averWindow"))) {
setAverWindow(ModelBase::int32_tFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("averWindow"))));
}
if (multipart->hasContent(
utility::conversions::to_string_t("maxDataBurstVol"))) {
setMaxDataBurstVol(ModelBase::int32_tFromHttpContent(multipart->getContent(
utility::conversions::to_string_t("maxDataBurstVol"))));
}
}
std::shared_ptr<QosResourceType> Dynamic5Qi::getResourceType() const {
return m_ResourceType;
}
void Dynamic5Qi::setResourceType(
const std::shared_ptr<QosResourceType>& value) {
m_ResourceType = value;
}
int32_t Dynamic5Qi::getPriorityLevel() const {
return m_PriorityLevel;
}
void Dynamic5Qi::setPriorityLevel(int32_t value) {
m_PriorityLevel = value;
}
int32_t Dynamic5Qi::getPacketDelayBudget() const {
return m_PacketDelayBudget;
}
void Dynamic5Qi::setPacketDelayBudget(int32_t value) {
m_PacketDelayBudget = value;
}
utility::string_t Dynamic5Qi::getPacketErrRate() const {
return m_PacketErrRate;
}
void Dynamic5Qi::setPacketErrRate(const utility::string_t& value) {
m_PacketErrRate = value;
}
int32_t Dynamic5Qi::getAverWindow() const {
return m_AverWindow;
}
void Dynamic5Qi::setAverWindow(int32_t value) {
m_AverWindow = value;
m_AverWindowIsSet = true;
}
bool Dynamic5Qi::averWindowIsSet() const {
return m_AverWindowIsSet;
}
void Dynamic5Qi::unsetAverWindow() {
m_AverWindowIsSet = false;
}
int32_t Dynamic5Qi::getMaxDataBurstVol() const {
return m_MaxDataBurstVol;
}
void Dynamic5Qi::setMaxDataBurstVol(int32_t value) {
m_MaxDataBurstVol = value;
m_MaxDataBurstVolIsSet = true;
}
bool Dynamic5Qi::maxDataBurstVolIsSet() const {
return m_MaxDataBurstVolIsSet;
}
void Dynamic5Qi::unsetMaxDataBurstVol() {
m_MaxDataBurstVolIsSet = false;
}
} // namespace model
} // namespace smf
} // namespace oai
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* Dynamic5Qi.h
*
*
*/
#ifndef OAI_SMF_MODEL_Dynamic5Qi_H_
#define OAI_SMF_MODEL_Dynamic5Qi_H_
#include "../ModelBase.h"
#include "QosResourceType.h"
#include <cpprest/details/basic_types.h>
namespace oai {
namespace smf {
namespace model {
/// <summary>
///
/// </summary>
class Dynamic5Qi : public ModelBase {
public:
Dynamic5Qi();
virtual ~Dynamic5Qi();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
void fromJson(const web::json::value& json) override;
void toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) const override;
void fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& namePrefix) override;
/////////////////////////////////////////////
/// Dynamic5Qi members
/// <summary>
///
/// </summary>
std::shared_ptr<QosResourceType> getResourceType() const;
void setResourceType(const std::shared_ptr<QosResourceType>& value);
/// <summary>
///
/// </summary>
int32_t getPriorityLevel() const;
void setPriorityLevel(int32_t value);
/// <summary>
///
/// </summary>
int32_t getPacketDelayBudget() const;
void setPacketDelayBudget(int32_t value);
/// <summary>
///
/// </summary>
utility::string_t getPacketErrRate() const;
void setPacketErrRate(const utility::string_t& value);
/// <summary>
///
/// </summary>
int32_t getAverWindow() const;
bool averWindowIsSet() const;
void unsetAverWindow();
void setAverWindow(int32_t value);
/// <summary>
///
/// </summary>
int32_t getMaxDataBurstVol() const;
bool maxDataBurstVolIsSet() const;
void unsetMaxDataBurstVol();
void setMaxDataBurstVol(int32_t value);
protected:
std::shared_ptr<QosResourceType> m_ResourceType;
int32_t m_PriorityLevel;
int32_t m_PacketDelayBudget;
utility::string_t m_PacketErrRate;
int32_t m_AverWindow;
bool m_AverWindowIsSet;
int32_t m_MaxDataBurstVol;
bool m_MaxDataBurstVolIsSet;
};
} // namespace model
} // namespace smf
} // namespace oai
#endif /* OAI_SMF_MODEL_Dynamic5Qi_H_ */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Nsmf_PDUSession
* SMF PDU Session Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.0.alpha-1
*
* NOTE: This class is auto generated by OpenAPI-Generator 4.1.1-SNAPSHOT.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "EpsInterworkingIndication.h"
namespace oai {
namespace smf {
namespace model {
EpsInterworkingIndication::EpsInterworkingIndication() {}
EpsInterworkingIndication::~EpsInterworkingIndication() {}
void EpsInterworkingIndication::validate() {
// TODO: implement validation
}
web::json::value EpsInterworkingIndication::toJson() const {
web::json::value val = web::json::value::object();
return val;
}
void EpsInterworkingIndication::fromJson(const web::json::value& val) {}
void EpsInterworkingIndication::toMultipart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) const {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
void EpsInterworkingIndication::fromMultiPart(
std::shared_ptr<MultipartFormData> multipart,
const utility::string_t& prefix) {
utility::string_t namePrefix = prefix;
if (namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) !=
utility::conversions::to_string_t(".")) {
namePrefix += utility::conversions::to_string_t(".");
}
}
} // namespace model
} // namespace smf
} // namespace oai
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment