3#include <boost/optional/optional.hpp>
4#include <grpcpp/client_context.h>
6#include <viam/api/common/v1/common.pb.h>
8#include <viam/sdk/common/proto_value.hpp>
9#include <viam/sdk/components/component.hpp>
10#include <viam/sdk/resource/resource_api.hpp>
15const std::string kComponent =
"component";
16const std::string kResource =
"resource";
17const std::string kService =
"service";
18const std::string kRDK =
"rdk";
19const std::string kBuiltin =
"builtin";
22 std::chrono::time_point<long long, std::chrono::nanoseconds> captured_at;
24 static response_metadata from_proto(
const viam::common::v1::ResponseMetadata& proto);
25 static viam::common::v1::ResponseMetadata to_proto(
const response_metadata& metadata);
32std::chrono::time_point<long long, std::chrono::nanoseconds> timestamp_to_time_pt(
33 const google::protobuf::Timestamp& timestamp);
37google::protobuf::Timestamp time_pt_to_timestamp(
38 const std::chrono::time_point<long long, std::chrono::nanoseconds>& time_pt);
40std::vector<unsigned char> string_to_bytes(std::string
const& s);
41std::string bytes_to_string(std::vector<unsigned char>
const& b);
43std::chrono::microseconds from_proto(
const google::protobuf::Duration& proto);
44google::protobuf::Duration to_proto(
const std::chrono::microseconds& duration);
54 operator grpc::ClientContext*();
55 operator const grpc::ClientContext*()
const;
56 void set_debug_key(
const std::string& debug_key);
59 void set_client_ctx_authority_();
60 void add_viam_client_version_();
61 grpc::ClientContext wrapped_context_;
66std::pair<std::string, std::string> long_name_to_remote_and_short(
const std::string& long_name);
69ProtoStruct debug_map();
73ProtoStruct debug_map(std::string debug_key);
77void add_debug_entry(ProtoStruct& map, std::string debug_key);
80void add_debug_entry(ProtoStruct& map);
85ProtoStruct with_debug_entry(ProtoStruct&& map, std::string debug_key);
89ProtoStruct with_debug_entry(ProtoStruct&& map);
99void set_logger_severity_from_args(
int argc,
char** argv);
104bool from_dm_from_extra(
const ProtoStruct& extra);