2 * Copyright (c) 2017 Uber Technologies, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef JAEGERTRACING_BAGGAGE_REMOTERESTRICTIONJSON_H
18 #define JAEGERTRACING_BAGGAGE_REMOTERESTRICTIONJSON_H
21 #include <nlohmann/json.hpp>
25 #include "jaegertracing/Compilers.h"
26 #include "jaegertracing/thrift-gen/BaggageRestrictionManager.h"
27 #include "jaegertracing/thrift-gen/baggage_types.h"
29 namespace jaegertracing
{
32 inline void to_json(nlohmann::json
& json
, const BaggageRestriction
& restriction
)
34 json
["baggageKey"] = restriction
.baggageKey
;
35 json
["maxValueLength"] = restriction
.maxValueLength
;
38 inline void from_json(const nlohmann::json
& json
,
39 BaggageRestriction
& restriction
)
41 restriction
.__set_baggageKey(json
.at("baggageKey"));
42 restriction
.__set_maxValueLength(json
.at("maxValueLength"));
45 using BaggageRestrictionList
=
46 BaggageRestrictionManager_getBaggageRestrictions_result
;
48 inline void to_json(nlohmann::json
& json
, const BaggageRestrictionList
& list
)
53 inline void from_json(const nlohmann::json
& json
, BaggageRestrictionList
& list
)
55 list
.success
= json
.get
<std::vector
<BaggageRestriction
>>();
56 list
.__isset
.success
= true;
60 } // namespace jaegertracing
62 #endif // JAEGERTRACING_BAGGAGE_REMOTERESTRICTIONJSON_H