Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 HERE Europe B.V.
* Copyright (C) 2020-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,6 +19,7 @@

#pragma once

#include <cstdint>
#include <utility>
#include <vector>

Expand Down
4 changes: 2 additions & 2 deletions olp-cpp-sdk-dataservice-read/src/JsonResultParser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020 HERE Europe B.V.
* Copyright (C) 2020-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,8 +23,8 @@
#include <string>
#include <utility>

#include <generated/parser/JsonParser.h>
#include <olp/core/client/ApiError.h>
#include <olp/core/generated/parser/JsonParser.h>
#include <olp/core/logging/Log.h>

namespace olp {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2024 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -22,6 +22,8 @@
#include <algorithm>
#include <map>
#include <sstream>
#include <utility>
#include <vector>

#include <olp/core/client/HttpResponse.h>
#include <olp/core/client/OlpClient.h>
Expand Down Expand Up @@ -235,8 +237,6 @@ MetadataApi::CompatibleVersionsResponse MetadataApi::GetCompatibleVersions(
std::multimap<std::string, std::string> query_params;
query_params.emplace("limit", std::to_string(limit));

rapidjson::Value value;

const auto serialized_dependencies = serializer::serialize(dependencies);

const auto data = std::make_shared<std::vector<unsigned char>>(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,11 +19,13 @@

#include "ApiParser.h"

#include <olp/core/generated/parser/ParserWrapper.h>
#include <map>

#include <generated/parser/ParserWrapper.h>

namespace olp {
namespace parser {
void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Api& x) {
x.SetApi(parse<std::string>(value, "api"));
x.SetVersion(parse<std::string>(value, "version"));
Expand Down
7 changes: 4 additions & 3 deletions olp-cpp-sdk-dataservice-read/src/generated/parser/ApiParser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,14 +19,15 @@

#pragma once

#include <rapidjson/document.h>
#include <boost/json/value.hpp>
#include "generated/model/Api.h"

#include <string>

namespace olp {
namespace parser {
void from_json(const rapidjson::Value& value, olp::dataservice::read::model::Api& x);
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Api& x);

} // namespace parser

Expand Down
34 changes: 18 additions & 16 deletions olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,48 +19,50 @@

#include "CatalogParser.h"

#include <olp/core/generated/parser/ParserWrapper.h>
#include <vector>

#include <generated/parser/ParserWrapper.h>

namespace olp {
namespace parser {
namespace model = dataservice::read::model;
namespace model = olp::dataservice::read::model;

void from_json(const rapidjson::Value& value, model::Coverage& x) {
void from_json(const boost::json::value& value, model::Coverage& x) {
x.SetAdminAreas(parse<std::vector<std::string>>(value, "adminAreas"));
}

void from_json(const rapidjson::Value& value, model::IndexDefinition& x) {
void from_json(const boost::json::value& value, model::IndexDefinition& x) {
x.SetName(parse<std::string>(value, "name"));
x.SetType(parse<std::string>(value, "type"));
x.SetDuration(parse<int64_t>(value, "duration"));
x.SetZoomLevel(parse<int64_t>(value, "zoomLevel"));
}

void from_json(const rapidjson::Value& value, model::IndexProperties& x) {
void from_json(const boost::json::value& value, model::IndexProperties& x) {
x.SetTtl(parse<std::string>(value, "ttl"));
x.SetIndexDefinitions(
parse<std::vector<model::IndexDefinition>>(value, "indexDefinitions"));
}

void from_json(const rapidjson::Value& value, model::Creator& x) {
void from_json(const boost::json::value& value, model::Creator& x) {
x.SetId(parse<std::string>(value, "id"));
}

void from_json(const rapidjson::Value& value, model::Owner& x) {
void from_json(const boost::json::value& value, model::Owner& x) {
x.SetCreator(parse<model::Creator>(value, "creator"));
x.SetOrganisation(parse<model::Creator>(value, "organisation"));
}

void from_json(const rapidjson::Value& value, model::Partitioning& x) {
void from_json(const boost::json::value& value, model::Partitioning& x) {
x.SetScheme(parse<std::string>(value, "scheme"));
x.SetTileLevels(parse<std::vector<int64_t>>(value, "tileLevels"));
}

void from_json(const rapidjson::Value& value, model::Schema& x) {
void from_json(const boost::json::value& value, model::Schema& x) {
x.SetHrn(parse<std::string>(value, "hrn"));
}

void from_json(const rapidjson::Value& value, model::StreamProperties& x) {
void from_json(const boost::json::value& value, model::StreamProperties& x) {
// Parsing these as double even though OepnAPI sepcs says int64 because
// Backend returns the value in decimal format (e.g. 1.0) and this triggers an
// assert in RapidJSON when parsing.
Expand All @@ -70,18 +72,18 @@ void from_json(const rapidjson::Value& value, model::StreamProperties& x) {
static_cast<int64_t>(parse<double>(value, "dataOutThroughputMbps")));
}

void from_json(const rapidjson::Value& value, model::Encryption& x) {
void from_json(const boost::json::value& value, model::Encryption& x) {
x.SetAlgorithm(parse<std::string>(value, "algorithm"));
}

void from_json(const rapidjson::Value& value, model::Volume& x) {
void from_json(const boost::json::value& value, model::Volume& x) {
x.SetVolumeType(parse<std::string>(value, "volumeType"));
x.SetMaxMemoryPolicy(parse<std::string>(value, "maxMemoryPolicy"));
x.SetPackageType(parse<std::string>(value, "packageType"));
x.SetEncryption(parse<model::Encryption>(value, "encryption"));
}

void from_json(const rapidjson::Value& value, model::Layer& x) {
void from_json(const boost::json::value& value, model::Layer& x) {
x.SetId(parse<std::string>(value, "id"));
x.SetName(parse<std::string>(value, "name"));
x.SetSummary(parse<std::string>(value, "summary"));
Expand All @@ -103,11 +105,11 @@ void from_json(const rapidjson::Value& value, model::Layer& x) {
x.SetVolume(parse<model::Volume>(value, "volume"));
}

void from_json(const rapidjson::Value& value, model::Notifications& x) {
void from_json(const boost::json::value& value, model::Notifications& x) {
x.SetEnabled(parse<bool>(value, "enabled"));
}

void from_json(const rapidjson::Value& value, model::Catalog& x) {
void from_json(const boost::json::value& value, model::Catalog& x) {
x.SetId(parse<std::string>(value, "id"));
x.SetHrn(parse<std::string>(value, "hrn"));
x.SetName(parse<std::string>(value, "name"));
Expand Down
30 changes: 15 additions & 15 deletions olp-cpp-sdk-dataservice-read/src/generated/parser/CatalogParser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,50 +19,50 @@

#pragma once

#include <rapidjson/document.h>
#include <boost/json/value.hpp>
#include "olp/dataservice/read/model/Catalog.h"

#include <string>

namespace olp {
namespace parser {
void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Coverage& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::IndexDefinition& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::IndexProperties& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Creator& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Owner& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Partitioning& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Schema& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::StreamProperties& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Encryption& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Volume& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Layer& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Notifications& x);

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Catalog& x);
} // namespace parser
} // namespace olp
16 changes: 10 additions & 6 deletions olp-cpp-sdk-dataservice-read/src/generated/parser/IndexParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,13 +19,17 @@

#include "IndexParser.h"

#include <olp/core/generated/parser/ParserWrapper.h>
#include <memory>
#include <vector>

#include <generated/parser/ParserWrapper.h>

namespace olp {
namespace parser {
namespace model = dataservice::read::model;

void from_json(const rapidjson::Value& value,
namespace model = olp::dataservice::read::model;

void from_json(const boost::json::value& value,
std::shared_ptr<model::SubQuad>& x) {
auto quad = std::make_shared<model::SubQuad>();

Expand All @@ -47,7 +51,7 @@ void from_json(const rapidjson::Value& value,
x.swap(quad);
}

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
std::shared_ptr<model::ParentQuad>& x) {
auto quad = std::make_shared<model::ParentQuad>();

Expand All @@ -69,7 +73,7 @@ void from_json(const rapidjson::Value& value,
x.swap(quad);
}

void from_json(const rapidjson::Value& value, model::Index& x) {
void from_json(const boost::json::value& value, model::Index& x) {
x.SetParentQuads(parse<std::vector<std::shared_ptr<model::ParentQuad>>>(
value, "parentQuads"));
x.SetSubQuads(
Expand Down
11 changes: 6 additions & 5 deletions olp-cpp-sdk-dataservice-read/src/generated/parser/IndexParser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019 HERE Europe B.V.
* Copyright (C) 2019-2026 HERE Europe B.V.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,19 +19,20 @@

#pragma once

#include <rapidjson/document.h>
#include <boost/json/value.hpp>
#include "generated/model/Index.h"

#include <memory>
#include <string>

namespace olp {
namespace parser {

void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
std::shared_ptr<olp::dataservice::read::model::SubQuad>& x);
void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
std::shared_ptr<olp::dataservice::read::model::ParentQuad>& x);
void from_json(const rapidjson::Value& value,
void from_json(const boost::json::value& value,
olp::dataservice::read::model::Index& x);
} // namespace parser
} // namespace olp
Loading
Loading