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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
// This file is generated by rust-protobuf 3.4.0. Do not edit
// .proto file is parsed by protoc --rust-out=...
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]

#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]

#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_casts)]
#![allow(unused_results)]
#![allow(unused_mut)]

//! Generated file from `shared/sp_shared.proto`

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_3_4_0;

///  WasmModule is used to ensure we only send the wasm module once per request
///  instead of duplicated in every pipeline where it is used. This prevents
///  over-sized payloads on SDK startup
// @@protoc_insertion_point(message:protos.shared.WasmModule)
#[derive(PartialEq,Clone,Default,Debug)]
pub struct WasmModule {
    // message fields
    ///  ID is a uuid(sha256(_wasm_bytes)) that is set by streamdal server
    // @@protoc_insertion_point(field:protos.shared.WasmModule.id)
    pub id: ::std::string::String,
    ///  WASM module bytes (set by server)
    // @@protoc_insertion_point(field:protos.shared.WasmModule.bytes)
    pub bytes: ::std::vec::Vec<u8>,
    ///  WASM function name to execute (set by server)
    // @@protoc_insertion_point(field:protos.shared.WasmModule.function)
    pub function: ::std::string::String,
    // special fields
    // @@protoc_insertion_point(special_field:protos.shared.WasmModule.special_fields)
    pub special_fields: ::protobuf::SpecialFields,
}

impl<'a> ::std::default::Default for &'a WasmModule {
    fn default() -> &'a WasmModule {
        <WasmModule as ::protobuf::Message>::default_instance()
    }
}

impl WasmModule {
    pub fn new() -> WasmModule {
        ::std::default::Default::default()
    }

    fn generated_message_descriptor_data() -> ::protobuf::reflect::GeneratedMessageDescriptorData {
        let mut fields = ::std::vec::Vec::with_capacity(3);
        let mut oneofs = ::std::vec::Vec::with_capacity(0);
        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
            "id",
            |m: &WasmModule| { &m.id },
            |m: &mut WasmModule| { &mut m.id },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
            "bytes",
            |m: &WasmModule| { &m.bytes },
            |m: &mut WasmModule| { &mut m.bytes },
        ));
        fields.push(::protobuf::reflect::rt::v2::make_simpler_field_accessor::<_, _>(
            "function",
            |m: &WasmModule| { &m.function },
            |m: &mut WasmModule| { &mut m.function },
        ));
        ::protobuf::reflect::GeneratedMessageDescriptorData::new_2::<WasmModule>(
            "WasmModule",
            fields,
            oneofs,
        )
    }
}

impl ::protobuf::Message for WasmModule {
    const NAME: &'static str = "WasmModule";

    fn is_initialized(&self) -> bool {
        true
    }

    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::Result<()> {
        while let Some(tag) = is.read_raw_tag_or_eof()? {
            match tag {
                10 => {
                    self.id = is.read_string()?;
                },
                18 => {
                    self.bytes = is.read_bytes()?;
                },
                26 => {
                    self.function = is.read_string()?;
                },
                tag => {
                    ::protobuf::rt::read_unknown_or_skip_group(tag, is, self.special_fields.mut_unknown_fields())?;
                },
            };
        }
        ::std::result::Result::Ok(())
    }

    // Compute sizes of nested messages
    #[allow(unused_variables)]
    fn compute_size(&self) -> u64 {
        let mut my_size = 0;
        if !self.id.is_empty() {
            my_size += ::protobuf::rt::string_size(1, &self.id);
        }
        if !self.bytes.is_empty() {
            my_size += ::protobuf::rt::bytes_size(2, &self.bytes);
        }
        if !self.function.is_empty() {
            my_size += ::protobuf::rt::string_size(3, &self.function);
        }
        my_size += ::protobuf::rt::unknown_fields_size(self.special_fields.unknown_fields());
        self.special_fields.cached_size().set(my_size as u32);
        my_size
    }

    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::Result<()> {
        if !self.id.is_empty() {
            os.write_string(1, &self.id)?;
        }
        if !self.bytes.is_empty() {
            os.write_bytes(2, &self.bytes)?;
        }
        if !self.function.is_empty() {
            os.write_string(3, &self.function)?;
        }
        os.write_unknown_fields(self.special_fields.unknown_fields())?;
        ::std::result::Result::Ok(())
    }

