aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/protobuf/docapi_feed.proto
blob: 702695ef6d88f7a9dd098af1f0fd1c86a7ab6c83 (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
76
77
78
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
syntax = "proto3";

package documentapi.protobuf;

option cc_enable_arenas = true;
option java_package = "ai.vespa.documentapi.protobuf";

import "docapi_common.proto";

message TestAndSetCondition {
    string selection = 1;
}

message DocumentUpdate {
    bytes payload = 1;
}

message GetDocumentRequest {
    DocumentId document_id = 1;
    FieldSet   field_set   = 2;
}

message GetDocumentResponse {
    Document document      = 1;
    uint64   last_modified = 2;
}

message PutDocumentRequest {
    // Note: document contains embedded document ID
    Document            document               = 1;
    TestAndSetCondition condition              = 2;
    bool                create_if_missing      = 3;
    uint64              force_assign_timestamp = 4;
}

message PutDocumentResponse {
    uint64 modification_timestamp = 1;
}

message UpdateDocumentRequest {
    enum CreateIfMissing {
        UNSPECIFIED = 0; // Legacy fallback: must deserialize `update` to find flag value
        TRUE        = 1;
        FALSE       = 2;
    }

    // Note: update contains embedded document ID
    DocumentUpdate      update                 = 1;
    TestAndSetCondition condition              = 2;
    uint64              expected_old_timestamp = 3;
    uint64              force_assign_timestamp = 4;
    CreateIfMissing     create_if_missing      = 5;
}

message UpdateDocumentResponse {
    bool   was_found              = 1;
    uint64 modification_timestamp = 2;
}

message RemoveDocumentRequest {
    DocumentId          document_id = 1;
    TestAndSetCondition condition   = 2;
}

message RemoveDocumentResponse {
    bool   was_found              = 1;
    uint64 modification_timestamp = 2;
}

message RemoveLocationRequest {
    DocumentSelection selection    = 1;
    BucketSpace       bucket_space = 2;
}

message RemoveLocationResponse {
    // empty
}