iceberg-cpp
Loading...
Searching...
No Matches
json_serde_internal.h
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
24
25#include <nlohmann/json_fwd.hpp>
26
27#include "iceberg/iceberg_export.h"
28#include "iceberg/metrics/commit_report.h"
29#include "iceberg/metrics/scan_report.h"
30#include "iceberg/result.h"
31
32namespace iceberg {
33
34ICEBERG_EXPORT nlohmann::json ToJson(const CounterResult& counter);
35ICEBERG_EXPORT Result<CounterResult> CounterResultFromJson(const nlohmann::json& json);
36
37ICEBERG_EXPORT Result<nlohmann::json> ToJson(const TimerResult& timer);
38ICEBERG_EXPORT Result<TimerResult> TimerResultFromJson(const nlohmann::json& json);
39
40ICEBERG_EXPORT Result<nlohmann::json> ToJson(const ScanMetricsResult& metrics);
41ICEBERG_EXPORT Result<ScanMetricsResult> ScanMetricsResultFromJson(
42 const nlohmann::json& json);
43
44ICEBERG_EXPORT Result<nlohmann::json> ToJson(const CommitMetricsResult& metrics);
45ICEBERG_EXPORT Result<CommitMetricsResult> CommitMetricsResultFromJson(
46 const nlohmann::json& json);
47
52ICEBERG_EXPORT Result<nlohmann::json> ToJson(const ScanReport& report);
53ICEBERG_EXPORT Result<ScanReport> ScanReportFromJson(const nlohmann::json& json);
54
58ICEBERG_EXPORT Result<nlohmann::json> ToJson(const CommitReport& report);
59ICEBERG_EXPORT Result<CommitReport> CommitReportFromJson(const nlohmann::json& json);
60
61} // namespace iceberg