aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/unified_agent_client/client_proto_weighing.h
blob: 728792e49fd543b665a5ff2a82d5c1c1a95d23b2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#pragma once

#include <library/cpp/unified_agent_client/f_maybe.h>
#include <library/cpp/unified_agent_client/proto_weighing.h>

namespace NUnifiedAgent::NPW {
    struct TMessageMetaItem: public TMessage {
        TMessageMetaItem()
            : TMessage()
            , Key(this)
            , Value(this)
            , SkipStart(this)
            , SkipLength(this)
        {
        }

        explicit TMessageMetaItem(TMessage* parent)
            : TMessage(parent)
            , Key(this)
            , Value(this)
            , SkipStart(this)
            , SkipLength(this)
        {
        }

        explicit TMessageMetaItem(const NUnifiedAgent::TFMaybe<TFieldLink>& link)
            : TMessage(link)
            , Key(this)
            , Value(this)
            , SkipStart(this)
            , SkipLength(this)
        {
        }

        TStringField Key;
        TRepeatedPtrField<TStringField> Value;
        TRepeatedField<ui32> SkipStart;
        TRepeatedField<ui32> SkipLength;
    };

    struct TDataBatch: public TMessage {
        TDataBatch()
            : TMessage()
            , SeqNo(this)
            , Timestamp(this)
            , Payload(this, 2)
            , Meta(this, 2)
        {
        }

        TDataBatch(TMessage* parent)
            : TMessage(parent)
            , SeqNo(this)
            , Timestamp(this)
            , Payload(this, 2)
            , Meta(this, 2)
        {
        }

        TRepeatedField<ui64> SeqNo;  // 1
        TRepeatedField<ui64> Timestamp; // 2
        TRepeatedPtrField<TStringField> Payload; // 100
        TRepeatedPtrField<TMessageMetaItem> Meta; // 101
    };

    struct TRequest: public TMessage {
        TRequest()
            : TMessage()
            , DataBatch(this)
        {
        }

        TDataBatch DataBatch;
    };
}