@fatehan/tsrp 1.6.20 → 1.6.21

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.
Files changed (88) hide show
  1. package/dist/fatehan/activities/workflow.d.ts +219 -0
  2. package/dist/fatehan/activities/workflow.d.ts.map +1 -0
  3. package/dist/fatehan/activities/workflow.js +1941 -0
  4. package/dist/fatehan/activities/workshift.d.ts +140 -0
  5. package/dist/fatehan/activities/workshift.d.ts.map +1 -0
  6. package/dist/fatehan/activities/workshift.js +1244 -0
  7. package/dist/fatehan/apis/client.d.ts +246 -0
  8. package/dist/fatehan/apis/client.d.ts.map +1 -0
  9. package/dist/fatehan/apis/client.js +2572 -0
  10. package/dist/fatehan/areas/area.d.ts +96 -0
  11. package/dist/fatehan/areas/area.d.ts.map +1 -0
  12. package/dist/fatehan/areas/area.js +761 -0
  13. package/dist/fatehan/devices/devices.d.ts +256 -0
  14. package/dist/fatehan/devices/devices.d.ts.map +1 -0
  15. package/dist/fatehan/devices/devices.js +2730 -0
  16. package/dist/fatehan/devices/maintenance.d.ts +64 -0
  17. package/dist/fatehan/devices/maintenance.d.ts.map +1 -0
  18. package/dist/fatehan/devices/maintenance.js +484 -0
  19. package/dist/fatehan/financial/financial.d.ts +162 -0
  20. package/dist/fatehan/financial/financial.d.ts.map +1 -0
  21. package/dist/fatehan/financial/financial.js +1701 -0
  22. package/dist/fatehan/google/protobuf/descriptor.d.ts +1303 -0
  23. package/dist/fatehan/google/protobuf/descriptor.d.ts.map +1 -0
  24. package/dist/fatehan/google/protobuf/descriptor.js +3467 -0
  25. package/dist/fatehan/google/protobuf/duration.d.ts +99 -0
  26. package/dist/fatehan/google/protobuf/duration.d.ts.map +1 -0
  27. package/dist/fatehan/google/protobuf/duration.js +63 -0
  28. package/dist/fatehan/google/protobuf/field_mask.d.ts +228 -0
  29. package/dist/fatehan/google/protobuf/field_mask.d.ts.map +1 -0
  30. package/dist/fatehan/google/protobuf/field_mask.js +57 -0
  31. package/dist/fatehan/google/protobuf/timestamp.d.ts +129 -0
  32. package/dist/fatehan/google/protobuf/timestamp.d.ts.map +1 -0
  33. package/dist/fatehan/google/protobuf/timestamp.js +63 -0
  34. package/dist/fatehan/identities/authentication.d.ts +164 -0
  35. package/dist/fatehan/identities/authentication.d.ts.map +1 -0
  36. package/dist/fatehan/identities/authentication.js +1291 -0
  37. package/dist/fatehan/identities/identities.d.ts +969 -0
  38. package/dist/fatehan/identities/identities.d.ts.map +1 -0
  39. package/dist/fatehan/identities/identities.js +2993 -0
  40. package/dist/fatehan/models/fusion.d.ts +149 -0
  41. package/dist/fatehan/models/fusion.d.ts.map +1 -0
  42. package/dist/fatehan/models/fusion.js +1531 -0
  43. package/dist/fatehan/models/models.d.ts +162 -0
  44. package/dist/fatehan/models/models.d.ts.map +1 -0
  45. package/dist/fatehan/models/models.js +1486 -0
  46. package/dist/fatehan/notifies/direct.d.ts +85 -0
  47. package/dist/fatehan/notifies/direct.d.ts.map +1 -0
  48. package/dist/fatehan/notifies/direct.js +669 -0
  49. package/dist/fatehan/notifies/notify.d.ts +232 -0
  50. package/dist/fatehan/notifies/notify.d.ts.map +1 -0
  51. package/dist/fatehan/notifies/notify.js +1958 -0
  52. package/dist/fatehan/packets/commands.d.ts +150 -0
  53. package/dist/fatehan/packets/commands.d.ts.map +1 -0
  54. package/dist/fatehan/packets/commands.js +1364 -0
  55. package/dist/fatehan/packets/dataModel.d.ts +1611 -0
  56. package/dist/fatehan/packets/dataModel.d.ts.map +1 -0
  57. package/dist/fatehan/packets/dataModel.js +14961 -0
  58. package/dist/fatehan/packets/dataModule.d.ts +61 -0
  59. package/dist/fatehan/packets/dataModule.d.ts.map +1 -0
  60. package/dist/fatehan/packets/dataModule.js +386 -0
  61. package/dist/fatehan/packets/forge.d.ts +142 -0
  62. package/dist/fatehan/packets/forge.d.ts.map +1 -0
  63. package/dist/fatehan/packets/forge.js +1339 -0
  64. package/dist/fatehan/services/api.d.ts +1221 -0
  65. package/dist/fatehan/services/api.d.ts.map +1 -0
  66. package/dist/fatehan/services/api.js +12678 -0
  67. package/dist/fatehan/services/repositories.d.ts +78 -0
  68. package/dist/fatehan/services/repositories.d.ts.map +1 -0
  69. package/dist/fatehan/services/repositories.js +620 -0
  70. package/dist/fatehan/stream/stream.d.ts +224 -0
  71. package/dist/fatehan/stream/stream.d.ts.map +1 -0
  72. package/dist/fatehan/stream/stream.js +1416 -0
  73. package/dist/fatehan/trips/trip.d.ts +325 -0
  74. package/dist/fatehan/trips/trip.d.ts.map +1 -0
  75. package/dist/fatehan/trips/trip.js +1635 -0
  76. package/dist/fatehan/utils/buf/validate/validate.d.ts +3520 -0
  77. package/dist/fatehan/utils/buf/validate/validate.d.ts.map +1 -0
  78. package/dist/fatehan/utils/buf/validate/validate.js +4248 -0
  79. package/dist/services.d.ts +79 -0
  80. package/dist/services.d.ts.map +1 -0
  81. package/dist/services.js +245 -0
  82. package/dist/store/system.io.d.ts +6 -0
  83. package/dist/store/system.io.d.ts.map +1 -0
  84. package/dist/store/system.io.js +14 -0
  85. package/dist/system.io.d.ts +6 -0
  86. package/dist/system.io.d.ts.map +1 -0
  87. package/dist/system.io.js +208 -0
  88. package/package.json +1 -1