    fn special_fields(&self) -> &::protobuf::SpecialFields {
        &self.special_fields
    }

    fn mut_special_fields(&mut self) -> &mut ::protobuf::SpecialFields {
        &mut self.special_fields
    }

    fn new() -> WasmModule {
        WasmModule::new()
    }

    fn clear(&mut self) {
        self.id.clear();
        self.bytes.clear();
        self.function.clear();
        self.special_fields.clear();
    }

    fn default_instance() -> &'static WasmModule {
        static instance: WasmModule = WasmModule {
            id: ::std::string::String::new(),
            bytes: ::std::vec::Vec::new(),
            function: ::std::string::String::new(),
            special_fields: ::protobuf::SpecialFields::new(),
        };
        &instance
    }
}

impl ::protobuf::MessageFull for WasmModule {
    fn descriptor() -> ::protobuf::reflect::MessageDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().message_by_package_relative_name("WasmModule").unwrap()).clone()
    }
}

impl ::std::fmt::Display for WasmModule {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::protobuf::text_format::fmt(self, f)
    }
}

impl ::protobuf::reflect::ProtobufValue for WasmModule {
    type RuntimeType = ::protobuf::reflect::rt::RuntimeTypeMessage<Self>;
}

///  KVAction is a shared type that is used for protos.KVCommand and protos.KVStep.
///  Note that only a subset of actions are used for protos.KVCommand (CREATE,
///  UPDATE, DELETE, DELETE_ALL) while protos.KVStep uses most of them.
///
///  protolint:disable:next ENUM_FIELD_NAMES_PREFIX
#[derive(Clone,Copy,PartialEq,Eq,Debug,Hash)]
// @@protoc_insertion_point(enum:protos.shared.KVAction)
pub enum KVAction {
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_UNSET)
    KV_ACTION_UNSET = 0,
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_GET)
    KV_ACTION_GET = 1,
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_CREATE)
    KV_ACTION_CREATE = 2,
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_UPDATE)
    KV_ACTION_UPDATE = 3,
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_EXISTS)
    KV_ACTION_EXISTS = 4,
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_DELETE)
    KV_ACTION_DELETE = 5,
    // @@protoc_insertion_point(enum_value:protos.shared.KVAction.KV_ACTION_DELETE_ALL)
    KV_ACTION_DELETE_ALL = 6,
}

impl ::protobuf::Enum for KVAction {
    const NAME: &'static str = "KVAction";

    fn value(&self) -> i32 {
        *self as i32
    }

    fn from_i32(value: i32) -> ::std::option::Option<KVAction> {
        match value {
            0 => ::std::option::Option::Some(KVAction::KV_ACTION_UNSET),
            1 => ::std::option::Option::Some(KVAction::KV_ACTION_GET),
            2 => ::std::option::Option::Some(KVAction::KV_ACTION_CREATE),
            3 => ::std::option::Option::Some(KVAction::KV_ACTION_UPDATE),
            4 => ::std::option::Option::Some(KVAction::KV_ACTION_EXISTS),
            5 => ::std::option::Option::Some(KVAction::KV_ACTION_DELETE),
            6 => ::std::option::Option::Some(KVAction::KV_ACTION_DELETE_ALL),
            _ => ::std::option::Option::None
        }
    }

    fn from_str(str: &str) -> ::std::option::Option<KVAction> {
        match str {
            "KV_ACTION_UNSET" => ::std::option::Option::Some(KVAction::KV_ACTION_UNSET),
            "KV_ACTION_GET" => ::std::option::Option::Some(KVAction::KV_ACTION_GET),
            "KV_ACTION_CREATE" => ::std::option::Option::Some(KVAction::KV_ACTION_CREATE),
            "KV_ACTION_UPDATE" => ::std::option::Option::Some(KVAction::KV_ACTION_UPDATE),
            "KV_ACTION_EXISTS" => ::std::option::Option::Some(KVAction::KV_ACTION_EXISTS),
            "KV_ACTION_DELETE" => ::std::option::Option::Some(KVAction::KV_ACTION_DELETE),
            "KV_ACTION_DELETE_ALL" => ::std::option::Option::Some(KVAction::KV_ACTION_DELETE_ALL),
            _ => ::std::option::Option::None
        }
    }

