Couchbase C++ SDK 1.0.1 (rev. 58d46d7)
Loading...
Searching...
No Matches
ping_result.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2023-present Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
22
23#include <cstdint>
24#include <map>
25#include <string>
26#include <utility>
27#include <vector>
28
29namespace couchbase
30{
32{
33public:
38 ping_result() = default;
39
44 ping_result(std::string id,
45 std::uint16_t version,
46 std::string sdk,
47 std::map<service_type, std::vector<endpoint_ping_report>> endpoints)
48 : id_{ std::move(id) }
49 , version_{ version }
50 , sdk_{ std::move(sdk) }
51 , endpoints_{ std::move(endpoints) }
52 {
53 }
54
63 [[nodiscard]] auto id() const -> std::string
64 {
65 return id_;
66 }
67
76 [[nodiscard]] auto version() const -> std::uint16_t
77 {
78 return version_;
79 }
80
89 [[nodiscard]] auto sdk() const -> std::string
90 {
91 return sdk_;
92 }
93
102 [[nodiscard]] auto endpoints() const -> std::map<service_type, std::vector<endpoint_ping_report>>
103 {
104 return endpoints_;
105 }
106
112 [[nodiscard]] auto as_json() const -> std::string;
113
114private:
115 std::string id_{};
116 std::uint16_t version_{};
117 std::string sdk_{};
118 std::map<service_type, std::vector<endpoint_ping_report>> endpoints_{};
119};
120} // namespace couchbase
Definition endpoint_ping_report.hxx:56
Definition ping_result.hxx:32
ping_result(std::string id, std::uint16_t version, std::string sdk, std::map< service_type, std::vector< endpoint_ping_report > > endpoints)
Definition ping_result.hxx:44
auto as_json() const -> std::string
Exports the ping report as JSON.
auto endpoints() const -> std::map< service_type, std::vector< endpoint_ping_report > >
Returns the ping reports for each individual endpoint, organised by service type.
Definition ping_result.hxx:102
auto id() const -> std::string
Returns the ID of this report.
Definition ping_result.hxx:63
auto version() const -> std::uint16_t
Returns the version of this report (useful when exporting to JSON).
Definition ping_result.hxx:76
auto sdk() const -> std::string
Returns the identifier of this SDK (useful when exporting to JSON).
Definition ping_result.hxx:89
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
service_type
Definition service_type.hxx:22