statelydb 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,472 @@
1
+ # Code generated by protoc-gen-rbi. DO NOT EDIT.
2
+ # source: db/list.proto
3
+ # typed: strict
4
+
5
+ class Stately::Db::BeginListRequest
6
+ include ::Google::Protobuf::MessageExts
7
+ extend ::Google::Protobuf::MessageExts::ClassMethods
8
+
9
+ sig do
10
+ params(
11
+ store_id: T.nilable(Integer),
12
+ key_path_prefix: T.nilable(String),
13
+ limit: T.nilable(Integer),
14
+ allow_stale: T.nilable(T::Boolean),
15
+ sort_property: T.nilable(T.any(Symbol, String, Integer)),
16
+ sort_direction: T.nilable(T.any(Symbol, String, Integer)),
17
+ schema_version_id: T.nilable(Integer),
18
+ schema_id: T.nilable(Integer)
19
+ ).void
20
+ end
21
+ def initialize(
22
+ store_id: 0,
23
+ key_path_prefix: "",
24
+ limit: 0,
25
+ allow_stale: false,
26
+ sort_property: :SORTABLE_PROPERTY_KEY_PATH,
27
+ sort_direction: :SORT_ASCENDING,
28
+ schema_version_id: 0,
29
+ schema_id: 0
30
+ )
31
+ end
32
+
33
+ # store_id is a globally unique Store ID, which can be looked up from the
34
+ # console or CLI.
35
+ sig { returns(Integer) }
36
+ def store_id
37
+ end
38
+
39
+ # store_id is a globally unique Store ID, which can be looked up from the
40
+ # console or CLI.
41
+ sig { params(value: Integer).void }
42
+ def store_id=(value)
43
+ end
44
+
45
+ # store_id is a globally unique Store ID, which can be looked up from the
46
+ # console or CLI.
47
+ sig { void }
48
+ def clear_store_id
49
+ end
50
+
51
+ # key_path_prefix is the a prefix that limits what items we will return. This
52
+ # must contain at least a root segment. See Item#key_path for more details.
53
+ sig { returns(String) }
54
+ def key_path_prefix
55
+ end
56
+
57
+ # key_path_prefix is the a prefix that limits what items we will return. This
58
+ # must contain at least a root segment. See Item#key_path for more details.
59
+ sig { params(value: String).void }
60
+ def key_path_prefix=(value)
61
+ end
62
+
63
+ # key_path_prefix is the a prefix that limits what items we will return. This
64
+ # must contain at least a root segment. See Item#key_path for more details.
65
+ sig { void }
66
+ def clear_key_path_prefix
67
+ end
68
+
69
+ # limit is the maximum number of items to return. If this is not specified or
70
+ # set to 0, it will default to unlimited. Fewer items than the limit may be
71
+ # returned even if there are more items to get - make sure to check
72
+ # token.can_continue.
73
+ sig { returns(Integer) }
74
+ def limit
75
+ end
76
+
77
+ # limit is the maximum number of items to return. If this is not specified or
78
+ # set to 0, it will default to unlimited. Fewer items than the limit may be
79
+ # returned even if there are more items to get - make sure to check
80
+ # token.can_continue.
81
+ sig { params(value: Integer).void }
82
+ def limit=(value)
83
+ end
84
+
85
+ # limit is the maximum number of items to return. If this is not specified or
86
+ # set to 0, it will default to unlimited. Fewer items than the limit may be
87
+ # returned even if there are more items to get - make sure to check
88
+ # token.can_continue.
89
+ sig { void }
90
+ def clear_limit
91
+ end
92
+
93
+ # allow_stale indicates that you're okay with getting slightly stale items -
94
+ # that is, if you had just changed an item and then call a List operation,
95
+ # you might get the old version of the item. This can result in improved
96
+ # performance, availability, and cost.
97
+ sig { returns(T::Boolean) }
98
+ def allow_stale
99
+ end
100
+
101
+ # allow_stale indicates that you're okay with getting slightly stale items -
102
+ # that is, if you had just changed an item and then call a List operation,
103
+ # you might get the old version of the item. This can result in improved
104
+ # performance, availability, and cost.
105
+ sig { params(value: T::Boolean).void }
106
+ def allow_stale=(value)
107
+ end
108
+
109
+ # allow_stale indicates that you're okay with getting slightly stale items -
110
+ # that is, if you had just changed an item and then call a List operation,
111
+ # you might get the old version of the item. This can result in improved
112
+ # performance, availability, and cost.
113
+ sig { void }
114
+ def clear_allow_stale
115
+ end
116
+
117
+ # sort_property is the property of the item to sort the results by. If this
118
+ # is not set, we will sort by key path.
119
+ sig { returns(T.any(Symbol, Integer)) }
120
+ def sort_property
121
+ end
122
+
123
+ # sort_property is the property of the item to sort the results by. If this
124
+ # is not set, we will sort by key path.
125
+ sig { params(value: T.any(Symbol, String, Integer)).void }
126
+ def sort_property=(value)
127
+ end
128
+
129
+ # sort_property is the property of the item to sort the results by. If this
130
+ # is not set, we will sort by key path.
131
+ sig { void }
132
+ def clear_sort_property
133
+ end
134
+
135
+ # sort_direction is the direction to sort the results in. If this is not set,
136
+ # we will sort in ascending order.
137
+ sig { returns(T.any(Symbol, Integer)) }
138
+ def sort_direction
139
+ end
140
+
141
+ # sort_direction is the direction to sort the results in. If this is not set,
142
+ # we will sort in ascending order.
143
+ sig { params(value: T.any(Symbol, String, Integer)).void }
144
+ def sort_direction=(value)
145
+ end
146
+
147
+ # sort_direction is the direction to sort the results in. If this is not set,
148
+ # we will sort in ascending order.
149
+ sig { void }
150
+ def clear_sort_direction
151
+ end
152
+
153
+ # schema_version_id refers to the item version to return.
154
+ #
155
+ # If the store's schema does not have this version, the operation
156
+ # will error with SchemaVersionNotFound error. You should not have to
157
+ # set this manually as your generated SDK should know its schema version
158
+ # and wire this in for you.
159
+ sig { returns(Integer) }
160
+ def schema_version_id
161
+ end
162
+
163
+ # schema_version_id refers to the item version to return.
164
+ #
165
+ # If the store's schema does not have this version, the operation
166
+ # will error with SchemaVersionNotFound error. You should not have to
167
+ # set this manually as your generated SDK should know its schema version
168
+ # and wire this in for you.
169
+ sig { params(value: Integer).void }
170
+ def schema_version_id=(value)
171
+ end
172
+
173
+ # schema_version_id refers to the item version to return.
174
+ #
175
+ # If the store's schema does not have this version, the operation
176
+ # will error with SchemaVersionNotFound error. You should not have to
177
+ # set this manually as your generated SDK should know its schema version
178
+ # and wire this in for you.
179
+ sig { void }
180
+ def clear_schema_version_id
181
+ end
182
+
183
+ # schema_id refers to the schema to use for this operation.
184
+ # If the store_id does not have a schema with this ID, the operation will
185
+ # error with SchemaNotFound error. You should not have to set this manually
186
+ # as your generated SDK should know its schema and wire this in for you.
187
+ sig { returns(Integer) }
188
+ def schema_id
189
+ end
190
+
191
+ # schema_id refers to the schema to use for this operation.
192
+ # If the store_id does not have a schema with this ID, the operation will
193
+ # error with SchemaNotFound error. You should not have to set this manually
194
+ # as your generated SDK should know its schema and wire this in for you.
195
+ sig { params(value: Integer).void }
196
+ def schema_id=(value)
197
+ end
198
+
199
+ # schema_id refers to the schema to use for this operation.
200
+ # If the store_id does not have a schema with this ID, the operation will
201
+ # error with SchemaNotFound error. You should not have to set this manually
202
+ # as your generated SDK should know its schema and wire this in for you.
203
+ sig { void }
204
+ def clear_schema_id
205
+ end
206
+
207
+ sig { params(field: String).returns(T.untyped) }
208
+ def [](field)
209
+ end
210
+
211
+ sig { params(field: String, value: T.untyped).void }
212
+ def []=(field, value)
213
+ end
214
+
215
+ sig { returns(T::Hash[Symbol, T.untyped]) }
216
+ def to_h
217
+ end
218
+
219
+ sig { params(str: String).returns(Stately::Db::BeginListRequest) }
220
+ def self.decode(str)
221
+ end
222
+
223
+ sig { params(msg: Stately::Db::BeginListRequest).returns(String) }
224
+ def self.encode(msg)
225
+ end
226
+
227
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::BeginListRequest) }
228
+ def self.decode_json(str, **kw)
229
+ end
230
+
231
+ sig { params(msg: Stately::Db::BeginListRequest, kw: T.untyped).returns(String) }
232
+ def self.encode_json(msg, **kw)
233
+ end
234
+
235
+ sig { returns(::Google::Protobuf::Descriptor) }
236
+ def self.descriptor
237
+ end
238
+ end
239
+
240
+ # These are stream messages, so multiple responses may be sent.
241
+ class Stately::Db::ListResponse
242
+ include ::Google::Protobuf::MessageExts
243
+ extend ::Google::Protobuf::MessageExts::ClassMethods
244
+
245
+ sig do
246
+ params(
247
+ result: T.nilable(Stately::Db::ListPartialResult),
248
+ finished: T.nilable(Stately::Db::ListFinished)
249
+ ).void
250
+ end
251
+ def initialize(
252
+ result: nil,
253
+ finished: nil
254
+ )
255
+ end
256
+
257
+ # Result is a segment of the result set - multiple of these may be returned
258
+ # in a stream before the final "finished" message.
259
+ sig { returns(T.nilable(Stately::Db::ListPartialResult)) }
260
+ def result
261
+ end
262
+
263
+ # Result is a segment of the result set - multiple of these may be returned
264
+ # in a stream before the final "finished" message.
265
+ sig { params(value: T.nilable(Stately::Db::ListPartialResult)).void }
266
+ def result=(value)
267
+ end
268
+
269
+ # Result is a segment of the result set - multiple of these may be returned
270
+ # in a stream before the final "finished" message.
271
+ sig { void }
272
+ def clear_result
273
+ end
274
+
275
+ # Finished is sent when there are no more results in this operation, and
276
+ # there will only be one.
277
+ sig { returns(T.nilable(Stately::Db::ListFinished)) }
278
+ def finished
279
+ end
280
+
281
+ # Finished is sent when there are no more results in this operation, and
282
+ # there will only be one.
283
+ sig { params(value: T.nilable(Stately::Db::ListFinished)).void }
284
+ def finished=(value)
285
+ end
286
+
287
+ # Finished is sent when there are no more results in this operation, and
288
+ # there will only be one.
289
+ sig { void }
290
+ def clear_finished
291
+ end
292
+
293
+ sig { returns(T.nilable(Symbol)) }
294
+ def response
295
+ end
296
+
297
+ sig { params(field: String).returns(T.untyped) }
298
+ def [](field)
299
+ end
300
+
301
+ sig { params(field: String, value: T.untyped).void }
302
+ def []=(field, value)
303
+ end
304
+
305
+ sig { returns(T::Hash[Symbol, T.untyped]) }
306
+ def to_h
307
+ end
308
+
309
+ sig { params(str: String).returns(Stately::Db::ListResponse) }
310
+ def self.decode(str)
311
+ end
312
+
313
+ sig { params(msg: Stately::Db::ListResponse).returns(String) }
314
+ def self.encode(msg)
315
+ end
316
+
317
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::ListResponse) }
318
+ def self.decode_json(str, **kw)
319
+ end
320
+
321
+ sig { params(msg: Stately::Db::ListResponse, kw: T.untyped).returns(String) }
322
+ def self.encode_json(msg, **kw)
323
+ end
324
+
325
+ sig { returns(::Google::Protobuf::Descriptor) }
326
+ def self.descriptor
327
+ end
328
+ end
329
+
330
+ class Stately::Db::ListPartialResult
331
+ include ::Google::Protobuf::MessageExts
332
+ extend ::Google::Protobuf::MessageExts::ClassMethods
333
+
334
+ sig do
335
+ params(
336
+ items: T.nilable(T::Array[T.nilable(Stately::Db::Item)])
337
+ ).void
338
+ end
339
+ def initialize(
340
+ items: []
341
+ )
342
+ end
343
+
344
+ # results is a list that contains one entry for each Item that was found.
345
+ sig { returns(T::Array[T.nilable(Stately::Db::Item)]) }
346
+ def items
347
+ end
348
+
349
+ # results is a list that contains one entry for each Item that was found.
350
+ sig { params(value: ::Google::Protobuf::RepeatedField).void }
351
+ def items=(value)
352
+ end
353
+
354
+ # results is a list that contains one entry for each Item that was found.
355
+ sig { void }
356
+ def clear_items
357
+ end
358
+
359
+ sig { params(field: String).returns(T.untyped) }
360
+ def [](field)
361
+ end
362
+
363
+ sig { params(field: String, value: T.untyped).void }
364
+ def []=(field, value)
365
+ end
366
+
367
+ sig { returns(T::Hash[Symbol, T.untyped]) }
368
+ def to_h
369
+ end
370
+
371
+ sig { params(str: String).returns(Stately::Db::ListPartialResult) }
372
+ def self.decode(str)
373
+ end
374
+
375
+ sig { params(msg: Stately::Db::ListPartialResult).returns(String) }
376
+ def self.encode(msg)
377
+ end
378
+
379
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::ListPartialResult) }
380
+ def self.decode_json(str, **kw)
381
+ end
382
+
383
+ sig { params(msg: Stately::Db::ListPartialResult, kw: T.untyped).returns(String) }
384
+ def self.encode_json(msg, **kw)
385
+ end
386
+
387
+ sig { returns(::Google::Protobuf::Descriptor) }
388
+ def self.descriptor
389
+ end
390
+ end
391
+
392
+ class Stately::Db::ListFinished
393
+ include ::Google::Protobuf::MessageExts
394
+ extend ::Google::Protobuf::MessageExts::ClassMethods
395
+
396
+ sig do
397
+ params(
398
+ token: T.nilable(Stately::Db::ListToken)
399
+ ).void
400
+ end
401
+ def initialize(
402
+ token: nil
403
+ )
404
+ end
405
+
406
+ # token is always set and represents an updated list continuation token that
407
+ # can be used in subsequent calls to ContinueList or SyncList.
408
+ sig { returns(T.nilable(Stately::Db::ListToken)) }
409
+ def token
410
+ end
411
+
412
+ # token is always set and represents an updated list continuation token that
413
+ # can be used in subsequent calls to ContinueList or SyncList.
414
+ sig { params(value: T.nilable(Stately::Db::ListToken)).void }
415
+ def token=(value)
416
+ end
417
+
418
+ # token is always set and represents an updated list continuation token that
419
+ # can be used in subsequent calls to ContinueList or SyncList.
420
+ sig { void }
421
+ def clear_token
422
+ end
423
+
424
+ sig { params(field: String).returns(T.untyped) }
425
+ def [](field)
426
+ end
427
+
428
+ sig { params(field: String, value: T.untyped).void }
429
+ def []=(field, value)
430
+ end
431
+
432
+ sig { returns(T::Hash[Symbol, T.untyped]) }
433
+ def to_h
434
+ end
435
+
436
+ sig { params(str: String).returns(Stately::Db::ListFinished) }
437
+ def self.decode(str)
438
+ end
439
+
440
+ sig { params(msg: Stately::Db::ListFinished).returns(String) }
441
+ def self.encode(msg)
442
+ end
443
+
444
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::ListFinished) }
445
+ def self.decode_json(str, **kw)
446
+ end
447
+
448
+ sig { params(msg: Stately::Db::ListFinished, kw: T.untyped).returns(String) }
449
+ def self.encode_json(msg, **kw)
450
+ end
451
+
452
+ sig { returns(::Google::Protobuf::Descriptor) }
453
+ def self.descriptor
454
+ end
455
+ end
456
+
457
+ module Stately::Db::SortDirection
458
+ self::SORT_ASCENDING = T.let(0, Integer)
459
+ self::SORT_DESCENDING = T.let(1, Integer)
460
+
461
+ sig { params(value: Integer).returns(T.nilable(Symbol)) }
462
+ def self.lookup(value)
463
+ end
464
+
465
+ sig { params(value: Symbol).returns(T.nilable(Integer)) }
466
+ def self.resolve(value)
467
+ end
468
+
469
+ sig { returns(::Google::Protobuf::EnumDescriptor) }
470
+ def self.descriptor
471
+ end
472
+ end
@@ -0,0 +1,154 @@
1
+ # Code generated by protoc-gen-rbi. DO NOT EDIT.
2
+ # source: db/list_token.proto
3
+ # typed: strict
4
+
5
+ # ListToken is an opaque token that can be used to continue (paginate) or sync
6
+ # results from a previous List operation.
7
+ class Stately::Db::ListToken
8
+ include ::Google::Protobuf::MessageExts
9
+ extend ::Google::Protobuf::MessageExts::ClassMethods
10
+
11
+ sig do
12
+ params(
13
+ token_data: T.nilable(String),
14
+ can_continue: T.nilable(T::Boolean),
15
+ can_sync: T.nilable(T::Boolean),
16
+ schema_version_id: T.nilable(Integer)
17
+ ).void
18
+ end
19
+ def initialize(
20
+ token_data: "",
21
+ can_continue: false,
22
+ can_sync: false,
23
+ schema_version_id: 0
24
+ )
25
+ end
26
+
27
+ # token_data will always be returned, and can be used to expand the result
28
+ # set via ContinueList (if can_continue is true), or to get changed items
29
+ # within the result set via SyncList (if can_sync is true). The token_data
30
+ # itself is opaque and cannot be parsed or modified by clients.
31
+ sig { returns(String) }
32
+ def token_data
33
+ end
34
+
35
+ # token_data will always be returned, and can be used to expand the result
36
+ # set via ContinueList (if can_continue is true), or to get changed items
37
+ # within the result set via SyncList (if can_sync is true). The token_data
38
+ # itself is opaque and cannot be parsed or modified by clients.
39
+ sig { params(value: String).void }
40
+ def token_data=(value)
41
+ end
42
+
43
+ # token_data will always be returned, and can be used to expand the result
44
+ # set via ContinueList (if can_continue is true), or to get changed items
45
+ # within the result set via SyncList (if can_sync is true). The token_data
46
+ # itself is opaque and cannot be parsed or modified by clients.
47
+ sig { void }
48
+ def clear_token_data
49
+ end
50
+
51
+ # can_continue indicates that there are more results available by expanding
52
+ # the pagination window by calling ContinueList with this token.
53
+ sig { returns(T::Boolean) }
54
+ def can_continue
55
+ end
56
+
57
+ # can_continue indicates that there are more results available by expanding
58
+ # the pagination window by calling ContinueList with this token.
59
+ sig { params(value: T::Boolean).void }
60
+ def can_continue=(value)
61
+ end
62
+
63
+ # can_continue indicates that there are more results available by expanding
64
+ # the pagination window by calling ContinueList with this token.
65
+ sig { void }
66
+ def clear_can_continue
67
+ end
68
+
69
+ # can_sync indicates that you could call SyncList with this token later to
70
+ # get updated items. This is determined by the type of store you're listing
71
+ # from.
72
+ sig { returns(T::Boolean) }
73
+ def can_sync
74
+ end
75
+
76
+ # can_sync indicates that you could call SyncList with this token later to
77
+ # get updated items. This is determined by the type of store you're listing
78
+ # from.
79
+ sig { params(value: T::Boolean).void }
80
+ def can_sync=(value)
81
+ end
82
+
83
+ # can_sync indicates that you could call SyncList with this token later to
84
+ # get updated items. This is determined by the type of store you're listing
85
+ # from.
86
+ sig { void }
87
+ def clear_can_sync
88
+ end
89
+
90
+ # schema_version_id represents the version of the schema that was used to
91
+ # generate token_data. For ContinueList calls, you must ensure the client's
92
+ # schema version and this field are the same. A mismatch between the two
93
+ # will result in a SchemaVersionMismatch error. For SyncList calls, you
94
+ # only need to ensure you handle Reset events correctly by clearing your
95
+ # local state and consuming a new list of items as Stately will handle
96
+ # re-send items in the correct version along with a new token at the end.
97
+ sig { returns(Integer) }
98
+ def schema_version_id
99
+ end
100
+
101
+ # schema_version_id represents the version of the schema that was used to
102
+ # generate token_data. For ContinueList calls, you must ensure the client's
103
+ # schema version and this field are the same. A mismatch between the two
104
+ # will result in a SchemaVersionMismatch error. For SyncList calls, you
105
+ # only need to ensure you handle Reset events correctly by clearing your
106
+ # local state and consuming a new list of items as Stately will handle
107
+ # re-send items in the correct version along with a new token at the end.
108
+ sig { params(value: Integer).void }
109
+ def schema_version_id=(value)
110
+ end
111
+
112
+ # schema_version_id represents the version of the schema that was used to
113
+ # generate token_data. For ContinueList calls, you must ensure the client's
114
+ # schema version and this field are the same. A mismatch between the two
115
+ # will result in a SchemaVersionMismatch error. For SyncList calls, you
116
+ # only need to ensure you handle Reset events correctly by clearing your
117
+ # local state and consuming a new list of items as Stately will handle
118
+ # re-send items in the correct version along with a new token at the end.
119
+ sig { void }
120
+ def clear_schema_version_id
121
+ end
122
+
123
+ sig { params(field: String).returns(T.untyped) }
124
+ def [](field)
125
+ end
126
+
127
+ sig { params(field: String, value: T.untyped).void }
128
+ def []=(field, value)
129
+ end
130
+
131
+ sig { returns(T::Hash[Symbol, T.untyped]) }
132
+ def to_h
133
+ end
134
+
135
+ sig { params(str: String).returns(Stately::Db::ListToken) }
136
+ def self.decode(str)
137
+ end
138
+
139
+ sig { params(msg: Stately::Db::ListToken).returns(String) }
140
+ def self.encode(msg)
141
+ end
142
+
143
+ sig { params(str: String, kw: T.untyped).returns(Stately::Db::ListToken) }
144
+ def self.decode_json(str, **kw)
145
+ end
146
+
147
+ sig { params(msg: Stately::Db::ListToken, kw: T.untyped).returns(String) }
148
+ def self.encode_json(msg, **kw)
149
+ end
150
+
151
+ sig { returns(::Google::Protobuf::Descriptor) }
152
+ def self.descriptor
153
+ end
154
+ end