    const VALUES: &'static [KVAction] = &[
        KVAction::KV_ACTION_UNSET,
        KVAction::KV_ACTION_GET,
        KVAction::KV_ACTION_CREATE,
        KVAction::KV_ACTION_UPDATE,
        KVAction::KV_ACTION_EXISTS,
        KVAction::KV_ACTION_DELETE,
        KVAction::KV_ACTION_DELETE_ALL,
    ];
}

impl ::protobuf::EnumFull for KVAction {
    fn enum_descriptor() -> ::protobuf::reflect::EnumDescriptor {
        static descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::Lazy::new();
        descriptor.get(|| file_descriptor().enum_by_package_relative_name("KVAction").unwrap()).clone()
    }

    fn descriptor(&self) -> ::protobuf::reflect::EnumValueDescriptor {
        let index = *self as usize;
        Self::enum_descriptor().value_by_index(index)
    }
}

impl ::std::default::Default for KVAction {
    fn default() -> Self {
        KVAction::KV_ACTION_UNSET
    }
}

impl KVAction {
    fn generated_enum_descriptor_data() -> ::protobuf::reflect::GeneratedEnumDescriptorData {
        ::protobuf::reflect::GeneratedEnumDescriptorData::new::<KVAction>("KVAction")
    }
}

static file_descriptor_proto_data: &'static [u8] = b"\
    \n\x16shared/sp_shared.proto\x12\rprotos.shared\"N\n\nWasmModule\x12\x0e\
    \n\x02id\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x05bytes\x18\x02\x20\x01(\
    \x0cR\x05bytes\x12\x1a\n\x08function\x18\x03\x20\x01(\tR\x08function*\
    \xa4\x01\n\x08KVAction\x12\x13\n\x0fKV_ACTION_UNSET\x10\0\x12\x11\n\rKV_\
    ACTION_GET\x10\x01\x12\x14\n\x10KV_ACTION_CREATE\x10\x02\x12\x14\n\x10KV\
    _ACTION_UPDATE\x10\x03\x12\x14\n\x10KV_ACTION_EXISTS\x10\x04\x12\x14\n\
    \x10KV_ACTION_DELETE\x10\x05\x12\x18\n\x14KV_ACTION_DELETE_ALL\x10\x06BC\
    ZAgithub.com/streamdal/streamdal/libs/protos/build/go/protos/sharedJ\xdd\
    \t\n\x06\x12\x04\x01\0\"\x01\nT\n\x01\x0c\x12\x03\x01\0\x12\x1aJ\x20This\
    \x20has\x20to\x20be\x20a\x20separate\x20pkg\x20to\x20avoid\x20circular\
    \x20import\x20problems\x20with\x20Go.\n\n\x08\n\x01\x02\x12\x03\x03\0\
    \x16\n\x08\n\x01\x08\x12\x03\x05\0X\n\t\n\x02\x08\x0b\x12\x03\x05\0X\n\
    \x9d\x02\n\x02\x05\0\x12\x04\x0c\0\x14\x01\x1a\x90\x02\x20KVAction\x20is\
    \x20a\x20shared\x20type\x20that\x20is\x20used\x20for\x20protos.KVCommand\
    \x20and\x20protos.KVStep.\n\x20Note\x20that\x20only\x20a\x20subset\x20of\
    \x20actions\x20are\x20used\x20for\x20protos.KVCommand\x20(CREATE,\n\x20U\
    PDATE,\x20DELETE,\x20DELETE_ALL)\x20while\x20protos.KVStep\x20uses\x20mo\
    st\x20of\x20them.\n\n\x20protolint:disable:next\x20ENUM_FIELD_NAMES_PREF\
    IX\n\n\n\n\x03\x05\0\x01\x12\x03\x0c\x05\r\n\x0b\n\x04\x05\0\x02\0\x12\
    \x03\r\x02\x16\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\r\x02\x11\n\x0c\n\x05\
    \x05\0\x02\0\x02\x12\x03\r\x14\x15\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x0e\
    \x02\x14\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x0e\x02\x0f\n\x0c\n\x05\
    \x05\0\x02\x01\x02\x12\x03\x0e\x12\x13\n\x0b\n\x04\x05\0\x02\x02\x12\x03\
    \x0f\x02\x17\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x0f\x02\x12\n\x0c\n\
    \x05\x05\0\x02\x02\x02\x12\x03\x0f\x15\x16\n\x0b\n\x04\x05\0\x02\x03\x12\
    \x03\x10\x02\x17\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x10\x02\x12\n\x0c\
    \n\x05\x05\0\x02\x03\x02\x12\x03\x10\x15\x16\n\x0b\n\x04\x05\0\x02\x04\
    \x12\x03\x11\x02\x17\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x11\x02\x12\n\
    \x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x11\x15\x16\n\x0b\n\x04\x05\0\x02\
    \x05\x12\x03\x12\x02\x17\n\x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x12\x02\
    \x12\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x12\x15\x16\n\x0b\n\x04\x05\0\
    \x02\x06\x12\x03\x13\x02\x1b\n\x0c\n\x05\x05\0\x02\x06\x01\x12\x03\x13\
    \x02\x16\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\x13\x19\x1a\n\xc6\x01\n\
    \x02\x04\0\x12\x04\x19\0\"\x01\x1a\xb9\x01\x20WasmModule\x20is\x20used\
    \x20to\x20ensure\x20we\x20only\x20send\x20the\x20wasm\x20module\x20once\
    \x20per\x20request\n\x20instead\x20of\x20duplicated\x20in\x20every\x20pi\
    peline\x20where\x20it\x20is\x20used.\x20This\x20prevents\n\x20over-sized\
    \x20payloads\x20on\x20SDK\x20startup\n\n\n\n\x03\x04\0\x01\x12\x03\x19\
    \x08\x12\nP\n\x04\x04\0\x02\0\x12\x03\x1b\x02\x10\x1aC\x20ID\x20is\x20a\
    \x20uuid(sha256(_wasm_bytes))\x20that\x20is\x20set\x20by\x20streamdal\
    \x20server\n\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x1b\x02\x08\n\x0c\n\x05\
    \x04\0\x02\0\x01\x12\x03\x1b\t\x0b\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\
    \x1b\x0e\x0f\n0\n\x04\x04\0\x02\x01\x12\x03\x1e\x02\x12\x1a#\x20WASM\x20\
    module\x20bytes\x20(set\x20by\x20server)\n\n\x0c\n\x05\x04\0\x02\x01\x05\
    \x12\x03\x1e\x02\x07\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x1e\x08\r\n\
    \x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x1e\x10\x11\n<\n\x04\x04\0\x02\x02\
    \x12\x03!\x02\x16\x1a/\x20WASM\x20function\x20name\x20to\x20execute\x20(\
    set\x20by\x20server)\n\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03!\x02\x08\n\
    \x0c\n\x05\x04\0\x02\x02\x01\x12\x03!\t\x11\n\x0c\n\x05\x04\0\x02\x02\
    \x03\x12\x03!\x14\x15b\x06proto3\
";