@@ -0,0 +1,3520 @@
1
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
2
+ import Long from "long";
3
+ import { FieldDescriptorProto_Type } from "../../../google/protobuf/descriptor";
4
+ import { Duration } from "../../../google/protobuf/duration";
5
+ export declare const protobufPackage = "buf.validate";
6
+ /**
7
+ * Specifies how `FieldRules.ignore` behaves, depending on the field's value, and
8
+ * whether the field tracks presence.
9
+ */
10
+ export declare enum Ignore {
11
+ /**
12
+ * IGNORE_UNSPECIFIED - Ignore rules if the field tracks presence and is unset. This is the default
13
+ * behavior.
14
+ *
15
+ * In proto3, only message fields, members of a Protobuf `oneof`, and fields
16
+ * with the `optional` label track presence. Consequently, the following fields
17
+ * are always validated, whether a value is set or not:
18
+ *
19
+ * ```proto
20
+ * syntax="proto3";
21
+ *
22
+ * message RulesApply {
23
+ * string email = 1 [
24
+ * (buf.validate.field).string.email = true
25
+ * ];
26
+ * int32 age = 2 [
27
+ * (buf.validate.field).int32.gt = 0
28
+ * ];
29
+ * repeated string labels = 3 [
30
+ * (buf.validate.field).repeated.min_items = 1
31
+ * ];
32
+ * }
33
+ * ```
34
+ *
35
+ * In contrast, the following fields track presence, and are only validated if
36
+ * a value is set:
37
+ *
38
+ * ```proto
39
+ * syntax="proto3";
40
+ *
41
+ * message RulesApplyIfSet {
42
+ * optional string email = 1 [
43
+ * (buf.validate.field).string.email = true
44
+ * ];
45
+ * oneof ref {
46
+ * string reference = 2 [
47
+ * (buf.validate.field).string.uuid = true
48
+ * ];
49
+ * string name = 3 [
50
+ * (buf.validate.field).string.min_len = 4
51
+ * ];
52
+ * }
53
+ * SomeMessage msg = 4 [
54
+ * (buf.validate.field).cel = {/* ... * /}
55
+ * ];
56
+ * }
57
+ * ```
58
+ *
59
+ * To ensure that such a field is set, add the `required` rule.
60
+ *
61
+ * To learn which fields track presence, see the
62
+ * [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).
63
+ */
64
+ IGNORE_UNSPECIFIED = 0,
65
+ /**
66
+ * IGNORE_IF_ZERO_VALUE - Ignore rules if the field is unset, or set to the zero value.
67
+ *
68
+ * The zero value depends on the field type:
69
+ * - For strings, the zero value is the empty string.
70
+ * - For bytes, the zero value is empty bytes.
71
+ * - For bool, the zero value is false.
72
+ * - For numeric types, the zero value is zero.
73
+ * - For enums, the zero value is the first defined enum value.
74
+ * - For repeated fields, the zero is an empty list.
75
+ * - For map fields, the zero is an empty map.
76
+ * - For message fields, absence of the message (typically a null-value) is considered zero value.
77
+ *
78
+ * For fields that track presence (e.g. adding the `optional` label in proto3),
79
+ * this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.
80
+ */
81
+ IGNORE_IF_ZERO_VALUE = 1,
82
+ /**
83
+ * IGNORE_ALWAYS - Always ignore rules, including the `required` rule.
84
+ *
85
+ * This is useful for ignoring the rules of a referenced message, or to
86
+ * temporarily ignore rules during development.
87
+ *
88
+ * ```proto
89
+ * message MyMessage {
90
+ * // The field's rules will always be ignored, including any validations
91
+ * // on value's fields.
92
+ * MyOtherMessage value = 1 [
93
+ * (buf.validate.field).ignore = IGNORE_ALWAYS
94
+ * ];
95
+ * }
96
+ * ```
97
+ */
98
+ IGNORE_ALWAYS = 3,
99
+ UNRECOGNIZED = -1
100
+ }
101
+ /** KnownRegex contains some well-known patterns. */
102
+ export declare enum KnownRegex {
103
+ KNOWN_REGEX_UNSPECIFIED = 0,
104
+ /** KNOWN_REGEX_HTTP_HEADER_NAME - HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2). */
105
+ KNOWN_REGEX_HTTP_HEADER_NAME = 1,
106
+ /** KNOWN_REGEX_HTTP_HEADER_VALUE - HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4). */
107
+ KNOWN_REGEX_HTTP_HEADER_VALUE = 2,
108
+ UNRECOGNIZED = -1
109
+ }
110
+ /**
111
+ * `Rule` represents a validation rule written in the Common Expression
112
+ * Language (CEL) syntax. Each Rule includes a unique identifier, an
113
+ * optional error message, and the CEL expression to evaluate. For more
114
+ * information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
115
+ *
116
+ * ```proto
117
+ * message Foo {
118
+ * option (buf.validate.message).cel = {
119
+ * id: "foo.bar"
120
+ * message: "bar must be greater than 0"
121
+ * expression: "this.bar > 0"
122
+ * };
123
+ * int32 bar = 1;
124
+ * }
125
+ * ```
126
+ */
127
+ export interface Rule {
128
+ /**
129
+ * `id` is a string that serves as a machine-readable name for this Rule.
130
+ * It should be unique within its scope, which could be either a message or a field.
131
+ */
132
+ id?: string | undefined;
133
+ /**
134
+ * `message` is an optional field that provides a human-readable error message
135
+ * for this Rule when the CEL expression evaluates to false. If a
136
+ * non-empty message is provided, any strings resulting from the CEL
137
+ * expression evaluation are ignored.
138
+ */
139
+ message?: string | undefined;
140
+ /**
141
+ * `expression` is the actual CEL expression that will be evaluated for
142
+ * validation. This string must resolve to either a boolean or a string
143
+ * value. If the expression evaluates to false or a non-empty string, the
144
+ * validation is considered failed, and the message is rejected.
145
+ */
146
+ expression?: string | undefined;
147
+ }
148
+ /**
149
+ * MessageRules represents validation rules that are applied to the entire message.
150
+ * It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.
151
+ */
152
+ export interface MessageRules {
153
+ /**
154
+ * `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation
155
+ * rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.
156
+ *
157
+ * This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for
158
+ * simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will
159
+ * be same as the `expression`.
160
+ *
161
+ * For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
162
+ *
163
+ * ```proto
164
+ * message MyMessage {
165
+ * // The field `foo` must be greater than 42.
166
+ * option (buf.validate.message).cel_expression = "this.foo > 42";
167
+ * // The field `foo` must be less than 84.
168
+ * option (buf.validate.message).cel_expression = "this.foo < 84";
169
+ * optional int32 foo = 1;
170
+ * }
171
+ * ```
172
+ */
173
+ celExpression: string[];
174
+ /**
175
+ * `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.
176
+ * These rules are written in Common Expression Language (CEL) syntax. For more information,
177
+ * [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
178
+ *
179
+ * ```proto
180
+ * message MyMessage {
181
+ * // The field `foo` must be greater than 42.
182
+ * option (buf.validate.message).cel = {
183
+ * id: "my_message.value",
184
+ * message: "value must be greater than 42",
185
+ * expression: "this.foo > 42",
186
+ * };
187
+ * optional int32 foo = 1;
188
+ * }
189
+ * ```
190
+ */
191
+ cel: Rule[];
192
+ /**
193
+ * `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields
194
+ * of which at most one can be present. If `required` is also specified, then exactly one
195
+ * of the specified fields _must_ be present.
196
+ *
197
+ * This will enforce oneof-like constraints with a few features not provided by
198
+ * actual Protobuf oneof declarations:
199
+ * 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,
200
+ * only scalar fields are allowed.
201
+ * 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member
202
+ * fields have explicit presence. This means that, for the purpose of determining
203
+ * how many fields are set, explicitly setting such a field to its zero value is
204
+ * effectively the same as not setting it at all.
205
+ * 3. This will always generate validation errors for a message unmarshalled from
206
+ * serialized data that sets more than one field. With a Protobuf oneof, when
207
+ * multiple fields are present in the serialized form, earlier values are usually
208
+ * silently ignored when unmarshalling, with only the last field being set when
209
+ * unmarshalling completes.
210
+ *
211
+ * Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means
212
+ * only the field that is set will be validated and the unset fields are not validated according to the field rules.
213
+ * This behavior can be overridden by setting `ignore` against a field.
214
+ *
215
+ * ```proto
216
+ * message MyMessage {
217
+ * // Only one of `field1` or `field2` _can_ be present in this message.
218
+ * option (buf.validate.message).oneof = { fields: ["field1", "field2"] };
219
+ * // Exactly one of `field3` or `field4` _must_ be present in this message.
220
+ * option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true };
221
+ * string field1 = 1;
222
+ * bytes field2 = 2;
223
+ * bool field3 = 3;
224
+ * int32 field4 = 4;
225
+ * }
226
+ * ```
227
+ */
228
+ oneof: MessageOneofRule[];
229
+ }
230
+ export interface MessageOneofRule {
231
+ /**
232
+ * A list of field names to include in the oneof. All field names must be
233
+ * defined in the message. At least one field must be specified, and
234
+ * duplicates are not permitted.
235
+ */
236
+ fields: string[];
237
+ /** If true, one of the fields specified _must_ be set. */
238
+ required?: boolean | undefined;
239
+ }
240
+ /**
241
+ * The `OneofRules` message type enables you to manage rules for
242
+ * oneof fields in your protobuf messages.
243
+ */
244
+ export interface OneofRules {
245
+ /**
246
+ * If `required` is true, exactly one field of the oneof must be set. A
247
+ * validation error is returned if no fields in the oneof are set. Further rules
248
+ * should be placed on the fields themselves to ensure they are valid values,
249
+ * such as `min_len` or `gt`.
250
+ *
251
+ * ```proto
252
+ * message MyMessage {
253
+ * oneof value {
254
+ * // Either `a` or `b` must be set. If `a` is set, it must also be
255
+ * // non-empty; whereas if `b` is set, it can still be an empty string.
256
+ * option (buf.validate.oneof).required = true;
257
+ * string a = 1 [(buf.validate.field).string.min_len = 1];
258
+ * string b = 2;
259
+ * }
260
+ * }
261
+ * ```
262
+ */
263
+ required?: boolean | undefined;
264
+ }
265
+ /**
266
+ * FieldRules encapsulates the rules for each type of field. Depending on
267
+ * the field, the correct set should be used to ensure proper validations.
268
+ */
269
+ export interface FieldRules {
270
+ /**
271
+ * `cel_expression` is a repeated field CEL expressions. Each expression specifies a validation
272
+ * rule to be applied to this message. These rules are written in Common Expression Language (CEL) syntax.
273
+ *
274
+ * This is a simplified form of the `cel` Rule field, where only `expression` is set. This allows for
275
+ * simpler syntax when defining CEL Rules where `id` and `message` derived from the `expression`. `id` will
276
+ * be same as the `expression`.
277
+ *
278
+ * For more information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
279
+ *
280
+ * ```proto
281
+ * message MyMessage {
282
+ * // The field `value` must be greater than 42.
283
+ * optional int32 value = 1 [(buf.validate.field).cel_expression = "this > 42"];
284
+ * }
285
+ * ```
286
+ */
287
+ celExpression: string[];
288
+ /**
289
+ * `cel` is a repeated field used to represent a textual expression
290
+ * in the Common Expression Language (CEL) syntax. For more information,
291
+ * [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
292
+ *
293
+ * ```proto
294
+ * message MyMessage {
295
+ * // The field `value` must be greater than 42.
296
+ * optional int32 value = 1 [(buf.validate.field).cel = {
297
+ * id: "my_message.value",
298
+ * message: "value must be greater than 42",
299
+ * expression: "this > 42",
300
+ * }];
301
+ * }
302
+ * ```
303
+ */
304
+ cel: Rule[];
305
+ /**
306
+ * If `required` is true, the field must be set. A validation error is returned
307
+ * if the field is not set.
308
+ *
309
+ * ```proto
310
+ * syntax="proto3";
311
+ *
312
+ * message FieldsWithPresence {
313
+ * // Requires any string to be set, including the empty string.
314
+ * optional string link = 1 [
315
+ * (buf.validate.field).required = true
316
+ * ];
317
+ * // Requires true or false to be set.
318
+ * optional bool disabled = 2 [
319
+ * (buf.validate.field).required = true
320
+ * ];
321
+ * // Requires a message to be set, including the empty message.
322
+ * SomeMessage msg = 4 [
323
+ * (buf.validate.field).required = true
324
+ * ];
325
+ * }
326
+ * ```
327
+ *
328
+ * All fields in the example above track presence. By default, Protovalidate
329
+ * ignores rules on those fields if no value is set. `required` ensures that
330
+ * the fields are set and valid.
331
+ *
332
+ * Fields that don't track presence are always validated by Protovalidate,
333
+ * whether they are set or not. It is not necessary to add `required`. It
334
+ * can be added to indicate that the field cannot be the zero value.
335
+ *
336
+ * ```proto
337
+ * syntax="proto3";
338
+ *
339
+ * message FieldsWithoutPresence {
340
+ * // `string.email` always applies, even to an empty string.
341
+ * string link = 1 [
342
+ * (buf.validate.field).string.email = true
343
+ * ];
344
+ * // `repeated.min_items` always applies, even to an empty list.
345
+ * repeated string labels = 2 [
346
+ * (buf.validate.field).repeated.min_items = 1
347
+ * ];
348
+ * // `required`, for fields that don't track presence, indicates
349
+ * // the value of the field can't be the zero value.
350
+ * int32 zero_value_not_allowed = 3 [
351
+ * (buf.validate.field).required = true
352
+ * ];
353
+ * }
354
+ * ```
355
+ *
356
+ * To learn which fields track presence, see the
357
+ * [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).
358
+ *
359
+ * Note: While field rules can be applied to repeated items, map keys, and map
360
+ * values, the elements are always considered to be set. Consequently,
361
+ * specifying `repeated.items.required` is redundant.
362
+ */
363
+ required?: boolean | undefined;
364
+ /**
365
+ * Ignore validation rules on the field if its value matches the specified
366
+ * criteria. See the `Ignore` enum for details.
367
+ *
368
+ * ```proto
369
+ * message UpdateRequest {
370
+ * // The uri rule only applies if the field is not an empty string.
371
+ * string url = 1 [
372
+ * (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,
373
+ * (buf.validate.field).string.uri = true
374
+ * ];
375
+ * }
376
+ * ```
377
+ */
378
+ ignore?: Ignore | undefined;
379
+ /** Scalar Field Types */
380
+ float?: FloatRules | undefined;
381
+ double?: DoubleRules | undefined;
382
+ int32?: Int32Rules | undefined;
383
+ int64?: Int64Rules | undefined;
384
+ uint32?: UInt32Rules | undefined;
385
+ uint64?: UInt64Rules | undefined;
386
+ sint32?: SInt32Rules | undefined;
387
+ sint64?: SInt64Rules | undefined;
388
+ fixed32?: Fixed32Rules | undefined;
389
+ fixed64?: Fixed64Rules | undefined;
390
+ sfixed32?: SFixed32Rules | undefined;
391
+ sfixed64?: SFixed64Rules | undefined;
392
+ bool?: BoolRules | undefined;
393
+ string?: StringRules | undefined;
394
+ bytes?: BytesRules | undefined;
395
+ /** Complex Field Types */
396
+ enum?: EnumRules | undefined;
397
+ repeated?: RepeatedRules | undefined;
398
+ map?: MapRules | undefined;
399
+ /** Well-Known Field Types */
400
+ any?: AnyRules | undefined;
401
+ duration?: DurationRules | undefined;
402
+ fieldMask?: FieldMaskRules | undefined;
403
+ timestamp?: TimestampRules | undefined;
404
+ }
405
+ /**
406
+ * PredefinedRules are custom rules that can be re-used with
407
+ * multiple fields.
408
+ */
409
+ export interface PredefinedRules {
410
+ /**
411
+ * `cel` is a repeated field used to represent a textual expression
412
+ * in the Common Expression Language (CEL) syntax. For more information,
413
+ * [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).
414
+ *
415
+ * ```proto
416
+ * message MyMessage {
417
+ * // The field `value` must be greater than 42.
418
+ * optional int32 value = 1 [(buf.validate.predefined).cel = {
419
+ * id: "my_message.value",
420
+ * message: "value must be greater than 42",
421
+ * expression: "this > 42",
422
+ * }];
423
+ * }
424
+ * ```
425
+ */
426
+ cel: Rule[];
427
+ }
428
+ /**
429
+ * FloatRules describes the rules applied to `float` values. These
430
+ * rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.
431
+ */
432
+ export interface FloatRules {
433
+ /**
434
+ * `const` requires the field value to exactly match the specified value. If
435
+ * the field value doesn't match, an error message is generated.
436
+ *
437
+ * ```proto
438
+ * message MyFloat {
439
+ * // value must equal 42.0
440
+ * float value = 1 [(buf.validate.field).float.const = 42.0];
441
+ * }
442
+ * ```
443
+ */
444
+ const?: number | undefined;
445
+ /**
446
+ * `lt` requires the field value to be less than the specified value (field <
447
+ * value). If the field value is equal to or greater than the specified value,
448
+ * an error message is generated.
449
+ *
450
+ * ```proto
451
+ * message MyFloat {
452
+ * // value must be less than 10.0
453
+ * float value = 1 [(buf.validate.field).float.lt = 10.0];
454
+ * }
455
+ * ```
456
+ */
457
+ lt?: number | undefined;
458
+ /**
459
+ * `lte` requires the field value to be less than or equal to the specified
460
+ * value (field <= value). If the field value is greater than the specified
461
+ * value, an error message is generated.
462
+ *
463
+ * ```proto
464
+ * message MyFloat {
465
+ * // value must be less than or equal to 10.0
466
+ * float value = 1 [(buf.validate.field).float.lte = 10.0];
467
+ * }
468
+ * ```
469
+ */
470
+ lte?: number | undefined;
471
+ /**
472
+ * `gt` requires the field value to be greater than the specified value
473
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
474
+ * `lte`, the range is reversed, and the field value must be outside the
475
+ * specified range. If the field value doesn't meet the required conditions,
476
+ * an error message is generated.
477
+ *
478
+ * ```proto
479
+ * message MyFloat {
480
+ * // value must be greater than 5.0 [float.gt]
481
+ * float value = 1 [(buf.validate.field).float.gt = 5.0];
482
+ *
483
+ * // value must be greater than 5 and less than 10.0 [float.gt_lt]
484
+ * float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];
485
+ *
486
+ * // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]
487
+ * float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];
488
+ * }
489
+ * ```
490
+ */
491
+ gt?: number | undefined;
492
+ /**
493
+ * `gte` requires the field value to be greater than or equal to the specified
494
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
495
+ * or `lte`, the range is reversed, and the field value must be outside the
496
+ * specified range. If the field value doesn't meet the required conditions,
497
+ * an error message is generated.
498
+ *
499
+ * ```proto
500
+ * message MyFloat {
501
+ * // value must be greater than or equal to 5.0 [float.gte]
502
+ * float value = 1 [(buf.validate.field).float.gte = 5.0];
503
+ *
504
+ * // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]
505
+ * float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];
506
+ *
507
+ * // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]
508
+ * float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];
509
+ * }
510
+ * ```
511
+ */
512
+ gte?: number | undefined;
513
+ /**
514
+ * `in` requires the field value to be equal to one of the specified values.
515
+ * If the field value isn't one of the specified values, an error message
516
+ * is generated.
517
+ *
518
+ * ```proto
519
+ * message MyFloat {
520
+ * // value must be in list [1.0, 2.0, 3.0]
521
+ * float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];
522
+ * }
523
+ * ```
524
+ */
525
+ in: number[];
526
+ /**
527
+ * `in` requires the field value to not be equal to any of the specified
528
+ * values. If the field value is one of the specified values, an error
529
+ * message is generated.
530
+ *
531
+ * ```proto
532
+ * message MyFloat {
533
+ * // value must not be in list [1.0, 2.0, 3.0]
534
+ * float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];
535
+ * }
536
+ * ```
537
+ */
538
+ notIn: number[];
539
+ /**
540
+ * `finite` requires the field value to be finite. If the field value is
541
+ * infinite or NaN, an error message is generated.
542
+ */
543
+ finite?: boolean | undefined;
544
+ /**
545
+ * `example` specifies values that the field may have. These values SHOULD
546
+ * conform to other rules. `example` values will not impact validation
547
+ * but may be used as helpful guidance on how to populate the given field.
548
+ *
549
+ * ```proto
550
+ * message MyFloat {
551
+ * float value = 1 [
552
+ * (buf.validate.field).float.example = 1.0,
553
+ * (buf.validate.field).float.example = inf
554
+ * ];
555
+ * }
556
+ * ```
557
+ */
558
+ example: number[];
559
+ }
560
+ /**
561
+ * DoubleRules describes the rules applied to `double` values. These
562
+ * rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.
563
+ */
564
+ export interface DoubleRules {
565
+ /**
566
+ * `const` requires the field value to exactly match the specified value. If
567
+ * the field value doesn't match, an error message is generated.
568
+ *
569
+ * ```proto
570
+ * message MyDouble {
571
+ * // value must equal 42.0
572
+ * double value = 1 [(buf.validate.field).double.const = 42.0];
573
+ * }
574
+ * ```
575
+ */
576
+ const?: number | undefined;
577
+ /**
578
+ * `lt` requires the field value to be less than the specified value (field <
579
+ * value). If the field value is equal to or greater than the specified
580
+ * value, an error message is generated.
581
+ *
582
+ * ```proto
583
+ * message MyDouble {
584
+ * // value must be less than 10.0
585
+ * double value = 1 [(buf.validate.field).double.lt = 10.0];
586
+ * }
587
+ * ```
588
+ */
589
+ lt?: number | undefined;
590
+ /**
591
+ * `lte` requires the field value to be less than or equal to the specified value
592
+ * (field <= value). If the field value is greater than the specified value,
593
+ * an error message is generated.
594
+ *
595
+ * ```proto
596
+ * message MyDouble {
597
+ * // value must be less than or equal to 10.0
598
+ * double value = 1 [(buf.validate.field).double.lte = 10.0];
599
+ * }
600
+ * ```
601
+ */
602
+ lte?: number | undefined;
603
+ /**
604
+ * `gt` requires the field value to be greater than the specified value
605
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,
606
+ * the range is reversed, and the field value must be outside the specified
607
+ * range. If the field value doesn't meet the required conditions, an error
608
+ * message is generated.
609
+ *
610
+ * ```proto
611
+ * message MyDouble {
612
+ * // value must be greater than 5.0 [double.gt]
613
+ * double value = 1 [(buf.validate.field).double.gt = 5.0];
614
+ *
615
+ * // value must be greater than 5 and less than 10.0 [double.gt_lt]
616
+ * double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];
617
+ *
618
+ * // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]
619
+ * double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];
620
+ * }
621
+ * ```
622
+ */
623
+ gt?: number | undefined;
624
+ /**
625
+ * `gte` requires the field value to be greater than or equal to the specified
626
+ * value (exclusive). If the value of `gte` is larger than a specified `lt` or
627
+ * `lte`, the range is reversed, and the field value must be outside the
628
+ * specified range. If the field value doesn't meet the required conditions,
629
+ * an error message is generated.
630
+ *
631
+ * ```proto
632
+ * message MyDouble {
633
+ * // value must be greater than or equal to 5.0 [double.gte]
634
+ * double value = 1 [(buf.validate.field).double.gte = 5.0];
635
+ *
636
+ * // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]
637
+ * double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];
638
+ *
639
+ * // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]
640
+ * double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];
641
+ * }
642
+ * ```
643
+ */
644
+ gte?: number | undefined;
645
+ /**
646
+ * `in` requires the field value to be equal to one of the specified values.
647
+ * If the field value isn't one of the specified values, an error message is
648
+ * generated.
649
+ *
650
+ * ```proto
651
+ * message MyDouble {
652
+ * // value must be in list [1.0, 2.0, 3.0]
653
+ * double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];
654
+ * }
655
+ * ```
656
+ */
657
+ in: number[];
658
+ /**
659
+ * `not_in` requires the field value to not be equal to any of the specified
660
+ * values. If the field value is one of the specified values, an error
661
+ * message is generated.
662
+ *
663
+ * ```proto
664
+ * message MyDouble {
665
+ * // value must not be in list [1.0, 2.0, 3.0]
666
+ * double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];
667
+ * }
668
+ * ```
669
+ */
670
+ notIn: number[];
671
+ /**
672
+ * `finite` requires the field value to be finite. If the field value is
673
+ * infinite or NaN, an error message is generated.
674
+ */
675
+ finite?: boolean | undefined;
676
+ /**
677
+ * `example` specifies values that the field may have. These values SHOULD
678
+ * conform to other rules. `example` values will not impact validation
679
+ * but may be used as helpful guidance on how to populate the given field.
680
+ *
681
+ * ```proto
682
+ * message MyDouble {
683
+ * double value = 1 [
684
+ * (buf.validate.field).double.example = 1.0,
685
+ * (buf.validate.field).double.example = inf
686
+ * ];
687
+ * }
688
+ * ```
689
+ */
690
+ example: number[];
691
+ }
692
+ /**
693
+ * Int32Rules describes the rules applied to `int32` values. These
694
+ * rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.
695
+ */
696
+ export interface Int32Rules {
697
+ /**
698
+ * `const` requires the field value to exactly match the specified value. If
699
+ * the field value doesn't match, an error message is generated.
700
+ *
701
+ * ```proto
702
+ * message MyInt32 {
703
+ * // value must equal 42
704
+ * int32 value = 1 [(buf.validate.field).int32.const = 42];
705
+ * }
706
+ * ```
707
+ */
708
+ const?: number | undefined;
709
+ /**
710
+ * `lt` requires the field value to be less than the specified value (field
711
+ * < value). If the field value is equal to or greater than the specified
712
+ * value, an error message is generated.
713
+ *
714
+ * ```proto
715
+ * message MyInt32 {
716
+ * // value must be less than 10
717
+ * int32 value = 1 [(buf.validate.field).int32.lt = 10];
718
+ * }
719
+ * ```
720
+ */
721
+ lt?: number | undefined;
722
+ /**
723
+ * `lte` requires the field value to be less than or equal to the specified
724
+ * value (field <= value). If the field value is greater than the specified
725
+ * value, an error message is generated.
726
+ *
727
+ * ```proto
728
+ * message MyInt32 {
729
+ * // value must be less than or equal to 10
730
+ * int32 value = 1 [(buf.validate.field).int32.lte = 10];
731
+ * }
732
+ * ```
733
+ */
734
+ lte?: number | undefined;
735
+ /**
736
+ * `gt` requires the field value to be greater than the specified value
737
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
738
+ * `lte`, the range is reversed, and the field value must be outside the
739
+ * specified range. If the field value doesn't meet the required conditions,
740
+ * an error message is generated.
741
+ *
742
+ * ```proto
743
+ * message MyInt32 {
744
+ * // value must be greater than 5 [int32.gt]
745
+ * int32 value = 1 [(buf.validate.field).int32.gt = 5];
746
+ *
747
+ * // value must be greater than 5 and less than 10 [int32.gt_lt]
748
+ * int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];
749
+ *
750
+ * // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]
751
+ * int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];
752
+ * }
753
+ * ```
754
+ */
755
+ gt?: number | undefined;
756
+ /**
757
+ * `gte` requires the field value to be greater than or equal to the specified value
758
+ * (exclusive). If the value of `gte` is larger than a specified `lt` or
759
+ * `lte`, the range is reversed, and the field value must be outside the
760
+ * specified range. If the field value doesn't meet the required conditions,
761
+ * an error message is generated.
762
+ *
763
+ * ```proto
764
+ * message MyInt32 {
765
+ * // value must be greater than or equal to 5 [int32.gte]
766
+ * int32 value = 1 [(buf.validate.field).int32.gte = 5];
767
+ *
768
+ * // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]
769
+ * int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];
770
+ *
771
+ * // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]
772
+ * int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];
773
+ * }
774
+ * ```
775
+ */
776
+ gte?: number | undefined;
777
+ /**
778
+ * `in` requires the field value to be equal to one of the specified values.
779
+ * If the field value isn't one of the specified values, an error message is
780
+ * generated.
781
+ *
782
+ * ```proto
783
+ * message MyInt32 {
784
+ * // value must be in list [1, 2, 3]
785
+ * int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];
786
+ * }
787
+ * ```
788
+ */
789
+ in: number[];
790
+ /**
791
+ * `not_in` requires the field value to not be equal to any of the specified
792
+ * values. If the field value is one of the specified values, an error message
793
+ * is generated.
794
+ *
795
+ * ```proto
796
+ * message MyInt32 {
797
+ * // value must not be in list [1, 2, 3]
798
+ * int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];
799
+ * }
800
+ * ```
801
+ */
802
+ notIn: number[];
803
+ /**
804
+ * `example` specifies values that the field may have. These values SHOULD
805
+ * conform to other rules. `example` values will not impact validation
806
+ * but may be used as helpful guidance on how to populate the given field.
807
+ *
808
+ * ```proto
809
+ * message MyInt32 {
810
+ * int32 value = 1 [
811
+ * (buf.validate.field).int32.example = 1,
812
+ * (buf.validate.field).int32.example = -10
813
+ * ];
814
+ * }
815
+ * ```
816
+ */
817
+ example: number[];
818
+ }
819
+ /**
820
+ * Int64Rules describes the rules applied to `int64` values. These
821
+ * rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
822
+ */
823
+ export interface Int64Rules {
824
+ /**
825
+ * `const` requires the field value to exactly match the specified value. If
826
+ * the field value doesn't match, an error message is generated.
827
+ *
828
+ * ```proto
829
+ * message MyInt64 {
830
+ * // value must equal 42
831
+ * int64 value = 1 [(buf.validate.field).int64.const = 42];
832
+ * }
833
+ * ```
834
+ */
835
+ const?: Long | undefined;
836
+ /**
837
+ * `lt` requires the field value to be less than the specified value (field <
838
+ * value). If the field value is equal to or greater than the specified value,
839
+ * an error message is generated.
840
+ *
841
+ * ```proto
842
+ * message MyInt64 {
843
+ * // value must be less than 10
844
+ * int64 value = 1 [(buf.validate.field).int64.lt = 10];
845
+ * }
846
+ * ```
847
+ */
848
+ lt?: Long | undefined;
849
+ /**
850
+ * `lte` requires the field value to be less than or equal to the specified
851
+ * value (field <= value). If the field value is greater than the specified
852
+ * value, an error message is generated.
853
+ *
854
+ * ```proto
855
+ * message MyInt64 {
856
+ * // value must be less than or equal to 10
857
+ * int64 value = 1 [(buf.validate.field).int64.lte = 10];
858
+ * }
859
+ * ```
860
+ */
861
+ lte?: Long | undefined;
862
+ /**
863
+ * `gt` requires the field value to be greater than the specified value
864
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
865
+ * `lte`, the range is reversed, and the field value must be outside the
866
+ * specified range. If the field value doesn't meet the required conditions,
867
+ * an error message is generated.
868
+ *
869
+ * ```proto
870
+ * message MyInt64 {
871
+ * // value must be greater than 5 [int64.gt]
872
+ * int64 value = 1 [(buf.validate.field).int64.gt = 5];
873
+ *
874
+ * // value must be greater than 5 and less than 10 [int64.gt_lt]
875
+ * int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];
876
+ *
877
+ * // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]
878
+ * int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];
879
+ * }
880
+ * ```
881
+ */
882
+ gt?: Long | undefined;
883
+ /**
884
+ * `gte` requires the field value to be greater than or equal to the specified
885
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
886
+ * or `lte`, the range is reversed, and the field value must be outside the
887
+ * specified range. If the field value doesn't meet the required conditions,
888
+ * an error message is generated.
889
+ *
890
+ * ```proto
891
+ * message MyInt64 {
892
+ * // value must be greater than or equal to 5 [int64.gte]
893
+ * int64 value = 1 [(buf.validate.field).int64.gte = 5];
894
+ *
895
+ * // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]
896
+ * int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];
897
+ *
898
+ * // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]
899
+ * int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];
900
+ * }
901
+ * ```
902
+ */
903
+ gte?: Long | undefined;
904
+ /**
905
+ * `in` requires the field value to be equal to one of the specified values.
906
+ * If the field value isn't one of the specified values, an error message is
907
+ * generated.
908
+ *
909
+ * ```proto
910
+ * message MyInt64 {
911
+ * // value must be in list [1, 2, 3]
912
+ * int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];
913
+ * }
914
+ * ```
915
+ */
916
+ in: Long[];
917
+ /**
918
+ * `not_in` requires the field value to not be equal to any of the specified
919
+ * values. If the field value is one of the specified values, an error
920
+ * message is generated.
921
+ *
922
+ * ```proto
923
+ * message MyInt64 {
924
+ * // value must not be in list [1, 2, 3]
925
+ * int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];
926
+ * }
927
+ * ```
928
+ */
929
+ notIn: Long[];
930
+ /**
931
+ * `example` specifies values that the field may have. These values SHOULD
932
+ * conform to other rules. `example` values will not impact validation
933
+ * but may be used as helpful guidance on how to populate the given field.
934
+ *
935
+ * ```proto
936
+ * message MyInt64 {
937
+ * int64 value = 1 [
938
+ * (buf.validate.field).int64.example = 1,
939
+ * (buf.validate.field).int64.example = -10
940
+ * ];
941
+ * }
942
+ * ```
943
+ */
944
+ example: Long[];
945
+ }
946
+ /**
947
+ * UInt32Rules describes the rules applied to `uint32` values. These
948
+ * rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.
949
+ */
950
+ export interface UInt32Rules {
951
+ /**
952
+ * `const` requires the field value to exactly match the specified value. If
953
+ * the field value doesn't match, an error message is generated.
954
+ *
955
+ * ```proto
956
+ * message MyUInt32 {
957
+ * // value must equal 42
958
+ * uint32 value = 1 [(buf.validate.field).uint32.const = 42];
959
+ * }
960
+ * ```
961
+ */
962
+ const?: number | undefined;
963
+ /**
964
+ * `lt` requires the field value to be less than the specified value (field <
965
+ * value). If the field value is equal to or greater than the specified value,
966
+ * an error message is generated.
967
+ *
968
+ * ```proto
969
+ * message MyUInt32 {
970
+ * // value must be less than 10
971
+ * uint32 value = 1 [(buf.validate.field).uint32.lt = 10];
972
+ * }
973
+ * ```
974
+ */
975
+ lt?: number | undefined;
976
+ /**
977
+ * `lte` requires the field value to be less than or equal to the specified
978
+ * value (field <= value). If the field value is greater than the specified
979
+ * value, an error message is generated.
980
+ *
981
+ * ```proto
982
+ * message MyUInt32 {
983
+ * // value must be less than or equal to 10
984
+ * uint32 value = 1 [(buf.validate.field).uint32.lte = 10];
985
+ * }
986
+ * ```
987
+ */
988
+ lte?: number | undefined;
989
+ /**
990
+ * `gt` requires the field value to be greater than the specified value
991
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
992
+ * `lte`, the range is reversed, and the field value must be outside the
993
+ * specified range. If the field value doesn't meet the required conditions,
994
+ * an error message is generated.
995
+ *
996
+ * ```proto
997
+ * message MyUInt32 {
998
+ * // value must be greater than 5 [uint32.gt]
999
+ * uint32 value = 1 [(buf.validate.field).uint32.gt = 5];
1000
+ *
1001
+ * // value must be greater than 5 and less than 10 [uint32.gt_lt]
1002
+ * uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];
1003
+ *
1004
+ * // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]
1005
+ * uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];
1006
+ * }
1007
+ * ```
1008
+ */
1009
+ gt?: number | undefined;
1010
+ /**
1011
+ * `gte` requires the field value to be greater than or equal to the specified
1012
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1013
+ * or `lte`, the range is reversed, and the field value must be outside the
1014
+ * specified range. If the field value doesn't meet the required conditions,
1015
+ * an error message is generated.
1016
+ *
1017
+ * ```proto
1018
+ * message MyUInt32 {
1019
+ * // value must be greater than or equal to 5 [uint32.gte]
1020
+ * uint32 value = 1 [(buf.validate.field).uint32.gte = 5];
1021
+ *
1022
+ * // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]
1023
+ * uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];
1024
+ *
1025
+ * // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]
1026
+ * uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];
1027
+ * }
1028
+ * ```
1029
+ */
1030
+ gte?: number | undefined;
1031
+ /**
1032
+ * `in` requires the field value to be equal to one of the specified values.
1033
+ * If the field value isn't one of the specified values, an error message is
1034
+ * generated.
1035
+ *
1036
+ * ```proto
1037
+ * message MyUInt32 {
1038
+ * // value must be in list [1, 2, 3]
1039
+ * uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];
1040
+ * }
1041
+ * ```
1042
+ */
1043
+ in: number[];
1044
+ /**
1045
+ * `not_in` requires the field value to not be equal to any of the specified
1046
+ * values. If the field value is one of the specified values, an error
1047
+ * message is generated.
1048
+ *
1049
+ * ```proto
1050
+ * message MyUInt32 {
1051
+ * // value must not be in list [1, 2, 3]
1052
+ * uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];
1053
+ * }
1054
+ * ```
1055
+ */
1056
+ notIn: number[];
1057
+ /**
1058
+ * `example` specifies values that the field may have. These values SHOULD
1059
+ * conform to other rules. `example` values will not impact validation
1060
+ * but may be used as helpful guidance on how to populate the given field.
1061
+ *
1062
+ * ```proto
1063
+ * message MyUInt32 {
1064
+ * uint32 value = 1 [
1065
+ * (buf.validate.field).uint32.example = 1,
1066
+ * (buf.validate.field).uint32.example = 10
1067
+ * ];
1068
+ * }
1069
+ * ```
1070
+ */
1071
+ example: number[];
1072
+ }
1073
+ /**
1074
+ * UInt64Rules describes the rules applied to `uint64` values. These
1075
+ * rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
1076
+ */
1077
+ export interface UInt64Rules {
1078
+ /**
1079
+ * `const` requires the field value to exactly match the specified value. If
1080
+ * the field value doesn't match, an error message is generated.
1081
+ *
1082
+ * ```proto
1083
+ * message MyUInt64 {
1084
+ * // value must equal 42
1085
+ * uint64 value = 1 [(buf.validate.field).uint64.const = 42];
1086
+ * }
1087
+ * ```
1088
+ */
1089
+ const?: Long | undefined;
1090
+ /**
1091
+ * `lt` requires the field value to be less than the specified value (field <
1092
+ * value). If the field value is equal to or greater than the specified value,
1093
+ * an error message is generated.
1094
+ *
1095
+ * ```proto
1096
+ * message MyUInt64 {
1097
+ * // value must be less than 10
1098
+ * uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
1099
+ * }
1100
+ * ```
1101
+ */
1102
+ lt?: Long | undefined;
1103
+ /**
1104
+ * `lte` requires the field value to be less than or equal to the specified
1105
+ * value (field <= value). If the field value is greater than the specified
1106
+ * value, an error message is generated.
1107
+ *
1108
+ * ```proto
1109
+ * message MyUInt64 {
1110
+ * // value must be less than or equal to 10
1111
+ * uint64 value = 1 [(buf.validate.field).uint64.lte = 10];
1112
+ * }
1113
+ * ```
1114
+ */
1115
+ lte?: Long | undefined;
1116
+ /**
1117
+ * `gt` requires the field value to be greater than the specified value
1118
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1119
+ * `lte`, the range is reversed, and the field value must be outside the
1120
+ * specified range. If the field value doesn't meet the required conditions,
1121
+ * an error message is generated.
1122
+ *
1123
+ * ```proto
1124
+ * message MyUInt64 {
1125
+ * // value must be greater than 5 [uint64.gt]
1126
+ * uint64 value = 1 [(buf.validate.field).uint64.gt = 5];
1127
+ *
1128
+ * // value must be greater than 5 and less than 10 [uint64.gt_lt]
1129
+ * uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];
1130
+ *
1131
+ * // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]
1132
+ * uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];
1133
+ * }
1134
+ * ```
1135
+ */
1136
+ gt?: Long | undefined;
1137
+ /**
1138
+ * `gte` requires the field value to be greater than or equal to the specified
1139
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1140
+ * or `lte`, the range is reversed, and the field value must be outside the
1141
+ * specified range. If the field value doesn't meet the required conditions,
1142
+ * an error message is generated.
1143
+ *
1144
+ * ```proto
1145
+ * message MyUInt64 {
1146
+ * // value must be greater than or equal to 5 [uint64.gte]
1147
+ * uint64 value = 1 [(buf.validate.field).uint64.gte = 5];
1148
+ *
1149
+ * // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]
1150
+ * uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];
1151
+ *
1152
+ * // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]
1153
+ * uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];
1154
+ * }
1155
+ * ```
1156
+ */
1157
+ gte?: Long | undefined;
1158
+ /**
1159
+ * `in` requires the field value to be equal to one of the specified values.
1160
+ * If the field value isn't one of the specified values, an error message is
1161
+ * generated.
1162
+ *
1163
+ * ```proto
1164
+ * message MyUInt64 {
1165
+ * // value must be in list [1, 2, 3]
1166
+ * uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];
1167
+ * }
1168
+ * ```
1169
+ */
1170
+ in: Long[];
1171
+ /**
1172
+ * `not_in` requires the field value to not be equal to any of the specified
1173
+ * values. If the field value is one of the specified values, an error
1174
+ * message is generated.
1175
+ *
1176
+ * ```proto
1177
+ * message MyUInt64 {
1178
+ * // value must not be in list [1, 2, 3]
1179
+ * uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];
1180
+ * }
1181
+ * ```
1182
+ */
1183
+ notIn: Long[];
1184
+ /**
1185
+ * `example` specifies values that the field may have. These values SHOULD
1186
+ * conform to other rules. `example` values will not impact validation
1187
+ * but may be used as helpful guidance on how to populate the given field.
1188
+ *
1189
+ * ```proto
1190
+ * message MyUInt64 {
1191
+ * uint64 value = 1 [
1192
+ * (buf.validate.field).uint64.example = 1,
1193
+ * (buf.validate.field).uint64.example = -10
1194
+ * ];
1195
+ * }
1196
+ * ```
1197
+ */
1198
+ example: Long[];
1199
+ }
1200
+ /** SInt32Rules describes the rules applied to `sint32` values. */
1201
+ export interface SInt32Rules {
1202
+ /**
1203
+ * `const` requires the field value to exactly match the specified value. If
1204
+ * the field value doesn't match, an error message is generated.
1205
+ *
1206
+ * ```proto
1207
+ * message MySInt32 {
1208
+ * // value must equal 42
1209
+ * sint32 value = 1 [(buf.validate.field).sint32.const = 42];
1210
+ * }
1211
+ * ```
1212
+ */
1213
+ const?: number | undefined;
1214
+ /**
1215
+ * `lt` requires the field value to be less than the specified value (field
1216
+ * < value). If the field value is equal to or greater than the specified
1217
+ * value, an error message is generated.
1218
+ *
1219
+ * ```proto
1220
+ * message MySInt32 {
1221
+ * // value must be less than 10
1222
+ * sint32 value = 1 [(buf.validate.field).sint32.lt = 10];
1223
+ * }
1224
+ * ```
1225
+ */
1226
+ lt?: number | undefined;
1227
+ /**
1228
+ * `lte` requires the field value to be less than or equal to the specified
1229
+ * value (field <= value). If the field value is greater than the specified
1230
+ * value, an error message is generated.
1231
+ *
1232
+ * ```proto
1233
+ * message MySInt32 {
1234
+ * // value must be less than or equal to 10
1235
+ * sint32 value = 1 [(buf.validate.field).sint32.lte = 10];
1236
+ * }
1237
+ * ```
1238
+ */
1239
+ lte?: number | undefined;
1240
+ /**
1241
+ * `gt` requires the field value to be greater than the specified value
1242
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1243
+ * `lte`, the range is reversed, and the field value must be outside the
1244
+ * specified range. If the field value doesn't meet the required conditions,
1245
+ * an error message is generated.
1246
+ *
1247
+ * ```proto
1248
+ * message MySInt32 {
1249
+ * // value must be greater than 5 [sint32.gt]
1250
+ * sint32 value = 1 [(buf.validate.field).sint32.gt = 5];
1251
+ *
1252
+ * // value must be greater than 5 and less than 10 [sint32.gt_lt]
1253
+ * sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];
1254
+ *
1255
+ * // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]
1256
+ * sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];
1257
+ * }
1258
+ * ```
1259
+ */
1260
+ gt?: number | undefined;
1261
+ /**
1262
+ * `gte` requires the field value to be greater than or equal to the specified
1263
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1264
+ * or `lte`, the range is reversed, and the field value must be outside the
1265
+ * specified range. If the field value doesn't meet the required conditions,
1266
+ * an error message is generated.
1267
+ *
1268
+ * ```proto
1269
+ * message MySInt32 {
1270
+ * // value must be greater than or equal to 5 [sint32.gte]
1271
+ * sint32 value = 1 [(buf.validate.field).sint32.gte = 5];
1272
+ *
1273
+ * // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]
1274
+ * sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];
1275
+ *
1276
+ * // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]
1277
+ * sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];
1278
+ * }
1279
+ * ```
1280
+ */
1281
+ gte?: number | undefined;
1282
+ /**
1283
+ * `in` requires the field value to be equal to one of the specified values.
1284
+ * If the field value isn't one of the specified values, an error message is
1285
+ * generated.
1286
+ *
1287
+ * ```proto
1288
+ * message MySInt32 {
1289
+ * // value must be in list [1, 2, 3]
1290
+ * sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];
1291
+ * }
1292
+ * ```
1293
+ */
1294
+ in: number[];
1295
+ /**
1296
+ * `not_in` requires the field value to not be equal to any of the specified
1297
+ * values. If the field value is one of the specified values, an error
1298
+ * message is generated.
1299
+ *
1300
+ * ```proto
1301
+ * message MySInt32 {
1302
+ * // value must not be in list [1, 2, 3]
1303
+ * sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];
1304
+ * }
1305
+ * ```
1306
+ */
1307
+ notIn: number[];
1308
+ /**
1309
+ * `example` specifies values that the field may have. These values SHOULD
1310
+ * conform to other rules. `example` values will not impact validation
1311
+ * but may be used as helpful guidance on how to populate the given field.
1312
+ *
1313
+ * ```proto
1314
+ * message MySInt32 {
1315
+ * sint32 value = 1 [
1316
+ * (buf.validate.field).sint32.example = 1,
1317
+ * (buf.validate.field).sint32.example = -10
1318
+ * ];
1319
+ * }
1320
+ * ```
1321
+ */
1322
+ example: number[];
1323
+ }
1324
+ /** SInt64Rules describes the rules applied to `sint64` values. */
1325
+ export interface SInt64Rules {
1326
+ /**
1327
+ * `const` requires the field value to exactly match the specified value. If
1328
+ * the field value doesn't match, an error message is generated.
1329
+ *
1330
+ * ```proto
1331
+ * message MySInt64 {
1332
+ * // value must equal 42
1333
+ * sint64 value = 1 [(buf.validate.field).sint64.const = 42];
1334
+ * }
1335
+ * ```
1336
+ */
1337
+ const?: Long | undefined;
1338
+ /**
1339
+ * `lt` requires the field value to be less than the specified value (field
1340
+ * < value). If the field value is equal to or greater than the specified
1341
+ * value, an error message is generated.
1342
+ *
1343
+ * ```proto
1344
+ * message MySInt64 {
1345
+ * // value must be less than 10
1346
+ * sint64 value = 1 [(buf.validate.field).sint64.lt = 10];
1347
+ * }
1348
+ * ```
1349
+ */
1350
+ lt?: Long | undefined;
1351
+ /**
1352
+ * `lte` requires the field value to be less than or equal to the specified
1353
+ * value (field <= value). If the field value is greater than the specified
1354
+ * value, an error message is generated.
1355
+ *
1356
+ * ```proto
1357
+ * message MySInt64 {
1358
+ * // value must be less than or equal to 10
1359
+ * sint64 value = 1 [(buf.validate.field).sint64.lte = 10];
1360
+ * }
1361
+ * ```
1362
+ */
1363
+ lte?: Long | undefined;
1364
+ /**
1365
+ * `gt` requires the field value to be greater than the specified value
1366
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1367
+ * `lte`, the range is reversed, and the field value must be outside the
1368
+ * specified range. If the field value doesn't meet the required conditions,
1369
+ * an error message is generated.
1370
+ *
1371
+ * ```proto
1372
+ * message MySInt64 {
1373
+ * // value must be greater than 5 [sint64.gt]
1374
+ * sint64 value = 1 [(buf.validate.field).sint64.gt = 5];
1375
+ *
1376
+ * // value must be greater than 5 and less than 10 [sint64.gt_lt]
1377
+ * sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];
1378
+ *
1379
+ * // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]
1380
+ * sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];
1381
+ * }
1382
+ * ```
1383
+ */
1384
+ gt?: Long | undefined;
1385
+ /**
1386
+ * `gte` requires the field value to be greater than or equal to the specified
1387
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1388
+ * or `lte`, the range is reversed, and the field value must be outside the
1389
+ * specified range. If the field value doesn't meet the required conditions,
1390
+ * an error message is generated.
1391
+ *
1392
+ * ```proto
1393
+ * message MySInt64 {
1394
+ * // value must be greater than or equal to 5 [sint64.gte]
1395
+ * sint64 value = 1 [(buf.validate.field).sint64.gte = 5];
1396
+ *
1397
+ * // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]
1398
+ * sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];
1399
+ *
1400
+ * // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]
1401
+ * sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];
1402
+ * }
1403
+ * ```
1404
+ */
1405
+ gte?: Long | undefined;
1406
+ /**
1407
+ * `in` requires the field value to be equal to one of the specified values.
1408
+ * If the field value isn't one of the specified values, an error message
1409
+ * is generated.
1410
+ *
1411
+ * ```proto
1412
+ * message MySInt64 {
1413
+ * // value must be in list [1, 2, 3]
1414
+ * sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];
1415
+ * }
1416
+ * ```
1417
+ */
1418
+ in: Long[];
1419
+ /**
1420
+ * `not_in` requires the field value to not be equal to any of the specified
1421
+ * values. If the field value is one of the specified values, an error
1422
+ * message is generated.
1423
+ *
1424
+ * ```proto
1425
+ * message MySInt64 {
1426
+ * // value must not be in list [1, 2, 3]
1427
+ * sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];
1428
+ * }
1429
+ * ```
1430
+ */
1431
+ notIn: Long[];
1432
+ /**
1433
+ * `example` specifies values that the field may have. These values SHOULD
1434
+ * conform to other rules. `example` values will not impact validation
1435
+ * but may be used as helpful guidance on how to populate the given field.
1436
+ *
1437
+ * ```proto
1438
+ * message MySInt64 {
1439
+ * sint64 value = 1 [
1440
+ * (buf.validate.field).sint64.example = 1,
1441
+ * (buf.validate.field).sint64.example = -10
1442
+ * ];
1443
+ * }
1444
+ * ```
1445
+ */
1446
+ example: Long[];
1447
+ }
1448
+ /** Fixed32Rules describes the rules applied to `fixed32` values. */
1449
+ export interface Fixed32Rules {
1450
+ /**
1451
+ * `const` requires the field value to exactly match the specified value.
1452
+ * If the field value doesn't match, an error message is generated.
1453
+ *
1454
+ * ```proto
1455
+ * message MyFixed32 {
1456
+ * // value must equal 42
1457
+ * fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];
1458
+ * }
1459
+ * ```
1460
+ */
1461
+ const?: number | undefined;
1462
+ /**
1463
+ * `lt` requires the field value to be less than the specified value (field <
1464
+ * value). If the field value is equal to or greater than the specified value,
1465
+ * an error message is generated.
1466
+ *
1467
+ * ```proto
1468
+ * message MyFixed32 {
1469
+ * // value must be less than 10
1470
+ * fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];
1471
+ * }
1472
+ * ```
1473
+ */
1474
+ lt?: number | undefined;
1475
+ /**
1476
+ * `lte` requires the field value to be less than or equal to the specified
1477
+ * value (field <= value). If the field value is greater than the specified
1478
+ * value, an error message is generated.
1479
+ *
1480
+ * ```proto
1481
+ * message MyFixed32 {
1482
+ * // value must be less than or equal to 10
1483
+ * fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];
1484
+ * }
1485
+ * ```
1486
+ */
1487
+ lte?: number | undefined;
1488
+ /**
1489
+ * `gt` requires the field value to be greater than the specified value
1490
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1491
+ * `lte`, the range is reversed, and the field value must be outside the
1492
+ * specified range. If the field value doesn't meet the required conditions,
1493
+ * an error message is generated.
1494
+ *
1495
+ * ```proto
1496
+ * message MyFixed32 {
1497
+ * // value must be greater than 5 [fixed32.gt]
1498
+ * fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];
1499
+ *
1500
+ * // value must be greater than 5 and less than 10 [fixed32.gt_lt]
1501
+ * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];
1502
+ *
1503
+ * // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]
1504
+ * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];
1505
+ * }
1506
+ * ```
1507
+ */
1508
+ gt?: number | undefined;
1509
+ /**
1510
+ * `gte` requires the field value to be greater than or equal to the specified
1511
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1512
+ * or `lte`, the range is reversed, and the field value must be outside the
1513
+ * specified range. If the field value doesn't meet the required conditions,
1514
+ * an error message is generated.
1515
+ *
1516
+ * ```proto
1517
+ * message MyFixed32 {
1518
+ * // value must be greater than or equal to 5 [fixed32.gte]
1519
+ * fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];
1520
+ *
1521
+ * // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]
1522
+ * fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];
1523
+ *
1524
+ * // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]
1525
+ * fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];
1526
+ * }
1527
+ * ```
1528
+ */
1529
+ gte?: number | undefined;
1530
+ /**
1531
+ * `in` requires the field value to be equal to one of the specified values.
1532
+ * If the field value isn't one of the specified values, an error message
1533
+ * is generated.
1534
+ *
1535
+ * ```proto
1536
+ * message MyFixed32 {
1537
+ * // value must be in list [1, 2, 3]
1538
+ * fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];
1539
+ * }
1540
+ * ```
1541
+ */
1542
+ in: number[];
1543
+ /**
1544
+ * `not_in` requires the field value to not be equal to any of the specified
1545
+ * values. If the field value is one of the specified values, an error
1546
+ * message is generated.
1547
+ *
1548
+ * ```proto
1549
+ * message MyFixed32 {
1550
+ * // value must not be in list [1, 2, 3]
1551
+ * fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];
1552
+ * }
1553
+ * ```
1554
+ */
1555
+ notIn: number[];
1556
+ /**
1557
+ * `example` specifies values that the field may have. These values SHOULD
1558
+ * conform to other rules. `example` values will not impact validation
1559
+ * but may be used as helpful guidance on how to populate the given field.
1560
+ *
1561
+ * ```proto
1562
+ * message MyFixed32 {
1563
+ * fixed32 value = 1 [
1564
+ * (buf.validate.field).fixed32.example = 1,
1565
+ * (buf.validate.field).fixed32.example = 2
1566
+ * ];
1567
+ * }
1568
+ * ```
1569
+ */
1570
+ example: number[];
1571
+ }
1572
+ /** Fixed64Rules describes the rules applied to `fixed64` values. */
1573
+ export interface Fixed64Rules {
1574
+ /**
1575
+ * `const` requires the field value to exactly match the specified value. If
1576
+ * the field value doesn't match, an error message is generated.
1577
+ *
1578
+ * ```proto
1579
+ * message MyFixed64 {
1580
+ * // value must equal 42
1581
+ * fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];
1582
+ * }
1583
+ * ```
1584
+ */
1585
+ const?: Long | undefined;
1586
+ /**
1587
+ * `lt` requires the field value to be less than the specified value (field <
1588
+ * value). If the field value is equal to or greater than the specified value,
1589
+ * an error message is generated.
1590
+ *
1591
+ * ```proto
1592
+ * message MyFixed64 {
1593
+ * // value must be less than 10
1594
+ * fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];
1595
+ * }
1596
+ * ```
1597
+ */
1598
+ lt?: Long | undefined;
1599
+ /**
1600
+ * `lte` requires the field value to be less than or equal to the specified
1601
+ * value (field <= value). If the field value is greater than the specified
1602
+ * value, an error message is generated.
1603
+ *
1604
+ * ```proto
1605
+ * message MyFixed64 {
1606
+ * // value must be less than or equal to 10
1607
+ * fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];
1608
+ * }
1609
+ * ```
1610
+ */
1611
+ lte?: Long | undefined;
1612
+ /**
1613
+ * `gt` requires the field value to be greater than the specified value
1614
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1615
+ * `lte`, the range is reversed, and the field value must be outside the
1616
+ * specified range. If the field value doesn't meet the required conditions,
1617
+ * an error message is generated.
1618
+ *
1619
+ * ```proto
1620
+ * message MyFixed64 {
1621
+ * // value must be greater than 5 [fixed64.gt]
1622
+ * fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];
1623
+ *
1624
+ * // value must be greater than 5 and less than 10 [fixed64.gt_lt]
1625
+ * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];
1626
+ *
1627
+ * // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]
1628
+ * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];
1629
+ * }
1630
+ * ```
1631
+ */
1632
+ gt?: Long | undefined;
1633
+ /**
1634
+ * `gte` requires the field value to be greater than or equal to the specified
1635
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1636
+ * or `lte`, the range is reversed, and the field value must be outside the
1637
+ * specified range. If the field value doesn't meet the required conditions,
1638
+ * an error message is generated.
1639
+ *
1640
+ * ```proto
1641
+ * message MyFixed64 {
1642
+ * // value must be greater than or equal to 5 [fixed64.gte]
1643
+ * fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];
1644
+ *
1645
+ * // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]
1646
+ * fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];
1647
+ *
1648
+ * // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]
1649
+ * fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];
1650
+ * }
1651
+ * ```
1652
+ */
1653
+ gte?: Long | undefined;
1654
+ /**
1655
+ * `in` requires the field value to be equal to one of the specified values.
1656
+ * If the field value isn't one of the specified values, an error message is
1657
+ * generated.
1658
+ *
1659
+ * ```proto
1660
+ * message MyFixed64 {
1661
+ * // value must be in list [1, 2, 3]
1662
+ * fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];
1663
+ * }
1664
+ * ```
1665
+ */
1666
+ in: Long[];
1667
+ /**
1668
+ * `not_in` requires the field value to not be equal to any of the specified
1669
+ * values. If the field value is one of the specified values, an error
1670
+ * message is generated.
1671
+ *
1672
+ * ```proto
1673
+ * message MyFixed64 {
1674
+ * // value must not be in list [1, 2, 3]
1675
+ * fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];
1676
+ * }
1677
+ * ```
1678
+ */
1679
+ notIn: Long[];
1680
+ /**
1681
+ * `example` specifies values that the field may have. These values SHOULD
1682
+ * conform to other rules. `example` values will not impact validation
1683
+ * but may be used as helpful guidance on how to populate the given field.
1684
+ *
1685
+ * ```proto
1686
+ * message MyFixed64 {
1687
+ * fixed64 value = 1 [
1688
+ * (buf.validate.field).fixed64.example = 1,
1689
+ * (buf.validate.field).fixed64.example = 2
1690
+ * ];
1691
+ * }
1692
+ * ```
1693
+ */
1694
+ example: Long[];
1695
+ }
1696
+ /** SFixed32Rules describes the rules applied to `fixed32` values. */
1697
+ export interface SFixed32Rules {
1698
+ /**
1699
+ * `const` requires the field value to exactly match the specified value. If
1700
+ * the field value doesn't match, an error message is generated.
1701
+ *
1702
+ * ```proto
1703
+ * message MySFixed32 {
1704
+ * // value must equal 42
1705
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];
1706
+ * }
1707
+ * ```
1708
+ */
1709
+ const?: number | undefined;
1710
+ /**
1711
+ * `lt` requires the field value to be less than the specified value (field <
1712
+ * value). If the field value is equal to or greater than the specified value,
1713
+ * an error message is generated.
1714
+ *
1715
+ * ```proto
1716
+ * message MySFixed32 {
1717
+ * // value must be less than 10
1718
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];
1719
+ * }
1720
+ * ```
1721
+ */
1722
+ lt?: number | undefined;
1723
+ /**
1724
+ * `lte` requires the field value to be less than or equal to the specified
1725
+ * value (field <= value). If the field value is greater than the specified
1726
+ * value, an error message is generated.
1727
+ *
1728
+ * ```proto
1729
+ * message MySFixed32 {
1730
+ * // value must be less than or equal to 10
1731
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];
1732
+ * }
1733
+ * ```
1734
+ */
1735
+ lte?: number | undefined;
1736
+ /**
1737
+ * `gt` requires the field value to be greater than the specified value
1738
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1739
+ * `lte`, the range is reversed, and the field value must be outside the
1740
+ * specified range. If the field value doesn't meet the required conditions,
1741
+ * an error message is generated.
1742
+ *
1743
+ * ```proto
1744
+ * message MySFixed32 {
1745
+ * // value must be greater than 5 [sfixed32.gt]
1746
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];
1747
+ *
1748
+ * // value must be greater than 5 and less than 10 [sfixed32.gt_lt]
1749
+ * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];
1750
+ *
1751
+ * // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]
1752
+ * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];
1753
+ * }
1754
+ * ```
1755
+ */
1756
+ gt?: number | undefined;
1757
+ /**
1758
+ * `gte` requires the field value to be greater than or equal to the specified
1759
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1760
+ * or `lte`, the range is reversed, and the field value must be outside the
1761
+ * specified range. If the field value doesn't meet the required conditions,
1762
+ * an error message is generated.
1763
+ *
1764
+ * ```proto
1765
+ * message MySFixed32 {
1766
+ * // value must be greater than or equal to 5 [sfixed32.gte]
1767
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];
1768
+ *
1769
+ * // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]
1770
+ * sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];
1771
+ *
1772
+ * // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]
1773
+ * sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];
1774
+ * }
1775
+ * ```
1776
+ */
1777
+ gte?: number | undefined;
1778
+ /**
1779
+ * `in` requires the field value to be equal to one of the specified values.
1780
+ * If the field value isn't one of the specified values, an error message is
1781
+ * generated.
1782
+ *
1783
+ * ```proto
1784
+ * message MySFixed32 {
1785
+ * // value must be in list [1, 2, 3]
1786
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];
1787
+ * }
1788
+ * ```
1789
+ */
1790
+ in: number[];
1791
+ /**
1792
+ * `not_in` requires the field value to not be equal to any of the specified
1793
+ * values. If the field value is one of the specified values, an error
1794
+ * message is generated.
1795
+ *
1796
+ * ```proto
1797
+ * message MySFixed32 {
1798
+ * // value must not be in list [1, 2, 3]
1799
+ * sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];
1800
+ * }
1801
+ * ```
1802
+ */
1803
+ notIn: number[];
1804
+ /**
1805
+ * `example` specifies values that the field may have. These values SHOULD
1806
+ * conform to other rules. `example` values will not impact validation
1807
+ * but may be used as helpful guidance on how to populate the given field.
1808
+ *
1809
+ * ```proto
1810
+ * message MySFixed32 {
1811
+ * sfixed32 value = 1 [
1812
+ * (buf.validate.field).sfixed32.example = 1,
1813
+ * (buf.validate.field).sfixed32.example = 2
1814
+ * ];
1815
+ * }
1816
+ * ```
1817
+ */
1818
+ example: number[];
1819
+ }
1820
+ /** SFixed64Rules describes the rules applied to `fixed64` values. */
1821
+ export interface SFixed64Rules {
1822
+ /**
1823
+ * `const` requires the field value to exactly match the specified value. If
1824
+ * the field value doesn't match, an error message is generated.
1825
+ *
1826
+ * ```proto
1827
+ * message MySFixed64 {
1828
+ * // value must equal 42
1829
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];
1830
+ * }
1831
+ * ```
1832
+ */
1833
+ const?: Long | undefined;
1834
+ /**
1835
+ * `lt` requires the field value to be less than the specified value (field <
1836
+ * value). If the field value is equal to or greater than the specified value,
1837
+ * an error message is generated.
1838
+ *
1839
+ * ```proto
1840
+ * message MySFixed64 {
1841
+ * // value must be less than 10
1842
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];
1843
+ * }
1844
+ * ```
1845
+ */
1846
+ lt?: Long | undefined;
1847
+ /**
1848
+ * `lte` requires the field value to be less than or equal to the specified
1849
+ * value (field <= value). If the field value is greater than the specified
1850
+ * value, an error message is generated.
1851
+ *
1852
+ * ```proto
1853
+ * message MySFixed64 {
1854
+ * // value must be less than or equal to 10
1855
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];
1856
+ * }
1857
+ * ```
1858
+ */
1859
+ lte?: Long | undefined;
1860
+ /**
1861
+ * `gt` requires the field value to be greater than the specified value
1862
+ * (exclusive). If the value of `gt` is larger than a specified `lt` or
1863
+ * `lte`, the range is reversed, and the field value must be outside the
1864
+ * specified range. If the field value doesn't meet the required conditions,
1865
+ * an error message is generated.
1866
+ *
1867
+ * ```proto
1868
+ * message MySFixed64 {
1869
+ * // value must be greater than 5 [sfixed64.gt]
1870
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];
1871
+ *
1872
+ * // value must be greater than 5 and less than 10 [sfixed64.gt_lt]
1873
+ * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];
1874
+ *
1875
+ * // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]
1876
+ * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];
1877
+ * }
1878
+ * ```
1879
+ */
1880
+ gt?: Long | undefined;
1881
+ /**
1882
+ * `gte` requires the field value to be greater than or equal to the specified
1883
+ * value (exclusive). If the value of `gte` is larger than a specified `lt`
1884
+ * or `lte`, the range is reversed, and the field value must be outside the
1885
+ * specified range. If the field value doesn't meet the required conditions,
1886
+ * an error message is generated.
1887
+ *
1888
+ * ```proto
1889
+ * message MySFixed64 {
1890
+ * // value must be greater than or equal to 5 [sfixed64.gte]
1891
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];
1892
+ *
1893
+ * // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]
1894
+ * sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];
1895
+ *
1896
+ * // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]
1897
+ * sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];
1898
+ * }
1899
+ * ```
1900
+ */
1901
+ gte?: Long | undefined;
1902
+ /**
1903
+ * `in` requires the field value to be equal to one of the specified values.
1904
+ * If the field value isn't one of the specified values, an error message is
1905
+ * generated.
1906
+ *
1907
+ * ```proto
1908
+ * message MySFixed64 {
1909
+ * // value must be in list [1, 2, 3]
1910
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];
1911
+ * }
1912
+ * ```
1913
+ */
1914
+ in: Long[];
1915
+ /**
1916
+ * `not_in` requires the field value to not be equal to any of the specified
1917
+ * values. If the field value is one of the specified values, an error
1918
+ * message is generated.
1919
+ *
1920
+ * ```proto
1921
+ * message MySFixed64 {
1922
+ * // value must not be in list [1, 2, 3]
1923
+ * sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];
1924
+ * }
1925
+ * ```
1926
+ */
1927
+ notIn: Long[];
1928
+ /**
1929
+ * `example` specifies values that the field may have. These values SHOULD
1930
+ * conform to other rules. `example` values will not impact validation
1931
+ * but may be used as helpful guidance on how to populate the given field.
1932
+ *
1933
+ * ```proto
1934
+ * message MySFixed64 {
1935
+ * sfixed64 value = 1 [
1936
+ * (buf.validate.field).sfixed64.example = 1,
1937
+ * (buf.validate.field).sfixed64.example = 2
1938
+ * ];
1939
+ * }
1940
+ * ```
1941
+ */
1942
+ example: Long[];
1943
+ }
1944
+ /**
1945
+ * BoolRules describes the rules applied to `bool` values. These rules
1946
+ * may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.
1947
+ */
1948
+ export interface BoolRules {
1949
+ /**
1950
+ * `const` requires the field value to exactly match the specified boolean value.
1951
+ * If the field value doesn't match, an error message is generated.
1952
+ *
1953
+ * ```proto
1954
+ * message MyBool {
1955
+ * // value must equal true
1956
+ * bool value = 1 [(buf.validate.field).bool.const = true];
1957
+ * }
1958
+ * ```
1959
+ */
1960
+ const?: boolean | undefined;
1961
+ /**
1962
+ * `example` specifies values that the field may have. These values SHOULD
1963
+ * conform to other rules. `example` values will not impact validation
1964
+ * but may be used as helpful guidance on how to populate the given field.
1965
+ *
1966
+ * ```proto
1967
+ * message MyBool {
1968
+ * bool value = 1 [
1969
+ * (buf.validate.field).bool.example = 1,
1970
+ * (buf.validate.field).bool.example = 2
1971
+ * ];
1972
+ * }
1973
+ * ```
1974
+ */
1975
+ example: boolean[];
1976
+ }
1977
+ /**
1978
+ * StringRules describes the rules applied to `string` values These
1979
+ * rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
1980
+ */
1981
+ export interface StringRules {
1982
+ /**
1983
+ * `const` requires the field value to exactly match the specified value. If
1984
+ * the field value doesn't match, an error message is generated.
1985
+ *
1986
+ * ```proto
1987
+ * message MyString {
1988
+ * // value must equal `hello`
1989
+ * string value = 1 [(buf.validate.field).string.const = "hello"];
1990
+ * }
1991
+ * ```
1992
+ */
1993
+ const?: string | undefined;
1994
+ /**
1995
+ * `len` dictates that the field value must have the specified
1996
+ * number of characters (Unicode code points), which may differ from the number
1997
+ * of bytes in the string. If the field value does not meet the specified
1998
+ * length, an error message will be generated.
1999
+ *
2000
+ * ```proto
2001
+ * message MyString {
2002
+ * // value length must be 5 characters
2003
+ * string value = 1 [(buf.validate.field).string.len = 5];
2004
+ * }
2005
+ * ```
2006
+ */
2007
+ len?: Long | undefined;
2008
+ /**
2009
+ * `min_len` specifies that the field value must have at least the specified
2010
+ * number of characters (Unicode code points), which may differ from the number
2011
+ * of bytes in the string. If the field value contains fewer characters, an error
2012
+ * message will be generated.
2013
+ *
2014
+ * ```proto
2015
+ * message MyString {
2016
+ * // value length must be at least 3 characters
2017
+ * string value = 1 [(buf.validate.field).string.min_len = 3];
2018
+ * }
2019
+ * ```
2020
+ */
2021
+ minLen?: Long | undefined;
2022
+ /**
2023
+ * `max_len` specifies that the field value must have no more than the specified
2024
+ * number of characters (Unicode code points), which may differ from the
2025
+ * number of bytes in the string. If the field value contains more characters,
2026
+ * an error message will be generated.
2027
+ *
2028
+ * ```proto
2029
+ * message MyString {
2030
+ * // value length must be at most 10 characters
2031
+ * string value = 1 [(buf.validate.field).string.max_len = 10];
2032
+ * }
2033
+ * ```
2034
+ */
2035
+ maxLen?: Long | undefined;
2036
+ /**
2037
+ * `len_bytes` dictates that the field value must have the specified number of
2038
+ * bytes. If the field value does not match the specified length in bytes,
2039
+ * an error message will be generated.
2040
+ *
2041
+ * ```proto
2042
+ * message MyString {
2043
+ * // value length must be 6 bytes
2044
+ * string value = 1 [(buf.validate.field).string.len_bytes = 6];
2045
+ * }
2046
+ * ```
2047
+ */
2048
+ lenBytes?: Long | undefined;
2049
+ /**
2050
+ * `min_bytes` specifies that the field value must have at least the specified
2051
+ * number of bytes. If the field value contains fewer bytes, an error message
2052
+ * will be generated.
2053
+ *
2054
+ * ```proto
2055
+ * message MyString {
2056
+ * // value length must be at least 4 bytes
2057
+ * string value = 1 [(buf.validate.field).string.min_bytes = 4];
2058
+ * }
2059
+ *
2060
+ * ```
2061
+ */
2062
+ minBytes?: Long | undefined;
2063
+ /**
2064
+ * `max_bytes` specifies that the field value must have no more than the
2065
+ * specified number of bytes. If the field value contains more bytes, an
2066
+ * error message will be generated.
2067
+ *
2068
+ * ```proto
2069
+ * message MyString {
2070
+ * // value length must be at most 8 bytes
2071
+ * string value = 1 [(buf.validate.field).string.max_bytes = 8];
2072
+ * }
2073
+ * ```
2074
+ */
2075
+ maxBytes?: Long | undefined;
2076
+ /**
2077
+ * `pattern` specifies that the field value must match the specified
2078
+ * regular expression (RE2 syntax), with the expression provided without any
2079
+ * delimiters. If the field value doesn't match the regular expression, an
2080
+ * error message will be generated.
2081
+ *
2082
+ * ```proto
2083
+ * message MyString {
2084
+ * // value does not match regex pattern `^[a-zA-Z]//$`
2085
+ * string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
2086
+ * }
2087
+ * ```
2088
+ */
2089
+ pattern?: string | undefined;
2090
+ /**
2091
+ * `prefix` specifies that the field value must have the
2092
+ * specified substring at the beginning of the string. If the field value
2093
+ * doesn't start with the specified prefix, an error message will be
2094
+ * generated.
2095
+ *
2096
+ * ```proto
2097
+ * message MyString {
2098
+ * // value does not have prefix `pre`
2099
+ * string value = 1 [(buf.validate.field).string.prefix = "pre"];
2100
+ * }
2101
+ * ```
2102
+ */
2103
+ prefix?: string | undefined;
2104
+ /**
2105
+ * `suffix` specifies that the field value must have the
2106
+ * specified substring at the end of the string. If the field value doesn't
2107
+ * end with the specified suffix, an error message will be generated.
2108
+ *
2109
+ * ```proto
2110
+ * message MyString {
2111
+ * // value does not have suffix `post`
2112
+ * string value = 1 [(buf.validate.field).string.suffix = "post"];
2113
+ * }
2114
+ * ```
2115
+ */
2116
+ suffix?: string | undefined;
2117
+ /**
2118
+ * `contains` specifies that the field value must have the
2119
+ * specified substring anywhere in the string. If the field value doesn't
2120
+ * contain the specified substring, an error message will be generated.
2121
+ *
2122
+ * ```proto
2123
+ * message MyString {
2124
+ * // value does not contain substring `inside`.
2125
+ * string value = 1 [(buf.validate.field).string.contains = "inside"];
2126
+ * }
2127
+ * ```
2128
+ */
2129
+ contains?: string | undefined;
2130
+ /**
2131
+ * `not_contains` specifies that the field value must not have the
2132
+ * specified substring anywhere in the string. If the field value contains
2133
+ * the specified substring, an error message will be generated.
2134
+ *
2135
+ * ```proto
2136
+ * message MyString {
2137
+ * // value contains substring `inside`.
2138
+ * string value = 1 [(buf.validate.field).string.not_contains = "inside"];
2139
+ * }
2140
+ * ```
2141
+ */
2142
+ notContains?: string | undefined;
2143
+ /**
2144
+ * `in` specifies that the field value must be equal to one of the specified
2145
+ * values. If the field value isn't one of the specified values, an error
2146
+ * message will be generated.
2147
+ *
2148
+ * ```proto
2149
+ * message MyString {
2150
+ * // value must be in list ["apple", "banana"]
2151
+ * string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
2152
+ * }
2153
+ * ```
2154
+ */
2155
+ in: string[];
2156
+ /**
2157
+ * `not_in` specifies that the field value cannot be equal to any
2158
+ * of the specified values. If the field value is one of the specified values,
2159
+ * an error message will be generated.
2160
+ * ```proto
2161
+ * message MyString {
2162
+ * // value must not be in list ["orange", "grape"]
2163
+ * string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
2164
+ * }
2165
+ * ```
2166
+ */
2167
+ notIn: string[];
2168
+ /**
2169
+ * `email` specifies that the field value must be a valid email address, for
2170
+ * example "foo@example.com".
2171
+ *
2172
+ * Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
2173
+ * Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),
2174
+ * which allows many unexpected forms of email addresses and will easily match
2175
+ * a typographical error.
2176
+ *
2177
+ * If the field value isn't a valid email address, an error message will be generated.
2178
+ *
2179
+ * ```proto
2180
+ * message MyString {
2181
+ * // value must be a valid email address
2182
+ * string value = 1 [(buf.validate.field).string.email = true];
2183
+ * }
2184
+ * ```
2185
+ */
2186
+ email?: boolean | undefined;
2187
+ /**
2188
+ * `hostname` specifies that the field value must be a valid hostname, for
2189
+ * example "foo.example.com".
2190
+ *
2191
+ * A valid hostname follows the rules below:
2192
+ * - The name consists of one or more labels, separated by a dot (".").
2193
+ * - Each label can be 1 to 63 alphanumeric characters.
2194
+ * - A label can contain hyphens ("-"), but must not start or end with a hyphen.
2195
+ * - The right-most label must not be digits only.
2196
+ * - The name can have a trailing dot—for example, "foo.example.com.".
2197
+ * - The name can be 253 characters at most, excluding the optional trailing dot.
2198
+ *
2199
+ * If the field value isn't a valid hostname, an error message will be generated.
2200
+ *
2201
+ * ```proto
2202
+ * message MyString {
2203
+ * // value must be a valid hostname
2204
+ * string value = 1 [(buf.validate.field).string.hostname = true];
2205
+ * }
2206
+ * ```
2207
+ */
2208
+ hostname?: boolean | undefined;
2209
+ /**
2210
+ * `ip` specifies that the field value must be a valid IP (v4 or v6) address.
2211
+ *
2212
+ * IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21".
2213
+ * IPv6 addresses are expected in their text representation—for example, "::1",
2214
+ * or "2001:0DB8:ABCD:0012::0".
2215
+ *
2216
+ * Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
2217
+ * Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported.
2218
+ *
2219
+ * If the field value isn't a valid IP address, an error message will be
2220
+ * generated.
2221
+ *
2222
+ * ```proto
2223
+ * message MyString {
2224
+ * // value must be a valid IP address
2225
+ * string value = 1 [(buf.validate.field).string.ip = true];
2226
+ * }
2227
+ * ```
2228
+ */
2229
+ ip?: boolean | undefined;
2230
+ /**
2231
+ * `ipv4` specifies that the field value must be a valid IPv4 address—for
2232
+ * example "192.168.5.21". If the field value isn't a valid IPv4 address, an
2233
+ * error message will be generated.
2234
+ *
2235
+ * ```proto
2236
+ * message MyString {
2237
+ * // value must be a valid IPv4 address
2238
+ * string value = 1 [(buf.validate.field).string.ipv4 = true];
2239
+ * }
2240
+ * ```
2241
+ */
2242
+ ipv4?: boolean | undefined;
2243
+ /**
2244
+ * `ipv6` specifies that the field value must be a valid IPv6 address—for
2245
+ * example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field
2246
+ * value is not a valid IPv6 address, an error message will be generated.
2247
+ *
2248
+ * ```proto
2249
+ * message MyString {
2250
+ * // value must be a valid IPv6 address
2251
+ * string value = 1 [(buf.validate.field).string.ipv6 = true];
2252
+ * }
2253
+ * ```
2254
+ */
2255
+ ipv6?: boolean | undefined;
2256
+ /**
2257
+ * `uri` specifies that the field value must be a valid URI, for example
2258
+ * "https://example.com/foo/bar?baz=quux#frag".
2259
+ *
2260
+ * URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
2261
+ * Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
2262
+ *
2263
+ * If the field value isn't a valid URI, an error message will be generated.
2264
+ *
2265
+ * ```proto
2266
+ * message MyString {
2267
+ * // value must be a valid URI
2268
+ * string value = 1 [(buf.validate.field).string.uri = true];
2269
+ * }
2270
+ * ```
2271
+ */
2272
+ uri?: boolean | undefined;
2273
+ /**
2274
+ * `uri_ref` specifies that the field value must be a valid URI Reference—either
2275
+ * a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative
2276
+ * Reference such as "./foo/bar?query".
2277
+ *
2278
+ * URI, URI Reference, and Relative Reference are defined in the internet
2279
+ * standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone
2280
+ * Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
2281
+ *
2282
+ * If the field value isn't a valid URI Reference, an error message will be
2283
+ * generated.
2284
+ *
2285
+ * ```proto
2286
+ * message MyString {
2287
+ * // value must be a valid URI Reference
2288
+ * string value = 1 [(buf.validate.field).string.uri_ref = true];
2289
+ * }
2290
+ * ```
2291
+ */
2292
+ uriRef?: boolean | undefined;
2293
+ /**
2294
+ * `address` specifies that the field value must be either a valid hostname
2295
+ * (for example, "example.com"), or a valid IP (v4 or v6) address (for example,
2296
+ * "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP,
2297
+ * an error message will be generated.
2298
+ *
2299
+ * ```proto
2300
+ * message MyString {
2301
+ * // value must be a valid hostname, or ip address
2302
+ * string value = 1 [(buf.validate.field).string.address = true];
2303
+ * }
2304
+ * ```
2305
+ */
2306
+ address?: boolean | undefined;
2307
+ /**
2308
+ * `uuid` specifies that the field value must be a valid UUID as defined by
2309
+ * [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the
2310
+ * field value isn't a valid UUID, an error message will be generated.
2311
+ *
2312
+ * ```proto
2313
+ * message MyString {
2314
+ * // value must be a valid UUID
2315
+ * string value = 1 [(buf.validate.field).string.uuid = true];
2316
+ * }
2317
+ * ```
2318
+ */
2319
+ uuid?: boolean | undefined;
2320
+ /**
2321
+ * `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
2322
+ * defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes
2323
+ * omitted. If the field value isn't a valid UUID without dashes, an error message
2324
+ * will be generated.
2325
+ *
2326
+ * ```proto
2327
+ * message MyString {
2328
+ * // value must be a valid trimmed UUID
2329
+ * string value = 1 [(buf.validate.field).string.tuuid = true];
2330
+ * }
2331
+ * ```
2332
+ */
2333
+ tuuid?: boolean | undefined;
2334
+ /**
2335
+ * `ip_with_prefixlen` specifies that the field value must be a valid IP
2336
+ * (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or
2337
+ * "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with
2338
+ * prefix length, an error message will be generated.
2339
+ *
2340
+ * ```proto
2341
+ * message MyString {
2342
+ * // value must be a valid IP with prefix length
2343
+ * string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
2344
+ * }
2345
+ * ```
2346
+ */
2347
+ ipWithPrefixlen?: boolean | undefined;
2348
+ /**
2349
+ * `ipv4_with_prefixlen` specifies that the field value must be a valid
2350
+ * IPv4 address with prefix length—for example, "192.168.5.21/16". If the
2351
+ * field value isn't a valid IPv4 address with prefix length, an error
2352
+ * message will be generated.
2353
+ *
2354
+ * ```proto
2355
+ * message MyString {
2356
+ * // value must be a valid IPv4 address with prefix length
2357
+ * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
2358
+ * }
2359
+ * ```
2360
+ */
2361
+ ipv4WithPrefixlen?: boolean | undefined;
2362
+ /**
2363
+ * `ipv6_with_prefixlen` specifies that the field value must be a valid
2364
+ * IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64".
2365
+ * If the field value is not a valid IPv6 address with prefix length,
2366
+ * an error message will be generated.
2367
+ *
2368
+ * ```proto
2369
+ * message MyString {
2370
+ * // value must be a valid IPv6 address prefix length
2371
+ * string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
2372
+ * }
2373
+ * ```
2374
+ */
2375
+ ipv6WithPrefixlen?: boolean | undefined;
2376
+ /**
2377
+ * `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)
2378
+ * prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64".
2379
+ *
2380
+ * The prefix must have all zeros for the unmasked bits. For example,
2381
+ * "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
2382
+ * prefix, and the remaining 64 bits must be zero.
2383
+ *
2384
+ * If the field value isn't a valid IP prefix, an error message will be
2385
+ * generated.
2386
+ *
2387
+ * ```proto
2388
+ * message MyString {
2389
+ * // value must be a valid IP prefix
2390
+ * string value = 1 [(buf.validate.field).string.ip_prefix = true];
2391
+ * }
2392
+ * ```
2393
+ */
2394
+ ipPrefix?: boolean | undefined;
2395
+ /**
2396
+ * `ipv4_prefix` specifies that the field value must be a valid IPv4
2397
+ * prefix, for example "192.168.0.0/16".
2398
+ *
2399
+ * The prefix must have all zeros for the unmasked bits. For example,
2400
+ * "192.168.0.0/16" designates the left-most 16 bits for the prefix,
2401
+ * and the remaining 16 bits must be zero.
2402
+ *
2403
+ * If the field value isn't a valid IPv4 prefix, an error message
2404
+ * will be generated.
2405
+ *
2406
+ * ```proto
2407
+ * message MyString {
2408
+ * // value must be a valid IPv4 prefix
2409
+ * string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
2410
+ * }
2411
+ * ```
2412
+ */
2413
+ ipv4Prefix?: boolean | undefined;
2414
+ /**
2415
+ * `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for
2416
+ * example, "2001:0DB8:ABCD:0012::0/64".
2417
+ *
2418
+ * The prefix must have all zeros for the unmasked bits. For example,
2419
+ * "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
2420
+ * prefix, and the remaining 64 bits must be zero.
2421
+ *
2422
+ * If the field value is not a valid IPv6 prefix, an error message will be
2423
+ * generated.
2424
+ *
2425
+ * ```proto
2426
+ * message MyString {
2427
+ * // value must be a valid IPv6 prefix
2428
+ * string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
2429
+ * }
2430
+ * ```
2431
+ */
2432
+ ipv6Prefix?: boolean | undefined;
2433
+ /**
2434
+ * `host_and_port` specifies that the field value must be valid host/port
2435
+ * pair—for example, "example.com:8080".
2436
+ *
2437
+ * The host can be one of:
2438
+ * - An IPv4 address in dotted decimal format—for example, "192.168.5.21".
2439
+ * - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]".
2440
+ * - A hostname—for example, "example.com".
2441
+ *
2442
+ * The port is separated by a colon. It must be non-empty, with a decimal number
2443
+ * in the range of 0-65535, inclusive.
2444
+ */
2445
+ hostAndPort?: boolean | undefined;
2446
+ /**
2447
+ * `ulid` specifies that the field value must be a valid ULID (Universally Unique
2448
+ * Lexicographically Sortable Identifier) as defined by the [ULID specification](https://github.com/ulid/spec).
2449
+ * If the field value isn't a valid ULID, an error message will be generated.
2450
+ *
2451
+ * ```proto
2452
+ * message MyString {
2453
+ * // value must be a valid ULID
2454
+ * string value = 1 [(buf.validate.field).string.ulid = true];
2455
+ * }
2456
+ * ```
2457
+ */
2458
+ ulid?: boolean | undefined;
2459
+ /**
2460
+ * `well_known_regex` specifies a common well-known pattern
2461
+ * defined as a regex. If the field value doesn't match the well-known
2462
+ * regex, an error message will be generated.
2463
+ *
2464
+ * ```proto
2465
+ * message MyString {
2466
+ * // value must be a valid HTTP header value
2467
+ * string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
2468
+ * }
2469
+ * ```
2470
+ *
2471
+ * #### KnownRegex
2472
+ *
2473
+ * `well_known_regex` contains some well-known patterns.
2474
+ *
2475
+ * | Name | Number | Description |
2476
+ * |-------------------------------|--------|-------------------------------------------|
2477
+ * | KNOWN_REGEX_UNSPECIFIED | 0 | |
2478
+ * | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) |
2479
+ * | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |
2480
+ */
2481
+ wellKnownRegex?: KnownRegex | undefined;
2482
+ /**
2483
+ * This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
2484
+ * enable strict header validation. By default, this is true, and HTTP header
2485
+ * validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser
2486
+ * validations that only disallow `\r\n\0` characters, which can be used to
2487
+ * bypass header matching rules.
2488
+ *
2489
+ * ```proto
2490
+ * message MyString {
2491
+ * // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
2492
+ * string value = 1 [(buf.validate.field).string.strict = false];
2493
+ * }
2494
+ * ```
2495
+ */
2496
+ strict?: boolean | undefined;
2497
+ /**
2498
+ * `example` specifies values that the field may have. These values SHOULD
2499
+ * conform to other rules. `example` values will not impact validation
2500
+ * but may be used as helpful guidance on how to populate the given field.
2501
+ *
2502
+ * ```proto
2503
+ * message MyString {
2504
+ * string value = 1 [
2505
+ * (buf.validate.field).string.example = "hello",
2506
+ * (buf.validate.field).string.example = "world"
2507
+ * ];
2508
+ * }
2509
+ * ```
2510
+ */
2511
+ example: string[];
2512
+ }
2513
+ /**
2514
+ * BytesRules describe the rules applied to `bytes` values. These rules
2515
+ * may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
2516
+ */
2517
+ export interface BytesRules {
2518
+ /**
2519
+ * `const` requires the field value to exactly match the specified bytes
2520
+ * value. If the field value doesn't match, an error message is generated.
2521
+ *
2522
+ * ```proto
2523
+ * message MyBytes {
2524
+ * // value must be "\x01\x02\x03\x04"
2525
+ * bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
2526
+ * }
2527
+ * ```
2528
+ */
2529
+ const?: Uint8Array | undefined;
2530
+ /**
2531
+ * `len` requires the field value to have the specified length in bytes.
2532
+ * If the field value doesn't match, an error message is generated.
2533
+ *
2534
+ * ```proto
2535
+ * message MyBytes {
2536
+ * // value length must be 4 bytes.
2537
+ * optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
2538
+ * }
2539
+ * ```
2540
+ */
2541
+ len?: Long | undefined;
2542
+ /**
2543
+ * `min_len` requires the field value to have at least the specified minimum
2544
+ * length in bytes.
2545
+ * If the field value doesn't meet the requirement, an error message is generated.
2546
+ *
2547
+ * ```proto
2548
+ * message MyBytes {
2549
+ * // value length must be at least 2 bytes.
2550
+ * optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
2551
+ * }
2552
+ * ```
2553
+ */
2554
+ minLen?: Long | undefined;
2555
+ /**
2556
+ * `max_len` requires the field value to have at most the specified maximum
2557
+ * length in bytes.
2558
+ * If the field value exceeds the requirement, an error message is generated.
2559
+ *
2560
+ * ```proto
2561
+ * message MyBytes {
2562
+ * // value must be at most 6 bytes.
2563
+ * optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
2564
+ * }
2565
+ * ```
2566
+ */
2567
+ maxLen?: Long | undefined;
2568
+ /**
2569
+ * `pattern` requires the field value to match the specified regular
2570
+ * expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
2571
+ * The value of the field must be valid UTF-8 or validation will fail with a
2572
+ * runtime error.
2573
+ * If the field value doesn't match the pattern, an error message is generated.
2574
+ *
2575
+ * ```proto
2576
+ * message MyBytes {
2577
+ * // value must match regex pattern "^[a-zA-Z0-9]+$".
2578
+ * optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
2579
+ * }
2580
+ * ```
2581
+ */
2582
+ pattern?: string | undefined;
2583
+ /**
2584
+ * `prefix` requires the field value to have the specified bytes at the
2585
+ * beginning of the string.
2586
+ * If the field value doesn't meet the requirement, an error message is generated.
2587
+ *
2588
+ * ```proto
2589
+ * message MyBytes {
2590
+ * // value does not have prefix \x01\x02
2591
+ * optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
2592
+ * }
2593
+ * ```
2594
+ */
2595
+ prefix?: Uint8Array | undefined;
2596
+ /**
2597
+ * `suffix` requires the field value to have the specified bytes at the end
2598
+ * of the string.
2599
+ * If the field value doesn't meet the requirement, an error message is generated.
2600
+ *
2601
+ * ```proto
2602
+ * message MyBytes {
2603
+ * // value does not have suffix \x03\x04
2604
+ * optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
2605
+ * }
2606
+ * ```
2607
+ */
2608
+ suffix?: Uint8Array | undefined;
2609
+ /**
2610
+ * `contains` requires the field value to have the specified bytes anywhere in
2611
+ * the string.
2612
+ * If the field value doesn't meet the requirement, an error message is generated.
2613
+ *
2614
+ * ```proto
2615
+ * message MyBytes {
2616
+ * // value does not contain \x02\x03
2617
+ * optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
2618
+ * }
2619
+ * ```
2620
+ */
2621
+ contains?: Uint8Array | undefined;
2622
+ /**
2623
+ * `in` requires the field value to be equal to one of the specified
2624
+ * values. If the field value doesn't match any of the specified values, an
2625
+ * error message is generated.
2626
+ *
2627
+ * ```proto
2628
+ * message MyBytes {
2629
+ * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
2630
+ * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
2631
+ * }
2632
+ * ```
2633
+ */
2634
+ in: Uint8Array[];
2635
+ /**
2636
+ * `not_in` requires the field value to be not equal to any of the specified
2637
+ * values.
2638
+ * If the field value matches any of the specified values, an error message is
2639
+ * generated.
2640
+ *
2641
+ * ```proto
2642
+ * message MyBytes {
2643
+ * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
2644
+ * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
2645
+ * }
2646
+ * ```
2647
+ */
2648
+ notIn: Uint8Array[];
2649
+ /**
2650
+ * `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
2651
+ * If the field value doesn't meet this rule, an error message is generated.
2652
+ *
2653
+ * ```proto
2654
+ * message MyBytes {
2655
+ * // value must be a valid IP address
2656
+ * optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
2657
+ * }
2658
+ * ```
2659
+ */
2660
+ ip?: boolean | undefined;
2661
+ /**
2662
+ * `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
2663
+ * If the field value doesn't meet this rule, an error message is generated.
2664
+ *
2665
+ * ```proto
2666
+ * message MyBytes {
2667
+ * // value must be a valid IPv4 address
2668
+ * optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
2669
+ * }
2670
+ * ```
2671
+ */
2672
+ ipv4?: boolean | undefined;
2673
+ /**
2674
+ * `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
2675
+ * If the field value doesn't meet this rule, an error message is generated.
2676
+ * ```proto
2677
+ * message MyBytes {
2678
+ * // value must be a valid IPv6 address
2679
+ * optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
2680
+ * }
2681
+ * ```
2682
+ */
2683
+ ipv6?: boolean | undefined;
2684
+ /**
2685
+ * `uuid` ensures that the field `value` encodes the 128-bit UUID data as
2686
+ * defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2).
2687
+ * The field must contain exactly 16 bytes
2688
+ * representing the UUID. If the field value isn't a valid UUID, an error
2689
+ * message will be generated.
2690
+ *
2691
+ * ```proto
2692
+ * message MyBytes {
2693
+ * // value must be a valid UUID
2694
+ * optional bytes value = 1 [(buf.validate.field).bytes.uuid = true];
2695
+ * }
2696
+ * ```
2697
+ */
2698
+ uuid?: boolean | undefined;
2699
+ /**
2700
+ * `example` specifies values that the field may have. These values SHOULD
2701
+ * conform to other rules. `example` values will not impact validation
2702
+ * but may be used as helpful guidance on how to populate the given field.
2703
+ *
2704
+ * ```proto
2705
+ * message MyBytes {
2706
+ * bytes value = 1 [
2707
+ * (buf.validate.field).bytes.example = "\x01\x02",
2708
+ * (buf.validate.field).bytes.example = "\x02\x03"
2709
+ * ];
2710
+ * }
2711
+ * ```
2712
+ */
2713
+ example: Uint8Array[];
2714
+ }
2715
+ /** EnumRules describe the rules applied to `enum` values. */
2716
+ export interface EnumRules {
2717
+ /**
2718
+ * `const` requires the field value to exactly match the specified enum value.
2719
+ * If the field value doesn't match, an error message is generated.
2720
+ *
2721
+ * ```proto
2722
+ * enum MyEnum {
2723
+ * MY_ENUM_UNSPECIFIED = 0;
2724
+ * MY_ENUM_VALUE1 = 1;
2725
+ * MY_ENUM_VALUE2 = 2;
2726
+ * }
2727
+ *
2728
+ * message MyMessage {
2729
+ * // The field `value` must be exactly MY_ENUM_VALUE1.
2730
+ * MyEnum value = 1 [(buf.validate.field).enum.const = 1];
2731
+ * }
2732
+ * ```
2733
+ */
2734
+ const?: number | undefined;
2735
+ /**
2736
+ * `defined_only` requires the field value to be one of the defined values for
2737
+ * this enum, failing on any undefined value.
2738
+ *
2739
+ * ```proto
2740
+ * enum MyEnum {
2741
+ * MY_ENUM_UNSPECIFIED = 0;
2742
+ * MY_ENUM_VALUE1 = 1;
2743
+ * MY_ENUM_VALUE2 = 2;
2744
+ * }
2745
+ *
2746
+ * message MyMessage {
2747
+ * // The field `value` must be a defined value of MyEnum.
2748
+ * MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
2749
+ * }
2750
+ * ```
2751
+ */
2752
+ definedOnly?: boolean | undefined;
2753
+ /**
2754
+ * `in` requires the field value to be equal to one of the
2755
+ * specified enum values. If the field value doesn't match any of the
2756
+ * specified values, an error message is generated.
2757
+ *
2758
+ * ```proto
2759
+ * enum MyEnum {
2760
+ * MY_ENUM_UNSPECIFIED = 0;
2761
+ * MY_ENUM_VALUE1 = 1;
2762
+ * MY_ENUM_VALUE2 = 2;
2763
+ * }
2764
+ *
2765
+ * message MyMessage {
2766
+ * // The field `value` must be equal to one of the specified values.
2767
+ * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
2768
+ * }
2769
+ * ```
2770
+ */
2771
+ in: number[];
2772
+ /**
2773
+ * `not_in` requires the field value to be not equal to any of the
2774
+ * specified enum values. If the field value matches one of the specified
2775
+ * values, an error message is generated.
2776
+ *
2777
+ * ```proto
2778
+ * enum MyEnum {
2779
+ * MY_ENUM_UNSPECIFIED = 0;
2780
+ * MY_ENUM_VALUE1 = 1;
2781
+ * MY_ENUM_VALUE2 = 2;
2782
+ * }
2783
+ *
2784
+ * message MyMessage {
2785
+ * // The field `value` must not be equal to any of the specified values.
2786
+ * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
2787
+ * }
2788
+ * ```
2789
+ */
2790
+ notIn: number[];
2791
+ /**
2792
+ * `example` specifies values that the field may have. These values SHOULD
2793
+ * conform to other rules. `example` values will not impact validation
2794
+ * but may be used as helpful guidance on how to populate the given field.
2795
+ *
2796
+ * ```proto
2797
+ * enum MyEnum {
2798
+ * MY_ENUM_UNSPECIFIED = 0;
2799
+ * MY_ENUM_VALUE1 = 1;
2800
+ * MY_ENUM_VALUE2 = 2;
2801
+ * }
2802
+ *
2803
+ * message MyMessage {
2804
+ * (buf.validate.field).enum.example = 1,
2805
+ * (buf.validate.field).enum.example = 2
2806
+ * }
2807
+ * ```
2808
+ */
2809
+ example: number[];
2810
+ }
2811
+ /** RepeatedRules describe the rules applied to `repeated` values. */
2812
+ export interface RepeatedRules {
2813
+ /**
2814
+ * `min_items` requires that this field must contain at least the specified
2815
+ * minimum number of items.
2816
+ *
2817
+ * Note that `min_items = 1` is equivalent to setting a field as `required`.
2818
+ *
2819
+ * ```proto
2820
+ * message MyRepeated {
2821
+ * // value must contain at least 2 items
2822
+ * repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
2823
+ * }
2824
+ * ```
2825
+ */
2826
+ minItems?: Long | undefined;
2827
+ /**
2828
+ * `max_items` denotes that this field must not exceed a
2829
+ * certain number of items as the upper limit. If the field contains more
2830
+ * items than specified, an error message will be generated, requiring the
2831
+ * field to maintain no more than the specified number of items.
2832
+ *
2833
+ * ```proto
2834
+ * message MyRepeated {
2835
+ * // value must contain no more than 3 item(s)
2836
+ * repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
2837
+ * }
2838
+ * ```
2839
+ */
2840
+ maxItems?: Long | undefined;
2841
+ /**
2842
+ * `unique` indicates that all elements in this field must
2843
+ * be unique. This rule is strictly applicable to scalar and enum
2844
+ * types, with message types not being supported.
2845
+ *
2846
+ * ```proto
2847
+ * message MyRepeated {
2848
+ * // repeated value must contain unique items
2849
+ * repeated string value = 1 [(buf.validate.field).repeated.unique = true];
2850
+ * }
2851
+ * ```
2852
+ */
2853
+ unique?: boolean | undefined;
2854
+ /**
2855
+ * `items` details the rules to be applied to each item
2856
+ * in the field. Even for repeated message fields, validation is executed
2857
+ * against each item unless `ignore` is specified.
2858
+ *
2859
+ * ```proto
2860
+ * message MyRepeated {
2861
+ * // The items in the field `value` must follow the specified rules.
2862
+ * repeated string value = 1 [(buf.validate.field).repeated.items = {
2863
+ * string: {
2864
+ * min_len: 3
2865
+ * max_len: 10
2866
+ * }
2867
+ * }];
2868
+ * }
2869
+ * ```
2870
+ *
2871
+ * Note that the `required` rule does not apply. Repeated items
2872
+ * cannot be unset.
2873
+ */
2874
+ items?: FieldRules | undefined;
2875
+ }
2876
+ /** MapRules describe the rules applied to `map` values. */
2877
+ export interface MapRules {
2878
+ /**
2879
+ * Specifies the minimum number of key-value pairs allowed. If the field has
2880
+ * fewer key-value pairs than specified, an error message is generated.
2881
+ *
2882
+ * ```proto
2883
+ * message MyMap {
2884
+ * // The field `value` must have at least 2 key-value pairs.
2885
+ * map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
2886
+ * }
2887
+ * ```
2888
+ */
2889
+ minPairs?: Long | undefined;
2890
+ /**
2891
+ * Specifies the maximum number of key-value pairs allowed. If the field has
2892
+ * more key-value pairs than specified, an error message is generated.
2893
+ *
2894
+ * ```proto
2895
+ * message MyMap {
2896
+ * // The field `value` must have at most 3 key-value pairs.
2897
+ * map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
2898
+ * }
2899
+ * ```
2900
+ */
2901
+ maxPairs?: Long | undefined;
2902
+ /**
2903
+ * Specifies the rules to be applied to each key in the field.
2904
+ *
2905
+ * ```proto
2906
+ * message MyMap {
2907
+ * // The keys in the field `value` must follow the specified rules.
2908
+ * map<string, string> value = 1 [(buf.validate.field).map.keys = {
2909
+ * string: {
2910
+ * min_len: 3
2911
+ * max_len: 10
2912
+ * }
2913
+ * }];
2914
+ * }
2915
+ * ```
2916
+ *
2917
+ * Note that the `required` rule does not apply. Map keys cannot be unset.
2918
+ */
2919
+ keys?: FieldRules | undefined;
2920
+ /**
2921
+ * Specifies the rules to be applied to the value of each key in the
2922
+ * field. Message values will still have their validations evaluated unless
2923
+ * `ignore` is specified.
2924
+ *
2925
+ * ```proto
2926
+ * message MyMap {
2927
+ * // The values in the field `value` must follow the specified rules.
2928
+ * map<string, string> value = 1 [(buf.validate.field).map.values = {
2929
+ * string: {
2930
+ * min_len: 5
2931
+ * max_len: 20
2932
+ * }
2933
+ * }];
2934
+ * }
2935
+ * ```
2936
+ * Note that the `required` rule does not apply. Map values cannot be unset.
2937
+ */
2938
+ values?: FieldRules | undefined;
2939
+ }
2940
+ /** AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type. */
2941
+ export interface AnyRules {
2942
+ /**
2943
+ * `in` requires the field's `type_url` to be equal to one of the
2944
+ * specified values. If it doesn't match any of the specified values, an error
2945
+ * message is generated.
2946
+ *
2947
+ * ```proto
2948
+ * message MyAny {
2949
+ * // The `value` field must have a `type_url` equal to one of the specified values.
2950
+ * google.protobuf.Any value = 1 [(buf.validate.field).any = {
2951
+ * in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]
2952
+ * }];
2953
+ * }
2954
+ * ```
2955
+ */
2956
+ in: string[];
2957
+ /**
2958
+ * requires the field's type_url to be not equal to any of the specified values. If it matches any of the specified values, an error message is generated.
2959
+ *
2960
+ * ```proto
2961
+ * message MyAny {
2962
+ * // The `value` field must not have a `type_url` equal to any of the specified values.
2963
+ * google.protobuf.Any value = 1 [(buf.validate.field).any = {
2964
+ * not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]
2965
+ * }];
2966
+ * }
2967
+ * ```
2968
+ */
2969
+ notIn: string[];
2970
+ }
2971
+ /** DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type. */
2972
+ export interface DurationRules {
2973
+ /**
2974
+ * `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.
2975
+ * If the field's value deviates from the specified value, an error message
2976
+ * will be generated.
2977
+ *
2978
+ * ```proto
2979
+ * message MyDuration {
2980
+ * // value must equal 5s
2981
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"];
2982
+ * }
2983
+ * ```
2984
+ */
2985
+ const?: Duration | undefined;
2986
+ /**
2987
+ * `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,
2988
+ * exclusive. If the field's value is greater than or equal to the specified
2989
+ * value, an error message will be generated.
2990
+ *
2991
+ * ```proto
2992
+ * message MyDuration {
2993
+ * // value must be less than 5s
2994
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"];
2995
+ * }
2996
+ * ```
2997
+ */
2998
+ lt?: Duration | undefined;
2999
+ /**
3000
+ * `lte` indicates that the field must be less than or equal to the specified
3001
+ * value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,
3002
+ * an error message will be generated.
3003
+ *
3004
+ * ```proto
3005
+ * message MyDuration {
3006
+ * // value must be less than or equal to 10s
3007
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"];
3008
+ * }
3009
+ * ```
3010
+ */
3011
+ lte?: Duration | undefined;
3012
+ /**
3013
+ * `gt` requires the duration field value to be greater than the specified
3014
+ * value (exclusive). If the value of `gt` is larger than a specified `lt`
3015
+ * or `lte`, the range is reversed, and the field value must be outside the
3016
+ * specified range. If the field value doesn't meet the required conditions,
3017
+ * an error message is generated.
3018
+ *
3019
+ * ```proto
3020
+ * message MyDuration {
3021
+ * // duration must be greater than 5s [duration.gt]
3022
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];
3023
+ *
3024
+ * // duration must be greater than 5s and less than 10s [duration.gt_lt]
3025
+ * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];
3026
+ *
3027
+ * // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]
3028
+ * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];
3029
+ * }
3030
+ * ```
3031
+ */
3032
+ gt?: Duration | undefined;
3033
+ /**
3034
+ * `gte` requires the duration field value to be greater than or equal to the
3035
+ * specified value (exclusive). If the value of `gte` is larger than a
3036
+ * specified `lt` or `lte`, the range is reversed, and the field value must
3037
+ * be outside the specified range. If the field value doesn't meet the
3038
+ * required conditions, an error message is generated.
3039
+ *
3040
+ * ```proto
3041
+ * message MyDuration {
3042
+ * // duration must be greater than or equal to 5s [duration.gte]
3043
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];
3044
+ *
3045
+ * // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]
3046
+ * google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];
3047
+ *
3048
+ * // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]
3049
+ * google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];
3050
+ * }
3051
+ * ```
3052
+ */
3053
+ gte?: Duration | undefined;
3054
+ /**
3055
+ * `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.
3056
+ * If the field's value doesn't correspond to any of the specified values,
3057
+ * an error message will be generated.
3058
+ *
3059
+ * ```proto
3060
+ * message MyDuration {
3061
+ * // value must be in list [1s, 2s, 3s]
3062
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]];
3063
+ * }
3064
+ * ```
3065
+ */
3066
+ in: Duration[];
3067
+ /**
3068
+ * `not_in` denotes that the field must not be equal to
3069
+ * any of the specified values of the `google.protobuf.Duration` type.
3070
+ * If the field's value matches any of these values, an error message will be
3071
+ * generated.
3072
+ *
3073
+ * ```proto
3074
+ * message MyDuration {
3075
+ * // value must not be in list [1s, 2s, 3s]
3076
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]];
3077
+ * }
3078
+ * ```
3079
+ */
3080
+ notIn: Duration[];
3081
+ /**
3082
+ * `example` specifies values that the field may have. These values SHOULD
3083
+ * conform to other rules. `example` values will not impact validation
3084
+ * but may be used as helpful guidance on how to populate the given field.
3085
+ *
3086
+ * ```proto
3087
+ * message MyDuration {
3088
+ * google.protobuf.Duration value = 1 [
3089
+ * (buf.validate.field).duration.example = { seconds: 1 },
3090
+ * (buf.validate.field).duration.example = { seconds: 2 },
3091
+ * ];
3092
+ * }
3093
+ * ```
3094
+ */
3095
+ example: Duration[];
3096
+ }
3097
+ /** FieldMaskRules describe rules applied exclusively to the `google.protobuf.FieldMask` well-known type. */
3098
+ export interface FieldMaskRules {
3099
+ /**
3100
+ * `const` dictates that the field must match the specified value of the `google.protobuf.FieldMask` type exactly.
3101
+ * If the field's value deviates from the specified value, an error message
3102
+ * will be generated.
3103
+ *
3104
+ * ```proto
3105
+ * message MyFieldMask {
3106
+ * // value must equal ["a"]
3107
+ * google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask.const = {
3108
+ * paths: ["a"]
3109
+ * }];
3110
+ * }
3111
+ * ```
3112
+ */
3113
+ const?: string[] | undefined;
3114
+ /**
3115
+ * `in` requires the field value to only contain paths matching specified
3116
+ * values or their subpaths.
3117
+ * If any of the field value's paths doesn't match the rule,
3118
+ * an error message is generated.
3119
+ * See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
3120
+ *
3121
+ * ```proto
3122
+ * message MyFieldMask {
3123
+ * // The `value` FieldMask must only contain paths listed in `in`.
3124
+ * google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
3125
+ * in: ["a", "b", "c.a"]
3126
+ * }];
3127
+ * }
3128
+ * ```
3129
+ */
3130
+ in: string[];
3131
+ /**
3132
+ * `not_in` requires the field value to not contain paths matching specified
3133
+ * values or their subpaths.
3134
+ * If any of the field value's paths matches the rule,
3135
+ * an error message is generated.
3136
+ * See: https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask
3137
+ *
3138
+ * ```proto
3139
+ * message MyFieldMask {
3140
+ * // The `value` FieldMask shall not contain paths listed in `not_in`.
3141
+ * google.protobuf.FieldMask value = 1 [(buf.validate.field).field_mask = {
3142
+ * not_in: ["forbidden", "immutable", "c.a"]
3143
+ * }];
3144
+ * }
3145
+ * ```
3146
+ */
3147
+ notIn: string[];
3148
+ /**
3149
+ * `example` specifies values that the field may have. These values SHOULD
3150
+ * conform to other rules. `example` values will not impact validation
3151
+ * but may be used as helpful guidance on how to populate the given field.
3152
+ *
3153
+ * ```proto
3154
+ * message MyFieldMask {
3155
+ * google.protobuf.FieldMask value = 1 [
3156
+ * (buf.validate.field).field_mask.example = { paths: ["a", "b"] },
3157
+ * (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] },
3158
+ * ];
3159
+ * }
3160
+ * ```
3161
+ */
3162
+ example: string[][];
3163
+ }
3164
+ /** TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type. */
3165
+ export interface TimestampRules {
3166
+ /**
3167
+ * `const` dictates that this field, of the `google.protobuf.Timestamp` type, must exactly match the specified value. If the field value doesn't correspond to the specified timestamp, an error message will be generated.
3168
+ *
3169
+ * ```proto
3170
+ * message MyTimestamp {
3171
+ * // value must equal 2023-05-03T10:00:00Z
3172
+ * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];
3173
+ * }
3174
+ * ```
3175
+ */
3176
+ const?: Date | undefined;
3177
+ /**
3178
+ * requires the duration field value to be less than the specified value (field < value). If the field value doesn't meet the required conditions, an error message is generated.
3179
+ *
3180
+ * ```proto
3181
+ * message MyDuration {
3182
+ * // duration must be less than 'P3D' [duration.lt]
3183
+ * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];
3184
+ * }
3185
+ * ```
3186
+ */
3187
+ lt?: Date | undefined;
3188
+ /**
3189
+ * requires the timestamp field value to be less than or equal to the specified value (field <= value). If the field value doesn't meet the required conditions, an error message is generated.
3190
+ *
3191
+ * ```proto
3192
+ * message MyTimestamp {
3193
+ * // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]
3194
+ * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];
3195
+ * }
3196
+ * ```
3197
+ */
3198
+ lte?: Date | undefined;
3199
+ /**
3200
+ * `lt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be less than the current time. `lt_now` can only be used with the `within` rule.
3201
+ *
3202
+ * ```proto
3203
+ * message MyTimestamp {
3204
+ * // value must be less than now
3205
+ * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];
3206
+ * }
3207
+ * ```
3208
+ */
3209
+ ltNow?: boolean | undefined;
3210
+ /**
3211
+ * `gt` requires the timestamp field value to be greater than the specified
3212
+ * value (exclusive). If the value of `gt` is larger than a specified `lt`
3213
+ * or `lte`, the range is reversed, and the field value must be outside the
3214
+ * specified range. If the field value doesn't meet the required conditions,
3215
+ * an error message is generated.
3216
+ *
3217
+ * ```proto
3218
+ * message MyTimestamp {
3219
+ * // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]
3220
+ * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];
3221
+ *
3222
+ * // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]
3223
+ * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
3224
+ *
3225
+ * // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]
3226
+ * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
3227
+ * }
3228
+ * ```
3229
+ */
3230
+ gt?: Date | undefined;
3231
+ /**
3232
+ * `gte` requires the timestamp field value to be greater than or equal to the
3233
+ * specified value (exclusive). If the value of `gte` is larger than a
3234
+ * specified `lt` or `lte`, the range is reversed, and the field value
3235
+ * must be outside the specified range. If the field value doesn't meet
3236
+ * the required conditions, an error message is generated.
3237
+ *
3238
+ * ```proto
3239
+ * message MyTimestamp {
3240
+ * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]
3241
+ * google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];
3242
+ *
3243
+ * // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]
3244
+ * google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
3245
+ *
3246
+ * // timestamp must be greater than or equal to '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gte_lt_exclusive]
3247
+ * google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
3248
+ * }
3249
+ * ```
3250
+ */
3251
+ gte?: Date | undefined;
3252
+ /**
3253
+ * `gt_now` specifies that this field, of the `google.protobuf.Timestamp` type, must be greater than the current time. `gt_now` can only be used with the `within` rule.
3254
+ *
3255
+ * ```proto
3256
+ * message MyTimestamp {
3257
+ * // value must be greater than now
3258
+ * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];
3259
+ * }
3260
+ * ```
3261
+ */
3262
+ gtNow?: boolean | undefined;
3263
+ /**
3264
+ * `within` specifies that this field, of the `google.protobuf.Timestamp` type, must be within the specified duration of the current time. If the field value isn't within the duration, an error message is generated.
3265
+ *
3266
+ * ```proto
3267
+ * message MyTimestamp {
3268
+ * // value must be within 1 hour of now
3269
+ * google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];
3270
+ * }
3271
+ * ```
3272
+ */
3273
+ within?: Duration | undefined;
3274
+ /**
3275
+ * `example` specifies values that the field may have. These values SHOULD
3276
+ * conform to other rules. `example` values will not impact validation
3277
+ * but may be used as helpful guidance on how to populate the given field.
3278
+ *
3279
+ * ```proto
3280
+ * message MyTimestamp {
3281
+ * google.protobuf.Timestamp value = 1 [
3282
+ * (buf.validate.field).timestamp.example = { seconds: 1672444800 },
3283
+ * (buf.validate.field).timestamp.example = { seconds: 1672531200 },
3284
+ * ];
3285
+ * }
3286
+ * ```
3287
+ */
3288
+ example: Date[];
3289
+ }
3290
+ /**
3291
+ * `Violations` is a collection of `Violation` messages. This message type is returned by
3292
+ * Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.
3293
+ * Each individual violation is represented by a `Violation` message.
3294
+ */
3295
+ export interface Violations {
3296
+ /** `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected. */
3297
+ violations: Violation[];
3298
+ }
3299
+ /**
3300
+ * `Violation` represents a single instance where a validation rule, expressed
3301
+ * as a `Rule`, was not met. It provides information about the field that
3302
+ * caused the violation, the specific rule that wasn't fulfilled, and a
3303
+ * human-readable error message.
3304
+ *
3305
+ * For example, consider the following message:
3306
+ *
3307
+ * ```proto
3308
+ * message User {
3309
+ * int32 age = 1 [(buf.validate.field).cel = {
3310
+ * id: "user.age",
3311
+ * expression: "this < 18 ? 'User must be at least 18 years old' : ''",
3312
+ * }];
3313
+ * }
3314
+ * ```
3315
+ *
3316
+ * It could produce the following violation:
3317
+ *
3318
+ * ```json
3319
+ * {
3320
+ * "ruleId": "user.age",
3321
+ * "message": "User must be at least 18 years old",
3322
+ * "field": {
3323
+ * "elements": [
3324
+ * {
3325
+ * "fieldNumber": 1,
3326
+ * "fieldName": "age",
3327
+ * "fieldType": "TYPE_INT32"
3328
+ * }
3329
+ * ]
3330
+ * },
3331
+ * "rule": {
3332
+ * "elements": [
3333
+ * {
3334
+ * "fieldNumber": 23,
3335
+ * "fieldName": "cel",
3336
+ * "fieldType": "TYPE_MESSAGE",
3337
+ * "index": "0"
3338
+ * }
3339
+ * ]
3340
+ * }
3341
+ * }
3342
+ * ```
3343
+ */
3344
+ export interface Violation {
3345
+ /**
3346
+ * `field` is a machine-readable path to the field that failed validation.
3347
+ * This could be a nested field, in which case the path will include all the parent fields leading to the actual field that caused the violation.
3348
+ *
3349
+ * For example, consider the following message:
3350
+ *
3351
+ * ```proto
3352
+ * message Message {
3353
+ * bool a = 1 [(buf.validate.field).required = true];
3354
+ * }
3355
+ * ```
3356
+ *
3357
+ * It could produce the following violation:
3358
+ *
3359
+ * ```textproto
3360
+ * violation {
3361
+ * field { element { field_number: 1, field_name: "a", field_type: 8 } }
3362
+ * ...
3363
+ * }
3364
+ * ```
3365
+ */
3366
+ field?: FieldPath | undefined;
3367
+ /**
3368
+ * `rule` is a machine-readable path that points to the specific rule that failed validation.
3369
+ * This will be a nested field starting from the FieldRules of the field that failed validation.
3370
+ * For custom rules, this will provide the path of the rule, e.g. `cel[0]`.
3371
+ *
3372
+ * For example, consider the following message:
3373
+ *
3374
+ * ```proto
3375
+ * message Message {
3376
+ * bool a = 1 [(buf.validate.field).required = true];
3377
+ * bool b = 2 [(buf.validate.field).cel = {
3378
+ * id: "custom_rule",
3379
+ * expression: "!this ? 'b must be true': ''"
3380
+ * }]
3381
+ * }
3382
+ * ```
3383
+ *
3384
+ * It could produce the following violations:
3385
+ *
3386
+ * ```textproto
3387
+ * violation {
3388
+ * rule { element { field_number: 25, field_name: "required", field_type: 8 } }
3389
+ * ...
3390
+ * }
3391
+ * violation {
3392
+ * rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } }
3393
+ * ...
3394
+ * }
3395
+ * ```
3396
+ */
3397
+ rule?: FieldPath | undefined;
3398
+ /**
3399
+ * `rule_id` is the unique identifier of the `Rule` that was not fulfilled.
3400
+ * This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.
3401
+ */
3402
+ ruleId?: string | undefined;
3403
+ /**
3404
+ * `message` is a human-readable error message that describes the nature of the violation.
3405
+ * This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.
3406
+ */
3407
+ message?: string | undefined;
3408
+ /** `for_key` indicates whether the violation was caused by a map key, rather than a value. */
3409
+ forKey?: boolean | undefined;
3410
+ }
3411
+ /**
3412
+ * `FieldPath` provides a path to a nested protobuf field.
3413
+ *
3414
+ * This message provides enough information to render a dotted field path even without protobuf descriptors.
3415
+ * It also provides enough information to resolve a nested field through unknown wire data.
3416
+ */
3417
+ export interface FieldPath {
3418
+ /** `elements` contains each element of the path, starting from the root and recursing downward. */
3419
+ elements: FieldPathElement[];
3420
+ }
3421
+ /**
3422
+ * `FieldPathElement` provides enough information to nest through a single protobuf field.
3423
+ *
3424
+ * If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.
3425
+ * A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.
3426
+ * The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.
3427
+ */
3428
+ export interface FieldPathElement {
3429
+ /** `field_number` is the field number this path element refers to. */
3430
+ fieldNumber?: number | undefined;
3431
+ /**
3432
+ * `field_name` contains the field name this path element refers to.
3433
+ * This can be used to display a human-readable path even if the field number is unknown.
3434
+ */
3435
+ fieldName?: string | undefined;
3436
+ /**
3437
+ * `field_type` specifies the type of this field. When using reflection, this value is not needed.
3438
+ *
3439
+ * This value is provided to make it possible to traverse unknown fields through wire data.
3440
+ * When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.
3441
+ *
3442
+ * [1]: https://protobuf.dev/programming-guides/encoding/#packed
3443
+ * [2]: https://protobuf.dev/programming-guides/encoding/#groups
3444
+ *
3445
+ * N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and
3446
+ * can be explicitly used in Protocol Buffers 2023 Edition.
3447
+ */
3448
+ fieldType?: FieldDescriptorProto_Type | undefined;
3449
+ /**
3450
+ * `key_type` specifies the map key type of this field. This value is useful when traversing
3451
+ * unknown fields through wire data: specifically, it allows handling the differences between
3452
+ * different integer encodings.
3453
+ */
3454
+ keyType?: FieldDescriptorProto_Type | undefined;
3455
+ /**
3456
+ * `value_type` specifies map value type of this field. This is useful if you want to display a
3457
+ * value inside unknown fields through wire data.
3458
+ */
3459
+ valueType?: FieldDescriptorProto_Type | undefined;
3460
+ /** `index` specifies a 0-based index into a repeated field. */
3461
+ index?: Long | undefined;
3462
+ /** `bool_key` specifies a map key of type bool. */
3463
+ boolKey?: boolean | undefined;
3464
+ /** `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64. */
3465
+ intKey?: Long | undefined;
3466
+ /** `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64. */
3467
+ uintKey?: Long | undefined;
3468
+ /** `string_key` specifies a map key of type string. */
3469
+ stringKey?: string | undefined;
3470
+ }
3471
+ export declare const Rule: MessageFns<Rule>;
3472
+ export declare const MessageRules: MessageFns<MessageRules>;
3473
+ export declare const MessageOneofRule: MessageFns<MessageOneofRule>;
3474
+ export declare const OneofRules: MessageFns<OneofRules>;
3475
+ export declare const FieldRules: MessageFns<FieldRules>;
3476
+ export declare const PredefinedRules: MessageFns<PredefinedRules>;
3477
+ export declare const FloatRules: MessageFns<FloatRules>;
3478
+ export declare const DoubleRules: MessageFns<DoubleRules>;
3479
+ export declare const Int32Rules: MessageFns<Int32Rules>;
3480
+ export declare const Int64Rules: MessageFns<Int64Rules>;
3481
+ export declare const UInt32Rules: MessageFns<UInt32Rules>;
3482
+ export declare const UInt64Rules: MessageFns<UInt64Rules>;
3483
+ export declare const SInt32Rules: MessageFns<SInt32Rules>;
3484
+ export declare const SInt64Rules: MessageFns<SInt64Rules>;
3485
+ export declare const Fixed32Rules: MessageFns<Fixed32Rules>;
3486
+ export declare const Fixed64Rules: MessageFns<Fixed64Rules>;
3487
+ export declare const SFixed32Rules: MessageFns<SFixed32Rules>;
3488
+ export declare const SFixed64Rules: MessageFns<SFixed64Rules>;
3489
+ export declare const BoolRules: MessageFns<BoolRules>;
3490
+ export declare const StringRules: MessageFns<StringRules>;
3491
+ export declare const BytesRules: MessageFns<BytesRules>;
3492
+ export declare const EnumRules: MessageFns<EnumRules>;
3493
+ export declare const RepeatedRules: MessageFns<RepeatedRules>;
3494
+ export declare const MapRules: MessageFns<MapRules>;
3495
+ export declare const AnyRules: MessageFns<AnyRules>;
3496
+ export declare const DurationRules: MessageFns<DurationRules>;
3497
+ export declare const FieldMaskRules: MessageFns<FieldMaskRules>;
3498
+ export declare const TimestampRules: MessageFns<TimestampRules>;
3499
+ export declare const Violations: MessageFns<Violations>;
3500
+ export declare const Violation: MessageFns<Violation>;
3501
+ export declare const FieldPath: MessageFns<FieldPath>;
3502
+ export declare const FieldPathElement: MessageFns<FieldPathElement>;
3503
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
3504
+ export type DeepPartial<T> = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
3505
+ [K in keyof T]?: DeepPartial<T[K]>;
3506
+ } : Partial<T>;
3507
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
3508
+ export type Exact<P, I extends P> = P extends Builtin ? P : P & {
3509
+ [K in keyof P]: Exact<P[K], I[K]>;
3510
+ } & {
3511
+ [K in Exclude<keyof I, KeysOfUnion<P>>]: never;
3512
+ };
3513
+ export interface MessageFns<T> {
3514
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
3515
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
3516
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
3517
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
3518
+ }
3519
+ export {};
3520
+ //# sourceMappingURL=validate.d.ts.map