/// `FileDescriptorProto` object which was a source for this generated file
fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto {
    static file_descriptor_proto_lazy: ::protobuf::rt::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::Lazy::new();
    file_descriptor_proto_lazy.get(|| {
        ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap()
    })
}

/// `FileDescriptor` object which allows dynamic access to files
pub fn file_descriptor() -> &'static ::protobuf::reflect::FileDescriptor {
    static generated_file_descriptor_lazy: ::protobuf::rt::Lazy<::protobuf::reflect::GeneratedFileDescriptor> = ::protobuf::rt::Lazy::new();
    static file_descriptor: ::protobuf::rt::Lazy<::protobuf::reflect::FileDescriptor> = ::protobuf::rt::Lazy::new();
    file_descriptor.get(|| {
        let generated_file_descriptor = generated_file_descriptor_lazy.get(|| {
            let mut deps = ::std::vec::Vec::with_capacity(0);
            let mut messages = ::std::vec::Vec::with_capacity(1);
            messages.push(WasmModule::generated_message_descriptor_data());
            let mut enums = ::std::vec::Vec::with_capacity(1);
            enums.push(KVAction::generated_enum_descriptor_data());
            ::protobuf::reflect::GeneratedFileDescriptor::new_generated(
                file_descriptor_proto(),
                deps,
                messages,
                enums,
            )
        });
        ::protobuf::reflect::FileDescriptor::new_generated_2(generated_file_descriptor)
    })
}