@mochabug/adapt-web 0.0.16 → 0.0.19
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.
- package/dist/genproto/buf/validate/validate_pb.d.ts +4041 -373
- package/dist/genproto/buf/validate/validate_pb.js.map +1 -1
- package/dist/genproto/google/api/annotations_pb.js.map +1 -1
- package/dist/genproto/google/api/client_pb.d.ts +570 -19
- package/dist/genproto/google/api/client_pb.js.map +1 -1
- package/dist/genproto/google/api/http_pb.d.ts +399 -3
- package/dist/genproto/google/api/http_pb.js.map +1 -1
- package/dist/genproto/google/api/launch_stage_pb.d.ts +8 -1
- package/dist/genproto/google/api/launch_stage_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.d.ts +362 -18
- package/dist/genproto/mochabugapis/adapt/automations/v1/automations_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/exchange_pb.d.ts +33 -2
- package/dist/genproto/mochabugapis/adapt/graph/exchange_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.d.ts +108 -1
- package/dist/genproto/mochabugapis/adapt/graph/jtd_schema_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/receiver_pb.d.ts +29 -2
- package/dist/genproto/mochabugapis/adapt/graph/receiver_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/signal_binding_pb.d.ts +42 -4
- package/dist/genproto/mochabugapis/adapt/graph/signal_binding_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.d.ts +39 -2
- package/dist/genproto/mochabugapis/adapt/graph/signal_descriptor_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/transceiver_pb.d.ts +27 -2
- package/dist/genproto/mochabugapis/adapt/graph/transceiver_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/transmitter_pb.d.ts +33 -2
- package/dist/genproto/mochabugapis/adapt/graph/transmitter_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/graph/vertex_config_pb.d.ts +51 -4
- package/dist/genproto/mochabugapis/adapt/graph/vertex_config_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.d.ts +579 -15
- package/dist/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.js +1 -1
- package/dist/genproto/mochabugapis/adapt/plugins/v1/plugins_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.d.ts +174 -12
- package/dist/genproto/mochabugapis/adapt/runtime/v1/incoming_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.d.ts +788 -50
- package/dist/genproto/mochabugapis/adapt/runtime/v1/runtime_pb.js.map +1 -1
- package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.d.ts +340 -16
- package/dist/genproto/mochabugapis/adapt/runtime/v1/store_pb.js.map +1 -1
- package/dist/index.d.ts +13 -31
- package/dist/index.js +15 -37
- package/dist/index.js.map +1 -1
- package/package.json +20 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv1";
|
|
2
|
-
import type { Duration, FieldDescriptorProto_Type, FieldOptions, MessageOptions, OneofOptions, Timestamp } from "@bufbuild/protobuf/wkt";
|
|
2
|
+
import type { Duration, DurationJson, FieldDescriptorProto_Type, FieldDescriptorProto_TypeJson, FieldOptions, MessageOptions, OneofOptions, Timestamp, TimestampJson } from "@bufbuild/protobuf/wkt";
|
|
3
3
|
import type { Message } from "@bufbuild/protobuf";
|
|
4
4
|
/**
|
|
5
5
|
* Describes the file buf/validate/validate.proto.
|
|
@@ -51,11 +51,57 @@ export type Constraint = Message<"buf.validate.Constraint"> & {
|
|
|
51
51
|
*/
|
|
52
52
|
expression: string;
|
|
53
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* `Constraint` represents a validation rule written in the Common Expression
|
|
56
|
+
* Language (CEL) syntax. Each Constraint includes a unique identifier, an
|
|
57
|
+
* optional error message, and the CEL expression to evaluate. For more
|
|
58
|
+
* information on CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
|
|
59
|
+
*
|
|
60
|
+
* ```proto
|
|
61
|
+
* message Foo {
|
|
62
|
+
* option (buf.validate.message).cel = {
|
|
63
|
+
* id: "foo.bar"
|
|
64
|
+
* message: "bar must be greater than 0"
|
|
65
|
+
* expression: "this.bar > 0"
|
|
66
|
+
* };
|
|
67
|
+
* int32 bar = 1;
|
|
68
|
+
* }
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @generated from message buf.validate.Constraint
|
|
72
|
+
*/
|
|
73
|
+
export type ConstraintJson = {
|
|
74
|
+
/**
|
|
75
|
+
* `id` is a string that serves as a machine-readable name for this Constraint.
|
|
76
|
+
* It should be unique within its scope, which could be either a message or a field.
|
|
77
|
+
*
|
|
78
|
+
* @generated from field: optional string id = 1;
|
|
79
|
+
*/
|
|
80
|
+
id?: string;
|
|
81
|
+
/**
|
|
82
|
+
* `message` is an optional field that provides a human-readable error message
|
|
83
|
+
* for this Constraint when the CEL expression evaluates to false. If a
|
|
84
|
+
* non-empty message is provided, any strings resulting from the CEL
|
|
85
|
+
* expression evaluation are ignored.
|
|
86
|
+
*
|
|
87
|
+
* @generated from field: optional string message = 2;
|
|
88
|
+
*/
|
|
89
|
+
message?: string;
|
|
90
|
+
/**
|
|
91
|
+
* `expression` is the actual CEL expression that will be evaluated for
|
|
92
|
+
* validation. This string must resolve to either a boolean or a string
|
|
93
|
+
* value. If the expression evaluates to false or a non-empty string, the
|
|
94
|
+
* validation is considered failed, and the message is rejected.
|
|
95
|
+
*
|
|
96
|
+
* @generated from field: optional string expression = 3;
|
|
97
|
+
*/
|
|
98
|
+
expression?: string;
|
|
99
|
+
};
|
|
54
100
|
/**
|
|
55
101
|
* Describes the message buf.validate.Constraint.
|
|
56
102
|
* Use `create(ConstraintSchema)` to create a new message.
|
|
57
103
|
*/
|
|
58
|
-
export declare const ConstraintSchema: GenMessage<Constraint>;
|
|
104
|
+
export declare const ConstraintSchema: GenMessage<Constraint, ConstraintJson>;
|
|
59
105
|
/**
|
|
60
106
|
* MessageConstraints represents validation rules that are applied to the entire message.
|
|
61
107
|
* It includes disabling options and a list of Constraint messages representing Common Expression Language (CEL) validation rules.
|
|
@@ -99,11 +145,54 @@ export type MessageConstraints = Message<"buf.validate.MessageConstraints"> & {
|
|
|
99
145
|
*/
|
|
100
146
|
cel: Constraint[];
|
|
101
147
|
};
|
|
148
|
+
/**
|
|
149
|
+
* MessageConstraints represents validation rules that are applied to the entire message.
|
|
150
|
+
* It includes disabling options and a list of Constraint messages representing Common Expression Language (CEL) validation rules.
|
|
151
|
+
*
|
|
152
|
+
* @generated from message buf.validate.MessageConstraints
|
|
153
|
+
*/
|
|
154
|
+
export type MessageConstraintsJson = {
|
|
155
|
+
/**
|
|
156
|
+
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
|
|
157
|
+
* This includes any fields within the message that would otherwise support validation.
|
|
158
|
+
*
|
|
159
|
+
* ```proto
|
|
160
|
+
* message MyMessage {
|
|
161
|
+
* // validation will be bypassed for this message
|
|
162
|
+
* option (buf.validate.message).disabled = true;
|
|
163
|
+
* }
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @generated from field: optional bool disabled = 1;
|
|
167
|
+
*/
|
|
168
|
+
disabled?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
|
|
171
|
+
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
|
|
172
|
+
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
|
|
173
|
+
*
|
|
174
|
+
*
|
|
175
|
+
* ```proto
|
|
176
|
+
* message MyMessage {
|
|
177
|
+
* // The field `foo` must be greater than 42.
|
|
178
|
+
* option (buf.validate.message).cel = {
|
|
179
|
+
* id: "my_message.value",
|
|
180
|
+
* message: "value must be greater than 42",
|
|
181
|
+
* expression: "this.foo > 42",
|
|
182
|
+
* };
|
|
183
|
+
* optional int32 foo = 1;
|
|
184
|
+
* }
|
|
185
|
+
* ```
|
|
186
|
+
*
|
|
187
|
+
* @generated from field: repeated buf.validate.Constraint cel = 3;
|
|
188
|
+
*/
|
|
189
|
+
cel?: ConstraintJson[];
|
|
190
|
+
};
|
|
102
191
|
/**
|
|
103
192
|
* Describes the message buf.validate.MessageConstraints.
|
|
104
193
|
* Use `create(MessageConstraintsSchema)` to create a new message.
|
|
105
194
|
*/
|
|
106
|
-
export declare const MessageConstraintsSchema: GenMessage<MessageConstraints>;
|
|
195
|
+
export declare const MessageConstraintsSchema: GenMessage<MessageConstraints, MessageConstraintsJson>;
|
|
107
196
|
/**
|
|
108
197
|
* The `OneofConstraints` message type enables you to manage constraints for
|
|
109
198
|
* oneof fields in your protobuf messages.
|
|
@@ -134,11 +223,41 @@ export type OneofConstraints = Message<"buf.validate.OneofConstraints"> & {
|
|
|
134
223
|
*/
|
|
135
224
|
required: boolean;
|
|
136
225
|
};
|
|
226
|
+
/**
|
|
227
|
+
* The `OneofConstraints` message type enables you to manage constraints for
|
|
228
|
+
* oneof fields in your protobuf messages.
|
|
229
|
+
*
|
|
230
|
+
* @generated from message buf.validate.OneofConstraints
|
|
231
|
+
*/
|
|
232
|
+
export type OneofConstraintsJson = {
|
|
233
|
+
/**
|
|
234
|
+
* If `required` is true, exactly one field of the oneof must be present. A
|
|
235
|
+
* validation error is returned if no fields in the oneof are present. The
|
|
236
|
+
* field itself may still be a default value; further constraints
|
|
237
|
+
* should be placed on the fields themselves to ensure they are valid values,
|
|
238
|
+
* such as `min_len` or `gt`.
|
|
239
|
+
*
|
|
240
|
+
* ```proto
|
|
241
|
+
* message MyMessage {
|
|
242
|
+
* oneof value {
|
|
243
|
+
* // Either `a` or `b` must be set. If `a` is set, it must also be
|
|
244
|
+
* // non-empty; whereas if `b` is set, it can still be an empty string.
|
|
245
|
+
* option (buf.validate.oneof).required = true;
|
|
246
|
+
* string a = 1 [(buf.validate.field).string.min_len = 1];
|
|
247
|
+
* string b = 2;
|
|
248
|
+
* }
|
|
249
|
+
* }
|
|
250
|
+
* ```
|
|
251
|
+
*
|
|
252
|
+
* @generated from field: optional bool required = 1;
|
|
253
|
+
*/
|
|
254
|
+
required?: boolean;
|
|
255
|
+
};
|
|
137
256
|
/**
|
|
138
257
|
* Describes the message buf.validate.OneofConstraints.
|
|
139
258
|
* Use `create(OneofConstraintsSchema)` to create a new message.
|
|
140
259
|
*/
|
|
141
|
-
export declare const OneofConstraintsSchema: GenMessage<OneofConstraints>;
|
|
260
|
+
export declare const OneofConstraintsSchema: GenMessage<OneofConstraints, OneofConstraintsJson>;
|
|
142
261
|
/**
|
|
143
262
|
* FieldConstraints encapsulates the rules for each type of field. Depending on
|
|
144
263
|
* the field, the correct set should be used to ensure proper validations.
|
|
@@ -359,11 +478,182 @@ export type FieldConstraints = Message<"buf.validate.FieldConstraints"> & {
|
|
|
359
478
|
*/
|
|
360
479
|
ignoreEmpty: boolean;
|
|
361
480
|
};
|
|
481
|
+
/**
|
|
482
|
+
* FieldConstraints encapsulates the rules for each type of field. Depending on
|
|
483
|
+
* the field, the correct set should be used to ensure proper validations.
|
|
484
|
+
*
|
|
485
|
+
* @generated from message buf.validate.FieldConstraints
|
|
486
|
+
*/
|
|
487
|
+
export type FieldConstraintsJson = {
|
|
488
|
+
/**
|
|
489
|
+
* `cel` is a repeated field used to represent a textual expression
|
|
490
|
+
* in the Common Expression Language (CEL) syntax. For more information on
|
|
491
|
+
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
|
|
492
|
+
*
|
|
493
|
+
* ```proto
|
|
494
|
+
* message MyMessage {
|
|
495
|
+
* // The field `value` must be greater than 42.
|
|
496
|
+
* optional int32 value = 1 [(buf.validate.field).cel = {
|
|
497
|
+
* id: "my_message.value",
|
|
498
|
+
* message: "value must be greater than 42",
|
|
499
|
+
* expression: "this > 42",
|
|
500
|
+
* }];
|
|
501
|
+
* }
|
|
502
|
+
* ```
|
|
503
|
+
*
|
|
504
|
+
* @generated from field: repeated buf.validate.Constraint cel = 23;
|
|
505
|
+
*/
|
|
506
|
+
cel?: ConstraintJson[];
|
|
507
|
+
/**
|
|
508
|
+
* If `required` is true, the field must be populated. A populated field can be
|
|
509
|
+
* described as "serialized in the wire format," which includes:
|
|
510
|
+
*
|
|
511
|
+
* - the following "nullable" fields must be explicitly set to be considered populated:
|
|
512
|
+
* - singular message fields (whose fields may be unpopulated/default values)
|
|
513
|
+
* - member fields of a oneof (may be their default value)
|
|
514
|
+
* - proto3 optional fields (may be their default value)
|
|
515
|
+
* - proto2 scalar fields (both optional and required)
|
|
516
|
+
* - proto3 scalar fields must be non-zero to be considered populated
|
|
517
|
+
* - repeated and map fields must be non-empty to be considered populated
|
|
518
|
+
*
|
|
519
|
+
* ```proto
|
|
520
|
+
* message MyMessage {
|
|
521
|
+
* // The field `value` must be set to a non-null value.
|
|
522
|
+
* optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
|
|
523
|
+
* }
|
|
524
|
+
* ```
|
|
525
|
+
*
|
|
526
|
+
* @generated from field: optional bool required = 25;
|
|
527
|
+
*/
|
|
528
|
+
required?: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Skip validation on the field if its value matches the specified criteria.
|
|
531
|
+
* See Ignore enum for details.
|
|
532
|
+
*
|
|
533
|
+
* ```proto
|
|
534
|
+
* message UpdateRequest {
|
|
535
|
+
* // The uri rule only applies if the field is populated and not an empty
|
|
536
|
+
* // string.
|
|
537
|
+
* optional string url = 1 [
|
|
538
|
+
* (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
|
|
539
|
+
* (buf.validate.field).string.uri = true,
|
|
540
|
+
* ];
|
|
541
|
+
* }
|
|
542
|
+
* ```
|
|
543
|
+
*
|
|
544
|
+
* @generated from field: optional buf.validate.Ignore ignore = 27;
|
|
545
|
+
*/
|
|
546
|
+
ignore?: IgnoreJson;
|
|
547
|
+
/**
|
|
548
|
+
* Scalar Field Types
|
|
549
|
+
*
|
|
550
|
+
* @generated from field: buf.validate.FloatRules float = 1;
|
|
551
|
+
*/
|
|
552
|
+
float?: FloatRulesJson;
|
|
553
|
+
/**
|
|
554
|
+
* @generated from field: buf.validate.DoubleRules double = 2;
|
|
555
|
+
*/
|
|
556
|
+
double?: DoubleRulesJson;
|
|
557
|
+
/**
|
|
558
|
+
* @generated from field: buf.validate.Int32Rules int32 = 3;
|
|
559
|
+
*/
|
|
560
|
+
int32?: Int32RulesJson;
|
|
561
|
+
/**
|
|
562
|
+
* @generated from field: buf.validate.Int64Rules int64 = 4;
|
|
563
|
+
*/
|
|
564
|
+
int64?: Int64RulesJson;
|
|
565
|
+
/**
|
|
566
|
+
* @generated from field: buf.validate.UInt32Rules uint32 = 5;
|
|
567
|
+
*/
|
|
568
|
+
uint32?: UInt32RulesJson;
|
|
569
|
+
/**
|
|
570
|
+
* @generated from field: buf.validate.UInt64Rules uint64 = 6;
|
|
571
|
+
*/
|
|
572
|
+
uint64?: UInt64RulesJson;
|
|
573
|
+
/**
|
|
574
|
+
* @generated from field: buf.validate.SInt32Rules sint32 = 7;
|
|
575
|
+
*/
|
|
576
|
+
sint32?: SInt32RulesJson;
|
|
577
|
+
/**
|
|
578
|
+
* @generated from field: buf.validate.SInt64Rules sint64 = 8;
|
|
579
|
+
*/
|
|
580
|
+
sint64?: SInt64RulesJson;
|
|
581
|
+
/**
|
|
582
|
+
* @generated from field: buf.validate.Fixed32Rules fixed32 = 9;
|
|
583
|
+
*/
|
|
584
|
+
fixed32?: Fixed32RulesJson;
|
|
585
|
+
/**
|
|
586
|
+
* @generated from field: buf.validate.Fixed64Rules fixed64 = 10;
|
|
587
|
+
*/
|
|
588
|
+
fixed64?: Fixed64RulesJson;
|
|
589
|
+
/**
|
|
590
|
+
* @generated from field: buf.validate.SFixed32Rules sfixed32 = 11;
|
|
591
|
+
*/
|
|
592
|
+
sfixed32?: SFixed32RulesJson;
|
|
593
|
+
/**
|
|
594
|
+
* @generated from field: buf.validate.SFixed64Rules sfixed64 = 12;
|
|
595
|
+
*/
|
|
596
|
+
sfixed64?: SFixed64RulesJson;
|
|
597
|
+
/**
|
|
598
|
+
* @generated from field: buf.validate.BoolRules bool = 13;
|
|
599
|
+
*/
|
|
600
|
+
bool?: BoolRulesJson;
|
|
601
|
+
/**
|
|
602
|
+
* @generated from field: buf.validate.StringRules string = 14;
|
|
603
|
+
*/
|
|
604
|
+
string?: StringRulesJson;
|
|
605
|
+
/**
|
|
606
|
+
* @generated from field: buf.validate.BytesRules bytes = 15;
|
|
607
|
+
*/
|
|
608
|
+
bytes?: BytesRulesJson;
|
|
609
|
+
/**
|
|
610
|
+
* Complex Field Types
|
|
611
|
+
*
|
|
612
|
+
* @generated from field: buf.validate.EnumRules enum = 16;
|
|
613
|
+
*/
|
|
614
|
+
enum?: EnumRulesJson;
|
|
615
|
+
/**
|
|
616
|
+
* @generated from field: buf.validate.RepeatedRules repeated = 18;
|
|
617
|
+
*/
|
|
618
|
+
repeated?: RepeatedRulesJson;
|
|
619
|
+
/**
|
|
620
|
+
* @generated from field: buf.validate.MapRules map = 19;
|
|
621
|
+
*/
|
|
622
|
+
map?: MapRulesJson;
|
|
623
|
+
/**
|
|
624
|
+
* Well-Known Field Types
|
|
625
|
+
*
|
|
626
|
+
* @generated from field: buf.validate.AnyRules any = 20;
|
|
627
|
+
*/
|
|
628
|
+
any?: AnyRulesJson;
|
|
629
|
+
/**
|
|
630
|
+
* @generated from field: buf.validate.DurationRules duration = 21;
|
|
631
|
+
*/
|
|
632
|
+
duration?: DurationRulesJson;
|
|
633
|
+
/**
|
|
634
|
+
* @generated from field: buf.validate.TimestampRules timestamp = 22;
|
|
635
|
+
*/
|
|
636
|
+
timestamp?: TimestampRulesJson;
|
|
637
|
+
/**
|
|
638
|
+
* DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
|
|
639
|
+
*
|
|
640
|
+
* @generated from field: optional bool skipped = 24 [deprecated = true];
|
|
641
|
+
* @deprecated
|
|
642
|
+
*/
|
|
643
|
+
skipped?: boolean;
|
|
644
|
+
/**
|
|
645
|
+
* DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
|
|
646
|
+
*
|
|
647
|
+
* @generated from field: optional bool ignore_empty = 26 [deprecated = true];
|
|
648
|
+
* @deprecated
|
|
649
|
+
*/
|
|
650
|
+
ignoreEmpty?: boolean;
|
|
651
|
+
};
|
|
362
652
|
/**
|
|
363
653
|
* Describes the message buf.validate.FieldConstraints.
|
|
364
654
|
* Use `create(FieldConstraintsSchema)` to create a new message.
|
|
365
655
|
*/
|
|
366
|
-
export declare const FieldConstraintsSchema: GenMessage<FieldConstraints>;
|
|
656
|
+
export declare const FieldConstraintsSchema: GenMessage<FieldConstraints, FieldConstraintsJson>;
|
|
367
657
|
/**
|
|
368
658
|
* PredefinedConstraints are custom constraints that can be re-used with
|
|
369
659
|
* multiple fields.
|
|
@@ -391,11 +681,38 @@ export type PredefinedConstraints = Message<"buf.validate.PredefinedConstraints"
|
|
|
391
681
|
*/
|
|
392
682
|
cel: Constraint[];
|
|
393
683
|
};
|
|
684
|
+
/**
|
|
685
|
+
* PredefinedConstraints are custom constraints that can be re-used with
|
|
686
|
+
* multiple fields.
|
|
687
|
+
*
|
|
688
|
+
* @generated from message buf.validate.PredefinedConstraints
|
|
689
|
+
*/
|
|
690
|
+
export type PredefinedConstraintsJson = {
|
|
691
|
+
/**
|
|
692
|
+
* `cel` is a repeated field used to represent a textual expression
|
|
693
|
+
* in the Common Expression Language (CEL) syntax. For more information on
|
|
694
|
+
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
|
|
695
|
+
*
|
|
696
|
+
* ```proto
|
|
697
|
+
* message MyMessage {
|
|
698
|
+
* // The field `value` must be greater than 42.
|
|
699
|
+
* optional int32 value = 1 [(buf.validate.predefined).cel = {
|
|
700
|
+
* id: "my_message.value",
|
|
701
|
+
* message: "value must be greater than 42",
|
|
702
|
+
* expression: "this > 42",
|
|
703
|
+
* }];
|
|
704
|
+
* }
|
|
705
|
+
* ```
|
|
706
|
+
*
|
|
707
|
+
* @generated from field: repeated buf.validate.Constraint cel = 1;
|
|
708
|
+
*/
|
|
709
|
+
cel?: ConstraintJson[];
|
|
710
|
+
};
|
|
394
711
|
/**
|
|
395
712
|
* Describes the message buf.validate.PredefinedConstraints.
|
|
396
713
|
* Use `create(PredefinedConstraintsSchema)` to create a new message.
|
|
397
714
|
*/
|
|
398
|
-
export declare const PredefinedConstraintsSchema: GenMessage<PredefinedConstraints>;
|
|
715
|
+
export declare const PredefinedConstraintsSchema: GenMessage<PredefinedConstraints, PredefinedConstraintsJson>;
|
|
399
716
|
/**
|
|
400
717
|
* FloatRules describes the constraints applied to `float` values. These
|
|
401
718
|
* rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.
|
|
@@ -571,10 +888,162 @@ export type FloatRules = Message<"buf.validate.FloatRules"> & {
|
|
|
571
888
|
example: number[];
|
|
572
889
|
};
|
|
573
890
|
/**
|
|
574
|
-
*
|
|
891
|
+
* FloatRules describes the constraints applied to `float` values. These
|
|
892
|
+
* rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.
|
|
893
|
+
*
|
|
894
|
+
* @generated from message buf.validate.FloatRules
|
|
895
|
+
*/
|
|
896
|
+
export type FloatRulesJson = {
|
|
897
|
+
/**
|
|
898
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
899
|
+
* the field value doesn't match, an error message is generated.
|
|
900
|
+
*
|
|
901
|
+
* ```proto
|
|
902
|
+
* message MyFloat {
|
|
903
|
+
* // value must equal 42.0
|
|
904
|
+
* float value = 1 [(buf.validate.field).float.const = 42.0];
|
|
905
|
+
* }
|
|
906
|
+
* ```
|
|
907
|
+
*
|
|
908
|
+
* @generated from field: optional float const = 1;
|
|
909
|
+
*/
|
|
910
|
+
const?: number | "NaN" | "Infinity" | "-Infinity";
|
|
911
|
+
/**
|
|
912
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
913
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
914
|
+
* an error message is generated.
|
|
915
|
+
*
|
|
916
|
+
* ```proto
|
|
917
|
+
* message MyFloat {
|
|
918
|
+
* // value must be less than 10.0
|
|
919
|
+
* float value = 1 [(buf.validate.field).float.lt = 10.0];
|
|
920
|
+
* }
|
|
921
|
+
* ```
|
|
922
|
+
*
|
|
923
|
+
* @generated from field: float lt = 2;
|
|
924
|
+
*/
|
|
925
|
+
lt?: number | "NaN" | "Infinity" | "-Infinity";
|
|
926
|
+
/**
|
|
927
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
928
|
+
* value (field <= value). If the field value is greater than the specified
|
|
929
|
+
* value, an error message is generated.
|
|
930
|
+
*
|
|
931
|
+
* ```proto
|
|
932
|
+
* message MyFloat {
|
|
933
|
+
* // value must be less than or equal to 10.0
|
|
934
|
+
* float value = 1 [(buf.validate.field).float.lte = 10.0];
|
|
935
|
+
* }
|
|
936
|
+
* ```
|
|
937
|
+
*
|
|
938
|
+
* @generated from field: float lte = 3;
|
|
939
|
+
*/
|
|
940
|
+
lte?: number | "NaN" | "Infinity" | "-Infinity";
|
|
941
|
+
/**
|
|
942
|
+
* `gt` requires the field value to be greater than the specified value
|
|
943
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
944
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
945
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
946
|
+
* an error message is generated.
|
|
947
|
+
*
|
|
948
|
+
* ```proto
|
|
949
|
+
* message MyFloat {
|
|
950
|
+
* // value must be greater than 5.0 [float.gt]
|
|
951
|
+
* float value = 1 [(buf.validate.field).float.gt = 5.0];
|
|
952
|
+
*
|
|
953
|
+
* // value must be greater than 5 and less than 10.0 [float.gt_lt]
|
|
954
|
+
* float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];
|
|
955
|
+
*
|
|
956
|
+
* // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]
|
|
957
|
+
* float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];
|
|
958
|
+
* }
|
|
959
|
+
* ```
|
|
960
|
+
*
|
|
961
|
+
* @generated from field: float gt = 4;
|
|
962
|
+
*/
|
|
963
|
+
gt?: number | "NaN" | "Infinity" | "-Infinity";
|
|
964
|
+
/**
|
|
965
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
966
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
967
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
968
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
969
|
+
* an error message is generated.
|
|
970
|
+
*
|
|
971
|
+
* ```proto
|
|
972
|
+
* message MyFloat {
|
|
973
|
+
* // value must be greater than or equal to 5.0 [float.gte]
|
|
974
|
+
* float value = 1 [(buf.validate.field).float.gte = 5.0];
|
|
975
|
+
*
|
|
976
|
+
* // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]
|
|
977
|
+
* float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];
|
|
978
|
+
*
|
|
979
|
+
* // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]
|
|
980
|
+
* float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];
|
|
981
|
+
* }
|
|
982
|
+
* ```
|
|
983
|
+
*
|
|
984
|
+
* @generated from field: float gte = 5;
|
|
985
|
+
*/
|
|
986
|
+
gte?: number | "NaN" | "Infinity" | "-Infinity";
|
|
987
|
+
/**
|
|
988
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
989
|
+
* If the field value isn't one of the specified values, an error message
|
|
990
|
+
* is generated.
|
|
991
|
+
*
|
|
992
|
+
* ```proto
|
|
993
|
+
* message MyFloat {
|
|
994
|
+
* // value must be in list [1.0, 2.0, 3.0]
|
|
995
|
+
* repeated float value = 1 (buf.validate.field).float = { in: [1.0, 2.0, 3.0] };
|
|
996
|
+
* }
|
|
997
|
+
* ```
|
|
998
|
+
*
|
|
999
|
+
* @generated from field: repeated float in = 6;
|
|
1000
|
+
*/
|
|
1001
|
+
in?: (number | "NaN" | "Infinity" | "-Infinity")[];
|
|
1002
|
+
/**
|
|
1003
|
+
* `in` requires the field value to not be equal to any of the specified
|
|
1004
|
+
* values. If the field value is one of the specified values, an error
|
|
1005
|
+
* message is generated.
|
|
1006
|
+
*
|
|
1007
|
+
* ```proto
|
|
1008
|
+
* message MyFloat {
|
|
1009
|
+
* // value must not be in list [1.0, 2.0, 3.0]
|
|
1010
|
+
* repeated float value = 1 (buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] };
|
|
1011
|
+
* }
|
|
1012
|
+
* ```
|
|
1013
|
+
*
|
|
1014
|
+
* @generated from field: repeated float not_in = 7;
|
|
1015
|
+
*/
|
|
1016
|
+
notIn?: (number | "NaN" | "Infinity" | "-Infinity")[];
|
|
1017
|
+
/**
|
|
1018
|
+
* `finite` requires the field value to be finite. If the field value is
|
|
1019
|
+
* infinite or NaN, an error message is generated.
|
|
1020
|
+
*
|
|
1021
|
+
* @generated from field: optional bool finite = 8;
|
|
1022
|
+
*/
|
|
1023
|
+
finite?: boolean;
|
|
1024
|
+
/**
|
|
1025
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1026
|
+
* conform to other constraints. `example` values will not impact validation
|
|
1027
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1028
|
+
*
|
|
1029
|
+
* ```proto
|
|
1030
|
+
* message MyFloat {
|
|
1031
|
+
* float value = 1 [
|
|
1032
|
+
* (buf.validate.field).float.example = 1.0,
|
|
1033
|
+
* (buf.validate.field).float.example = "Infinity"
|
|
1034
|
+
* ];
|
|
1035
|
+
* }
|
|
1036
|
+
* ```
|
|
1037
|
+
*
|
|
1038
|
+
* @generated from field: repeated float example = 9;
|
|
1039
|
+
*/
|
|
1040
|
+
example?: (number | "NaN" | "Infinity" | "-Infinity")[];
|
|
1041
|
+
};
|
|
1042
|
+
/**
|
|
1043
|
+
* Describes the message buf.validate.FloatRules.
|
|
575
1044
|
* Use `create(FloatRulesSchema)` to create a new message.
|
|
576
1045
|
*/
|
|
577
|
-
export declare const FloatRulesSchema: GenMessage<FloatRules>;
|
|
1046
|
+
export declare const FloatRulesSchema: GenMessage<FloatRules, FloatRulesJson>;
|
|
578
1047
|
/**
|
|
579
1048
|
* DoubleRules describes the constraints applied to `double` values. These
|
|
580
1049
|
* rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.
|
|
@@ -749,11 +1218,163 @@ export type DoubleRules = Message<"buf.validate.DoubleRules"> & {
|
|
|
749
1218
|
*/
|
|
750
1219
|
example: number[];
|
|
751
1220
|
};
|
|
1221
|
+
/**
|
|
1222
|
+
* DoubleRules describes the constraints applied to `double` values. These
|
|
1223
|
+
* rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.
|
|
1224
|
+
*
|
|
1225
|
+
* @generated from message buf.validate.DoubleRules
|
|
1226
|
+
*/
|
|
1227
|
+
export type DoubleRulesJson = {
|
|
1228
|
+
/**
|
|
1229
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1230
|
+
* the field value doesn't match, an error message is generated.
|
|
1231
|
+
*
|
|
1232
|
+
* ```proto
|
|
1233
|
+
* message MyDouble {
|
|
1234
|
+
* // value must equal 42.0
|
|
1235
|
+
* double value = 1 [(buf.validate.field).double.const = 42.0];
|
|
1236
|
+
* }
|
|
1237
|
+
* ```
|
|
1238
|
+
*
|
|
1239
|
+
* @generated from field: optional double const = 1;
|
|
1240
|
+
*/
|
|
1241
|
+
const?: number | "NaN" | "Infinity" | "-Infinity";
|
|
1242
|
+
/**
|
|
1243
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1244
|
+
* value). If the field value is equal to or greater than the specified
|
|
1245
|
+
* value, an error message is generated.
|
|
1246
|
+
*
|
|
1247
|
+
* ```proto
|
|
1248
|
+
* message MyDouble {
|
|
1249
|
+
* // value must be less than 10.0
|
|
1250
|
+
* double value = 1 [(buf.validate.field).double.lt = 10.0];
|
|
1251
|
+
* }
|
|
1252
|
+
* ```
|
|
1253
|
+
*
|
|
1254
|
+
* @generated from field: double lt = 2;
|
|
1255
|
+
*/
|
|
1256
|
+
lt?: number | "NaN" | "Infinity" | "-Infinity";
|
|
1257
|
+
/**
|
|
1258
|
+
* `lte` requires the field value to be less than or equal to the specified value
|
|
1259
|
+
* (field <= value). If the field value is greater than the specified value,
|
|
1260
|
+
* an error message is generated.
|
|
1261
|
+
*
|
|
1262
|
+
* ```proto
|
|
1263
|
+
* message MyDouble {
|
|
1264
|
+
* // value must be less than or equal to 10.0
|
|
1265
|
+
* double value = 1 [(buf.validate.field).double.lte = 10.0];
|
|
1266
|
+
* }
|
|
1267
|
+
* ```
|
|
1268
|
+
*
|
|
1269
|
+
* @generated from field: double lte = 3;
|
|
1270
|
+
*/
|
|
1271
|
+
lte?: number | "NaN" | "Infinity" | "-Infinity";
|
|
1272
|
+
/**
|
|
1273
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1274
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,
|
|
1275
|
+
* the range is reversed, and the field value must be outside the specified
|
|
1276
|
+
* range. If the field value doesn't meet the required conditions, an error
|
|
1277
|
+
* message is generated.
|
|
1278
|
+
*
|
|
1279
|
+
* ```proto
|
|
1280
|
+
* message MyDouble {
|
|
1281
|
+
* // value must be greater than 5.0 [double.gt]
|
|
1282
|
+
* double value = 1 [(buf.validate.field).double.gt = 5.0];
|
|
1283
|
+
*
|
|
1284
|
+
* // value must be greater than 5 and less than 10.0 [double.gt_lt]
|
|
1285
|
+
* double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];
|
|
1286
|
+
*
|
|
1287
|
+
* // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]
|
|
1288
|
+
* double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];
|
|
1289
|
+
* }
|
|
1290
|
+
* ```
|
|
1291
|
+
*
|
|
1292
|
+
* @generated from field: double gt = 4;
|
|
1293
|
+
*/
|
|
1294
|
+
gt?: number | "NaN" | "Infinity" | "-Infinity";
|
|
1295
|
+
/**
|
|
1296
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1297
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt` or
|
|
1298
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1299
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1300
|
+
* an error message is generated.
|
|
1301
|
+
*
|
|
1302
|
+
* ```proto
|
|
1303
|
+
* message MyDouble {
|
|
1304
|
+
* // value must be greater than or equal to 5.0 [double.gte]
|
|
1305
|
+
* double value = 1 [(buf.validate.field).double.gte = 5.0];
|
|
1306
|
+
*
|
|
1307
|
+
* // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]
|
|
1308
|
+
* double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];
|
|
1309
|
+
*
|
|
1310
|
+
* // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]
|
|
1311
|
+
* double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];
|
|
1312
|
+
* }
|
|
1313
|
+
* ```
|
|
1314
|
+
*
|
|
1315
|
+
* @generated from field: double gte = 5;
|
|
1316
|
+
*/
|
|
1317
|
+
gte?: number | "NaN" | "Infinity" | "-Infinity";
|
|
1318
|
+
/**
|
|
1319
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1320
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1321
|
+
* generated.
|
|
1322
|
+
*
|
|
1323
|
+
* ```proto
|
|
1324
|
+
* message MyDouble {
|
|
1325
|
+
* // value must be in list [1.0, 2.0, 3.0]
|
|
1326
|
+
* repeated double value = 1 (buf.validate.field).double = { in: [1.0, 2.0, 3.0] };
|
|
1327
|
+
* }
|
|
1328
|
+
* ```
|
|
1329
|
+
*
|
|
1330
|
+
* @generated from field: repeated double in = 6;
|
|
1331
|
+
*/
|
|
1332
|
+
in?: (number | "NaN" | "Infinity" | "-Infinity")[];
|
|
1333
|
+
/**
|
|
1334
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1335
|
+
* values. If the field value is one of the specified values, an error
|
|
1336
|
+
* message is generated.
|
|
1337
|
+
*
|
|
1338
|
+
* ```proto
|
|
1339
|
+
* message MyDouble {
|
|
1340
|
+
* // value must not be in list [1.0, 2.0, 3.0]
|
|
1341
|
+
* repeated double value = 1 (buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] };
|
|
1342
|
+
* }
|
|
1343
|
+
* ```
|
|
1344
|
+
*
|
|
1345
|
+
* @generated from field: repeated double not_in = 7;
|
|
1346
|
+
*/
|
|
1347
|
+
notIn?: (number | "NaN" | "Infinity" | "-Infinity")[];
|
|
1348
|
+
/**
|
|
1349
|
+
* `finite` requires the field value to be finite. If the field value is
|
|
1350
|
+
* infinite or NaN, an error message is generated.
|
|
1351
|
+
*
|
|
1352
|
+
* @generated from field: optional bool finite = 8;
|
|
1353
|
+
*/
|
|
1354
|
+
finite?: boolean;
|
|
1355
|
+
/**
|
|
1356
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1357
|
+
* conform to other constraints. `example` values will not impact validation
|
|
1358
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1359
|
+
*
|
|
1360
|
+
* ```proto
|
|
1361
|
+
* message MyDouble {
|
|
1362
|
+
* double value = 1 [
|
|
1363
|
+
* (buf.validate.field).double.example = 1.0,
|
|
1364
|
+
* (buf.validate.field).double.example = "Infinity"
|
|
1365
|
+
* ];
|
|
1366
|
+
* }
|
|
1367
|
+
* ```
|
|
1368
|
+
*
|
|
1369
|
+
* @generated from field: repeated double example = 9;
|
|
1370
|
+
*/
|
|
1371
|
+
example?: (number | "NaN" | "Infinity" | "-Infinity")[];
|
|
1372
|
+
};
|
|
752
1373
|
/**
|
|
753
1374
|
* Describes the message buf.validate.DoubleRules.
|
|
754
1375
|
* Use `create(DoubleRulesSchema)` to create a new message.
|
|
755
1376
|
*/
|
|
756
|
-
export declare const DoubleRulesSchema: GenMessage<DoubleRules>;
|
|
1377
|
+
export declare const DoubleRulesSchema: GenMessage<DoubleRules, DoubleRulesJson>;
|
|
757
1378
|
/**
|
|
758
1379
|
* Int32Rules describes the constraints applied to `int32` values. These
|
|
759
1380
|
* rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.
|
|
@@ -922,51 +1543,196 @@ export type Int32Rules = Message<"buf.validate.Int32Rules"> & {
|
|
|
922
1543
|
example: number[];
|
|
923
1544
|
};
|
|
924
1545
|
/**
|
|
925
|
-
*
|
|
926
|
-
*
|
|
927
|
-
*/
|
|
928
|
-
export declare const Int32RulesSchema: GenMessage<Int32Rules>;
|
|
929
|
-
/**
|
|
930
|
-
* Int64Rules describes the constraints applied to `int64` values. These
|
|
931
|
-
* rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
|
|
1546
|
+
* Int32Rules describes the constraints applied to `int32` values. These
|
|
1547
|
+
* rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.
|
|
932
1548
|
*
|
|
933
|
-
* @generated from message buf.validate.
|
|
1549
|
+
* @generated from message buf.validate.Int32Rules
|
|
934
1550
|
*/
|
|
935
|
-
export type
|
|
1551
|
+
export type Int32RulesJson = {
|
|
936
1552
|
/**
|
|
937
1553
|
* `const` requires the field value to exactly match the specified value. If
|
|
938
1554
|
* the field value doesn't match, an error message is generated.
|
|
939
1555
|
*
|
|
940
1556
|
* ```proto
|
|
941
|
-
* message
|
|
1557
|
+
* message MyInt32 {
|
|
942
1558
|
* // value must equal 42
|
|
943
|
-
*
|
|
1559
|
+
* int32 value = 1 [(buf.validate.field).int32.const = 42];
|
|
944
1560
|
* }
|
|
945
1561
|
* ```
|
|
946
1562
|
*
|
|
947
|
-
* @generated from field: optional
|
|
1563
|
+
* @generated from field: optional int32 const = 1;
|
|
948
1564
|
*/
|
|
949
|
-
const
|
|
1565
|
+
const?: number;
|
|
950
1566
|
/**
|
|
951
|
-
*
|
|
1567
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
1568
|
+
* < value). If the field value is equal to or greater than the specified
|
|
1569
|
+
* value, an error message is generated.
|
|
1570
|
+
*
|
|
1571
|
+
* ```proto
|
|
1572
|
+
* message MyInt32 {
|
|
1573
|
+
* // value must be less than 10
|
|
1574
|
+
* int32 value = 1 [(buf.validate.field).int32.lt = 10];
|
|
1575
|
+
* }
|
|
1576
|
+
* ```
|
|
1577
|
+
*
|
|
1578
|
+
* @generated from field: int32 lt = 2;
|
|
952
1579
|
*/
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1580
|
+
lt?: number;
|
|
1581
|
+
/**
|
|
1582
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1583
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1584
|
+
* value, an error message is generated.
|
|
1585
|
+
*
|
|
1586
|
+
* ```proto
|
|
1587
|
+
* message MyInt32 {
|
|
1588
|
+
* // value must be less than or equal to 10
|
|
1589
|
+
* int32 value = 1 [(buf.validate.field).int32.lte = 10];
|
|
1590
|
+
* }
|
|
1591
|
+
* ```
|
|
1592
|
+
*
|
|
1593
|
+
* @generated from field: int32 lte = 3;
|
|
1594
|
+
*/
|
|
1595
|
+
lte?: number;
|
|
1596
|
+
/**
|
|
1597
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1598
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1599
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1600
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1601
|
+
* an error message is generated.
|
|
1602
|
+
*
|
|
1603
|
+
* ```proto
|
|
1604
|
+
* message MyInt32 {
|
|
1605
|
+
* // value must be greater than 5 [int32.gt]
|
|
1606
|
+
* int32 value = 1 [(buf.validate.field).int32.gt = 5];
|
|
1607
|
+
*
|
|
1608
|
+
* // value must be greater than 5 and less than 10 [int32.gt_lt]
|
|
1609
|
+
* int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];
|
|
1610
|
+
*
|
|
1611
|
+
* // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]
|
|
1612
|
+
* int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];
|
|
1613
|
+
* }
|
|
1614
|
+
* ```
|
|
1615
|
+
*
|
|
1616
|
+
* @generated from field: int32 gt = 4;
|
|
1617
|
+
*/
|
|
1618
|
+
gt?: number;
|
|
1619
|
+
/**
|
|
1620
|
+
* `gte` requires the field value to be greater than or equal to the specified value
|
|
1621
|
+
* (exclusive). If the value of `gte` is larger than a specified `lt` or
|
|
1622
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1623
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1624
|
+
* an error message is generated.
|
|
1625
|
+
*
|
|
1626
|
+
* ```proto
|
|
1627
|
+
* message MyInt32 {
|
|
1628
|
+
* // value must be greater than or equal to 5 [int32.gte]
|
|
1629
|
+
* int32 value = 1 [(buf.validate.field).int32.gte = 5];
|
|
1630
|
+
*
|
|
1631
|
+
* // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]
|
|
1632
|
+
* int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];
|
|
1633
|
+
*
|
|
1634
|
+
* // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]
|
|
1635
|
+
* int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];
|
|
1636
|
+
* }
|
|
1637
|
+
* ```
|
|
1638
|
+
*
|
|
1639
|
+
* @generated from field: int32 gte = 5;
|
|
1640
|
+
*/
|
|
1641
|
+
gte?: number;
|
|
1642
|
+
/**
|
|
1643
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1644
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1645
|
+
* generated.
|
|
1646
|
+
*
|
|
1647
|
+
* ```proto
|
|
1648
|
+
* message MyInt32 {
|
|
1649
|
+
* // value must be in list [1, 2, 3]
|
|
1650
|
+
* repeated int32 value = 1 (buf.validate.field).int32 = { in: [1, 2, 3] };
|
|
1651
|
+
* }
|
|
1652
|
+
* ```
|
|
1653
|
+
*
|
|
1654
|
+
* @generated from field: repeated int32 in = 6;
|
|
1655
|
+
*/
|
|
1656
|
+
in?: number[];
|
|
1657
|
+
/**
|
|
1658
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1659
|
+
* values. If the field value is one of the specified values, an error message
|
|
1660
|
+
* is generated.
|
|
1661
|
+
*
|
|
1662
|
+
* ```proto
|
|
1663
|
+
* message MyInt32 {
|
|
1664
|
+
* // value must not be in list [1, 2, 3]
|
|
1665
|
+
* repeated int32 value = 1 (buf.validate.field).int32 = { not_in: [1, 2, 3] };
|
|
1666
|
+
* }
|
|
1667
|
+
* ```
|
|
1668
|
+
*
|
|
1669
|
+
* @generated from field: repeated int32 not_in = 7;
|
|
1670
|
+
*/
|
|
1671
|
+
notIn?: number[];
|
|
1672
|
+
/**
|
|
1673
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1674
|
+
* conform to other constraints. `example` values will not impact validation
|
|
1675
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1676
|
+
*
|
|
1677
|
+
* ```proto
|
|
1678
|
+
* message MyInt32 {
|
|
1679
|
+
* int32 value = 1 [
|
|
1680
|
+
* (buf.validate.field).int32.example = 1,
|
|
1681
|
+
* (buf.validate.field).int32.example = -10
|
|
1682
|
+
* ];
|
|
1683
|
+
* }
|
|
1684
|
+
* ```
|
|
1685
|
+
*
|
|
1686
|
+
* @generated from field: repeated int32 example = 8;
|
|
1687
|
+
*/
|
|
1688
|
+
example?: number[];
|
|
1689
|
+
};
|
|
1690
|
+
/**
|
|
1691
|
+
* Describes the message buf.validate.Int32Rules.
|
|
1692
|
+
* Use `create(Int32RulesSchema)` to create a new message.
|
|
1693
|
+
*/
|
|
1694
|
+
export declare const Int32RulesSchema: GenMessage<Int32Rules, Int32RulesJson>;
|
|
1695
|
+
/**
|
|
1696
|
+
* Int64Rules describes the constraints applied to `int64` values. These
|
|
1697
|
+
* rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
|
|
1698
|
+
*
|
|
1699
|
+
* @generated from message buf.validate.Int64Rules
|
|
1700
|
+
*/
|
|
1701
|
+
export type Int64Rules = Message<"buf.validate.Int64Rules"> & {
|
|
1702
|
+
/**
|
|
1703
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1704
|
+
* the field value doesn't match, an error message is generated.
|
|
1705
|
+
*
|
|
1706
|
+
* ```proto
|
|
1707
|
+
* message MyInt64 {
|
|
1708
|
+
* // value must equal 42
|
|
1709
|
+
* int64 value = 1 [(buf.validate.field).int64.const = 42];
|
|
1710
|
+
* }
|
|
1711
|
+
* ```
|
|
1712
|
+
*
|
|
1713
|
+
* @generated from field: optional int64 const = 1;
|
|
1714
|
+
*/
|
|
1715
|
+
const: bigint;
|
|
1716
|
+
/**
|
|
1717
|
+
* @generated from oneof buf.validate.Int64Rules.less_than
|
|
1718
|
+
*/
|
|
1719
|
+
lessThan: {
|
|
1720
|
+
/**
|
|
1721
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1722
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
1723
|
+
* an error message is generated.
|
|
1724
|
+
*
|
|
1725
|
+
* ```proto
|
|
1726
|
+
* message MyInt64 {
|
|
1727
|
+
* // value must be less than 10
|
|
1728
|
+
* int64 value = 1 [(buf.validate.field).int64.lt = 10];
|
|
1729
|
+
* }
|
|
1730
|
+
* ```
|
|
1731
|
+
*
|
|
1732
|
+
* @generated from field: int64 lt = 2;
|
|
1733
|
+
*/
|
|
1734
|
+
value: bigint;
|
|
1735
|
+
case: "lt";
|
|
970
1736
|
} | {
|
|
971
1737
|
/**
|
|
972
1738
|
* `lte` requires the field value to be less than or equal to the specified
|
|
@@ -1093,11 +1859,156 @@ export type Int64Rules = Message<"buf.validate.Int64Rules"> & {
|
|
|
1093
1859
|
*/
|
|
1094
1860
|
example: bigint[];
|
|
1095
1861
|
};
|
|
1862
|
+
/**
|
|
1863
|
+
* Int64Rules describes the constraints applied to `int64` values. These
|
|
1864
|
+
* rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
|
|
1865
|
+
*
|
|
1866
|
+
* @generated from message buf.validate.Int64Rules
|
|
1867
|
+
*/
|
|
1868
|
+
export type Int64RulesJson = {
|
|
1869
|
+
/**
|
|
1870
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1871
|
+
* the field value doesn't match, an error message is generated.
|
|
1872
|
+
*
|
|
1873
|
+
* ```proto
|
|
1874
|
+
* message MyInt64 {
|
|
1875
|
+
* // value must equal 42
|
|
1876
|
+
* int64 value = 1 [(buf.validate.field).int64.const = 42];
|
|
1877
|
+
* }
|
|
1878
|
+
* ```
|
|
1879
|
+
*
|
|
1880
|
+
* @generated from field: optional int64 const = 1;
|
|
1881
|
+
*/
|
|
1882
|
+
const?: string;
|
|
1883
|
+
/**
|
|
1884
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1885
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
1886
|
+
* an error message is generated.
|
|
1887
|
+
*
|
|
1888
|
+
* ```proto
|
|
1889
|
+
* message MyInt64 {
|
|
1890
|
+
* // value must be less than 10
|
|
1891
|
+
* int64 value = 1 [(buf.validate.field).int64.lt = 10];
|
|
1892
|
+
* }
|
|
1893
|
+
* ```
|
|
1894
|
+
*
|
|
1895
|
+
* @generated from field: int64 lt = 2;
|
|
1896
|
+
*/
|
|
1897
|
+
lt?: string;
|
|
1898
|
+
/**
|
|
1899
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1900
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1901
|
+
* value, an error message is generated.
|
|
1902
|
+
*
|
|
1903
|
+
* ```proto
|
|
1904
|
+
* message MyInt64 {
|
|
1905
|
+
* // value must be less than or equal to 10
|
|
1906
|
+
* int64 value = 1 [(buf.validate.field).int64.lte = 10];
|
|
1907
|
+
* }
|
|
1908
|
+
* ```
|
|
1909
|
+
*
|
|
1910
|
+
* @generated from field: int64 lte = 3;
|
|
1911
|
+
*/
|
|
1912
|
+
lte?: string;
|
|
1913
|
+
/**
|
|
1914
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1915
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1916
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1917
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1918
|
+
* an error message is generated.
|
|
1919
|
+
*
|
|
1920
|
+
* ```proto
|
|
1921
|
+
* message MyInt64 {
|
|
1922
|
+
* // value must be greater than 5 [int64.gt]
|
|
1923
|
+
* int64 value = 1 [(buf.validate.field).int64.gt = 5];
|
|
1924
|
+
*
|
|
1925
|
+
* // value must be greater than 5 and less than 10 [int64.gt_lt]
|
|
1926
|
+
* int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];
|
|
1927
|
+
*
|
|
1928
|
+
* // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]
|
|
1929
|
+
* int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];
|
|
1930
|
+
* }
|
|
1931
|
+
* ```
|
|
1932
|
+
*
|
|
1933
|
+
* @generated from field: int64 gt = 4;
|
|
1934
|
+
*/
|
|
1935
|
+
gt?: string;
|
|
1936
|
+
/**
|
|
1937
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1938
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1939
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1940
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1941
|
+
* an error message is generated.
|
|
1942
|
+
*
|
|
1943
|
+
* ```proto
|
|
1944
|
+
* message MyInt64 {
|
|
1945
|
+
* // value must be greater than or equal to 5 [int64.gte]
|
|
1946
|
+
* int64 value = 1 [(buf.validate.field).int64.gte = 5];
|
|
1947
|
+
*
|
|
1948
|
+
* // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]
|
|
1949
|
+
* int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];
|
|
1950
|
+
*
|
|
1951
|
+
* // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]
|
|
1952
|
+
* int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];
|
|
1953
|
+
* }
|
|
1954
|
+
* ```
|
|
1955
|
+
*
|
|
1956
|
+
* @generated from field: int64 gte = 5;
|
|
1957
|
+
*/
|
|
1958
|
+
gte?: string;
|
|
1959
|
+
/**
|
|
1960
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1961
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1962
|
+
* generated.
|
|
1963
|
+
*
|
|
1964
|
+
* ```proto
|
|
1965
|
+
* message MyInt64 {
|
|
1966
|
+
* // value must be in list [1, 2, 3]
|
|
1967
|
+
* repeated int64 value = 1 (buf.validate.field).int64 = { in: [1, 2, 3] };
|
|
1968
|
+
* }
|
|
1969
|
+
* ```
|
|
1970
|
+
*
|
|
1971
|
+
* @generated from field: repeated int64 in = 6;
|
|
1972
|
+
*/
|
|
1973
|
+
in?: string[];
|
|
1974
|
+
/**
|
|
1975
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1976
|
+
* values. If the field value is one of the specified values, an error
|
|
1977
|
+
* message is generated.
|
|
1978
|
+
*
|
|
1979
|
+
* ```proto
|
|
1980
|
+
* message MyInt64 {
|
|
1981
|
+
* // value must not be in list [1, 2, 3]
|
|
1982
|
+
* repeated int64 value = 1 (buf.validate.field).int64 = { not_in: [1, 2, 3] };
|
|
1983
|
+
* }
|
|
1984
|
+
* ```
|
|
1985
|
+
*
|
|
1986
|
+
* @generated from field: repeated int64 not_in = 7;
|
|
1987
|
+
*/
|
|
1988
|
+
notIn?: string[];
|
|
1989
|
+
/**
|
|
1990
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1991
|
+
* conform to other constraints. `example` values will not impact validation
|
|
1992
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1993
|
+
*
|
|
1994
|
+
* ```proto
|
|
1995
|
+
* message MyInt64 {
|
|
1996
|
+
* int64 value = 1 [
|
|
1997
|
+
* (buf.validate.field).int64.example = 1,
|
|
1998
|
+
* (buf.validate.field).int64.example = -10
|
|
1999
|
+
* ];
|
|
2000
|
+
* }
|
|
2001
|
+
* ```
|
|
2002
|
+
*
|
|
2003
|
+
* @generated from field: repeated int64 example = 9;
|
|
2004
|
+
*/
|
|
2005
|
+
example?: string[];
|
|
2006
|
+
};
|
|
1096
2007
|
/**
|
|
1097
2008
|
* Describes the message buf.validate.Int64Rules.
|
|
1098
2009
|
* Use `create(Int64RulesSchema)` to create a new message.
|
|
1099
2010
|
*/
|
|
1100
|
-
export declare const Int64RulesSchema: GenMessage<Int64Rules>;
|
|
2011
|
+
export declare const Int64RulesSchema: GenMessage<Int64Rules, Int64RulesJson>;
|
|
1101
2012
|
/**
|
|
1102
2013
|
* UInt32Rules describes the constraints applied to `uint32` values. These
|
|
1103
2014
|
* rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.
|
|
@@ -1266,47 +2177,192 @@ export type UInt32Rules = Message<"buf.validate.UInt32Rules"> & {
|
|
|
1266
2177
|
example: number[];
|
|
1267
2178
|
};
|
|
1268
2179
|
/**
|
|
1269
|
-
*
|
|
1270
|
-
*
|
|
1271
|
-
*/
|
|
1272
|
-
export declare const UInt32RulesSchema: GenMessage<UInt32Rules>;
|
|
1273
|
-
/**
|
|
1274
|
-
* UInt64Rules describes the constraints applied to `uint64` values. These
|
|
1275
|
-
* rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
|
|
2180
|
+
* UInt32Rules describes the constraints applied to `uint32` values. These
|
|
2181
|
+
* rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.
|
|
1276
2182
|
*
|
|
1277
|
-
* @generated from message buf.validate.
|
|
2183
|
+
* @generated from message buf.validate.UInt32Rules
|
|
1278
2184
|
*/
|
|
1279
|
-
export type
|
|
2185
|
+
export type UInt32RulesJson = {
|
|
1280
2186
|
/**
|
|
1281
2187
|
* `const` requires the field value to exactly match the specified value. If
|
|
1282
2188
|
* the field value doesn't match, an error message is generated.
|
|
1283
2189
|
*
|
|
1284
2190
|
* ```proto
|
|
1285
|
-
* message
|
|
2191
|
+
* message MyUInt32 {
|
|
1286
2192
|
* // value must equal 42
|
|
1287
|
-
*
|
|
2193
|
+
* uint32 value = 1 [(buf.validate.field).uint32.const = 42];
|
|
1288
2194
|
* }
|
|
1289
2195
|
* ```
|
|
1290
2196
|
*
|
|
1291
|
-
* @generated from field: optional
|
|
2197
|
+
* @generated from field: optional uint32 const = 1;
|
|
1292
2198
|
*/
|
|
1293
|
-
const
|
|
2199
|
+
const?: number;
|
|
1294
2200
|
/**
|
|
1295
|
-
*
|
|
2201
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
2202
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
2203
|
+
* an error message is generated.
|
|
2204
|
+
*
|
|
2205
|
+
* ```proto
|
|
2206
|
+
* message MyUInt32 {
|
|
2207
|
+
* // value must be less than 10
|
|
2208
|
+
* uint32 value = 1 [(buf.validate.field).uint32.lt = 10];
|
|
2209
|
+
* }
|
|
2210
|
+
* ```
|
|
2211
|
+
*
|
|
2212
|
+
* @generated from field: uint32 lt = 2;
|
|
1296
2213
|
*/
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
2214
|
+
lt?: number;
|
|
2215
|
+
/**
|
|
2216
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
2217
|
+
* value (field <= value). If the field value is greater than the specified
|
|
2218
|
+
* value, an error message is generated.
|
|
2219
|
+
*
|
|
2220
|
+
* ```proto
|
|
2221
|
+
* message MyUInt32 {
|
|
2222
|
+
* // value must be less than or equal to 10
|
|
2223
|
+
* uint32 value = 1 [(buf.validate.field).uint32.lte = 10];
|
|
2224
|
+
* }
|
|
2225
|
+
* ```
|
|
2226
|
+
*
|
|
2227
|
+
* @generated from field: uint32 lte = 3;
|
|
2228
|
+
*/
|
|
2229
|
+
lte?: number;
|
|
2230
|
+
/**
|
|
2231
|
+
* `gt` requires the field value to be greater than the specified value
|
|
2232
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
2233
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
2234
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2235
|
+
* an error message is generated.
|
|
2236
|
+
*
|
|
2237
|
+
* ```proto
|
|
2238
|
+
* message MyUInt32 {
|
|
2239
|
+
* // value must be greater than 5 [uint32.gt]
|
|
2240
|
+
* uint32 value = 1 [(buf.validate.field).uint32.gt = 5];
|
|
2241
|
+
*
|
|
2242
|
+
* // value must be greater than 5 and less than 10 [uint32.gt_lt]
|
|
2243
|
+
* uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];
|
|
2244
|
+
*
|
|
2245
|
+
* // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]
|
|
2246
|
+
* uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];
|
|
2247
|
+
* }
|
|
2248
|
+
* ```
|
|
2249
|
+
*
|
|
2250
|
+
* @generated from field: uint32 gt = 4;
|
|
2251
|
+
*/
|
|
2252
|
+
gt?: number;
|
|
2253
|
+
/**
|
|
2254
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
2255
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
2256
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
2257
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2258
|
+
* an error message is generated.
|
|
2259
|
+
*
|
|
2260
|
+
* ```proto
|
|
2261
|
+
* message MyUInt32 {
|
|
2262
|
+
* // value must be greater than or equal to 5 [uint32.gte]
|
|
2263
|
+
* uint32 value = 1 [(buf.validate.field).uint32.gte = 5];
|
|
2264
|
+
*
|
|
2265
|
+
* // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]
|
|
2266
|
+
* uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];
|
|
2267
|
+
*
|
|
2268
|
+
* // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]
|
|
2269
|
+
* uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];
|
|
2270
|
+
* }
|
|
2271
|
+
* ```
|
|
2272
|
+
*
|
|
2273
|
+
* @generated from field: uint32 gte = 5;
|
|
2274
|
+
*/
|
|
2275
|
+
gte?: number;
|
|
2276
|
+
/**
|
|
2277
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
2278
|
+
* If the field value isn't one of the specified values, an error message is
|
|
2279
|
+
* generated.
|
|
2280
|
+
*
|
|
2281
|
+
* ```proto
|
|
2282
|
+
* message MyUInt32 {
|
|
2283
|
+
* // value must be in list [1, 2, 3]
|
|
2284
|
+
* repeated uint32 value = 1 (buf.validate.field).uint32 = { in: [1, 2, 3] };
|
|
2285
|
+
* }
|
|
2286
|
+
* ```
|
|
2287
|
+
*
|
|
2288
|
+
* @generated from field: repeated uint32 in = 6;
|
|
2289
|
+
*/
|
|
2290
|
+
in?: number[];
|
|
2291
|
+
/**
|
|
2292
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
2293
|
+
* values. If the field value is one of the specified values, an error
|
|
2294
|
+
* message is generated.
|
|
2295
|
+
*
|
|
2296
|
+
* ```proto
|
|
2297
|
+
* message MyUInt32 {
|
|
2298
|
+
* // value must not be in list [1, 2, 3]
|
|
2299
|
+
* repeated uint32 value = 1 (buf.validate.field).uint32 = { not_in: [1, 2, 3] };
|
|
2300
|
+
* }
|
|
2301
|
+
* ```
|
|
2302
|
+
*
|
|
2303
|
+
* @generated from field: repeated uint32 not_in = 7;
|
|
2304
|
+
*/
|
|
2305
|
+
notIn?: number[];
|
|
2306
|
+
/**
|
|
2307
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2308
|
+
* conform to other constraints. `example` values will not impact validation
|
|
2309
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2310
|
+
*
|
|
2311
|
+
* ```proto
|
|
2312
|
+
* message MyUInt32 {
|
|
2313
|
+
* uint32 value = 1 [
|
|
2314
|
+
* (buf.validate.field).uint32.example = 1,
|
|
2315
|
+
* (buf.validate.field).uint32.example = 10
|
|
2316
|
+
* ];
|
|
2317
|
+
* }
|
|
2318
|
+
* ```
|
|
2319
|
+
*
|
|
2320
|
+
* @generated from field: repeated uint32 example = 8;
|
|
2321
|
+
*/
|
|
2322
|
+
example?: number[];
|
|
2323
|
+
};
|
|
2324
|
+
/**
|
|
2325
|
+
* Describes the message buf.validate.UInt32Rules.
|
|
2326
|
+
* Use `create(UInt32RulesSchema)` to create a new message.
|
|
2327
|
+
*/
|
|
2328
|
+
export declare const UInt32RulesSchema: GenMessage<UInt32Rules, UInt32RulesJson>;
|
|
2329
|
+
/**
|
|
2330
|
+
* UInt64Rules describes the constraints applied to `uint64` values. These
|
|
2331
|
+
* rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
|
|
2332
|
+
*
|
|
2333
|
+
* @generated from message buf.validate.UInt64Rules
|
|
2334
|
+
*/
|
|
2335
|
+
export type UInt64Rules = Message<"buf.validate.UInt64Rules"> & {
|
|
2336
|
+
/**
|
|
2337
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2338
|
+
* the field value doesn't match, an error message is generated.
|
|
2339
|
+
*
|
|
2340
|
+
* ```proto
|
|
2341
|
+
* message MyUInt64 {
|
|
2342
|
+
* // value must equal 42
|
|
2343
|
+
* uint64 value = 1 [(buf.validate.field).uint64.const = 42];
|
|
2344
|
+
* }
|
|
2345
|
+
* ```
|
|
2346
|
+
*
|
|
2347
|
+
* @generated from field: optional uint64 const = 1;
|
|
2348
|
+
*/
|
|
2349
|
+
const: bigint;
|
|
2350
|
+
/**
|
|
2351
|
+
* @generated from oneof buf.validate.UInt64Rules.less_than
|
|
2352
|
+
*/
|
|
2353
|
+
lessThan: {
|
|
2354
|
+
/**
|
|
2355
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
2356
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
2357
|
+
* an error message is generated.
|
|
2358
|
+
*
|
|
2359
|
+
* ```proto
|
|
2360
|
+
* message MyUInt64 {
|
|
2361
|
+
* // value must be less than 10
|
|
2362
|
+
* uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
|
|
2363
|
+
* }
|
|
2364
|
+
* ```
|
|
2365
|
+
*
|
|
1310
2366
|
* @generated from field: uint64 lt = 2;
|
|
1311
2367
|
*/
|
|
1312
2368
|
value: bigint;
|
|
@@ -1437,11 +2493,156 @@ export type UInt64Rules = Message<"buf.validate.UInt64Rules"> & {
|
|
|
1437
2493
|
*/
|
|
1438
2494
|
example: bigint[];
|
|
1439
2495
|
};
|
|
2496
|
+
/**
|
|
2497
|
+
* UInt64Rules describes the constraints applied to `uint64` values. These
|
|
2498
|
+
* rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
|
|
2499
|
+
*
|
|
2500
|
+
* @generated from message buf.validate.UInt64Rules
|
|
2501
|
+
*/
|
|
2502
|
+
export type UInt64RulesJson = {
|
|
2503
|
+
/**
|
|
2504
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2505
|
+
* the field value doesn't match, an error message is generated.
|
|
2506
|
+
*
|
|
2507
|
+
* ```proto
|
|
2508
|
+
* message MyUInt64 {
|
|
2509
|
+
* // value must equal 42
|
|
2510
|
+
* uint64 value = 1 [(buf.validate.field).uint64.const = 42];
|
|
2511
|
+
* }
|
|
2512
|
+
* ```
|
|
2513
|
+
*
|
|
2514
|
+
* @generated from field: optional uint64 const = 1;
|
|
2515
|
+
*/
|
|
2516
|
+
const?: string;
|
|
2517
|
+
/**
|
|
2518
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
2519
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
2520
|
+
* an error message is generated.
|
|
2521
|
+
*
|
|
2522
|
+
* ```proto
|
|
2523
|
+
* message MyUInt64 {
|
|
2524
|
+
* // value must be less than 10
|
|
2525
|
+
* uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
|
|
2526
|
+
* }
|
|
2527
|
+
* ```
|
|
2528
|
+
*
|
|
2529
|
+
* @generated from field: uint64 lt = 2;
|
|
2530
|
+
*/
|
|
2531
|
+
lt?: string;
|
|
2532
|
+
/**
|
|
2533
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
2534
|
+
* value (field <= value). If the field value is greater than the specified
|
|
2535
|
+
* value, an error message is generated.
|
|
2536
|
+
*
|
|
2537
|
+
* ```proto
|
|
2538
|
+
* message MyUInt64 {
|
|
2539
|
+
* // value must be less than or equal to 10
|
|
2540
|
+
* uint64 value = 1 [(buf.validate.field).uint64.lte = 10];
|
|
2541
|
+
* }
|
|
2542
|
+
* ```
|
|
2543
|
+
*
|
|
2544
|
+
* @generated from field: uint64 lte = 3;
|
|
2545
|
+
*/
|
|
2546
|
+
lte?: string;
|
|
2547
|
+
/**
|
|
2548
|
+
* `gt` requires the field value to be greater than the specified value
|
|
2549
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
2550
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
2551
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2552
|
+
* an error message is generated.
|
|
2553
|
+
*
|
|
2554
|
+
* ```proto
|
|
2555
|
+
* message MyUInt64 {
|
|
2556
|
+
* // value must be greater than 5 [uint64.gt]
|
|
2557
|
+
* uint64 value = 1 [(buf.validate.field).uint64.gt = 5];
|
|
2558
|
+
*
|
|
2559
|
+
* // value must be greater than 5 and less than 10 [uint64.gt_lt]
|
|
2560
|
+
* uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];
|
|
2561
|
+
*
|
|
2562
|
+
* // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]
|
|
2563
|
+
* uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];
|
|
2564
|
+
* }
|
|
2565
|
+
* ```
|
|
2566
|
+
*
|
|
2567
|
+
* @generated from field: uint64 gt = 4;
|
|
2568
|
+
*/
|
|
2569
|
+
gt?: string;
|
|
2570
|
+
/**
|
|
2571
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
2572
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
2573
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
2574
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2575
|
+
* an error message is generated.
|
|
2576
|
+
*
|
|
2577
|
+
* ```proto
|
|
2578
|
+
* message MyUInt64 {
|
|
2579
|
+
* // value must be greater than or equal to 5 [uint64.gte]
|
|
2580
|
+
* uint64 value = 1 [(buf.validate.field).uint64.gte = 5];
|
|
2581
|
+
*
|
|
2582
|
+
* // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]
|
|
2583
|
+
* uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];
|
|
2584
|
+
*
|
|
2585
|
+
* // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]
|
|
2586
|
+
* uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];
|
|
2587
|
+
* }
|
|
2588
|
+
* ```
|
|
2589
|
+
*
|
|
2590
|
+
* @generated from field: uint64 gte = 5;
|
|
2591
|
+
*/
|
|
2592
|
+
gte?: string;
|
|
2593
|
+
/**
|
|
2594
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
2595
|
+
* If the field value isn't one of the specified values, an error message is
|
|
2596
|
+
* generated.
|
|
2597
|
+
*
|
|
2598
|
+
* ```proto
|
|
2599
|
+
* message MyUInt64 {
|
|
2600
|
+
* // value must be in list [1, 2, 3]
|
|
2601
|
+
* repeated uint64 value = 1 (buf.validate.field).uint64 = { in: [1, 2, 3] };
|
|
2602
|
+
* }
|
|
2603
|
+
* ```
|
|
2604
|
+
*
|
|
2605
|
+
* @generated from field: repeated uint64 in = 6;
|
|
2606
|
+
*/
|
|
2607
|
+
in?: string[];
|
|
2608
|
+
/**
|
|
2609
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
2610
|
+
* values. If the field value is one of the specified values, an error
|
|
2611
|
+
* message is generated.
|
|
2612
|
+
*
|
|
2613
|
+
* ```proto
|
|
2614
|
+
* message MyUInt64 {
|
|
2615
|
+
* // value must not be in list [1, 2, 3]
|
|
2616
|
+
* repeated uint64 value = 1 (buf.validate.field).uint64 = { not_in: [1, 2, 3] };
|
|
2617
|
+
* }
|
|
2618
|
+
* ```
|
|
2619
|
+
*
|
|
2620
|
+
* @generated from field: repeated uint64 not_in = 7;
|
|
2621
|
+
*/
|
|
2622
|
+
notIn?: string[];
|
|
2623
|
+
/**
|
|
2624
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2625
|
+
* conform to other constraints. `example` values will not impact validation
|
|
2626
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2627
|
+
*
|
|
2628
|
+
* ```proto
|
|
2629
|
+
* message MyUInt64 {
|
|
2630
|
+
* uint64 value = 1 [
|
|
2631
|
+
* (buf.validate.field).uint64.example = 1,
|
|
2632
|
+
* (buf.validate.field).uint64.example = -10
|
|
2633
|
+
* ];
|
|
2634
|
+
* }
|
|
2635
|
+
* ```
|
|
2636
|
+
*
|
|
2637
|
+
* @generated from field: repeated uint64 example = 8;
|
|
2638
|
+
*/
|
|
2639
|
+
example?: string[];
|
|
2640
|
+
};
|
|
1440
2641
|
/**
|
|
1441
2642
|
* Describes the message buf.validate.UInt64Rules.
|
|
1442
2643
|
* Use `create(UInt64RulesSchema)` to create a new message.
|
|
1443
2644
|
*/
|
|
1444
|
-
export declare const UInt64RulesSchema: GenMessage<UInt64Rules>;
|
|
2645
|
+
export declare const UInt64RulesSchema: GenMessage<UInt64Rules, UInt64RulesJson>;
|
|
1445
2646
|
/**
|
|
1446
2647
|
* SInt32Rules describes the constraints applied to `sint32` values.
|
|
1447
2648
|
*
|
|
@@ -1609,52 +2810,196 @@ export type SInt32Rules = Message<"buf.validate.SInt32Rules"> & {
|
|
|
1609
2810
|
example: number[];
|
|
1610
2811
|
};
|
|
1611
2812
|
/**
|
|
1612
|
-
*
|
|
1613
|
-
* Use `create(SInt32RulesSchema)` to create a new message.
|
|
1614
|
-
*/
|
|
1615
|
-
export declare const SInt32RulesSchema: GenMessage<SInt32Rules>;
|
|
1616
|
-
/**
|
|
1617
|
-
* SInt64Rules describes the constraints applied to `sint64` values.
|
|
2813
|
+
* SInt32Rules describes the constraints applied to `sint32` values.
|
|
1618
2814
|
*
|
|
1619
|
-
* @generated from message buf.validate.
|
|
2815
|
+
* @generated from message buf.validate.SInt32Rules
|
|
1620
2816
|
*/
|
|
1621
|
-
export type
|
|
2817
|
+
export type SInt32RulesJson = {
|
|
1622
2818
|
/**
|
|
1623
2819
|
* `const` requires the field value to exactly match the specified value. If
|
|
1624
2820
|
* the field value doesn't match, an error message is generated.
|
|
1625
2821
|
*
|
|
1626
2822
|
* ```proto
|
|
1627
|
-
* message
|
|
2823
|
+
* message MySInt32 {
|
|
1628
2824
|
* // value must equal 42
|
|
1629
|
-
*
|
|
2825
|
+
* sint32 value = 1 [(buf.validate.field).sint32.const = 42];
|
|
1630
2826
|
* }
|
|
1631
2827
|
* ```
|
|
1632
2828
|
*
|
|
1633
|
-
* @generated from field: optional
|
|
2829
|
+
* @generated from field: optional sint32 const = 1;
|
|
1634
2830
|
*/
|
|
1635
|
-
const
|
|
2831
|
+
const?: number;
|
|
1636
2832
|
/**
|
|
1637
|
-
*
|
|
2833
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
2834
|
+
* < value). If the field value is equal to or greater than the specified
|
|
2835
|
+
* value, an error message is generated.
|
|
2836
|
+
*
|
|
2837
|
+
* ```proto
|
|
2838
|
+
* message MySInt32 {
|
|
2839
|
+
* // value must be less than 10
|
|
2840
|
+
* sint32 value = 1 [(buf.validate.field).sint32.lt = 10];
|
|
2841
|
+
* }
|
|
2842
|
+
* ```
|
|
2843
|
+
*
|
|
2844
|
+
* @generated from field: sint32 lt = 2;
|
|
1638
2845
|
*/
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
2846
|
+
lt?: number;
|
|
2847
|
+
/**
|
|
2848
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
2849
|
+
* value (field <= value). If the field value is greater than the specified
|
|
2850
|
+
* value, an error message is generated.
|
|
2851
|
+
*
|
|
2852
|
+
* ```proto
|
|
2853
|
+
* message MySInt32 {
|
|
2854
|
+
* // value must be less than or equal to 10
|
|
2855
|
+
* sint32 value = 1 [(buf.validate.field).sint32.lte = 10];
|
|
2856
|
+
* }
|
|
2857
|
+
* ```
|
|
2858
|
+
*
|
|
2859
|
+
* @generated from field: sint32 lte = 3;
|
|
2860
|
+
*/
|
|
2861
|
+
lte?: number;
|
|
2862
|
+
/**
|
|
2863
|
+
* `gt` requires the field value to be greater than the specified value
|
|
2864
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
2865
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
2866
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2867
|
+
* an error message is generated.
|
|
2868
|
+
*
|
|
2869
|
+
* ```proto
|
|
2870
|
+
* message MySInt32 {
|
|
2871
|
+
* // value must be greater than 5 [sint32.gt]
|
|
2872
|
+
* sint32 value = 1 [(buf.validate.field).sint32.gt = 5];
|
|
2873
|
+
*
|
|
2874
|
+
* // value must be greater than 5 and less than 10 [sint32.gt_lt]
|
|
2875
|
+
* sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];
|
|
2876
|
+
*
|
|
2877
|
+
* // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]
|
|
2878
|
+
* sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];
|
|
2879
|
+
* }
|
|
2880
|
+
* ```
|
|
2881
|
+
*
|
|
2882
|
+
* @generated from field: sint32 gt = 4;
|
|
2883
|
+
*/
|
|
2884
|
+
gt?: number;
|
|
2885
|
+
/**
|
|
2886
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
2887
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
2888
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
2889
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2890
|
+
* an error message is generated.
|
|
2891
|
+
*
|
|
2892
|
+
* ```proto
|
|
2893
|
+
* message MySInt32 {
|
|
2894
|
+
* // value must be greater than or equal to 5 [sint32.gte]
|
|
2895
|
+
* sint32 value = 1 [(buf.validate.field).sint32.gte = 5];
|
|
2896
|
+
*
|
|
2897
|
+
* // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]
|
|
2898
|
+
* sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];
|
|
2899
|
+
*
|
|
2900
|
+
* // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]
|
|
2901
|
+
* sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];
|
|
2902
|
+
* }
|
|
2903
|
+
* ```
|
|
2904
|
+
*
|
|
2905
|
+
* @generated from field: sint32 gte = 5;
|
|
2906
|
+
*/
|
|
2907
|
+
gte?: number;
|
|
2908
|
+
/**
|
|
2909
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
2910
|
+
* If the field value isn't one of the specified values, an error message is
|
|
2911
|
+
* generated.
|
|
2912
|
+
*
|
|
2913
|
+
* ```proto
|
|
2914
|
+
* message MySInt32 {
|
|
2915
|
+
* // value must be in list [1, 2, 3]
|
|
2916
|
+
* repeated sint32 value = 1 (buf.validate.field).sint32 = { in: [1, 2, 3] };
|
|
2917
|
+
* }
|
|
2918
|
+
* ```
|
|
2919
|
+
*
|
|
2920
|
+
* @generated from field: repeated sint32 in = 6;
|
|
2921
|
+
*/
|
|
2922
|
+
in?: number[];
|
|
2923
|
+
/**
|
|
2924
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
2925
|
+
* values. If the field value is one of the specified values, an error
|
|
2926
|
+
* message is generated.
|
|
2927
|
+
*
|
|
2928
|
+
* ```proto
|
|
2929
|
+
* message MySInt32 {
|
|
2930
|
+
* // value must not be in list [1, 2, 3]
|
|
2931
|
+
* repeated sint32 value = 1 (buf.validate.field).sint32 = { not_in: [1, 2, 3] };
|
|
2932
|
+
* }
|
|
2933
|
+
* ```
|
|
2934
|
+
*
|
|
2935
|
+
* @generated from field: repeated sint32 not_in = 7;
|
|
2936
|
+
*/
|
|
2937
|
+
notIn?: number[];
|
|
2938
|
+
/**
|
|
2939
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2940
|
+
* conform to other constraints. `example` values will not impact validation
|
|
2941
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2942
|
+
*
|
|
2943
|
+
* ```proto
|
|
2944
|
+
* message MySInt32 {
|
|
2945
|
+
* sint32 value = 1 [
|
|
2946
|
+
* (buf.validate.field).sint32.example = 1,
|
|
2947
|
+
* (buf.validate.field).sint32.example = -10
|
|
2948
|
+
* ];
|
|
2949
|
+
* }
|
|
2950
|
+
* ```
|
|
2951
|
+
*
|
|
2952
|
+
* @generated from field: repeated sint32 example = 8;
|
|
2953
|
+
*/
|
|
2954
|
+
example?: number[];
|
|
2955
|
+
};
|
|
2956
|
+
/**
|
|
2957
|
+
* Describes the message buf.validate.SInt32Rules.
|
|
2958
|
+
* Use `create(SInt32RulesSchema)` to create a new message.
|
|
2959
|
+
*/
|
|
2960
|
+
export declare const SInt32RulesSchema: GenMessage<SInt32Rules, SInt32RulesJson>;
|
|
2961
|
+
/**
|
|
2962
|
+
* SInt64Rules describes the constraints applied to `sint64` values.
|
|
2963
|
+
*
|
|
2964
|
+
* @generated from message buf.validate.SInt64Rules
|
|
2965
|
+
*/
|
|
2966
|
+
export type SInt64Rules = Message<"buf.validate.SInt64Rules"> & {
|
|
2967
|
+
/**
|
|
2968
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2969
|
+
* the field value doesn't match, an error message is generated.
|
|
2970
|
+
*
|
|
2971
|
+
* ```proto
|
|
2972
|
+
* message MySInt64 {
|
|
2973
|
+
* // value must equal 42
|
|
2974
|
+
* sint64 value = 1 [(buf.validate.field).sint64.const = 42];
|
|
2975
|
+
* }
|
|
2976
|
+
* ```
|
|
2977
|
+
*
|
|
2978
|
+
* @generated from field: optional sint64 const = 1;
|
|
2979
|
+
*/
|
|
2980
|
+
const: bigint;
|
|
2981
|
+
/**
|
|
2982
|
+
* @generated from oneof buf.validate.SInt64Rules.less_than
|
|
2983
|
+
*/
|
|
2984
|
+
lessThan: {
|
|
2985
|
+
/**
|
|
2986
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
2987
|
+
* < value). If the field value is equal to or greater than the specified
|
|
2988
|
+
* value, an error message is generated.
|
|
2989
|
+
*
|
|
2990
|
+
* ```proto
|
|
2991
|
+
* message MySInt64 {
|
|
2992
|
+
* // value must be less than 10
|
|
2993
|
+
* sint64 value = 1 [(buf.validate.field).sint64.lt = 10];
|
|
2994
|
+
* }
|
|
2995
|
+
* ```
|
|
2996
|
+
*
|
|
2997
|
+
* @generated from field: sint64 lt = 2;
|
|
2998
|
+
*/
|
|
2999
|
+
value: bigint;
|
|
3000
|
+
case: "lt";
|
|
3001
|
+
} | {
|
|
3002
|
+
/**
|
|
1658
3003
|
* `lte` requires the field value to be less than or equal to the specified
|
|
1659
3004
|
* value (field <= value). If the field value is greater than the specified
|
|
1660
3005
|
* value, an error message is generated.
|
|
@@ -1779,11 +3124,155 @@ export type SInt64Rules = Message<"buf.validate.SInt64Rules"> & {
|
|
|
1779
3124
|
*/
|
|
1780
3125
|
example: bigint[];
|
|
1781
3126
|
};
|
|
3127
|
+
/**
|
|
3128
|
+
* SInt64Rules describes the constraints applied to `sint64` values.
|
|
3129
|
+
*
|
|
3130
|
+
* @generated from message buf.validate.SInt64Rules
|
|
3131
|
+
*/
|
|
3132
|
+
export type SInt64RulesJson = {
|
|
3133
|
+
/**
|
|
3134
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
3135
|
+
* the field value doesn't match, an error message is generated.
|
|
3136
|
+
*
|
|
3137
|
+
* ```proto
|
|
3138
|
+
* message MySInt64 {
|
|
3139
|
+
* // value must equal 42
|
|
3140
|
+
* sint64 value = 1 [(buf.validate.field).sint64.const = 42];
|
|
3141
|
+
* }
|
|
3142
|
+
* ```
|
|
3143
|
+
*
|
|
3144
|
+
* @generated from field: optional sint64 const = 1;
|
|
3145
|
+
*/
|
|
3146
|
+
const?: string;
|
|
3147
|
+
/**
|
|
3148
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
3149
|
+
* < value). If the field value is equal to or greater than the specified
|
|
3150
|
+
* value, an error message is generated.
|
|
3151
|
+
*
|
|
3152
|
+
* ```proto
|
|
3153
|
+
* message MySInt64 {
|
|
3154
|
+
* // value must be less than 10
|
|
3155
|
+
* sint64 value = 1 [(buf.validate.field).sint64.lt = 10];
|
|
3156
|
+
* }
|
|
3157
|
+
* ```
|
|
3158
|
+
*
|
|
3159
|
+
* @generated from field: sint64 lt = 2;
|
|
3160
|
+
*/
|
|
3161
|
+
lt?: string;
|
|
3162
|
+
/**
|
|
3163
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
3164
|
+
* value (field <= value). If the field value is greater than the specified
|
|
3165
|
+
* value, an error message is generated.
|
|
3166
|
+
*
|
|
3167
|
+
* ```proto
|
|
3168
|
+
* message MySInt64 {
|
|
3169
|
+
* // value must be less than or equal to 10
|
|
3170
|
+
* sint64 value = 1 [(buf.validate.field).sint64.lte = 10];
|
|
3171
|
+
* }
|
|
3172
|
+
* ```
|
|
3173
|
+
*
|
|
3174
|
+
* @generated from field: sint64 lte = 3;
|
|
3175
|
+
*/
|
|
3176
|
+
lte?: string;
|
|
3177
|
+
/**
|
|
3178
|
+
* `gt` requires the field value to be greater than the specified value
|
|
3179
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
3180
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
3181
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3182
|
+
* an error message is generated.
|
|
3183
|
+
*
|
|
3184
|
+
* ```proto
|
|
3185
|
+
* message MySInt64 {
|
|
3186
|
+
* // value must be greater than 5 [sint64.gt]
|
|
3187
|
+
* sint64 value = 1 [(buf.validate.field).sint64.gt = 5];
|
|
3188
|
+
*
|
|
3189
|
+
* // value must be greater than 5 and less than 10 [sint64.gt_lt]
|
|
3190
|
+
* sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];
|
|
3191
|
+
*
|
|
3192
|
+
* // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]
|
|
3193
|
+
* sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];
|
|
3194
|
+
* }
|
|
3195
|
+
* ```
|
|
3196
|
+
*
|
|
3197
|
+
* @generated from field: sint64 gt = 4;
|
|
3198
|
+
*/
|
|
3199
|
+
gt?: string;
|
|
3200
|
+
/**
|
|
3201
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
3202
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
3203
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
3204
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3205
|
+
* an error message is generated.
|
|
3206
|
+
*
|
|
3207
|
+
* ```proto
|
|
3208
|
+
* message MySInt64 {
|
|
3209
|
+
* // value must be greater than or equal to 5 [sint64.gte]
|
|
3210
|
+
* sint64 value = 1 [(buf.validate.field).sint64.gte = 5];
|
|
3211
|
+
*
|
|
3212
|
+
* // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]
|
|
3213
|
+
* sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];
|
|
3214
|
+
*
|
|
3215
|
+
* // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]
|
|
3216
|
+
* sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];
|
|
3217
|
+
* }
|
|
3218
|
+
* ```
|
|
3219
|
+
*
|
|
3220
|
+
* @generated from field: sint64 gte = 5;
|
|
3221
|
+
*/
|
|
3222
|
+
gte?: string;
|
|
3223
|
+
/**
|
|
3224
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
3225
|
+
* If the field value isn't one of the specified values, an error message
|
|
3226
|
+
* is generated.
|
|
3227
|
+
*
|
|
3228
|
+
* ```proto
|
|
3229
|
+
* message MySInt64 {
|
|
3230
|
+
* // value must be in list [1, 2, 3]
|
|
3231
|
+
* repeated sint64 value = 1 (buf.validate.field).sint64 = { in: [1, 2, 3] };
|
|
3232
|
+
* }
|
|
3233
|
+
* ```
|
|
3234
|
+
*
|
|
3235
|
+
* @generated from field: repeated sint64 in = 6;
|
|
3236
|
+
*/
|
|
3237
|
+
in?: string[];
|
|
3238
|
+
/**
|
|
3239
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
3240
|
+
* values. If the field value is one of the specified values, an error
|
|
3241
|
+
* message is generated.
|
|
3242
|
+
*
|
|
3243
|
+
* ```proto
|
|
3244
|
+
* message MySInt64 {
|
|
3245
|
+
* // value must not be in list [1, 2, 3]
|
|
3246
|
+
* repeated sint64 value = 1 (buf.validate.field).sint64 = { not_in: [1, 2, 3] };
|
|
3247
|
+
* }
|
|
3248
|
+
* ```
|
|
3249
|
+
*
|
|
3250
|
+
* @generated from field: repeated sint64 not_in = 7;
|
|
3251
|
+
*/
|
|
3252
|
+
notIn?: string[];
|
|
3253
|
+
/**
|
|
3254
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3255
|
+
* conform to other constraints. `example` values will not impact validation
|
|
3256
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3257
|
+
*
|
|
3258
|
+
* ```proto
|
|
3259
|
+
* message MySInt64 {
|
|
3260
|
+
* sint64 value = 1 [
|
|
3261
|
+
* (buf.validate.field).sint64.example = 1,
|
|
3262
|
+
* (buf.validate.field).sint64.example = -10
|
|
3263
|
+
* ];
|
|
3264
|
+
* }
|
|
3265
|
+
* ```
|
|
3266
|
+
*
|
|
3267
|
+
* @generated from field: repeated sint64 example = 8;
|
|
3268
|
+
*/
|
|
3269
|
+
example?: string[];
|
|
3270
|
+
};
|
|
1782
3271
|
/**
|
|
1783
3272
|
* Describes the message buf.validate.SInt64Rules.
|
|
1784
3273
|
* Use `create(SInt64RulesSchema)` to create a new message.
|
|
1785
3274
|
*/
|
|
1786
|
-
export declare const SInt64RulesSchema: GenMessage<SInt64Rules>;
|
|
3275
|
+
export declare const SInt64RulesSchema: GenMessage<SInt64Rules, SInt64RulesJson>;
|
|
1787
3276
|
/**
|
|
1788
3277
|
* Fixed32Rules describes the constraints applied to `fixed32` values.
|
|
1789
3278
|
*
|
|
@@ -1951,44 +3440,188 @@ export type Fixed32Rules = Message<"buf.validate.Fixed32Rules"> & {
|
|
|
1951
3440
|
example: number[];
|
|
1952
3441
|
};
|
|
1953
3442
|
/**
|
|
1954
|
-
*
|
|
1955
|
-
* Use `create(Fixed32RulesSchema)` to create a new message.
|
|
1956
|
-
*/
|
|
1957
|
-
export declare const Fixed32RulesSchema: GenMessage<Fixed32Rules>;
|
|
1958
|
-
/**
|
|
1959
|
-
* Fixed64Rules describes the constraints applied to `fixed64` values.
|
|
3443
|
+
* Fixed32Rules describes the constraints applied to `fixed32` values.
|
|
1960
3444
|
*
|
|
1961
|
-
* @generated from message buf.validate.
|
|
3445
|
+
* @generated from message buf.validate.Fixed32Rules
|
|
1962
3446
|
*/
|
|
1963
|
-
export type
|
|
3447
|
+
export type Fixed32RulesJson = {
|
|
1964
3448
|
/**
|
|
1965
|
-
* `const` requires the field value to exactly match the specified value.
|
|
1966
|
-
* the field value doesn't match, an error message is generated.
|
|
3449
|
+
* `const` requires the field value to exactly match the specified value.
|
|
3450
|
+
* If the field value doesn't match, an error message is generated.
|
|
1967
3451
|
*
|
|
1968
3452
|
* ```proto
|
|
1969
|
-
* message
|
|
3453
|
+
* message MyFixed32 {
|
|
1970
3454
|
* // value must equal 42
|
|
1971
|
-
*
|
|
3455
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];
|
|
1972
3456
|
* }
|
|
1973
3457
|
* ```
|
|
1974
3458
|
*
|
|
1975
|
-
* @generated from field: optional
|
|
3459
|
+
* @generated from field: optional fixed32 const = 1;
|
|
1976
3460
|
*/
|
|
1977
|
-
const
|
|
3461
|
+
const?: number;
|
|
1978
3462
|
/**
|
|
1979
|
-
*
|
|
3463
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
3464
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
3465
|
+
* an error message is generated.
|
|
3466
|
+
*
|
|
3467
|
+
* ```proto
|
|
3468
|
+
* message MyFixed32 {
|
|
3469
|
+
* // value must be less than 10
|
|
3470
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];
|
|
3471
|
+
* }
|
|
3472
|
+
* ```
|
|
3473
|
+
*
|
|
3474
|
+
* @generated from field: fixed32 lt = 2;
|
|
1980
3475
|
*/
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
3476
|
+
lt?: number;
|
|
3477
|
+
/**
|
|
3478
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
3479
|
+
* value (field <= value). If the field value is greater than the specified
|
|
3480
|
+
* value, an error message is generated.
|
|
3481
|
+
*
|
|
3482
|
+
* ```proto
|
|
3483
|
+
* message MyFixed32 {
|
|
3484
|
+
* // value must be less than or equal to 10
|
|
3485
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];
|
|
3486
|
+
* }
|
|
3487
|
+
* ```
|
|
3488
|
+
*
|
|
3489
|
+
* @generated from field: fixed32 lte = 3;
|
|
3490
|
+
*/
|
|
3491
|
+
lte?: number;
|
|
3492
|
+
/**
|
|
3493
|
+
* `gt` requires the field value to be greater than the specified value
|
|
3494
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
3495
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
3496
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3497
|
+
* an error message is generated.
|
|
3498
|
+
*
|
|
3499
|
+
* ```proto
|
|
3500
|
+
* message MyFixed32 {
|
|
3501
|
+
* // value must be greater than 5 [fixed32.gt]
|
|
3502
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];
|
|
3503
|
+
*
|
|
3504
|
+
* // value must be greater than 5 and less than 10 [fixed32.gt_lt]
|
|
3505
|
+
* fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];
|
|
3506
|
+
*
|
|
3507
|
+
* // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]
|
|
3508
|
+
* fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];
|
|
3509
|
+
* }
|
|
3510
|
+
* ```
|
|
3511
|
+
*
|
|
3512
|
+
* @generated from field: fixed32 gt = 4;
|
|
3513
|
+
*/
|
|
3514
|
+
gt?: number;
|
|
3515
|
+
/**
|
|
3516
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
3517
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
3518
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
3519
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3520
|
+
* an error message is generated.
|
|
3521
|
+
*
|
|
3522
|
+
* ```proto
|
|
3523
|
+
* message MyFixed32 {
|
|
3524
|
+
* // value must be greater than or equal to 5 [fixed32.gte]
|
|
3525
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];
|
|
3526
|
+
*
|
|
3527
|
+
* // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]
|
|
3528
|
+
* fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];
|
|
3529
|
+
*
|
|
3530
|
+
* // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]
|
|
3531
|
+
* fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];
|
|
3532
|
+
* }
|
|
3533
|
+
* ```
|
|
3534
|
+
*
|
|
3535
|
+
* @generated from field: fixed32 gte = 5;
|
|
3536
|
+
*/
|
|
3537
|
+
gte?: number;
|
|
3538
|
+
/**
|
|
3539
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
3540
|
+
* If the field value isn't one of the specified values, an error message
|
|
3541
|
+
* is generated.
|
|
3542
|
+
*
|
|
3543
|
+
* ```proto
|
|
3544
|
+
* message MyFixed32 {
|
|
3545
|
+
* // value must be in list [1, 2, 3]
|
|
3546
|
+
* repeated fixed32 value = 1 (buf.validate.field).fixed32 = { in: [1, 2, 3] };
|
|
3547
|
+
* }
|
|
3548
|
+
* ```
|
|
3549
|
+
*
|
|
3550
|
+
* @generated from field: repeated fixed32 in = 6;
|
|
3551
|
+
*/
|
|
3552
|
+
in?: number[];
|
|
3553
|
+
/**
|
|
3554
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
3555
|
+
* values. If the field value is one of the specified values, an error
|
|
3556
|
+
* message is generated.
|
|
3557
|
+
*
|
|
3558
|
+
* ```proto
|
|
3559
|
+
* message MyFixed32 {
|
|
3560
|
+
* // value must not be in list [1, 2, 3]
|
|
3561
|
+
* repeated fixed32 value = 1 (buf.validate.field).fixed32 = { not_in: [1, 2, 3] };
|
|
3562
|
+
* }
|
|
3563
|
+
* ```
|
|
3564
|
+
*
|
|
3565
|
+
* @generated from field: repeated fixed32 not_in = 7;
|
|
3566
|
+
*/
|
|
3567
|
+
notIn?: number[];
|
|
3568
|
+
/**
|
|
3569
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3570
|
+
* conform to other constraints. `example` values will not impact validation
|
|
3571
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3572
|
+
*
|
|
3573
|
+
* ```proto
|
|
3574
|
+
* message MyFixed32 {
|
|
3575
|
+
* fixed32 value = 1 [
|
|
3576
|
+
* (buf.validate.field).fixed32.example = 1,
|
|
3577
|
+
* (buf.validate.field).fixed32.example = 2
|
|
3578
|
+
* ];
|
|
3579
|
+
* }
|
|
3580
|
+
* ```
|
|
3581
|
+
*
|
|
3582
|
+
* @generated from field: repeated fixed32 example = 8;
|
|
3583
|
+
*/
|
|
3584
|
+
example?: number[];
|
|
3585
|
+
};
|
|
3586
|
+
/**
|
|
3587
|
+
* Describes the message buf.validate.Fixed32Rules.
|
|
3588
|
+
* Use `create(Fixed32RulesSchema)` to create a new message.
|
|
3589
|
+
*/
|
|
3590
|
+
export declare const Fixed32RulesSchema: GenMessage<Fixed32Rules, Fixed32RulesJson>;
|
|
3591
|
+
/**
|
|
3592
|
+
* Fixed64Rules describes the constraints applied to `fixed64` values.
|
|
3593
|
+
*
|
|
3594
|
+
* @generated from message buf.validate.Fixed64Rules
|
|
3595
|
+
*/
|
|
3596
|
+
export type Fixed64Rules = Message<"buf.validate.Fixed64Rules"> & {
|
|
3597
|
+
/**
|
|
3598
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
3599
|
+
* the field value doesn't match, an error message is generated.
|
|
3600
|
+
*
|
|
3601
|
+
* ```proto
|
|
3602
|
+
* message MyFixed64 {
|
|
3603
|
+
* // value must equal 42
|
|
3604
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];
|
|
3605
|
+
* }
|
|
3606
|
+
* ```
|
|
3607
|
+
*
|
|
3608
|
+
* @generated from field: optional fixed64 const = 1;
|
|
3609
|
+
*/
|
|
3610
|
+
const: bigint;
|
|
3611
|
+
/**
|
|
3612
|
+
* @generated from oneof buf.validate.Fixed64Rules.less_than
|
|
3613
|
+
*/
|
|
3614
|
+
lessThan: {
|
|
3615
|
+
/**
|
|
3616
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
3617
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
3618
|
+
* an error message is generated.
|
|
3619
|
+
*
|
|
3620
|
+
* ```proto
|
|
3621
|
+
* message MyFixed64 {
|
|
3622
|
+
* // value must be less than 10
|
|
3623
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];
|
|
3624
|
+
* }
|
|
1992
3625
|
* ```
|
|
1993
3626
|
*
|
|
1994
3627
|
* @generated from field: fixed64 lt = 2;
|
|
@@ -2121,11 +3754,155 @@ export type Fixed64Rules = Message<"buf.validate.Fixed64Rules"> & {
|
|
|
2121
3754
|
*/
|
|
2122
3755
|
example: bigint[];
|
|
2123
3756
|
};
|
|
3757
|
+
/**
|
|
3758
|
+
* Fixed64Rules describes the constraints applied to `fixed64` values.
|
|
3759
|
+
*
|
|
3760
|
+
* @generated from message buf.validate.Fixed64Rules
|
|
3761
|
+
*/
|
|
3762
|
+
export type Fixed64RulesJson = {
|
|
3763
|
+
/**
|
|
3764
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
3765
|
+
* the field value doesn't match, an error message is generated.
|
|
3766
|
+
*
|
|
3767
|
+
* ```proto
|
|
3768
|
+
* message MyFixed64 {
|
|
3769
|
+
* // value must equal 42
|
|
3770
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];
|
|
3771
|
+
* }
|
|
3772
|
+
* ```
|
|
3773
|
+
*
|
|
3774
|
+
* @generated from field: optional fixed64 const = 1;
|
|
3775
|
+
*/
|
|
3776
|
+
const?: string;
|
|
3777
|
+
/**
|
|
3778
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
3779
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
3780
|
+
* an error message is generated.
|
|
3781
|
+
*
|
|
3782
|
+
* ```proto
|
|
3783
|
+
* message MyFixed64 {
|
|
3784
|
+
* // value must be less than 10
|
|
3785
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];
|
|
3786
|
+
* }
|
|
3787
|
+
* ```
|
|
3788
|
+
*
|
|
3789
|
+
* @generated from field: fixed64 lt = 2;
|
|
3790
|
+
*/
|
|
3791
|
+
lt?: string;
|
|
3792
|
+
/**
|
|
3793
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
3794
|
+
* value (field <= value). If the field value is greater than the specified
|
|
3795
|
+
* value, an error message is generated.
|
|
3796
|
+
*
|
|
3797
|
+
* ```proto
|
|
3798
|
+
* message MyFixed64 {
|
|
3799
|
+
* // value must be less than or equal to 10
|
|
3800
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];
|
|
3801
|
+
* }
|
|
3802
|
+
* ```
|
|
3803
|
+
*
|
|
3804
|
+
* @generated from field: fixed64 lte = 3;
|
|
3805
|
+
*/
|
|
3806
|
+
lte?: string;
|
|
3807
|
+
/**
|
|
3808
|
+
* `gt` requires the field value to be greater than the specified value
|
|
3809
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
3810
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
3811
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3812
|
+
* an error message is generated.
|
|
3813
|
+
*
|
|
3814
|
+
* ```proto
|
|
3815
|
+
* message MyFixed64 {
|
|
3816
|
+
* // value must be greater than 5 [fixed64.gt]
|
|
3817
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];
|
|
3818
|
+
*
|
|
3819
|
+
* // value must be greater than 5 and less than 10 [fixed64.gt_lt]
|
|
3820
|
+
* fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];
|
|
3821
|
+
*
|
|
3822
|
+
* // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]
|
|
3823
|
+
* fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];
|
|
3824
|
+
* }
|
|
3825
|
+
* ```
|
|
3826
|
+
*
|
|
3827
|
+
* @generated from field: fixed64 gt = 4;
|
|
3828
|
+
*/
|
|
3829
|
+
gt?: string;
|
|
3830
|
+
/**
|
|
3831
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
3832
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
3833
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
3834
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3835
|
+
* an error message is generated.
|
|
3836
|
+
*
|
|
3837
|
+
* ```proto
|
|
3838
|
+
* message MyFixed64 {
|
|
3839
|
+
* // value must be greater than or equal to 5 [fixed64.gte]
|
|
3840
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];
|
|
3841
|
+
*
|
|
3842
|
+
* // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]
|
|
3843
|
+
* fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];
|
|
3844
|
+
*
|
|
3845
|
+
* // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]
|
|
3846
|
+
* fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];
|
|
3847
|
+
* }
|
|
3848
|
+
* ```
|
|
3849
|
+
*
|
|
3850
|
+
* @generated from field: fixed64 gte = 5;
|
|
3851
|
+
*/
|
|
3852
|
+
gte?: string;
|
|
3853
|
+
/**
|
|
3854
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
3855
|
+
* If the field value isn't one of the specified values, an error message is
|
|
3856
|
+
* generated.
|
|
3857
|
+
*
|
|
3858
|
+
* ```proto
|
|
3859
|
+
* message MyFixed64 {
|
|
3860
|
+
* // value must be in list [1, 2, 3]
|
|
3861
|
+
* repeated fixed64 value = 1 (buf.validate.field).fixed64 = { in: [1, 2, 3] };
|
|
3862
|
+
* }
|
|
3863
|
+
* ```
|
|
3864
|
+
*
|
|
3865
|
+
* @generated from field: repeated fixed64 in = 6;
|
|
3866
|
+
*/
|
|
3867
|
+
in?: string[];
|
|
3868
|
+
/**
|
|
3869
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
3870
|
+
* values. If the field value is one of the specified values, an error
|
|
3871
|
+
* message is generated.
|
|
3872
|
+
*
|
|
3873
|
+
* ```proto
|
|
3874
|
+
* message MyFixed64 {
|
|
3875
|
+
* // value must not be in list [1, 2, 3]
|
|
3876
|
+
* repeated fixed64 value = 1 (buf.validate.field).fixed64 = { not_in: [1, 2, 3] };
|
|
3877
|
+
* }
|
|
3878
|
+
* ```
|
|
3879
|
+
*
|
|
3880
|
+
* @generated from field: repeated fixed64 not_in = 7;
|
|
3881
|
+
*/
|
|
3882
|
+
notIn?: string[];
|
|
3883
|
+
/**
|
|
3884
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3885
|
+
* conform to other constraints. `example` values will not impact validation
|
|
3886
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3887
|
+
*
|
|
3888
|
+
* ```proto
|
|
3889
|
+
* message MyFixed64 {
|
|
3890
|
+
* fixed64 value = 1 [
|
|
3891
|
+
* (buf.validate.field).fixed64.example = 1,
|
|
3892
|
+
* (buf.validate.field).fixed64.example = 2
|
|
3893
|
+
* ];
|
|
3894
|
+
* }
|
|
3895
|
+
* ```
|
|
3896
|
+
*
|
|
3897
|
+
* @generated from field: repeated fixed64 example = 8;
|
|
3898
|
+
*/
|
|
3899
|
+
example?: string[];
|
|
3900
|
+
};
|
|
2124
3901
|
/**
|
|
2125
3902
|
* Describes the message buf.validate.Fixed64Rules.
|
|
2126
3903
|
* Use `create(Fixed64RulesSchema)` to create a new message.
|
|
2127
3904
|
*/
|
|
2128
|
-
export declare const Fixed64RulesSchema: GenMessage<Fixed64Rules>;
|
|
3905
|
+
export declare const Fixed64RulesSchema: GenMessage<Fixed64Rules, Fixed64RulesJson>;
|
|
2129
3906
|
/**
|
|
2130
3907
|
* SFixed32Rules describes the constraints applied to `fixed32` values.
|
|
2131
3908
|
*
|
|
@@ -2293,56 +4070,200 @@ export type SFixed32Rules = Message<"buf.validate.SFixed32Rules"> & {
|
|
|
2293
4070
|
example: number[];
|
|
2294
4071
|
};
|
|
2295
4072
|
/**
|
|
2296
|
-
*
|
|
2297
|
-
* Use `create(SFixed32RulesSchema)` to create a new message.
|
|
2298
|
-
*/
|
|
2299
|
-
export declare const SFixed32RulesSchema: GenMessage<SFixed32Rules>;
|
|
2300
|
-
/**
|
|
2301
|
-
* SFixed64Rules describes the constraints applied to `fixed64` values.
|
|
4073
|
+
* SFixed32Rules describes the constraints applied to `fixed32` values.
|
|
2302
4074
|
*
|
|
2303
|
-
* @generated from message buf.validate.
|
|
4075
|
+
* @generated from message buf.validate.SFixed32Rules
|
|
2304
4076
|
*/
|
|
2305
|
-
export type
|
|
4077
|
+
export type SFixed32RulesJson = {
|
|
2306
4078
|
/**
|
|
2307
4079
|
* `const` requires the field value to exactly match the specified value. If
|
|
2308
4080
|
* the field value doesn't match, an error message is generated.
|
|
2309
4081
|
*
|
|
2310
4082
|
* ```proto
|
|
2311
|
-
* message
|
|
4083
|
+
* message MySFixed32 {
|
|
2312
4084
|
* // value must equal 42
|
|
2313
|
-
*
|
|
4085
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];
|
|
2314
4086
|
* }
|
|
2315
4087
|
* ```
|
|
2316
4088
|
*
|
|
2317
|
-
* @generated from field: optional
|
|
4089
|
+
* @generated from field: optional sfixed32 const = 1;
|
|
2318
4090
|
*/
|
|
2319
|
-
const
|
|
4091
|
+
const?: number;
|
|
2320
4092
|
/**
|
|
2321
|
-
*
|
|
4093
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
4094
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
4095
|
+
* an error message is generated.
|
|
4096
|
+
*
|
|
4097
|
+
* ```proto
|
|
4098
|
+
* message MySFixed32 {
|
|
4099
|
+
* // value must be less than 10
|
|
4100
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];
|
|
4101
|
+
* }
|
|
4102
|
+
* ```
|
|
4103
|
+
*
|
|
4104
|
+
* @generated from field: sfixed32 lt = 2;
|
|
2322
4105
|
*/
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
4106
|
+
lt?: number;
|
|
4107
|
+
/**
|
|
4108
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
4109
|
+
* value (field <= value). If the field value is greater than the specified
|
|
4110
|
+
* value, an error message is generated.
|
|
4111
|
+
*
|
|
4112
|
+
* ```proto
|
|
4113
|
+
* message MySFixed32 {
|
|
4114
|
+
* // value must be less than or equal to 10
|
|
4115
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];
|
|
4116
|
+
* }
|
|
4117
|
+
* ```
|
|
4118
|
+
*
|
|
4119
|
+
* @generated from field: sfixed32 lte = 3;
|
|
4120
|
+
*/
|
|
4121
|
+
lte?: number;
|
|
4122
|
+
/**
|
|
4123
|
+
* `gt` requires the field value to be greater than the specified value
|
|
4124
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
4125
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
4126
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
4127
|
+
* an error message is generated.
|
|
4128
|
+
*
|
|
4129
|
+
* ```proto
|
|
4130
|
+
* message MySFixed32 {
|
|
4131
|
+
* // value must be greater than 5 [sfixed32.gt]
|
|
4132
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];
|
|
4133
|
+
*
|
|
4134
|
+
* // value must be greater than 5 and less than 10 [sfixed32.gt_lt]
|
|
4135
|
+
* sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];
|
|
4136
|
+
*
|
|
4137
|
+
* // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]
|
|
4138
|
+
* sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];
|
|
4139
|
+
* }
|
|
4140
|
+
* ```
|
|
4141
|
+
*
|
|
4142
|
+
* @generated from field: sfixed32 gt = 4;
|
|
4143
|
+
*/
|
|
4144
|
+
gt?: number;
|
|
4145
|
+
/**
|
|
4146
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
4147
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
4148
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
4149
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
4150
|
+
* an error message is generated.
|
|
4151
|
+
*
|
|
4152
|
+
* ```proto
|
|
4153
|
+
* message MySFixed32 {
|
|
4154
|
+
* // value must be greater than or equal to 5 [sfixed32.gte]
|
|
4155
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];
|
|
4156
|
+
*
|
|
4157
|
+
* // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]
|
|
4158
|
+
* sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];
|
|
4159
|
+
*
|
|
4160
|
+
* // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]
|
|
4161
|
+
* sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];
|
|
4162
|
+
* }
|
|
4163
|
+
* ```
|
|
4164
|
+
*
|
|
4165
|
+
* @generated from field: sfixed32 gte = 5;
|
|
4166
|
+
*/
|
|
4167
|
+
gte?: number;
|
|
4168
|
+
/**
|
|
4169
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
4170
|
+
* If the field value isn't one of the specified values, an error message is
|
|
4171
|
+
* generated.
|
|
4172
|
+
*
|
|
4173
|
+
* ```proto
|
|
4174
|
+
* message MySFixed32 {
|
|
4175
|
+
* // value must be in list [1, 2, 3]
|
|
4176
|
+
* repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { in: [1, 2, 3] };
|
|
4177
|
+
* }
|
|
4178
|
+
* ```
|
|
4179
|
+
*
|
|
4180
|
+
* @generated from field: repeated sfixed32 in = 6;
|
|
4181
|
+
*/
|
|
4182
|
+
in?: number[];
|
|
4183
|
+
/**
|
|
4184
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
4185
|
+
* values. If the field value is one of the specified values, an error
|
|
4186
|
+
* message is generated.
|
|
4187
|
+
*
|
|
4188
|
+
* ```proto
|
|
4189
|
+
* message MySFixed32 {
|
|
4190
|
+
* // value must not be in list [1, 2, 3]
|
|
4191
|
+
* repeated sfixed32 value = 1 (buf.validate.field).sfixed32 = { not_in: [1, 2, 3] };
|
|
4192
|
+
* }
|
|
4193
|
+
* ```
|
|
4194
|
+
*
|
|
4195
|
+
* @generated from field: repeated sfixed32 not_in = 7;
|
|
4196
|
+
*/
|
|
4197
|
+
notIn?: number[];
|
|
4198
|
+
/**
|
|
4199
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
4200
|
+
* conform to other constraints. `example` values will not impact validation
|
|
4201
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
4202
|
+
*
|
|
4203
|
+
* ```proto
|
|
4204
|
+
* message MySFixed32 {
|
|
4205
|
+
* sfixed32 value = 1 [
|
|
4206
|
+
* (buf.validate.field).sfixed32.example = 1,
|
|
4207
|
+
* (buf.validate.field).sfixed32.example = 2
|
|
4208
|
+
* ];
|
|
4209
|
+
* }
|
|
4210
|
+
* ```
|
|
4211
|
+
*
|
|
4212
|
+
* @generated from field: repeated sfixed32 example = 8;
|
|
4213
|
+
*/
|
|
4214
|
+
example?: number[];
|
|
4215
|
+
};
|
|
4216
|
+
/**
|
|
4217
|
+
* Describes the message buf.validate.SFixed32Rules.
|
|
4218
|
+
* Use `create(SFixed32RulesSchema)` to create a new message.
|
|
4219
|
+
*/
|
|
4220
|
+
export declare const SFixed32RulesSchema: GenMessage<SFixed32Rules, SFixed32RulesJson>;
|
|
4221
|
+
/**
|
|
4222
|
+
* SFixed64Rules describes the constraints applied to `fixed64` values.
|
|
4223
|
+
*
|
|
4224
|
+
* @generated from message buf.validate.SFixed64Rules
|
|
4225
|
+
*/
|
|
4226
|
+
export type SFixed64Rules = Message<"buf.validate.SFixed64Rules"> & {
|
|
4227
|
+
/**
|
|
4228
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
4229
|
+
* the field value doesn't match, an error message is generated.
|
|
4230
|
+
*
|
|
4231
|
+
* ```proto
|
|
4232
|
+
* message MySFixed64 {
|
|
4233
|
+
* // value must equal 42
|
|
4234
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];
|
|
4235
|
+
* }
|
|
4236
|
+
* ```
|
|
4237
|
+
*
|
|
4238
|
+
* @generated from field: optional sfixed64 const = 1;
|
|
4239
|
+
*/
|
|
4240
|
+
const: bigint;
|
|
4241
|
+
/**
|
|
4242
|
+
* @generated from oneof buf.validate.SFixed64Rules.less_than
|
|
4243
|
+
*/
|
|
4244
|
+
lessThan: {
|
|
4245
|
+
/**
|
|
4246
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
4247
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
4248
|
+
* an error message is generated.
|
|
4249
|
+
*
|
|
4250
|
+
* ```proto
|
|
4251
|
+
* message MySFixed64 {
|
|
4252
|
+
* // value must be less than 10
|
|
4253
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];
|
|
4254
|
+
* }
|
|
4255
|
+
* ```
|
|
4256
|
+
*
|
|
4257
|
+
* @generated from field: sfixed64 lt = 2;
|
|
4258
|
+
*/
|
|
4259
|
+
value: bigint;
|
|
4260
|
+
case: "lt";
|
|
4261
|
+
} | {
|
|
4262
|
+
/**
|
|
4263
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
4264
|
+
* value (field <= value). If the field value is greater than the specified
|
|
4265
|
+
* value, an error message is generated.
|
|
4266
|
+
*
|
|
2346
4267
|
* ```proto
|
|
2347
4268
|
* message MySFixed64 {
|
|
2348
4269
|
* // value must be less than or equal to 10
|
|
@@ -2464,160 +4385,343 @@ export type SFixed64Rules = Message<"buf.validate.SFixed64Rules"> & {
|
|
|
2464
4385
|
example: bigint[];
|
|
2465
4386
|
};
|
|
2466
4387
|
/**
|
|
2467
|
-
*
|
|
2468
|
-
* Use `create(SFixed64RulesSchema)` to create a new message.
|
|
2469
|
-
*/
|
|
2470
|
-
export declare const SFixed64RulesSchema: GenMessage<SFixed64Rules>;
|
|
2471
|
-
/**
|
|
2472
|
-
* BoolRules describes the constraints applied to `bool` values. These rules
|
|
2473
|
-
* may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.
|
|
4388
|
+
* SFixed64Rules describes the constraints applied to `fixed64` values.
|
|
2474
4389
|
*
|
|
2475
|
-
* @generated from message buf.validate.
|
|
4390
|
+
* @generated from message buf.validate.SFixed64Rules
|
|
2476
4391
|
*/
|
|
2477
|
-
export type
|
|
4392
|
+
export type SFixed64RulesJson = {
|
|
2478
4393
|
/**
|
|
2479
|
-
* `const` requires the field value to exactly match the specified
|
|
2480
|
-
*
|
|
4394
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
4395
|
+
* the field value doesn't match, an error message is generated.
|
|
2481
4396
|
*
|
|
2482
4397
|
* ```proto
|
|
2483
|
-
* message
|
|
2484
|
-
* // value must equal
|
|
2485
|
-
*
|
|
4398
|
+
* message MySFixed64 {
|
|
4399
|
+
* // value must equal 42
|
|
4400
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];
|
|
2486
4401
|
* }
|
|
2487
4402
|
* ```
|
|
2488
4403
|
*
|
|
2489
|
-
* @generated from field: optional
|
|
4404
|
+
* @generated from field: optional sfixed64 const = 1;
|
|
2490
4405
|
*/
|
|
2491
|
-
const
|
|
4406
|
+
const?: string;
|
|
2492
4407
|
/**
|
|
2493
|
-
* `
|
|
2494
|
-
*
|
|
2495
|
-
*
|
|
4408
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
4409
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
4410
|
+
* an error message is generated.
|
|
2496
4411
|
*
|
|
2497
4412
|
* ```proto
|
|
2498
|
-
* message
|
|
2499
|
-
*
|
|
2500
|
-
*
|
|
2501
|
-
* (buf.validate.field).bool.example = 2
|
|
2502
|
-
* ];
|
|
4413
|
+
* message MySFixed64 {
|
|
4414
|
+
* // value must be less than 10
|
|
4415
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];
|
|
2503
4416
|
* }
|
|
2504
4417
|
* ```
|
|
2505
4418
|
*
|
|
2506
|
-
* @generated from field:
|
|
4419
|
+
* @generated from field: sfixed64 lt = 2;
|
|
2507
4420
|
*/
|
|
2508
|
-
|
|
2509
|
-
};
|
|
2510
|
-
/**
|
|
2511
|
-
* Describes the message buf.validate.BoolRules.
|
|
2512
|
-
* Use `create(BoolRulesSchema)` to create a new message.
|
|
2513
|
-
*/
|
|
2514
|
-
export declare const BoolRulesSchema: GenMessage<BoolRules>;
|
|
2515
|
-
/**
|
|
2516
|
-
* StringRules describes the constraints applied to `string` values These
|
|
2517
|
-
* rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
|
|
2518
|
-
*
|
|
2519
|
-
* @generated from message buf.validate.StringRules
|
|
2520
|
-
*/
|
|
2521
|
-
export type StringRules = Message<"buf.validate.StringRules"> & {
|
|
4421
|
+
lt?: string;
|
|
2522
4422
|
/**
|
|
2523
|
-
* `
|
|
2524
|
-
*
|
|
4423
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
4424
|
+
* value (field <= value). If the field value is greater than the specified
|
|
4425
|
+
* value, an error message is generated.
|
|
2525
4426
|
*
|
|
2526
4427
|
* ```proto
|
|
2527
|
-
* message
|
|
2528
|
-
* // value must equal
|
|
2529
|
-
*
|
|
4428
|
+
* message MySFixed64 {
|
|
4429
|
+
* // value must be less than or equal to 10
|
|
4430
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];
|
|
2530
4431
|
* }
|
|
2531
4432
|
* ```
|
|
2532
4433
|
*
|
|
2533
|
-
* @generated from field:
|
|
4434
|
+
* @generated from field: sfixed64 lte = 3;
|
|
2534
4435
|
*/
|
|
2535
|
-
|
|
4436
|
+
lte?: string;
|
|
2536
4437
|
/**
|
|
2537
|
-
* `
|
|
2538
|
-
*
|
|
2539
|
-
*
|
|
2540
|
-
*
|
|
4438
|
+
* `gt` requires the field value to be greater than the specified value
|
|
4439
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
4440
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
4441
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
4442
|
+
* an error message is generated.
|
|
2541
4443
|
*
|
|
2542
4444
|
* ```proto
|
|
2543
|
-
* message
|
|
2544
|
-
* // value
|
|
2545
|
-
*
|
|
4445
|
+
* message MySFixed64 {
|
|
4446
|
+
* // value must be greater than 5 [sfixed64.gt]
|
|
4447
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];
|
|
4448
|
+
*
|
|
4449
|
+
* // value must be greater than 5 and less than 10 [sfixed64.gt_lt]
|
|
4450
|
+
* sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];
|
|
4451
|
+
*
|
|
4452
|
+
* // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]
|
|
4453
|
+
* sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];
|
|
2546
4454
|
* }
|
|
2547
4455
|
* ```
|
|
2548
4456
|
*
|
|
2549
|
-
* @generated from field:
|
|
4457
|
+
* @generated from field: sfixed64 gt = 4;
|
|
2550
4458
|
*/
|
|
2551
|
-
|
|
4459
|
+
gt?: string;
|
|
2552
4460
|
/**
|
|
2553
|
-
* `
|
|
2554
|
-
*
|
|
2555
|
-
*
|
|
2556
|
-
*
|
|
4461
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
4462
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
4463
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
4464
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
4465
|
+
* an error message is generated.
|
|
2557
4466
|
*
|
|
2558
4467
|
* ```proto
|
|
2559
|
-
* message
|
|
2560
|
-
* // value
|
|
2561
|
-
*
|
|
4468
|
+
* message MySFixed64 {
|
|
4469
|
+
* // value must be greater than or equal to 5 [sfixed64.gte]
|
|
4470
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];
|
|
4471
|
+
*
|
|
4472
|
+
* // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]
|
|
4473
|
+
* sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];
|
|
4474
|
+
*
|
|
4475
|
+
* // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]
|
|
4476
|
+
* sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];
|
|
2562
4477
|
* }
|
|
2563
4478
|
* ```
|
|
2564
4479
|
*
|
|
2565
|
-
* @generated from field:
|
|
4480
|
+
* @generated from field: sfixed64 gte = 5;
|
|
2566
4481
|
*/
|
|
2567
|
-
|
|
4482
|
+
gte?: string;
|
|
2568
4483
|
/**
|
|
2569
|
-
* `
|
|
2570
|
-
*
|
|
2571
|
-
*
|
|
2572
|
-
* an error message will be generated.
|
|
4484
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
4485
|
+
* If the field value isn't one of the specified values, an error message is
|
|
4486
|
+
* generated.
|
|
2573
4487
|
*
|
|
2574
4488
|
* ```proto
|
|
2575
|
-
* message
|
|
2576
|
-
* // value
|
|
2577
|
-
*
|
|
4489
|
+
* message MySFixed64 {
|
|
4490
|
+
* // value must be in list [1, 2, 3]
|
|
4491
|
+
* repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { in: [1, 2, 3] };
|
|
2578
4492
|
* }
|
|
2579
4493
|
* ```
|
|
2580
4494
|
*
|
|
2581
|
-
* @generated from field:
|
|
4495
|
+
* @generated from field: repeated sfixed64 in = 6;
|
|
2582
4496
|
*/
|
|
2583
|
-
|
|
4497
|
+
in?: string[];
|
|
2584
4498
|
/**
|
|
2585
|
-
* `
|
|
2586
|
-
*
|
|
2587
|
-
*
|
|
4499
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
4500
|
+
* values. If the field value is one of the specified values, an error
|
|
4501
|
+
* message is generated.
|
|
2588
4502
|
*
|
|
2589
4503
|
* ```proto
|
|
2590
|
-
* message
|
|
2591
|
-
* // value
|
|
2592
|
-
*
|
|
4504
|
+
* message MySFixed64 {
|
|
4505
|
+
* // value must not be in list [1, 2, 3]
|
|
4506
|
+
* repeated sfixed64 value = 1 (buf.validate.field).sfixed64 = { not_in: [1, 2, 3] };
|
|
2593
4507
|
* }
|
|
2594
4508
|
* ```
|
|
2595
4509
|
*
|
|
2596
|
-
* @generated from field:
|
|
4510
|
+
* @generated from field: repeated sfixed64 not_in = 7;
|
|
2597
4511
|
*/
|
|
2598
|
-
|
|
4512
|
+
notIn?: string[];
|
|
2599
4513
|
/**
|
|
2600
|
-
* `
|
|
2601
|
-
*
|
|
2602
|
-
*
|
|
4514
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
4515
|
+
* conform to other constraints. `example` values will not impact validation
|
|
4516
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2603
4517
|
*
|
|
2604
4518
|
* ```proto
|
|
2605
|
-
* message
|
|
2606
|
-
*
|
|
2607
|
-
*
|
|
4519
|
+
* message MySFixed64 {
|
|
4520
|
+
* sfixed64 value = 1 [
|
|
4521
|
+
* (buf.validate.field).sfixed64.example = 1,
|
|
4522
|
+
* (buf.validate.field).sfixed64.example = 2
|
|
4523
|
+
* ];
|
|
2608
4524
|
* }
|
|
2609
|
-
*
|
|
2610
4525
|
* ```
|
|
2611
4526
|
*
|
|
2612
|
-
* @generated from field:
|
|
4527
|
+
* @generated from field: repeated sfixed64 example = 8;
|
|
2613
4528
|
*/
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
4529
|
+
example?: string[];
|
|
4530
|
+
};
|
|
4531
|
+
/**
|
|
4532
|
+
* Describes the message buf.validate.SFixed64Rules.
|
|
4533
|
+
* Use `create(SFixed64RulesSchema)` to create a new message.
|
|
4534
|
+
*/
|
|
4535
|
+
export declare const SFixed64RulesSchema: GenMessage<SFixed64Rules, SFixed64RulesJson>;
|
|
4536
|
+
/**
|
|
4537
|
+
* BoolRules describes the constraints applied to `bool` values. These rules
|
|
4538
|
+
* may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.
|
|
4539
|
+
*
|
|
4540
|
+
* @generated from message buf.validate.BoolRules
|
|
4541
|
+
*/
|
|
4542
|
+
export type BoolRules = Message<"buf.validate.BoolRules"> & {
|
|
4543
|
+
/**
|
|
4544
|
+
* `const` requires the field value to exactly match the specified boolean value.
|
|
4545
|
+
* If the field value doesn't match, an error message is generated.
|
|
4546
|
+
*
|
|
4547
|
+
* ```proto
|
|
4548
|
+
* message MyBool {
|
|
4549
|
+
* // value must equal true
|
|
4550
|
+
* bool value = 1 [(buf.validate.field).bool.const = true];
|
|
4551
|
+
* }
|
|
4552
|
+
* ```
|
|
4553
|
+
*
|
|
4554
|
+
* @generated from field: optional bool const = 1;
|
|
4555
|
+
*/
|
|
4556
|
+
const: boolean;
|
|
4557
|
+
/**
|
|
4558
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
4559
|
+
* conform to other constraints. `example` values will not impact validation
|
|
4560
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
4561
|
+
*
|
|
4562
|
+
* ```proto
|
|
4563
|
+
* message MyBool {
|
|
4564
|
+
* bool value = 1 [
|
|
4565
|
+
* (buf.validate.field).bool.example = 1,
|
|
4566
|
+
* (buf.validate.field).bool.example = 2
|
|
4567
|
+
* ];
|
|
4568
|
+
* }
|
|
4569
|
+
* ```
|
|
4570
|
+
*
|
|
4571
|
+
* @generated from field: repeated bool example = 2;
|
|
4572
|
+
*/
|
|
4573
|
+
example: boolean[];
|
|
4574
|
+
};
|
|
4575
|
+
/**
|
|
4576
|
+
* BoolRules describes the constraints applied to `bool` values. These rules
|
|
4577
|
+
* may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.
|
|
4578
|
+
*
|
|
4579
|
+
* @generated from message buf.validate.BoolRules
|
|
4580
|
+
*/
|
|
4581
|
+
export type BoolRulesJson = {
|
|
4582
|
+
/**
|
|
4583
|
+
* `const` requires the field value to exactly match the specified boolean value.
|
|
4584
|
+
* If the field value doesn't match, an error message is generated.
|
|
4585
|
+
*
|
|
4586
|
+
* ```proto
|
|
4587
|
+
* message MyBool {
|
|
4588
|
+
* // value must equal true
|
|
4589
|
+
* bool value = 1 [(buf.validate.field).bool.const = true];
|
|
4590
|
+
* }
|
|
4591
|
+
* ```
|
|
4592
|
+
*
|
|
4593
|
+
* @generated from field: optional bool const = 1;
|
|
4594
|
+
*/
|
|
4595
|
+
const?: boolean;
|
|
4596
|
+
/**
|
|
4597
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
4598
|
+
* conform to other constraints. `example` values will not impact validation
|
|
4599
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
4600
|
+
*
|
|
4601
|
+
* ```proto
|
|
4602
|
+
* message MyBool {
|
|
4603
|
+
* bool value = 1 [
|
|
4604
|
+
* (buf.validate.field).bool.example = 1,
|
|
4605
|
+
* (buf.validate.field).bool.example = 2
|
|
4606
|
+
* ];
|
|
4607
|
+
* }
|
|
4608
|
+
* ```
|
|
4609
|
+
*
|
|
4610
|
+
* @generated from field: repeated bool example = 2;
|
|
4611
|
+
*/
|
|
4612
|
+
example?: boolean[];
|
|
4613
|
+
};
|
|
4614
|
+
/**
|
|
4615
|
+
* Describes the message buf.validate.BoolRules.
|
|
4616
|
+
* Use `create(BoolRulesSchema)` to create a new message.
|
|
4617
|
+
*/
|
|
4618
|
+
export declare const BoolRulesSchema: GenMessage<BoolRules, BoolRulesJson>;
|
|
4619
|
+
/**
|
|
4620
|
+
* StringRules describes the constraints applied to `string` values These
|
|
4621
|
+
* rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
|
|
4622
|
+
*
|
|
4623
|
+
* @generated from message buf.validate.StringRules
|
|
4624
|
+
*/
|
|
4625
|
+
export type StringRules = Message<"buf.validate.StringRules"> & {
|
|
4626
|
+
/**
|
|
4627
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
4628
|
+
* the field value doesn't match, an error message is generated.
|
|
4629
|
+
*
|
|
4630
|
+
* ```proto
|
|
4631
|
+
* message MyString {
|
|
4632
|
+
* // value must equal `hello`
|
|
4633
|
+
* string value = 1 [(buf.validate.field).string.const = "hello"];
|
|
4634
|
+
* }
|
|
4635
|
+
* ```
|
|
4636
|
+
*
|
|
4637
|
+
* @generated from field: optional string const = 1;
|
|
4638
|
+
*/
|
|
4639
|
+
const: string;
|
|
4640
|
+
/**
|
|
4641
|
+
* `len` dictates that the field value must have the specified
|
|
4642
|
+
* number of characters (Unicode code points), which may differ from the number
|
|
4643
|
+
* of bytes in the string. If the field value does not meet the specified
|
|
4644
|
+
* length, an error message will be generated.
|
|
4645
|
+
*
|
|
4646
|
+
* ```proto
|
|
4647
|
+
* message MyString {
|
|
4648
|
+
* // value length must be 5 characters
|
|
4649
|
+
* string value = 1 [(buf.validate.field).string.len = 5];
|
|
4650
|
+
* }
|
|
4651
|
+
* ```
|
|
4652
|
+
*
|
|
4653
|
+
* @generated from field: optional uint64 len = 19;
|
|
4654
|
+
*/
|
|
4655
|
+
len: bigint;
|
|
4656
|
+
/**
|
|
4657
|
+
* `min_len` specifies that the field value must have at least the specified
|
|
4658
|
+
* number of characters (Unicode code points), which may differ from the number
|
|
4659
|
+
* of bytes in the string. If the field value contains fewer characters, an error
|
|
4660
|
+
* message will be generated.
|
|
4661
|
+
*
|
|
4662
|
+
* ```proto
|
|
4663
|
+
* message MyString {
|
|
4664
|
+
* // value length must be at least 3 characters
|
|
4665
|
+
* string value = 1 [(buf.validate.field).string.min_len = 3];
|
|
4666
|
+
* }
|
|
4667
|
+
* ```
|
|
4668
|
+
*
|
|
4669
|
+
* @generated from field: optional uint64 min_len = 2;
|
|
4670
|
+
*/
|
|
4671
|
+
minLen: bigint;
|
|
4672
|
+
/**
|
|
4673
|
+
* `max_len` specifies that the field value must have no more than the specified
|
|
4674
|
+
* number of characters (Unicode code points), which may differ from the
|
|
4675
|
+
* number of bytes in the string. If the field value contains more characters,
|
|
4676
|
+
* an error message will be generated.
|
|
4677
|
+
*
|
|
4678
|
+
* ```proto
|
|
4679
|
+
* message MyString {
|
|
4680
|
+
* // value length must be at most 10 characters
|
|
4681
|
+
* string value = 1 [(buf.validate.field).string.max_len = 10];
|
|
4682
|
+
* }
|
|
4683
|
+
* ```
|
|
4684
|
+
*
|
|
4685
|
+
* @generated from field: optional uint64 max_len = 3;
|
|
4686
|
+
*/
|
|
4687
|
+
maxLen: bigint;
|
|
4688
|
+
/**
|
|
4689
|
+
* `len_bytes` dictates that the field value must have the specified number of
|
|
4690
|
+
* bytes. If the field value does not match the specified length in bytes,
|
|
4691
|
+
* an error message will be generated.
|
|
4692
|
+
*
|
|
4693
|
+
* ```proto
|
|
4694
|
+
* message MyString {
|
|
4695
|
+
* // value length must be 6 bytes
|
|
4696
|
+
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
|
|
4697
|
+
* }
|
|
4698
|
+
* ```
|
|
4699
|
+
*
|
|
4700
|
+
* @generated from field: optional uint64 len_bytes = 20;
|
|
4701
|
+
*/
|
|
4702
|
+
lenBytes: bigint;
|
|
4703
|
+
/**
|
|
4704
|
+
* `min_bytes` specifies that the field value must have at least the specified
|
|
4705
|
+
* number of bytes. If the field value contains fewer bytes, an error message
|
|
4706
|
+
* will be generated.
|
|
4707
|
+
*
|
|
4708
|
+
* ```proto
|
|
4709
|
+
* message MyString {
|
|
4710
|
+
* // value length must be at least 4 bytes
|
|
4711
|
+
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
|
|
4712
|
+
* }
|
|
4713
|
+
*
|
|
4714
|
+
* ```
|
|
4715
|
+
*
|
|
4716
|
+
* @generated from field: optional uint64 min_bytes = 4;
|
|
4717
|
+
*/
|
|
4718
|
+
minBytes: bigint;
|
|
4719
|
+
/**
|
|
4720
|
+
* `max_bytes` specifies that the field value must have no more than the
|
|
4721
|
+
* specified number of bytes. If the field value contains more bytes, an
|
|
4722
|
+
* error message will be generated.
|
|
4723
|
+
*
|
|
4724
|
+
* ```proto
|
|
2621
4725
|
* message MyString {
|
|
2622
4726
|
* // value length must be at most 8 bytes
|
|
2623
4727
|
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
|
|
@@ -3100,45 +5204,819 @@ export type StringRules = Message<"buf.validate.StringRules"> & {
|
|
|
3100
5204
|
example: string[];
|
|
3101
5205
|
};
|
|
3102
5206
|
/**
|
|
3103
|
-
*
|
|
3104
|
-
*
|
|
3105
|
-
*/
|
|
3106
|
-
export declare const StringRulesSchema: GenMessage<StringRules>;
|
|
3107
|
-
/**
|
|
3108
|
-
* BytesRules describe the constraints applied to `bytes` values. These rules
|
|
3109
|
-
* may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
|
|
5207
|
+
* StringRules describes the constraints applied to `string` values These
|
|
5208
|
+
* rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
|
|
3110
5209
|
*
|
|
3111
|
-
* @generated from message buf.validate.
|
|
5210
|
+
* @generated from message buf.validate.StringRules
|
|
3112
5211
|
*/
|
|
3113
|
-
export type
|
|
5212
|
+
export type StringRulesJson = {
|
|
3114
5213
|
/**
|
|
3115
|
-
* `const` requires the field value to exactly match the specified
|
|
3116
|
-
*
|
|
5214
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
5215
|
+
* the field value doesn't match, an error message is generated.
|
|
3117
5216
|
*
|
|
3118
5217
|
* ```proto
|
|
3119
|
-
* message
|
|
3120
|
-
* // value must
|
|
3121
|
-
*
|
|
5218
|
+
* message MyString {
|
|
5219
|
+
* // value must equal `hello`
|
|
5220
|
+
* string value = 1 [(buf.validate.field).string.const = "hello"];
|
|
3122
5221
|
* }
|
|
3123
5222
|
* ```
|
|
3124
5223
|
*
|
|
3125
|
-
* @generated from field: optional
|
|
5224
|
+
* @generated from field: optional string const = 1;
|
|
3126
5225
|
*/
|
|
3127
|
-
const
|
|
5226
|
+
const?: string;
|
|
3128
5227
|
/**
|
|
3129
|
-
* `len`
|
|
3130
|
-
*
|
|
5228
|
+
* `len` dictates that the field value must have the specified
|
|
5229
|
+
* number of characters (Unicode code points), which may differ from the number
|
|
5230
|
+
* of bytes in the string. If the field value does not meet the specified
|
|
5231
|
+
* length, an error message will be generated.
|
|
3131
5232
|
*
|
|
3132
5233
|
* ```proto
|
|
3133
|
-
* message
|
|
3134
|
-
* // value length must be
|
|
3135
|
-
*
|
|
5234
|
+
* message MyString {
|
|
5235
|
+
* // value length must be 5 characters
|
|
5236
|
+
* string value = 1 [(buf.validate.field).string.len = 5];
|
|
3136
5237
|
* }
|
|
3137
5238
|
* ```
|
|
3138
5239
|
*
|
|
3139
|
-
* @generated from field: optional uint64 len =
|
|
5240
|
+
* @generated from field: optional uint64 len = 19;
|
|
3140
5241
|
*/
|
|
3141
|
-
len
|
|
5242
|
+
len?: string;
|
|
5243
|
+
/**
|
|
5244
|
+
* `min_len` specifies that the field value must have at least the specified
|
|
5245
|
+
* number of characters (Unicode code points), which may differ from the number
|
|
5246
|
+
* of bytes in the string. If the field value contains fewer characters, an error
|
|
5247
|
+
* message will be generated.
|
|
5248
|
+
*
|
|
5249
|
+
* ```proto
|
|
5250
|
+
* message MyString {
|
|
5251
|
+
* // value length must be at least 3 characters
|
|
5252
|
+
* string value = 1 [(buf.validate.field).string.min_len = 3];
|
|
5253
|
+
* }
|
|
5254
|
+
* ```
|
|
5255
|
+
*
|
|
5256
|
+
* @generated from field: optional uint64 min_len = 2;
|
|
5257
|
+
*/
|
|
5258
|
+
minLen?: string;
|
|
5259
|
+
/**
|
|
5260
|
+
* `max_len` specifies that the field value must have no more than the specified
|
|
5261
|
+
* number of characters (Unicode code points), which may differ from the
|
|
5262
|
+
* number of bytes in the string. If the field value contains more characters,
|
|
5263
|
+
* an error message will be generated.
|
|
5264
|
+
*
|
|
5265
|
+
* ```proto
|
|
5266
|
+
* message MyString {
|
|
5267
|
+
* // value length must be at most 10 characters
|
|
5268
|
+
* string value = 1 [(buf.validate.field).string.max_len = 10];
|
|
5269
|
+
* }
|
|
5270
|
+
* ```
|
|
5271
|
+
*
|
|
5272
|
+
* @generated from field: optional uint64 max_len = 3;
|
|
5273
|
+
*/
|
|
5274
|
+
maxLen?: string;
|
|
5275
|
+
/**
|
|
5276
|
+
* `len_bytes` dictates that the field value must have the specified number of
|
|
5277
|
+
* bytes. If the field value does not match the specified length in bytes,
|
|
5278
|
+
* an error message will be generated.
|
|
5279
|
+
*
|
|
5280
|
+
* ```proto
|
|
5281
|
+
* message MyString {
|
|
5282
|
+
* // value length must be 6 bytes
|
|
5283
|
+
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
|
|
5284
|
+
* }
|
|
5285
|
+
* ```
|
|
5286
|
+
*
|
|
5287
|
+
* @generated from field: optional uint64 len_bytes = 20;
|
|
5288
|
+
*/
|
|
5289
|
+
lenBytes?: string;
|
|
5290
|
+
/**
|
|
5291
|
+
* `min_bytes` specifies that the field value must have at least the specified
|
|
5292
|
+
* number of bytes. If the field value contains fewer bytes, an error message
|
|
5293
|
+
* will be generated.
|
|
5294
|
+
*
|
|
5295
|
+
* ```proto
|
|
5296
|
+
* message MyString {
|
|
5297
|
+
* // value length must be at least 4 bytes
|
|
5298
|
+
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
|
|
5299
|
+
* }
|
|
5300
|
+
*
|
|
5301
|
+
* ```
|
|
5302
|
+
*
|
|
5303
|
+
* @generated from field: optional uint64 min_bytes = 4;
|
|
5304
|
+
*/
|
|
5305
|
+
minBytes?: string;
|
|
5306
|
+
/**
|
|
5307
|
+
* `max_bytes` specifies that the field value must have no more than the
|
|
5308
|
+
* specified number of bytes. If the field value contains more bytes, an
|
|
5309
|
+
* error message will be generated.
|
|
5310
|
+
*
|
|
5311
|
+
* ```proto
|
|
5312
|
+
* message MyString {
|
|
5313
|
+
* // value length must be at most 8 bytes
|
|
5314
|
+
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
|
|
5315
|
+
* }
|
|
5316
|
+
* ```
|
|
5317
|
+
*
|
|
5318
|
+
* @generated from field: optional uint64 max_bytes = 5;
|
|
5319
|
+
*/
|
|
5320
|
+
maxBytes?: string;
|
|
5321
|
+
/**
|
|
5322
|
+
* `pattern` specifies that the field value must match the specified
|
|
5323
|
+
* regular expression (RE2 syntax), with the expression provided without any
|
|
5324
|
+
* delimiters. If the field value doesn't match the regular expression, an
|
|
5325
|
+
* error message will be generated.
|
|
5326
|
+
*
|
|
5327
|
+
* ```proto
|
|
5328
|
+
* message MyString {
|
|
5329
|
+
* // value does not match regex pattern `^[a-zA-Z]//$`
|
|
5330
|
+
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
|
|
5331
|
+
* }
|
|
5332
|
+
* ```
|
|
5333
|
+
*
|
|
5334
|
+
* @generated from field: optional string pattern = 6;
|
|
5335
|
+
*/
|
|
5336
|
+
pattern?: string;
|
|
5337
|
+
/**
|
|
5338
|
+
* `prefix` specifies that the field value must have the
|
|
5339
|
+
* specified substring at the beginning of the string. If the field value
|
|
5340
|
+
* doesn't start with the specified prefix, an error message will be
|
|
5341
|
+
* generated.
|
|
5342
|
+
*
|
|
5343
|
+
* ```proto
|
|
5344
|
+
* message MyString {
|
|
5345
|
+
* // value does not have prefix `pre`
|
|
5346
|
+
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
|
|
5347
|
+
* }
|
|
5348
|
+
* ```
|
|
5349
|
+
*
|
|
5350
|
+
* @generated from field: optional string prefix = 7;
|
|
5351
|
+
*/
|
|
5352
|
+
prefix?: string;
|
|
5353
|
+
/**
|
|
5354
|
+
* `suffix` specifies that the field value must have the
|
|
5355
|
+
* specified substring at the end of the string. If the field value doesn't
|
|
5356
|
+
* end with the specified suffix, an error message will be generated.
|
|
5357
|
+
*
|
|
5358
|
+
* ```proto
|
|
5359
|
+
* message MyString {
|
|
5360
|
+
* // value does not have suffix `post`
|
|
5361
|
+
* string value = 1 [(buf.validate.field).string.suffix = "post"];
|
|
5362
|
+
* }
|
|
5363
|
+
* ```
|
|
5364
|
+
*
|
|
5365
|
+
* @generated from field: optional string suffix = 8;
|
|
5366
|
+
*/
|
|
5367
|
+
suffix?: string;
|
|
5368
|
+
/**
|
|
5369
|
+
* `contains` specifies that the field value must have the
|
|
5370
|
+
* specified substring anywhere in the string. If the field value doesn't
|
|
5371
|
+
* contain the specified substring, an error message will be generated.
|
|
5372
|
+
*
|
|
5373
|
+
* ```proto
|
|
5374
|
+
* message MyString {
|
|
5375
|
+
* // value does not contain substring `inside`.
|
|
5376
|
+
* string value = 1 [(buf.validate.field).string.contains = "inside"];
|
|
5377
|
+
* }
|
|
5378
|
+
* ```
|
|
5379
|
+
*
|
|
5380
|
+
* @generated from field: optional string contains = 9;
|
|
5381
|
+
*/
|
|
5382
|
+
contains?: string;
|
|
5383
|
+
/**
|
|
5384
|
+
* `not_contains` specifies that the field value must not have the
|
|
5385
|
+
* specified substring anywhere in the string. If the field value contains
|
|
5386
|
+
* the specified substring, an error message will be generated.
|
|
5387
|
+
*
|
|
5388
|
+
* ```proto
|
|
5389
|
+
* message MyString {
|
|
5390
|
+
* // value contains substring `inside`.
|
|
5391
|
+
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
|
|
5392
|
+
* }
|
|
5393
|
+
* ```
|
|
5394
|
+
*
|
|
5395
|
+
* @generated from field: optional string not_contains = 23;
|
|
5396
|
+
*/
|
|
5397
|
+
notContains?: string;
|
|
5398
|
+
/**
|
|
5399
|
+
* `in` specifies that the field value must be equal to one of the specified
|
|
5400
|
+
* values. If the field value isn't one of the specified values, an error
|
|
5401
|
+
* message will be generated.
|
|
5402
|
+
*
|
|
5403
|
+
* ```proto
|
|
5404
|
+
* message MyString {
|
|
5405
|
+
* // value must be in list ["apple", "banana"]
|
|
5406
|
+
* repeated string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
|
|
5407
|
+
* }
|
|
5408
|
+
* ```
|
|
5409
|
+
*
|
|
5410
|
+
* @generated from field: repeated string in = 10;
|
|
5411
|
+
*/
|
|
5412
|
+
in?: string[];
|
|
5413
|
+
/**
|
|
5414
|
+
* `not_in` specifies that the field value cannot be equal to any
|
|
5415
|
+
* of the specified values. If the field value is one of the specified values,
|
|
5416
|
+
* an error message will be generated.
|
|
5417
|
+
* ```proto
|
|
5418
|
+
* message MyString {
|
|
5419
|
+
* // value must not be in list ["orange", "grape"]
|
|
5420
|
+
* repeated string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
|
|
5421
|
+
* }
|
|
5422
|
+
* ```
|
|
5423
|
+
*
|
|
5424
|
+
* @generated from field: repeated string not_in = 11;
|
|
5425
|
+
*/
|
|
5426
|
+
notIn?: string[];
|
|
5427
|
+
/**
|
|
5428
|
+
* `email` specifies that the field value must be a valid email address
|
|
5429
|
+
* (addr-spec only) as defined by [RFC 5322](https://tools.ietf.org/html/rfc5322#section-3.4.1).
|
|
5430
|
+
* If the field value isn't a valid email address, an error message will be generated.
|
|
5431
|
+
*
|
|
5432
|
+
* ```proto
|
|
5433
|
+
* message MyString {
|
|
5434
|
+
* // value must be a valid email address
|
|
5435
|
+
* string value = 1 [(buf.validate.field).string.email = true];
|
|
5436
|
+
* }
|
|
5437
|
+
* ```
|
|
5438
|
+
*
|
|
5439
|
+
* @generated from field: bool email = 12;
|
|
5440
|
+
*/
|
|
5441
|
+
email?: boolean;
|
|
5442
|
+
/**
|
|
5443
|
+
* `hostname` specifies that the field value must be a valid
|
|
5444
|
+
* hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
|
|
5445
|
+
* internationalized domain names (IDNs). If the field value isn't a
|
|
5446
|
+
* valid hostname, an error message will be generated.
|
|
5447
|
+
*
|
|
5448
|
+
* ```proto
|
|
5449
|
+
* message MyString {
|
|
5450
|
+
* // value must be a valid hostname
|
|
5451
|
+
* string value = 1 [(buf.validate.field).string.hostname = true];
|
|
5452
|
+
* }
|
|
5453
|
+
* ```
|
|
5454
|
+
*
|
|
5455
|
+
* @generated from field: bool hostname = 13;
|
|
5456
|
+
*/
|
|
5457
|
+
hostname?: boolean;
|
|
5458
|
+
/**
|
|
5459
|
+
* `ip` specifies that the field value must be a valid IP
|
|
5460
|
+
* (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
|
|
5461
|
+
* If the field value isn't a valid IP address, an error message will be
|
|
5462
|
+
* generated.
|
|
5463
|
+
*
|
|
5464
|
+
* ```proto
|
|
5465
|
+
* message MyString {
|
|
5466
|
+
* // value must be a valid IP address
|
|
5467
|
+
* string value = 1 [(buf.validate.field).string.ip = true];
|
|
5468
|
+
* }
|
|
5469
|
+
* ```
|
|
5470
|
+
*
|
|
5471
|
+
* @generated from field: bool ip = 14;
|
|
5472
|
+
*/
|
|
5473
|
+
ip?: boolean;
|
|
5474
|
+
/**
|
|
5475
|
+
* `ipv4` specifies that the field value must be a valid IPv4
|
|
5476
|
+
* address. If the field value isn't a valid IPv4 address, an error message
|
|
5477
|
+
* will be generated.
|
|
5478
|
+
*
|
|
5479
|
+
* ```proto
|
|
5480
|
+
* message MyString {
|
|
5481
|
+
* // value must be a valid IPv4 address
|
|
5482
|
+
* string value = 1 [(buf.validate.field).string.ipv4 = true];
|
|
5483
|
+
* }
|
|
5484
|
+
* ```
|
|
5485
|
+
*
|
|
5486
|
+
* @generated from field: bool ipv4 = 15;
|
|
5487
|
+
*/
|
|
5488
|
+
ipv4?: boolean;
|
|
5489
|
+
/**
|
|
5490
|
+
* `ipv6` specifies that the field value must be a valid
|
|
5491
|
+
* IPv6 address, without surrounding square brackets. If the field value is
|
|
5492
|
+
* not a valid IPv6 address, an error message will be generated.
|
|
5493
|
+
*
|
|
5494
|
+
* ```proto
|
|
5495
|
+
* message MyString {
|
|
5496
|
+
* // value must be a valid IPv6 address
|
|
5497
|
+
* string value = 1 [(buf.validate.field).string.ipv6 = true];
|
|
5498
|
+
* }
|
|
5499
|
+
* ```
|
|
5500
|
+
*
|
|
5501
|
+
* @generated from field: bool ipv6 = 16;
|
|
5502
|
+
*/
|
|
5503
|
+
ipv6?: boolean;
|
|
5504
|
+
/**
|
|
5505
|
+
* `uri` specifies that the field value must be a valid,
|
|
5506
|
+
* absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
|
|
5507
|
+
* absolute URI, an error message will be generated.
|
|
5508
|
+
*
|
|
5509
|
+
* ```proto
|
|
5510
|
+
* message MyString {
|
|
5511
|
+
* // value must be a valid URI
|
|
5512
|
+
* string value = 1 [(buf.validate.field).string.uri = true];
|
|
5513
|
+
* }
|
|
5514
|
+
* ```
|
|
5515
|
+
*
|
|
5516
|
+
* @generated from field: bool uri = 17;
|
|
5517
|
+
*/
|
|
5518
|
+
uri?: boolean;
|
|
5519
|
+
/**
|
|
5520
|
+
* `uri_ref` specifies that the field value must be a valid URI
|
|
5521
|
+
* as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
|
|
5522
|
+
* field value isn't a valid URI, an error message will be generated.
|
|
5523
|
+
*
|
|
5524
|
+
* ```proto
|
|
5525
|
+
* message MyString {
|
|
5526
|
+
* // value must be a valid URI
|
|
5527
|
+
* string value = 1 [(buf.validate.field).string.uri_ref = true];
|
|
5528
|
+
* }
|
|
5529
|
+
* ```
|
|
5530
|
+
*
|
|
5531
|
+
* @generated from field: bool uri_ref = 18;
|
|
5532
|
+
*/
|
|
5533
|
+
uriRef?: boolean;
|
|
5534
|
+
/**
|
|
5535
|
+
* `address` specifies that the field value must be either a valid hostname
|
|
5536
|
+
* as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5)
|
|
5537
|
+
* (which doesn't support internationalized domain names or IDNs) or a valid
|
|
5538
|
+
* IP (v4 or v6). If the field value isn't a valid hostname or IP, an error
|
|
5539
|
+
* message will be generated.
|
|
5540
|
+
*
|
|
5541
|
+
* ```proto
|
|
5542
|
+
* message MyString {
|
|
5543
|
+
* // value must be a valid hostname, or ip address
|
|
5544
|
+
* string value = 1 [(buf.validate.field).string.address = true];
|
|
5545
|
+
* }
|
|
5546
|
+
* ```
|
|
5547
|
+
*
|
|
5548
|
+
* @generated from field: bool address = 21;
|
|
5549
|
+
*/
|
|
5550
|
+
address?: boolean;
|
|
5551
|
+
/**
|
|
5552
|
+
* `uuid` specifies that the field value must be a valid UUID as defined by
|
|
5553
|
+
* [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
|
|
5554
|
+
* field value isn't a valid UUID, an error message will be generated.
|
|
5555
|
+
*
|
|
5556
|
+
* ```proto
|
|
5557
|
+
* message MyString {
|
|
5558
|
+
* // value must be a valid UUID
|
|
5559
|
+
* string value = 1 [(buf.validate.field).string.uuid = true];
|
|
5560
|
+
* }
|
|
5561
|
+
* ```
|
|
5562
|
+
*
|
|
5563
|
+
* @generated from field: bool uuid = 22;
|
|
5564
|
+
*/
|
|
5565
|
+
uuid?: boolean;
|
|
5566
|
+
/**
|
|
5567
|
+
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
|
|
5568
|
+
* defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2) with all dashes
|
|
5569
|
+
* omitted. If the field value isn't a valid UUID without dashes, an error message
|
|
5570
|
+
* will be generated.
|
|
5571
|
+
*
|
|
5572
|
+
* ```proto
|
|
5573
|
+
* message MyString {
|
|
5574
|
+
* // value must be a valid trimmed UUID
|
|
5575
|
+
* string value = 1 [(buf.validate.field).string.tuuid = true];
|
|
5576
|
+
* }
|
|
5577
|
+
* ```
|
|
5578
|
+
*
|
|
5579
|
+
* @generated from field: bool tuuid = 33;
|
|
5580
|
+
*/
|
|
5581
|
+
tuuid?: boolean;
|
|
5582
|
+
/**
|
|
5583
|
+
* `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
|
|
5584
|
+
* address with prefix length. If the field value isn't a valid IP with prefix
|
|
5585
|
+
* length, an error message will be generated.
|
|
5586
|
+
*
|
|
5587
|
+
*
|
|
5588
|
+
* ```proto
|
|
5589
|
+
* message MyString {
|
|
5590
|
+
* // value must be a valid IP with prefix length
|
|
5591
|
+
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
|
|
5592
|
+
* }
|
|
5593
|
+
* ```
|
|
5594
|
+
*
|
|
5595
|
+
* @generated from field: bool ip_with_prefixlen = 26;
|
|
5596
|
+
*/
|
|
5597
|
+
ipWithPrefixlen?: boolean;
|
|
5598
|
+
/**
|
|
5599
|
+
* `ipv4_with_prefixlen` specifies that the field value must be a valid
|
|
5600
|
+
* IPv4 address with prefix.
|
|
5601
|
+
* If the field value isn't a valid IPv4 address with prefix length,
|
|
5602
|
+
* an error message will be generated.
|
|
5603
|
+
*
|
|
5604
|
+
* ```proto
|
|
5605
|
+
* message MyString {
|
|
5606
|
+
* // value must be a valid IPv4 address with prefix length
|
|
5607
|
+
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
|
|
5608
|
+
* }
|
|
5609
|
+
* ```
|
|
5610
|
+
*
|
|
5611
|
+
* @generated from field: bool ipv4_with_prefixlen = 27;
|
|
5612
|
+
*/
|
|
5613
|
+
ipv4WithPrefixlen?: boolean;
|
|
5614
|
+
/**
|
|
5615
|
+
* `ipv6_with_prefixlen` specifies that the field value must be a valid
|
|
5616
|
+
* IPv6 address with prefix length.
|
|
5617
|
+
* If the field value is not a valid IPv6 address with prefix length,
|
|
5618
|
+
* an error message will be generated.
|
|
5619
|
+
*
|
|
5620
|
+
* ```proto
|
|
5621
|
+
* message MyString {
|
|
5622
|
+
* // value must be a valid IPv6 address prefix length
|
|
5623
|
+
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
|
|
5624
|
+
* }
|
|
5625
|
+
* ```
|
|
5626
|
+
*
|
|
5627
|
+
* @generated from field: bool ipv6_with_prefixlen = 28;
|
|
5628
|
+
*/
|
|
5629
|
+
ipv6WithPrefixlen?: boolean;
|
|
5630
|
+
/**
|
|
5631
|
+
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
|
|
5632
|
+
* If the field value isn't a valid IP prefix, an error message will be
|
|
5633
|
+
* generated. The prefix must have all zeros for the masked bits of the prefix (e.g.,
|
|
5634
|
+
* `127.0.0.0/16`, not `127.0.0.1/16`).
|
|
5635
|
+
*
|
|
5636
|
+
* ```proto
|
|
5637
|
+
* message MyString {
|
|
5638
|
+
* // value must be a valid IP prefix
|
|
5639
|
+
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
|
|
5640
|
+
* }
|
|
5641
|
+
* ```
|
|
5642
|
+
*
|
|
5643
|
+
* @generated from field: bool ip_prefix = 29;
|
|
5644
|
+
*/
|
|
5645
|
+
ipPrefix?: boolean;
|
|
5646
|
+
/**
|
|
5647
|
+
* `ipv4_prefix` specifies that the field value must be a valid IPv4
|
|
5648
|
+
* prefix. If the field value isn't a valid IPv4 prefix, an error message
|
|
5649
|
+
* will be generated. The prefix must have all zeros for the masked bits of
|
|
5650
|
+
* the prefix (e.g., `127.0.0.0/16`, not `127.0.0.1/16`).
|
|
5651
|
+
*
|
|
5652
|
+
* ```proto
|
|
5653
|
+
* message MyString {
|
|
5654
|
+
* // value must be a valid IPv4 prefix
|
|
5655
|
+
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
|
|
5656
|
+
* }
|
|
5657
|
+
* ```
|
|
5658
|
+
*
|
|
5659
|
+
* @generated from field: bool ipv4_prefix = 30;
|
|
5660
|
+
*/
|
|
5661
|
+
ipv4Prefix?: boolean;
|
|
5662
|
+
/**
|
|
5663
|
+
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
|
|
5664
|
+
* If the field value is not a valid IPv6 prefix, an error message will be
|
|
5665
|
+
* generated. The prefix must have all zeros for the masked bits of the prefix
|
|
5666
|
+
* (e.g., `2001:db8::/48`, not `2001:db8::1/48`).
|
|
5667
|
+
*
|
|
5668
|
+
* ```proto
|
|
5669
|
+
* message MyString {
|
|
5670
|
+
* // value must be a valid IPv6 prefix
|
|
5671
|
+
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
|
|
5672
|
+
* }
|
|
5673
|
+
* ```
|
|
5674
|
+
*
|
|
5675
|
+
* @generated from field: bool ipv6_prefix = 31;
|
|
5676
|
+
*/
|
|
5677
|
+
ipv6Prefix?: boolean;
|
|
5678
|
+
/**
|
|
5679
|
+
* `host_and_port` specifies the field value must be a valid host and port
|
|
5680
|
+
* pair. The host must be a valid hostname or IP address while the port
|
|
5681
|
+
* must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
|
|
5682
|
+
* with square brackets (e.g., `[::1]:1234`).
|
|
5683
|
+
*
|
|
5684
|
+
* @generated from field: bool host_and_port = 32;
|
|
5685
|
+
*/
|
|
5686
|
+
hostAndPort?: boolean;
|
|
5687
|
+
/**
|
|
5688
|
+
* `well_known_regex` specifies a common well-known pattern
|
|
5689
|
+
* defined as a regex. If the field value doesn't match the well-known
|
|
5690
|
+
* regex, an error message will be generated.
|
|
5691
|
+
*
|
|
5692
|
+
* ```proto
|
|
5693
|
+
* message MyString {
|
|
5694
|
+
* // value must be a valid HTTP header value
|
|
5695
|
+
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
|
|
5696
|
+
* }
|
|
5697
|
+
* ```
|
|
5698
|
+
*
|
|
5699
|
+
* #### KnownRegex
|
|
5700
|
+
*
|
|
5701
|
+
* `well_known_regex` contains some well-known patterns.
|
|
5702
|
+
*
|
|
5703
|
+
* | Name | Number | Description |
|
|
5704
|
+
* |-------------------------------|--------|-------------------------------------------|
|
|
5705
|
+
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
|
|
5706
|
+
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2) |
|
|
5707
|
+
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
|
|
5708
|
+
*
|
|
5709
|
+
* @generated from field: buf.validate.KnownRegex well_known_regex = 24;
|
|
5710
|
+
*/
|
|
5711
|
+
wellKnownRegex?: KnownRegexJson;
|
|
5712
|
+
/**
|
|
5713
|
+
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
|
|
5714
|
+
* enable strict header validation. By default, this is true, and HTTP header
|
|
5715
|
+
* validations are [RFC-compliant](https://tools.ietf.org/html/rfc7230#section-3). Setting to false will enable looser
|
|
5716
|
+
* validations that only disallow `\r\n\0` characters, which can be used to
|
|
5717
|
+
* bypass header matching rules.
|
|
5718
|
+
*
|
|
5719
|
+
* ```proto
|
|
5720
|
+
* message MyString {
|
|
5721
|
+
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
|
|
5722
|
+
* string value = 1 [(buf.validate.field).string.strict = false];
|
|
5723
|
+
* }
|
|
5724
|
+
* ```
|
|
5725
|
+
*
|
|
5726
|
+
* @generated from field: optional bool strict = 25;
|
|
5727
|
+
*/
|
|
5728
|
+
strict?: boolean;
|
|
5729
|
+
/**
|
|
5730
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
5731
|
+
* conform to other constraints. `example` values will not impact validation
|
|
5732
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
5733
|
+
*
|
|
5734
|
+
* ```proto
|
|
5735
|
+
* message MyString {
|
|
5736
|
+
* string value = 1 [
|
|
5737
|
+
* (buf.validate.field).string.example = "hello",
|
|
5738
|
+
* (buf.validate.field).string.example = "world"
|
|
5739
|
+
* ];
|
|
5740
|
+
* }
|
|
5741
|
+
* ```
|
|
5742
|
+
*
|
|
5743
|
+
* @generated from field: repeated string example = 34;
|
|
5744
|
+
*/
|
|
5745
|
+
example?: string[];
|
|
5746
|
+
};
|
|
5747
|
+
/**
|
|
5748
|
+
* Describes the message buf.validate.StringRules.
|
|
5749
|
+
* Use `create(StringRulesSchema)` to create a new message.
|
|
5750
|
+
*/
|
|
5751
|
+
export declare const StringRulesSchema: GenMessage<StringRules, StringRulesJson>;
|
|
5752
|
+
/**
|
|
5753
|
+
* BytesRules describe the constraints applied to `bytes` values. These rules
|
|
5754
|
+
* may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
|
|
5755
|
+
*
|
|
5756
|
+
* @generated from message buf.validate.BytesRules
|
|
5757
|
+
*/
|
|
5758
|
+
export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
5759
|
+
/**
|
|
5760
|
+
* `const` requires the field value to exactly match the specified bytes
|
|
5761
|
+
* value. If the field value doesn't match, an error message is generated.
|
|
5762
|
+
*
|
|
5763
|
+
* ```proto
|
|
5764
|
+
* message MyBytes {
|
|
5765
|
+
* // value must be "\x01\x02\x03\x04"
|
|
5766
|
+
* bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
|
|
5767
|
+
* }
|
|
5768
|
+
* ```
|
|
5769
|
+
*
|
|
5770
|
+
* @generated from field: optional bytes const = 1;
|
|
5771
|
+
*/
|
|
5772
|
+
const: Uint8Array;
|
|
5773
|
+
/**
|
|
5774
|
+
* `len` requires the field value to have the specified length in bytes.
|
|
5775
|
+
* If the field value doesn't match, an error message is generated.
|
|
5776
|
+
*
|
|
5777
|
+
* ```proto
|
|
5778
|
+
* message MyBytes {
|
|
5779
|
+
* // value length must be 4 bytes.
|
|
5780
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
|
|
5781
|
+
* }
|
|
5782
|
+
* ```
|
|
5783
|
+
*
|
|
5784
|
+
* @generated from field: optional uint64 len = 13;
|
|
5785
|
+
*/
|
|
5786
|
+
len: bigint;
|
|
5787
|
+
/**
|
|
5788
|
+
* `min_len` requires the field value to have at least the specified minimum
|
|
5789
|
+
* length in bytes.
|
|
5790
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
5791
|
+
*
|
|
5792
|
+
* ```proto
|
|
5793
|
+
* message MyBytes {
|
|
5794
|
+
* // value length must be at least 2 bytes.
|
|
5795
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
|
|
5796
|
+
* }
|
|
5797
|
+
* ```
|
|
5798
|
+
*
|
|
5799
|
+
* @generated from field: optional uint64 min_len = 2;
|
|
5800
|
+
*/
|
|
5801
|
+
minLen: bigint;
|
|
5802
|
+
/**
|
|
5803
|
+
* `max_len` requires the field value to have at most the specified maximum
|
|
5804
|
+
* length in bytes.
|
|
5805
|
+
* If the field value exceeds the requirement, an error message is generated.
|
|
5806
|
+
*
|
|
5807
|
+
* ```proto
|
|
5808
|
+
* message MyBytes {
|
|
5809
|
+
* // value must be at most 6 bytes.
|
|
5810
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
|
|
5811
|
+
* }
|
|
5812
|
+
* ```
|
|
5813
|
+
*
|
|
5814
|
+
* @generated from field: optional uint64 max_len = 3;
|
|
5815
|
+
*/
|
|
5816
|
+
maxLen: bigint;
|
|
5817
|
+
/**
|
|
5818
|
+
* `pattern` requires the field value to match the specified regular
|
|
5819
|
+
* expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
|
5820
|
+
* The value of the field must be valid UTF-8 or validation will fail with a
|
|
5821
|
+
* runtime error.
|
|
5822
|
+
* If the field value doesn't match the pattern, an error message is generated.
|
|
5823
|
+
*
|
|
5824
|
+
* ```proto
|
|
5825
|
+
* message MyBytes {
|
|
5826
|
+
* // value must match regex pattern "^[a-zA-Z0-9]+$".
|
|
5827
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
|
|
5828
|
+
* }
|
|
5829
|
+
* ```
|
|
5830
|
+
*
|
|
5831
|
+
* @generated from field: optional string pattern = 4;
|
|
5832
|
+
*/
|
|
5833
|
+
pattern: string;
|
|
5834
|
+
/**
|
|
5835
|
+
* `prefix` requires the field value to have the specified bytes at the
|
|
5836
|
+
* beginning of the string.
|
|
5837
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
5838
|
+
*
|
|
5839
|
+
* ```proto
|
|
5840
|
+
* message MyBytes {
|
|
5841
|
+
* // value does not have prefix \x01\x02
|
|
5842
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
|
|
5843
|
+
* }
|
|
5844
|
+
* ```
|
|
5845
|
+
*
|
|
5846
|
+
* @generated from field: optional bytes prefix = 5;
|
|
5847
|
+
*/
|
|
5848
|
+
prefix: Uint8Array;
|
|
5849
|
+
/**
|
|
5850
|
+
* `suffix` requires the field value to have the specified bytes at the end
|
|
5851
|
+
* of the string.
|
|
5852
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
5853
|
+
*
|
|
5854
|
+
* ```proto
|
|
5855
|
+
* message MyBytes {
|
|
5856
|
+
* // value does not have suffix \x03\x04
|
|
5857
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
|
|
5858
|
+
* }
|
|
5859
|
+
* ```
|
|
5860
|
+
*
|
|
5861
|
+
* @generated from field: optional bytes suffix = 6;
|
|
5862
|
+
*/
|
|
5863
|
+
suffix: Uint8Array;
|
|
5864
|
+
/**
|
|
5865
|
+
* `contains` requires the field value to have the specified bytes anywhere in
|
|
5866
|
+
* the string.
|
|
5867
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
5868
|
+
*
|
|
5869
|
+
* ```protobuf
|
|
5870
|
+
* message MyBytes {
|
|
5871
|
+
* // value does not contain \x02\x03
|
|
5872
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
|
|
5873
|
+
* }
|
|
5874
|
+
* ```
|
|
5875
|
+
*
|
|
5876
|
+
* @generated from field: optional bytes contains = 7;
|
|
5877
|
+
*/
|
|
5878
|
+
contains: Uint8Array;
|
|
5879
|
+
/**
|
|
5880
|
+
* `in` requires the field value to be equal to one of the specified
|
|
5881
|
+
* values. If the field value doesn't match any of the specified values, an
|
|
5882
|
+
* error message is generated.
|
|
5883
|
+
*
|
|
5884
|
+
* ```protobuf
|
|
5885
|
+
* message MyBytes {
|
|
5886
|
+
* // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
|
|
5887
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
|
|
5888
|
+
* }
|
|
5889
|
+
* ```
|
|
5890
|
+
*
|
|
5891
|
+
* @generated from field: repeated bytes in = 8;
|
|
5892
|
+
*/
|
|
5893
|
+
in: Uint8Array[];
|
|
5894
|
+
/**
|
|
5895
|
+
* `not_in` requires the field value to be not equal to any of the specified
|
|
5896
|
+
* values.
|
|
5897
|
+
* If the field value matches any of the specified values, an error message is
|
|
5898
|
+
* generated.
|
|
5899
|
+
*
|
|
5900
|
+
* ```proto
|
|
5901
|
+
* message MyBytes {
|
|
5902
|
+
* // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
|
|
5903
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
|
|
5904
|
+
* }
|
|
5905
|
+
* ```
|
|
5906
|
+
*
|
|
5907
|
+
* @generated from field: repeated bytes not_in = 9;
|
|
5908
|
+
*/
|
|
5909
|
+
notIn: Uint8Array[];
|
|
5910
|
+
/**
|
|
5911
|
+
* WellKnown rules provide advanced constraints against common byte
|
|
5912
|
+
* patterns
|
|
5913
|
+
*
|
|
5914
|
+
* @generated from oneof buf.validate.BytesRules.well_known
|
|
5915
|
+
*/
|
|
5916
|
+
wellKnown: {
|
|
5917
|
+
/**
|
|
5918
|
+
* `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
|
5919
|
+
* If the field value doesn't meet this constraint, an error message is generated.
|
|
5920
|
+
*
|
|
5921
|
+
* ```proto
|
|
5922
|
+
* message MyBytes {
|
|
5923
|
+
* // value must be a valid IP address
|
|
5924
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
|
|
5925
|
+
* }
|
|
5926
|
+
* ```
|
|
5927
|
+
*
|
|
5928
|
+
* @generated from field: bool ip = 10;
|
|
5929
|
+
*/
|
|
5930
|
+
value: boolean;
|
|
5931
|
+
case: "ip";
|
|
5932
|
+
} | {
|
|
5933
|
+
/**
|
|
5934
|
+
* `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
|
5935
|
+
* If the field value doesn't meet this constraint, an error message is generated.
|
|
5936
|
+
*
|
|
5937
|
+
* ```proto
|
|
5938
|
+
* message MyBytes {
|
|
5939
|
+
* // value must be a valid IPv4 address
|
|
5940
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
|
|
5941
|
+
* }
|
|
5942
|
+
* ```
|
|
5943
|
+
*
|
|
5944
|
+
* @generated from field: bool ipv4 = 11;
|
|
5945
|
+
*/
|
|
5946
|
+
value: boolean;
|
|
5947
|
+
case: "ipv4";
|
|
5948
|
+
} | {
|
|
5949
|
+
/**
|
|
5950
|
+
* `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
|
5951
|
+
* If the field value doesn't meet this constraint, an error message is generated.
|
|
5952
|
+
* ```proto
|
|
5953
|
+
* message MyBytes {
|
|
5954
|
+
* // value must be a valid IPv6 address
|
|
5955
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
|
|
5956
|
+
* }
|
|
5957
|
+
* ```
|
|
5958
|
+
*
|
|
5959
|
+
* @generated from field: bool ipv6 = 12;
|
|
5960
|
+
*/
|
|
5961
|
+
value: boolean;
|
|
5962
|
+
case: "ipv6";
|
|
5963
|
+
} | {
|
|
5964
|
+
case: undefined;
|
|
5965
|
+
value?: undefined;
|
|
5966
|
+
};
|
|
5967
|
+
/**
|
|
5968
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
5969
|
+
* conform to other constraints. `example` values will not impact validation
|
|
5970
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
5971
|
+
*
|
|
5972
|
+
* ```proto
|
|
5973
|
+
* message MyBytes {
|
|
5974
|
+
* bytes value = 1 [
|
|
5975
|
+
* (buf.validate.field).bytes.example = "\x01\x02",
|
|
5976
|
+
* (buf.validate.field).bytes.example = "\x02\x03"
|
|
5977
|
+
* ];
|
|
5978
|
+
* }
|
|
5979
|
+
* ```
|
|
5980
|
+
*
|
|
5981
|
+
* @generated from field: repeated bytes example = 14;
|
|
5982
|
+
*/
|
|
5983
|
+
example: Uint8Array[];
|
|
5984
|
+
};
|
|
5985
|
+
/**
|
|
5986
|
+
* BytesRules describe the constraints applied to `bytes` values. These rules
|
|
5987
|
+
* may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
|
|
5988
|
+
*
|
|
5989
|
+
* @generated from message buf.validate.BytesRules
|
|
5990
|
+
*/
|
|
5991
|
+
export type BytesRulesJson = {
|
|
5992
|
+
/**
|
|
5993
|
+
* `const` requires the field value to exactly match the specified bytes
|
|
5994
|
+
* value. If the field value doesn't match, an error message is generated.
|
|
5995
|
+
*
|
|
5996
|
+
* ```proto
|
|
5997
|
+
* message MyBytes {
|
|
5998
|
+
* // value must be "\x01\x02\x03\x04"
|
|
5999
|
+
* bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
|
|
6000
|
+
* }
|
|
6001
|
+
* ```
|
|
6002
|
+
*
|
|
6003
|
+
* @generated from field: optional bytes const = 1;
|
|
6004
|
+
*/
|
|
6005
|
+
const?: string;
|
|
6006
|
+
/**
|
|
6007
|
+
* `len` requires the field value to have the specified length in bytes.
|
|
6008
|
+
* If the field value doesn't match, an error message is generated.
|
|
6009
|
+
*
|
|
6010
|
+
* ```proto
|
|
6011
|
+
* message MyBytes {
|
|
6012
|
+
* // value length must be 4 bytes.
|
|
6013
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
|
|
6014
|
+
* }
|
|
6015
|
+
* ```
|
|
6016
|
+
*
|
|
6017
|
+
* @generated from field: optional uint64 len = 13;
|
|
6018
|
+
*/
|
|
6019
|
+
len?: string;
|
|
3142
6020
|
/**
|
|
3143
6021
|
* `min_len` requires the field value to have at least the specified minimum
|
|
3144
6022
|
* length in bytes.
|
|
@@ -3153,7 +6031,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3153
6031
|
*
|
|
3154
6032
|
* @generated from field: optional uint64 min_len = 2;
|
|
3155
6033
|
*/
|
|
3156
|
-
minLen
|
|
6034
|
+
minLen?: string;
|
|
3157
6035
|
/**
|
|
3158
6036
|
* `max_len` requires the field value to have at most the specified maximum
|
|
3159
6037
|
* length in bytes.
|
|
@@ -3168,7 +6046,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3168
6046
|
*
|
|
3169
6047
|
* @generated from field: optional uint64 max_len = 3;
|
|
3170
6048
|
*/
|
|
3171
|
-
maxLen
|
|
6049
|
+
maxLen?: string;
|
|
3172
6050
|
/**
|
|
3173
6051
|
* `pattern` requires the field value to match the specified regular
|
|
3174
6052
|
* expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
|
@@ -3185,7 +6063,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3185
6063
|
*
|
|
3186
6064
|
* @generated from field: optional string pattern = 4;
|
|
3187
6065
|
*/
|
|
3188
|
-
pattern
|
|
6066
|
+
pattern?: string;
|
|
3189
6067
|
/**
|
|
3190
6068
|
* `prefix` requires the field value to have the specified bytes at the
|
|
3191
6069
|
* beginning of the string.
|
|
@@ -3200,7 +6078,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3200
6078
|
*
|
|
3201
6079
|
* @generated from field: optional bytes prefix = 5;
|
|
3202
6080
|
*/
|
|
3203
|
-
prefix
|
|
6081
|
+
prefix?: string;
|
|
3204
6082
|
/**
|
|
3205
6083
|
* `suffix` requires the field value to have the specified bytes at the end
|
|
3206
6084
|
* of the string.
|
|
@@ -3215,7 +6093,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3215
6093
|
*
|
|
3216
6094
|
* @generated from field: optional bytes suffix = 6;
|
|
3217
6095
|
*/
|
|
3218
|
-
suffix
|
|
6096
|
+
suffix?: string;
|
|
3219
6097
|
/**
|
|
3220
6098
|
* `contains` requires the field value to have the specified bytes anywhere in
|
|
3221
6099
|
* the string.
|
|
@@ -3230,7 +6108,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3230
6108
|
*
|
|
3231
6109
|
* @generated from field: optional bytes contains = 7;
|
|
3232
6110
|
*/
|
|
3233
|
-
contains
|
|
6111
|
+
contains?: string;
|
|
3234
6112
|
/**
|
|
3235
6113
|
* `in` requires the field value to be equal to one of the specified
|
|
3236
6114
|
* values. If the field value doesn't match any of the specified values, an
|
|
@@ -3245,7 +6123,7 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3245
6123
|
*
|
|
3246
6124
|
* @generated from field: repeated bytes in = 8;
|
|
3247
6125
|
*/
|
|
3248
|
-
in
|
|
6126
|
+
in?: string[];
|
|
3249
6127
|
/**
|
|
3250
6128
|
* `not_in` requires the field value to be not equal to any of the specified
|
|
3251
6129
|
* values.
|
|
@@ -3261,64 +6139,48 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3261
6139
|
*
|
|
3262
6140
|
* @generated from field: repeated bytes not_in = 9;
|
|
3263
6141
|
*/
|
|
3264
|
-
notIn
|
|
6142
|
+
notIn?: string[];
|
|
3265
6143
|
/**
|
|
3266
|
-
*
|
|
3267
|
-
*
|
|
6144
|
+
* `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
|
6145
|
+
* If the field value doesn't meet this constraint, an error message is generated.
|
|
3268
6146
|
*
|
|
3269
|
-
*
|
|
6147
|
+
* ```proto
|
|
6148
|
+
* message MyBytes {
|
|
6149
|
+
* // value must be a valid IP address
|
|
6150
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
|
|
6151
|
+
* }
|
|
6152
|
+
* ```
|
|
6153
|
+
*
|
|
6154
|
+
* @generated from field: bool ip = 10;
|
|
3270
6155
|
*/
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
* @generated from field: bool ipv4 = 11;
|
|
3300
|
-
*/
|
|
3301
|
-
value: boolean;
|
|
3302
|
-
case: "ipv4";
|
|
3303
|
-
} | {
|
|
3304
|
-
/**
|
|
3305
|
-
* `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
|
3306
|
-
* If the field value doesn't meet this constraint, an error message is generated.
|
|
3307
|
-
* ```proto
|
|
3308
|
-
* message MyBytes {
|
|
3309
|
-
* // value must be a valid IPv6 address
|
|
3310
|
-
* optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
|
|
3311
|
-
* }
|
|
3312
|
-
* ```
|
|
3313
|
-
*
|
|
3314
|
-
* @generated from field: bool ipv6 = 12;
|
|
3315
|
-
*/
|
|
3316
|
-
value: boolean;
|
|
3317
|
-
case: "ipv6";
|
|
3318
|
-
} | {
|
|
3319
|
-
case: undefined;
|
|
3320
|
-
value?: undefined;
|
|
3321
|
-
};
|
|
6156
|
+
ip?: boolean;
|
|
6157
|
+
/**
|
|
6158
|
+
* `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
|
6159
|
+
* If the field value doesn't meet this constraint, an error message is generated.
|
|
6160
|
+
*
|
|
6161
|
+
* ```proto
|
|
6162
|
+
* message MyBytes {
|
|
6163
|
+
* // value must be a valid IPv4 address
|
|
6164
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
|
|
6165
|
+
* }
|
|
6166
|
+
* ```
|
|
6167
|
+
*
|
|
6168
|
+
* @generated from field: bool ipv4 = 11;
|
|
6169
|
+
*/
|
|
6170
|
+
ipv4?: boolean;
|
|
6171
|
+
/**
|
|
6172
|
+
* `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
|
6173
|
+
* If the field value doesn't meet this constraint, an error message is generated.
|
|
6174
|
+
* ```proto
|
|
6175
|
+
* message MyBytes {
|
|
6176
|
+
* // value must be a valid IPv6 address
|
|
6177
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
|
|
6178
|
+
* }
|
|
6179
|
+
* ```
|
|
6180
|
+
*
|
|
6181
|
+
* @generated from field: bool ipv6 = 12;
|
|
6182
|
+
*/
|
|
6183
|
+
ipv6?: boolean;
|
|
3322
6184
|
/**
|
|
3323
6185
|
* `example` specifies values that the field may have. These values SHOULD
|
|
3324
6186
|
* conform to other constraints. `example` values will not impact validation
|
|
@@ -3335,13 +6197,13 @@ export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
|
3335
6197
|
*
|
|
3336
6198
|
* @generated from field: repeated bytes example = 14;
|
|
3337
6199
|
*/
|
|
3338
|
-
example
|
|
6200
|
+
example?: string[];
|
|
3339
6201
|
};
|
|
3340
6202
|
/**
|
|
3341
6203
|
* Describes the message buf.validate.BytesRules.
|
|
3342
6204
|
* Use `create(BytesRulesSchema)` to create a new message.
|
|
3343
6205
|
*/
|
|
3344
|
-
export declare const BytesRulesSchema: GenMessage<BytesRules>;
|
|
6206
|
+
export declare const BytesRulesSchema: GenMessage<BytesRules, BytesRulesJson>;
|
|
3345
6207
|
/**
|
|
3346
6208
|
* EnumRules describe the constraints applied to `enum` values.
|
|
3347
6209
|
*
|
|
@@ -3448,21 +6310,205 @@ export type EnumRules = Message<"buf.validate.EnumRules"> & {
|
|
|
3448
6310
|
* }
|
|
3449
6311
|
* ```
|
|
3450
6312
|
*
|
|
3451
|
-
* @generated from field: repeated int32 example = 5;
|
|
6313
|
+
* @generated from field: repeated int32 example = 5;
|
|
6314
|
+
*/
|
|
6315
|
+
example: number[];
|
|
6316
|
+
};
|
|
6317
|
+
/**
|
|
6318
|
+
* EnumRules describe the constraints applied to `enum` values.
|
|
6319
|
+
*
|
|
6320
|
+
* @generated from message buf.validate.EnumRules
|
|
6321
|
+
*/
|
|
6322
|
+
export type EnumRulesJson = {
|
|
6323
|
+
/**
|
|
6324
|
+
* `const` requires the field value to exactly match the specified enum value.
|
|
6325
|
+
* If the field value doesn't match, an error message is generated.
|
|
6326
|
+
*
|
|
6327
|
+
* ```proto
|
|
6328
|
+
* enum MyEnum {
|
|
6329
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
6330
|
+
* MY_ENUM_VALUE1 = 1;
|
|
6331
|
+
* MY_ENUM_VALUE2 = 2;
|
|
6332
|
+
* }
|
|
6333
|
+
*
|
|
6334
|
+
* message MyMessage {
|
|
6335
|
+
* // The field `value` must be exactly MY_ENUM_VALUE1.
|
|
6336
|
+
* MyEnum value = 1 [(buf.validate.field).enum.const = 1];
|
|
6337
|
+
* }
|
|
6338
|
+
* ```
|
|
6339
|
+
*
|
|
6340
|
+
* @generated from field: optional int32 const = 1;
|
|
6341
|
+
*/
|
|
6342
|
+
const?: number;
|
|
6343
|
+
/**
|
|
6344
|
+
* `defined_only` requires the field value to be one of the defined values for
|
|
6345
|
+
* this enum, failing on any undefined value.
|
|
6346
|
+
*
|
|
6347
|
+
* ```proto
|
|
6348
|
+
* enum MyEnum {
|
|
6349
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
6350
|
+
* MY_ENUM_VALUE1 = 1;
|
|
6351
|
+
* MY_ENUM_VALUE2 = 2;
|
|
6352
|
+
* }
|
|
6353
|
+
*
|
|
6354
|
+
* message MyMessage {
|
|
6355
|
+
* // The field `value` must be a defined value of MyEnum.
|
|
6356
|
+
* MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
|
|
6357
|
+
* }
|
|
6358
|
+
* ```
|
|
6359
|
+
*
|
|
6360
|
+
* @generated from field: optional bool defined_only = 2;
|
|
6361
|
+
*/
|
|
6362
|
+
definedOnly?: boolean;
|
|
6363
|
+
/**
|
|
6364
|
+
* `in` requires the field value to be equal to one of the
|
|
6365
|
+
* specified enum values. If the field value doesn't match any of the
|
|
6366
|
+
* specified values, an error message is generated.
|
|
6367
|
+
*
|
|
6368
|
+
* ```proto
|
|
6369
|
+
* enum MyEnum {
|
|
6370
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
6371
|
+
* MY_ENUM_VALUE1 = 1;
|
|
6372
|
+
* MY_ENUM_VALUE2 = 2;
|
|
6373
|
+
* }
|
|
6374
|
+
*
|
|
6375
|
+
* message MyMessage {
|
|
6376
|
+
* // The field `value` must be equal to one of the specified values.
|
|
6377
|
+
* MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
|
|
6378
|
+
* }
|
|
6379
|
+
* ```
|
|
6380
|
+
*
|
|
6381
|
+
* @generated from field: repeated int32 in = 3;
|
|
6382
|
+
*/
|
|
6383
|
+
in?: number[];
|
|
6384
|
+
/**
|
|
6385
|
+
* `not_in` requires the field value to be not equal to any of the
|
|
6386
|
+
* specified enum values. If the field value matches one of the specified
|
|
6387
|
+
* values, an error message is generated.
|
|
6388
|
+
*
|
|
6389
|
+
* ```proto
|
|
6390
|
+
* enum MyEnum {
|
|
6391
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
6392
|
+
* MY_ENUM_VALUE1 = 1;
|
|
6393
|
+
* MY_ENUM_VALUE2 = 2;
|
|
6394
|
+
* }
|
|
6395
|
+
*
|
|
6396
|
+
* message MyMessage {
|
|
6397
|
+
* // The field `value` must not be equal to any of the specified values.
|
|
6398
|
+
* MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
|
|
6399
|
+
* }
|
|
6400
|
+
* ```
|
|
6401
|
+
*
|
|
6402
|
+
* @generated from field: repeated int32 not_in = 4;
|
|
6403
|
+
*/
|
|
6404
|
+
notIn?: number[];
|
|
6405
|
+
/**
|
|
6406
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
6407
|
+
* conform to other constraints. `example` values will not impact validation
|
|
6408
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
6409
|
+
*
|
|
6410
|
+
* ```proto
|
|
6411
|
+
* enum MyEnum {
|
|
6412
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
6413
|
+
* MY_ENUM_VALUE1 = 1;
|
|
6414
|
+
* MY_ENUM_VALUE2 = 2;
|
|
6415
|
+
* }
|
|
6416
|
+
*
|
|
6417
|
+
* message MyMessage {
|
|
6418
|
+
* (buf.validate.field).enum.example = 1,
|
|
6419
|
+
* (buf.validate.field).enum.example = 2
|
|
6420
|
+
* }
|
|
6421
|
+
* ```
|
|
6422
|
+
*
|
|
6423
|
+
* @generated from field: repeated int32 example = 5;
|
|
6424
|
+
*/
|
|
6425
|
+
example?: number[];
|
|
6426
|
+
};
|
|
6427
|
+
/**
|
|
6428
|
+
* Describes the message buf.validate.EnumRules.
|
|
6429
|
+
* Use `create(EnumRulesSchema)` to create a new message.
|
|
6430
|
+
*/
|
|
6431
|
+
export declare const EnumRulesSchema: GenMessage<EnumRules, EnumRulesJson>;
|
|
6432
|
+
/**
|
|
6433
|
+
* RepeatedRules describe the constraints applied to `repeated` values.
|
|
6434
|
+
*
|
|
6435
|
+
* @generated from message buf.validate.RepeatedRules
|
|
6436
|
+
*/
|
|
6437
|
+
export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & {
|
|
6438
|
+
/**
|
|
6439
|
+
* `min_items` requires that this field must contain at least the specified
|
|
6440
|
+
* minimum number of items.
|
|
6441
|
+
*
|
|
6442
|
+
* Note that `min_items = 1` is equivalent to setting a field as `required`.
|
|
6443
|
+
*
|
|
6444
|
+
* ```proto
|
|
6445
|
+
* message MyRepeated {
|
|
6446
|
+
* // value must contain at least 2 items
|
|
6447
|
+
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
|
|
6448
|
+
* }
|
|
6449
|
+
* ```
|
|
6450
|
+
*
|
|
6451
|
+
* @generated from field: optional uint64 min_items = 1;
|
|
6452
|
+
*/
|
|
6453
|
+
minItems: bigint;
|
|
6454
|
+
/**
|
|
6455
|
+
* `max_items` denotes that this field must not exceed a
|
|
6456
|
+
* certain number of items as the upper limit. If the field contains more
|
|
6457
|
+
* items than specified, an error message will be generated, requiring the
|
|
6458
|
+
* field to maintain no more than the specified number of items.
|
|
6459
|
+
*
|
|
6460
|
+
* ```proto
|
|
6461
|
+
* message MyRepeated {
|
|
6462
|
+
* // value must contain no more than 3 item(s)
|
|
6463
|
+
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
|
|
6464
|
+
* }
|
|
6465
|
+
* ```
|
|
6466
|
+
*
|
|
6467
|
+
* @generated from field: optional uint64 max_items = 2;
|
|
6468
|
+
*/
|
|
6469
|
+
maxItems: bigint;
|
|
6470
|
+
/**
|
|
6471
|
+
* `unique` indicates that all elements in this field must
|
|
6472
|
+
* be unique. This constraint is strictly applicable to scalar and enum
|
|
6473
|
+
* types, with message types not being supported.
|
|
6474
|
+
*
|
|
6475
|
+
* ```proto
|
|
6476
|
+
* message MyRepeated {
|
|
6477
|
+
* // repeated value must contain unique items
|
|
6478
|
+
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
|
|
6479
|
+
* }
|
|
6480
|
+
* ```
|
|
6481
|
+
*
|
|
6482
|
+
* @generated from field: optional bool unique = 3;
|
|
6483
|
+
*/
|
|
6484
|
+
unique: boolean;
|
|
6485
|
+
/**
|
|
6486
|
+
* `items` details the constraints to be applied to each item
|
|
6487
|
+
* in the field. Even for repeated message fields, validation is executed
|
|
6488
|
+
* against each item unless skip is explicitly specified.
|
|
6489
|
+
*
|
|
6490
|
+
* ```proto
|
|
6491
|
+
* message MyRepeated {
|
|
6492
|
+
* // The items in the field `value` must follow the specified constraints.
|
|
6493
|
+
* repeated string value = 1 [(buf.validate.field).repeated.items = {
|
|
6494
|
+
* string: {
|
|
6495
|
+
* min_len: 3
|
|
6496
|
+
* max_len: 10
|
|
6497
|
+
* }
|
|
6498
|
+
* }];
|
|
6499
|
+
* }
|
|
6500
|
+
* ```
|
|
6501
|
+
*
|
|
6502
|
+
* @generated from field: optional buf.validate.FieldConstraints items = 4;
|
|
3452
6503
|
*/
|
|
3453
|
-
|
|
6504
|
+
items?: FieldConstraints;
|
|
3454
6505
|
};
|
|
3455
|
-
/**
|
|
3456
|
-
* Describes the message buf.validate.EnumRules.
|
|
3457
|
-
* Use `create(EnumRulesSchema)` to create a new message.
|
|
3458
|
-
*/
|
|
3459
|
-
export declare const EnumRulesSchema: GenMessage<EnumRules>;
|
|
3460
6506
|
/**
|
|
3461
6507
|
* RepeatedRules describe the constraints applied to `repeated` values.
|
|
3462
6508
|
*
|
|
3463
6509
|
* @generated from message buf.validate.RepeatedRules
|
|
3464
6510
|
*/
|
|
3465
|
-
export type
|
|
6511
|
+
export type RepeatedRulesJson = {
|
|
3466
6512
|
/**
|
|
3467
6513
|
* `min_items` requires that this field must contain at least the specified
|
|
3468
6514
|
* minimum number of items.
|
|
@@ -3478,7 +6524,7 @@ export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & {
|
|
|
3478
6524
|
*
|
|
3479
6525
|
* @generated from field: optional uint64 min_items = 1;
|
|
3480
6526
|
*/
|
|
3481
|
-
minItems
|
|
6527
|
+
minItems?: string;
|
|
3482
6528
|
/**
|
|
3483
6529
|
* `max_items` denotes that this field must not exceed a
|
|
3484
6530
|
* certain number of items as the upper limit. If the field contains more
|
|
@@ -3494,7 +6540,7 @@ export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & {
|
|
|
3494
6540
|
*
|
|
3495
6541
|
* @generated from field: optional uint64 max_items = 2;
|
|
3496
6542
|
*/
|
|
3497
|
-
maxItems
|
|
6543
|
+
maxItems?: string;
|
|
3498
6544
|
/**
|
|
3499
6545
|
* `unique` indicates that all elements in this field must
|
|
3500
6546
|
* be unique. This constraint is strictly applicable to scalar and enum
|
|
@@ -3509,7 +6555,7 @@ export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & {
|
|
|
3509
6555
|
*
|
|
3510
6556
|
* @generated from field: optional bool unique = 3;
|
|
3511
6557
|
*/
|
|
3512
|
-
unique
|
|
6558
|
+
unique?: boolean;
|
|
3513
6559
|
/**
|
|
3514
6560
|
* `items` details the constraints to be applied to each item
|
|
3515
6561
|
* in the field. Even for repeated message fields, validation is executed
|
|
@@ -3529,13 +6575,13 @@ export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & {
|
|
|
3529
6575
|
*
|
|
3530
6576
|
* @generated from field: optional buf.validate.FieldConstraints items = 4;
|
|
3531
6577
|
*/
|
|
3532
|
-
items?:
|
|
6578
|
+
items?: FieldConstraintsJson;
|
|
3533
6579
|
};
|
|
3534
6580
|
/**
|
|
3535
6581
|
* Describes the message buf.validate.RepeatedRules.
|
|
3536
6582
|
* Use `create(RepeatedRulesSchema)` to create a new message.
|
|
3537
6583
|
*/
|
|
3538
|
-
export declare const RepeatedRulesSchema: GenMessage<RepeatedRules>;
|
|
6584
|
+
export declare const RepeatedRulesSchema: GenMessage<RepeatedRules, RepeatedRulesJson>;
|
|
3539
6585
|
/**
|
|
3540
6586
|
* MapRules describe the constraints applied to `map` values.
|
|
3541
6587
|
*
|
|
@@ -3609,11 +6655,84 @@ export type MapRules = Message<"buf.validate.MapRules"> & {
|
|
|
3609
6655
|
*/
|
|
3610
6656
|
values?: FieldConstraints;
|
|
3611
6657
|
};
|
|
6658
|
+
/**
|
|
6659
|
+
* MapRules describe the constraints applied to `map` values.
|
|
6660
|
+
*
|
|
6661
|
+
* @generated from message buf.validate.MapRules
|
|
6662
|
+
*/
|
|
6663
|
+
export type MapRulesJson = {
|
|
6664
|
+
/**
|
|
6665
|
+
* Specifies the minimum number of key-value pairs allowed. If the field has
|
|
6666
|
+
* fewer key-value pairs than specified, an error message is generated.
|
|
6667
|
+
*
|
|
6668
|
+
* ```proto
|
|
6669
|
+
* message MyMap {
|
|
6670
|
+
* // The field `value` must have at least 2 key-value pairs.
|
|
6671
|
+
* map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
|
|
6672
|
+
* }
|
|
6673
|
+
* ```
|
|
6674
|
+
*
|
|
6675
|
+
* @generated from field: optional uint64 min_pairs = 1;
|
|
6676
|
+
*/
|
|
6677
|
+
minPairs?: string;
|
|
6678
|
+
/**
|
|
6679
|
+
* Specifies the maximum number of key-value pairs allowed. If the field has
|
|
6680
|
+
* more key-value pairs than specified, an error message is generated.
|
|
6681
|
+
*
|
|
6682
|
+
* ```proto
|
|
6683
|
+
* message MyMap {
|
|
6684
|
+
* // The field `value` must have at most 3 key-value pairs.
|
|
6685
|
+
* map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
|
|
6686
|
+
* }
|
|
6687
|
+
* ```
|
|
6688
|
+
*
|
|
6689
|
+
* @generated from field: optional uint64 max_pairs = 2;
|
|
6690
|
+
*/
|
|
6691
|
+
maxPairs?: string;
|
|
6692
|
+
/**
|
|
6693
|
+
* Specifies the constraints to be applied to each key in the field.
|
|
6694
|
+
*
|
|
6695
|
+
* ```proto
|
|
6696
|
+
* message MyMap {
|
|
6697
|
+
* // The keys in the field `value` must follow the specified constraints.
|
|
6698
|
+
* map<string, string> value = 1 [(buf.validate.field).map.keys = {
|
|
6699
|
+
* string: {
|
|
6700
|
+
* min_len: 3
|
|
6701
|
+
* max_len: 10
|
|
6702
|
+
* }
|
|
6703
|
+
* }];
|
|
6704
|
+
* }
|
|
6705
|
+
* ```
|
|
6706
|
+
*
|
|
6707
|
+
* @generated from field: optional buf.validate.FieldConstraints keys = 4;
|
|
6708
|
+
*/
|
|
6709
|
+
keys?: FieldConstraintsJson;
|
|
6710
|
+
/**
|
|
6711
|
+
* Specifies the constraints to be applied to the value of each key in the
|
|
6712
|
+
* field. Message values will still have their validations evaluated unless
|
|
6713
|
+
* skip is specified here.
|
|
6714
|
+
*
|
|
6715
|
+
* ```proto
|
|
6716
|
+
* message MyMap {
|
|
6717
|
+
* // The values in the field `value` must follow the specified constraints.
|
|
6718
|
+
* map<string, string> value = 1 [(buf.validate.field).map.values = {
|
|
6719
|
+
* string: {
|
|
6720
|
+
* min_len: 5
|
|
6721
|
+
* max_len: 20
|
|
6722
|
+
* }
|
|
6723
|
+
* }];
|
|
6724
|
+
* }
|
|
6725
|
+
* ```
|
|
6726
|
+
*
|
|
6727
|
+
* @generated from field: optional buf.validate.FieldConstraints values = 5;
|
|
6728
|
+
*/
|
|
6729
|
+
values?: FieldConstraintsJson;
|
|
6730
|
+
};
|
|
3612
6731
|
/**
|
|
3613
6732
|
* Describes the message buf.validate.MapRules.
|
|
3614
6733
|
* Use `create(MapRulesSchema)` to create a new message.
|
|
3615
6734
|
*/
|
|
3616
|
-
export declare const MapRulesSchema: GenMessage<MapRules>;
|
|
6735
|
+
export declare const MapRulesSchema: GenMessage<MapRules, MapRulesJson>;
|
|
3617
6736
|
/**
|
|
3618
6737
|
* AnyRules describe constraints applied exclusively to the `google.protobuf.Any` well-known type.
|
|
3619
6738
|
*
|
|
@@ -3649,11 +6768,46 @@ export type AnyRules = Message<"buf.validate.AnyRules"> & {
|
|
|
3649
6768
|
*/
|
|
3650
6769
|
notIn: string[];
|
|
3651
6770
|
};
|
|
6771
|
+
/**
|
|
6772
|
+
* AnyRules describe constraints applied exclusively to the `google.protobuf.Any` well-known type.
|
|
6773
|
+
*
|
|
6774
|
+
* @generated from message buf.validate.AnyRules
|
|
6775
|
+
*/
|
|
6776
|
+
export type AnyRulesJson = {
|
|
6777
|
+
/**
|
|
6778
|
+
* `in` requires the field's `type_url` to be equal to one of the
|
|
6779
|
+
* specified values. If it doesn't match any of the specified values, an error
|
|
6780
|
+
* message is generated.
|
|
6781
|
+
*
|
|
6782
|
+
* ```proto
|
|
6783
|
+
* message MyAny {
|
|
6784
|
+
* // The `value` field must have a `type_url` equal to one of the specified values.
|
|
6785
|
+
* google.protobuf.Any value = 1 [(buf.validate.field).any.in = ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]];
|
|
6786
|
+
* }
|
|
6787
|
+
* ```
|
|
6788
|
+
*
|
|
6789
|
+
* @generated from field: repeated string in = 2;
|
|
6790
|
+
*/
|
|
6791
|
+
in?: string[];
|
|
6792
|
+
/**
|
|
6793
|
+
* 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.
|
|
6794
|
+
*
|
|
6795
|
+
* ```proto
|
|
6796
|
+
* message MyAny {
|
|
6797
|
+
* // The field `value` must not have a `type_url` equal to any of the specified values.
|
|
6798
|
+
* google.protobuf.Any value = 1 [(buf.validate.field).any.not_in = ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]];
|
|
6799
|
+
* }
|
|
6800
|
+
* ```
|
|
6801
|
+
*
|
|
6802
|
+
* @generated from field: repeated string not_in = 3;
|
|
6803
|
+
*/
|
|
6804
|
+
notIn?: string[];
|
|
6805
|
+
};
|
|
3652
6806
|
/**
|
|
3653
6807
|
* Describes the message buf.validate.AnyRules.
|
|
3654
6808
|
* Use `create(AnyRulesSchema)` to create a new message.
|
|
3655
6809
|
*/
|
|
3656
|
-
export declare const AnyRulesSchema: GenMessage<AnyRules>;
|
|
6810
|
+
export declare const AnyRulesSchema: GenMessage<AnyRules, AnyRulesJson>;
|
|
3657
6811
|
/**
|
|
3658
6812
|
* DurationRules describe the constraints applied exclusively to the `google.protobuf.Duration` well-known type.
|
|
3659
6813
|
*
|
|
@@ -3822,11 +6976,157 @@ export type DurationRules = Message<"buf.validate.DurationRules"> & {
|
|
|
3822
6976
|
*/
|
|
3823
6977
|
example: Duration[];
|
|
3824
6978
|
};
|
|
6979
|
+
/**
|
|
6980
|
+
* DurationRules describe the constraints applied exclusively to the `google.protobuf.Duration` well-known type.
|
|
6981
|
+
*
|
|
6982
|
+
* @generated from message buf.validate.DurationRules
|
|
6983
|
+
*/
|
|
6984
|
+
export type DurationRulesJson = {
|
|
6985
|
+
/**
|
|
6986
|
+
* `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.
|
|
6987
|
+
* If the field's value deviates from the specified value, an error message
|
|
6988
|
+
* will be generated.
|
|
6989
|
+
*
|
|
6990
|
+
* ```proto
|
|
6991
|
+
* message MyDuration {
|
|
6992
|
+
* // value must equal 5s
|
|
6993
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"];
|
|
6994
|
+
* }
|
|
6995
|
+
* ```
|
|
6996
|
+
*
|
|
6997
|
+
* @generated from field: optional google.protobuf.Duration const = 2;
|
|
6998
|
+
*/
|
|
6999
|
+
const?: DurationJson;
|
|
7000
|
+
/**
|
|
7001
|
+
* `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,
|
|
7002
|
+
* exclusive. If the field's value is greater than or equal to the specified
|
|
7003
|
+
* value, an error message will be generated.
|
|
7004
|
+
*
|
|
7005
|
+
* ```proto
|
|
7006
|
+
* message MyDuration {
|
|
7007
|
+
* // value must be less than 5s
|
|
7008
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"];
|
|
7009
|
+
* }
|
|
7010
|
+
* ```
|
|
7011
|
+
*
|
|
7012
|
+
* @generated from field: google.protobuf.Duration lt = 3;
|
|
7013
|
+
*/
|
|
7014
|
+
lt?: DurationJson;
|
|
7015
|
+
/**
|
|
7016
|
+
* `lte` indicates that the field must be less than or equal to the specified
|
|
7017
|
+
* value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,
|
|
7018
|
+
* an error message will be generated.
|
|
7019
|
+
*
|
|
7020
|
+
* ```proto
|
|
7021
|
+
* message MyDuration {
|
|
7022
|
+
* // value must be less than or equal to 10s
|
|
7023
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"];
|
|
7024
|
+
* }
|
|
7025
|
+
* ```
|
|
7026
|
+
*
|
|
7027
|
+
* @generated from field: google.protobuf.Duration lte = 4;
|
|
7028
|
+
*/
|
|
7029
|
+
lte?: DurationJson;
|
|
7030
|
+
/**
|
|
7031
|
+
* `gt` requires the duration field value to be greater than the specified
|
|
7032
|
+
* value (exclusive). If the value of `gt` is larger than a specified `lt`
|
|
7033
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
7034
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
7035
|
+
* an error message is generated.
|
|
7036
|
+
*
|
|
7037
|
+
* ```proto
|
|
7038
|
+
* message MyDuration {
|
|
7039
|
+
* // duration must be greater than 5s [duration.gt]
|
|
7040
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];
|
|
7041
|
+
*
|
|
7042
|
+
* // duration must be greater than 5s and less than 10s [duration.gt_lt]
|
|
7043
|
+
* google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];
|
|
7044
|
+
*
|
|
7045
|
+
* // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]
|
|
7046
|
+
* google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];
|
|
7047
|
+
* }
|
|
7048
|
+
* ```
|
|
7049
|
+
*
|
|
7050
|
+
* @generated from field: google.protobuf.Duration gt = 5;
|
|
7051
|
+
*/
|
|
7052
|
+
gt?: DurationJson;
|
|
7053
|
+
/**
|
|
7054
|
+
* `gte` requires the duration field value to be greater than or equal to the
|
|
7055
|
+
* specified value (exclusive). If the value of `gte` is larger than a
|
|
7056
|
+
* specified `lt` or `lte`, the range is reversed, and the field value must
|
|
7057
|
+
* be outside the specified range. If the field value doesn't meet the
|
|
7058
|
+
* required conditions, an error message is generated.
|
|
7059
|
+
*
|
|
7060
|
+
* ```proto
|
|
7061
|
+
* message MyDuration {
|
|
7062
|
+
* // duration must be greater than or equal to 5s [duration.gte]
|
|
7063
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];
|
|
7064
|
+
*
|
|
7065
|
+
* // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]
|
|
7066
|
+
* google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];
|
|
7067
|
+
*
|
|
7068
|
+
* // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]
|
|
7069
|
+
* google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];
|
|
7070
|
+
* }
|
|
7071
|
+
* ```
|
|
7072
|
+
*
|
|
7073
|
+
* @generated from field: google.protobuf.Duration gte = 6;
|
|
7074
|
+
*/
|
|
7075
|
+
gte?: DurationJson;
|
|
7076
|
+
/**
|
|
7077
|
+
* `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.
|
|
7078
|
+
* If the field's value doesn't correspond to any of the specified values,
|
|
7079
|
+
* an error message will be generated.
|
|
7080
|
+
*
|
|
7081
|
+
* ```proto
|
|
7082
|
+
* message MyDuration {
|
|
7083
|
+
* // value must be in list [1s, 2s, 3s]
|
|
7084
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]];
|
|
7085
|
+
* }
|
|
7086
|
+
* ```
|
|
7087
|
+
*
|
|
7088
|
+
* @generated from field: repeated google.protobuf.Duration in = 7;
|
|
7089
|
+
*/
|
|
7090
|
+
in?: DurationJson[];
|
|
7091
|
+
/**
|
|
7092
|
+
* `not_in` denotes that the field must not be equal to
|
|
7093
|
+
* any of the specified values of the `google.protobuf.Duration` type.
|
|
7094
|
+
* If the field's value matches any of these values, an error message will be
|
|
7095
|
+
* generated.
|
|
7096
|
+
*
|
|
7097
|
+
* ```proto
|
|
7098
|
+
* message MyDuration {
|
|
7099
|
+
* // value must not be in list [1s, 2s, 3s]
|
|
7100
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]];
|
|
7101
|
+
* }
|
|
7102
|
+
* ```
|
|
7103
|
+
*
|
|
7104
|
+
* @generated from field: repeated google.protobuf.Duration not_in = 8;
|
|
7105
|
+
*/
|
|
7106
|
+
notIn?: DurationJson[];
|
|
7107
|
+
/**
|
|
7108
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
7109
|
+
* conform to other constraints. `example` values will not impact validation
|
|
7110
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
7111
|
+
*
|
|
7112
|
+
* ```proto
|
|
7113
|
+
* message MyDuration {
|
|
7114
|
+
* google.protobuf.Duration value = 1 [
|
|
7115
|
+
* (buf.validate.field).duration.example = { seconds: 1 },
|
|
7116
|
+
* (buf.validate.field).duration.example = { seconds: 2 },
|
|
7117
|
+
* ];
|
|
7118
|
+
* }
|
|
7119
|
+
* ```
|
|
7120
|
+
*
|
|
7121
|
+
* @generated from field: repeated google.protobuf.Duration example = 9;
|
|
7122
|
+
*/
|
|
7123
|
+
example?: DurationJson[];
|
|
7124
|
+
};
|
|
3825
7125
|
/**
|
|
3826
7126
|
* Describes the message buf.validate.DurationRules.
|
|
3827
7127
|
* Use `create(DurationRulesSchema)` to create a new message.
|
|
3828
7128
|
*/
|
|
3829
|
-
export declare const DurationRulesSchema: GenMessage<DurationRules>;
|
|
7129
|
+
export declare const DurationRulesSchema: GenMessage<DurationRules, DurationRulesJson>;
|
|
3830
7130
|
/**
|
|
3831
7131
|
* TimestampRules describe the constraints applied exclusively to the `google.protobuf.Timestamp` well-known type.
|
|
3832
7132
|
*
|
|
@@ -3982,17 +7282,152 @@ export type TimestampRules = Message<"buf.validate.TimestampRules"> & {
|
|
|
3982
7282
|
*
|
|
3983
7283
|
* @generated from field: optional google.protobuf.Duration within = 9;
|
|
3984
7284
|
*/
|
|
3985
|
-
within?: Duration;
|
|
7285
|
+
within?: Duration;
|
|
7286
|
+
/**
|
|
7287
|
+
* @generated from field: repeated google.protobuf.Timestamp example = 10;
|
|
7288
|
+
*/
|
|
7289
|
+
example: Timestamp[];
|
|
7290
|
+
};
|
|
7291
|
+
/**
|
|
7292
|
+
* TimestampRules describe the constraints applied exclusively to the `google.protobuf.Timestamp` well-known type.
|
|
7293
|
+
*
|
|
7294
|
+
* @generated from message buf.validate.TimestampRules
|
|
7295
|
+
*/
|
|
7296
|
+
export type TimestampRulesJson = {
|
|
7297
|
+
/**
|
|
7298
|
+
* `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.
|
|
7299
|
+
*
|
|
7300
|
+
* ```proto
|
|
7301
|
+
* message MyTimestamp {
|
|
7302
|
+
* // value must equal 2023-05-03T10:00:00Z
|
|
7303
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];
|
|
7304
|
+
* }
|
|
7305
|
+
* ```
|
|
7306
|
+
*
|
|
7307
|
+
* @generated from field: optional google.protobuf.Timestamp const = 2;
|
|
7308
|
+
*/
|
|
7309
|
+
const?: TimestampJson;
|
|
7310
|
+
/**
|
|
7311
|
+
* 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.
|
|
7312
|
+
*
|
|
7313
|
+
* ```proto
|
|
7314
|
+
* message MyDuration {
|
|
7315
|
+
* // duration must be less than 'P3D' [duration.lt]
|
|
7316
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];
|
|
7317
|
+
* }
|
|
7318
|
+
* ```
|
|
7319
|
+
*
|
|
7320
|
+
* @generated from field: google.protobuf.Timestamp lt = 3;
|
|
7321
|
+
*/
|
|
7322
|
+
lt?: TimestampJson;
|
|
7323
|
+
/**
|
|
7324
|
+
* 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.
|
|
7325
|
+
*
|
|
7326
|
+
* ```proto
|
|
7327
|
+
* message MyTimestamp {
|
|
7328
|
+
* // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]
|
|
7329
|
+
* google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];
|
|
7330
|
+
* }
|
|
7331
|
+
* ```
|
|
7332
|
+
*
|
|
7333
|
+
* @generated from field: google.protobuf.Timestamp lte = 4;
|
|
7334
|
+
*/
|
|
7335
|
+
lte?: TimestampJson;
|
|
7336
|
+
/**
|
|
7337
|
+
* `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.
|
|
7338
|
+
*
|
|
7339
|
+
* ```proto
|
|
7340
|
+
* message MyTimestamp {
|
|
7341
|
+
* // value must be less than now
|
|
7342
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];
|
|
7343
|
+
* }
|
|
7344
|
+
* ```
|
|
7345
|
+
*
|
|
7346
|
+
* @generated from field: bool lt_now = 7;
|
|
7347
|
+
*/
|
|
7348
|
+
ltNow?: boolean;
|
|
7349
|
+
/**
|
|
7350
|
+
* `gt` requires the timestamp field value to be greater than the specified
|
|
7351
|
+
* value (exclusive). If the value of `gt` is larger than a specified `lt`
|
|
7352
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
7353
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
7354
|
+
* an error message is generated.
|
|
7355
|
+
*
|
|
7356
|
+
* ```proto
|
|
7357
|
+
* message MyTimestamp {
|
|
7358
|
+
* // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]
|
|
7359
|
+
* google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];
|
|
7360
|
+
*
|
|
7361
|
+
* // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]
|
|
7362
|
+
* google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
|
|
7363
|
+
*
|
|
7364
|
+
* // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]
|
|
7365
|
+
* google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
|
|
7366
|
+
* }
|
|
7367
|
+
* ```
|
|
7368
|
+
*
|
|
7369
|
+
* @generated from field: google.protobuf.Timestamp gt = 5;
|
|
7370
|
+
*/
|
|
7371
|
+
gt?: TimestampJson;
|
|
7372
|
+
/**
|
|
7373
|
+
* `gte` requires the timestamp field value to be greater than or equal to the
|
|
7374
|
+
* specified value (exclusive). If the value of `gte` is larger than a
|
|
7375
|
+
* specified `lt` or `lte`, the range is reversed, and the field value
|
|
7376
|
+
* must be outside the specified range. If the field value doesn't meet
|
|
7377
|
+
* the required conditions, an error message is generated.
|
|
7378
|
+
*
|
|
7379
|
+
* ```proto
|
|
7380
|
+
* message MyTimestamp {
|
|
7381
|
+
* // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]
|
|
7382
|
+
* google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];
|
|
7383
|
+
*
|
|
7384
|
+
* // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]
|
|
7385
|
+
* google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
|
|
7386
|
+
*
|
|
7387
|
+
* // 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]
|
|
7388
|
+
* google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
|
|
7389
|
+
* }
|
|
7390
|
+
* ```
|
|
7391
|
+
*
|
|
7392
|
+
* @generated from field: google.protobuf.Timestamp gte = 6;
|
|
7393
|
+
*/
|
|
7394
|
+
gte?: TimestampJson;
|
|
7395
|
+
/**
|
|
7396
|
+
* `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.
|
|
7397
|
+
*
|
|
7398
|
+
* ```proto
|
|
7399
|
+
* message MyTimestamp {
|
|
7400
|
+
* // value must be greater than now
|
|
7401
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];
|
|
7402
|
+
* }
|
|
7403
|
+
* ```
|
|
7404
|
+
*
|
|
7405
|
+
* @generated from field: bool gt_now = 8;
|
|
7406
|
+
*/
|
|
7407
|
+
gtNow?: boolean;
|
|
7408
|
+
/**
|
|
7409
|
+
* `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.
|
|
7410
|
+
*
|
|
7411
|
+
* ```proto
|
|
7412
|
+
* message MyTimestamp {
|
|
7413
|
+
* // value must be within 1 hour of now
|
|
7414
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];
|
|
7415
|
+
* }
|
|
7416
|
+
* ```
|
|
7417
|
+
*
|
|
7418
|
+
* @generated from field: optional google.protobuf.Duration within = 9;
|
|
7419
|
+
*/
|
|
7420
|
+
within?: DurationJson;
|
|
3986
7421
|
/**
|
|
3987
7422
|
* @generated from field: repeated google.protobuf.Timestamp example = 10;
|
|
3988
7423
|
*/
|
|
3989
|
-
example
|
|
7424
|
+
example?: TimestampJson[];
|
|
3990
7425
|
};
|
|
3991
7426
|
/**
|
|
3992
7427
|
* Describes the message buf.validate.TimestampRules.
|
|
3993
7428
|
* Use `create(TimestampRulesSchema)` to create a new message.
|
|
3994
7429
|
*/
|
|
3995
|
-
export declare const TimestampRulesSchema: GenMessage<TimestampRules>;
|
|
7430
|
+
export declare const TimestampRulesSchema: GenMessage<TimestampRules, TimestampRulesJson>;
|
|
3996
7431
|
/**
|
|
3997
7432
|
* `Violations` is a collection of `Violation` messages. This message type is returned by
|
|
3998
7433
|
* protovalidate when a proto message fails to meet the requirements set by the `Constraint` validation rules.
|
|
@@ -4008,11 +7443,26 @@ export type Violations = Message<"buf.validate.Violations"> & {
|
|
|
4008
7443
|
*/
|
|
4009
7444
|
violations: Violation[];
|
|
4010
7445
|
};
|
|
7446
|
+
/**
|
|
7447
|
+
* `Violations` is a collection of `Violation` messages. This message type is returned by
|
|
7448
|
+
* protovalidate when a proto message fails to meet the requirements set by the `Constraint` validation rules.
|
|
7449
|
+
* Each individual violation is represented by a `Violation` message.
|
|
7450
|
+
*
|
|
7451
|
+
* @generated from message buf.validate.Violations
|
|
7452
|
+
*/
|
|
7453
|
+
export type ViolationsJson = {
|
|
7454
|
+
/**
|
|
7455
|
+
* `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.
|
|
7456
|
+
*
|
|
7457
|
+
* @generated from field: repeated buf.validate.Violation violations = 1;
|
|
7458
|
+
*/
|
|
7459
|
+
violations?: ViolationJson[];
|
|
7460
|
+
};
|
|
4011
7461
|
/**
|
|
4012
7462
|
* Describes the message buf.validate.Violations.
|
|
4013
7463
|
* Use `create(ViolationsSchema)` to create a new message.
|
|
4014
7464
|
*/
|
|
4015
|
-
export declare const ViolationsSchema: GenMessage<Violations>;
|
|
7465
|
+
export declare const ViolationsSchema: GenMessage<Violations, ViolationsJson>;
|
|
4016
7466
|
/**
|
|
4017
7467
|
* `Violation` represents a single instance where a validation rule, expressed
|
|
4018
7468
|
* as a `Constraint`, was not met. It provides information about the field that
|
|
@@ -4118,11 +7568,116 @@ export type Violation = Message<"buf.validate.Violation"> & {
|
|
|
4118
7568
|
*/
|
|
4119
7569
|
forKey: boolean;
|
|
4120
7570
|
};
|
|
7571
|
+
/**
|
|
7572
|
+
* `Violation` represents a single instance where a validation rule, expressed
|
|
7573
|
+
* as a `Constraint`, was not met. It provides information about the field that
|
|
7574
|
+
* caused the violation, the specific constraint that wasn't fulfilled, and a
|
|
7575
|
+
* human-readable error message.
|
|
7576
|
+
*
|
|
7577
|
+
* ```json
|
|
7578
|
+
* {
|
|
7579
|
+
* "fieldPath": "bar",
|
|
7580
|
+
* "constraintId": "foo.bar",
|
|
7581
|
+
* "message": "bar must be greater than 0"
|
|
7582
|
+
* }
|
|
7583
|
+
* ```
|
|
7584
|
+
*
|
|
7585
|
+
* @generated from message buf.validate.Violation
|
|
7586
|
+
*/
|
|
7587
|
+
export type ViolationJson = {
|
|
7588
|
+
/**
|
|
7589
|
+
* `field` is a machine-readable path to the field that failed validation.
|
|
7590
|
+
* 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.
|
|
7591
|
+
*
|
|
7592
|
+
* For example, consider the following message:
|
|
7593
|
+
*
|
|
7594
|
+
* ```proto
|
|
7595
|
+
* message Message {
|
|
7596
|
+
* bool a = 1 [(buf.validate.field).required = true];
|
|
7597
|
+
* }
|
|
7598
|
+
* ```
|
|
7599
|
+
*
|
|
7600
|
+
* It could produce the following violation:
|
|
7601
|
+
*
|
|
7602
|
+
* ```textproto
|
|
7603
|
+
* violation {
|
|
7604
|
+
* field { element { field_number: 1, field_name: "a", field_type: 8 } }
|
|
7605
|
+
* ...
|
|
7606
|
+
* }
|
|
7607
|
+
* ```
|
|
7608
|
+
*
|
|
7609
|
+
* @generated from field: optional buf.validate.FieldPath field = 5;
|
|
7610
|
+
*/
|
|
7611
|
+
field?: FieldPathJson;
|
|
7612
|
+
/**
|
|
7613
|
+
* `rule` is a machine-readable path that points to the specific constraint rule that failed validation.
|
|
7614
|
+
* This will be a nested field starting from the FieldConstraints of the field that failed validation.
|
|
7615
|
+
* For custom constraints, this will provide the path of the constraint, e.g. `cel[0]`.
|
|
7616
|
+
*
|
|
7617
|
+
* For example, consider the following message:
|
|
7618
|
+
*
|
|
7619
|
+
* ```proto
|
|
7620
|
+
* message Message {
|
|
7621
|
+
* bool a = 1 [(buf.validate.field).required = true];
|
|
7622
|
+
* bool b = 2 [(buf.validate.field).cel = {
|
|
7623
|
+
* id: "custom_constraint",
|
|
7624
|
+
* expression: "!this ? 'b must be true': ''"
|
|
7625
|
+
* }]
|
|
7626
|
+
* }
|
|
7627
|
+
* ```
|
|
7628
|
+
*
|
|
7629
|
+
* It could produce the following violations:
|
|
7630
|
+
*
|
|
7631
|
+
* ```textproto
|
|
7632
|
+
* violation {
|
|
7633
|
+
* rule { element { field_number: 25, field_name: "required", field_type: 8 } }
|
|
7634
|
+
* ...
|
|
7635
|
+
* }
|
|
7636
|
+
* violation {
|
|
7637
|
+
* rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } }
|
|
7638
|
+
* ...
|
|
7639
|
+
* }
|
|
7640
|
+
* ```
|
|
7641
|
+
*
|
|
7642
|
+
* @generated from field: optional buf.validate.FieldPath rule = 6;
|
|
7643
|
+
*/
|
|
7644
|
+
rule?: FieldPathJson;
|
|
7645
|
+
/**
|
|
7646
|
+
* `field_path` is a human-readable identifier that points to the specific field that failed the validation.
|
|
7647
|
+
* 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.
|
|
7648
|
+
*
|
|
7649
|
+
* Deprecated: use the `field` instead.
|
|
7650
|
+
*
|
|
7651
|
+
* @generated from field: optional string field_path = 1 [deprecated = true];
|
|
7652
|
+
* @deprecated
|
|
7653
|
+
*/
|
|
7654
|
+
fieldPath?: string;
|
|
7655
|
+
/**
|
|
7656
|
+
* `constraint_id` is the unique identifier of the `Constraint` that was not fulfilled.
|
|
7657
|
+
* This is the same `id` that was specified in the `Constraint` message, allowing easy tracing of which rule was violated.
|
|
7658
|
+
*
|
|
7659
|
+
* @generated from field: optional string constraint_id = 2;
|
|
7660
|
+
*/
|
|
7661
|
+
constraintId?: string;
|
|
7662
|
+
/**
|
|
7663
|
+
* `message` is a human-readable error message that describes the nature of the violation.
|
|
7664
|
+
* This can be the default error message from the violated `Constraint`, or it can be a custom message that gives more context about the violation.
|
|
7665
|
+
*
|
|
7666
|
+
* @generated from field: optional string message = 3;
|
|
7667
|
+
*/
|
|
7668
|
+
message?: string;
|
|
7669
|
+
/**
|
|
7670
|
+
* `for_key` indicates whether the violation was caused by a map key, rather than a value.
|
|
7671
|
+
*
|
|
7672
|
+
* @generated from field: optional bool for_key = 4;
|
|
7673
|
+
*/
|
|
7674
|
+
forKey?: boolean;
|
|
7675
|
+
};
|
|
4121
7676
|
/**
|
|
4122
7677
|
* Describes the message buf.validate.Violation.
|
|
4123
7678
|
* Use `create(ViolationSchema)` to create a new message.
|
|
4124
7679
|
*/
|
|
4125
|
-
export declare const ViolationSchema: GenMessage<Violation>;
|
|
7680
|
+
export declare const ViolationSchema: GenMessage<Violation, ViolationJson>;
|
|
4126
7681
|
/**
|
|
4127
7682
|
* `FieldPath` provides a path to a nested protobuf field.
|
|
4128
7683
|
*
|
|
@@ -4139,11 +7694,27 @@ export type FieldPath = Message<"buf.validate.FieldPath"> & {
|
|
|
4139
7694
|
*/
|
|
4140
7695
|
elements: FieldPathElement[];
|
|
4141
7696
|
};
|
|
7697
|
+
/**
|
|
7698
|
+
* `FieldPath` provides a path to a nested protobuf field.
|
|
7699
|
+
*
|
|
7700
|
+
* This message provides enough information to render a dotted field path even without protobuf descriptors.
|
|
7701
|
+
* It also provides enough information to resolve a nested field through unknown wire data.
|
|
7702
|
+
*
|
|
7703
|
+
* @generated from message buf.validate.FieldPath
|
|
7704
|
+
*/
|
|
7705
|
+
export type FieldPathJson = {
|
|
7706
|
+
/**
|
|
7707
|
+
* `elements` contains each element of the path, starting from the root and recursing downward.
|
|
7708
|
+
*
|
|
7709
|
+
* @generated from field: repeated buf.validate.FieldPathElement elements = 1;
|
|
7710
|
+
*/
|
|
7711
|
+
elements?: FieldPathElementJson[];
|
|
7712
|
+
};
|
|
4142
7713
|
/**
|
|
4143
7714
|
* Describes the message buf.validate.FieldPath.
|
|
4144
7715
|
* Use `create(FieldPathSchema)` to create a new message.
|
|
4145
7716
|
*/
|
|
4146
|
-
export declare const FieldPathSchema: GenMessage<FieldPath>;
|
|
7717
|
+
export declare const FieldPathSchema: GenMessage<FieldPath, FieldPathJson>;
|
|
4147
7718
|
/**
|
|
4148
7719
|
* `FieldPathElement` provides enough information to nest through a single protobuf field.
|
|
4149
7720
|
*
|
|
@@ -4247,11 +7818,95 @@ export type FieldPathElement = Message<"buf.validate.FieldPathElement"> & {
|
|
|
4247
7818
|
value?: undefined;
|
|
4248
7819
|
};
|
|
4249
7820
|
};
|
|
7821
|
+
/**
|
|
7822
|
+
* `FieldPathElement` provides enough information to nest through a single protobuf field.
|
|
7823
|
+
*
|
|
7824
|
+
* If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.
|
|
7825
|
+
* A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.
|
|
7826
|
+
* The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.
|
|
7827
|
+
*
|
|
7828
|
+
* @generated from message buf.validate.FieldPathElement
|
|
7829
|
+
*/
|
|
7830
|
+
export type FieldPathElementJson = {
|
|
7831
|
+
/**
|
|
7832
|
+
* `field_number` is the field number this path element refers to.
|
|
7833
|
+
*
|
|
7834
|
+
* @generated from field: optional int32 field_number = 1;
|
|
7835
|
+
*/
|
|
7836
|
+
fieldNumber?: number;
|
|
7837
|
+
/**
|
|
7838
|
+
* `field_name` contains the field name this path element refers to.
|
|
7839
|
+
* This can be used to display a human-readable path even if the field number is unknown.
|
|
7840
|
+
*
|
|
7841
|
+
* @generated from field: optional string field_name = 2;
|
|
7842
|
+
*/
|
|
7843
|
+
fieldName?: string;
|
|
7844
|
+
/**
|
|
7845
|
+
* `field_type` specifies the type of this field. When using reflection, this value is not needed.
|
|
7846
|
+
*
|
|
7847
|
+
* This value is provided to make it possible to traverse unknown fields through wire data.
|
|
7848
|
+
* When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.
|
|
7849
|
+
*
|
|
7850
|
+
* [1]: https://protobuf.dev/programming-guides/encoding/#packed
|
|
7851
|
+
* [2]: https://protobuf.dev/programming-guides/encoding/#groups
|
|
7852
|
+
*
|
|
7853
|
+
* N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and
|
|
7854
|
+
* can be explicitly used in Protocol Buffers 2023 Edition.
|
|
7855
|
+
*
|
|
7856
|
+
* @generated from field: optional google.protobuf.FieldDescriptorProto.Type field_type = 3;
|
|
7857
|
+
*/
|
|
7858
|
+
fieldType?: FieldDescriptorProto_TypeJson;
|
|
7859
|
+
/**
|
|
7860
|
+
* `key_type` specifies the map key type of this field. This value is useful when traversing
|
|
7861
|
+
* unknown fields through wire data: specifically, it allows handling the differences between
|
|
7862
|
+
* different integer encodings.
|
|
7863
|
+
*
|
|
7864
|
+
* @generated from field: optional google.protobuf.FieldDescriptorProto.Type key_type = 4;
|
|
7865
|
+
*/
|
|
7866
|
+
keyType?: FieldDescriptorProto_TypeJson;
|
|
7867
|
+
/**
|
|
7868
|
+
* `value_type` specifies map value type of this field. This is useful if you want to display a
|
|
7869
|
+
* value inside unknown fields through wire data.
|
|
7870
|
+
*
|
|
7871
|
+
* @generated from field: optional google.protobuf.FieldDescriptorProto.Type value_type = 5;
|
|
7872
|
+
*/
|
|
7873
|
+
valueType?: FieldDescriptorProto_TypeJson;
|
|
7874
|
+
/**
|
|
7875
|
+
* `index` specifies a 0-based index into a repeated field.
|
|
7876
|
+
*
|
|
7877
|
+
* @generated from field: uint64 index = 6;
|
|
7878
|
+
*/
|
|
7879
|
+
index?: string;
|
|
7880
|
+
/**
|
|
7881
|
+
* `bool_key` specifies a map key of type bool.
|
|
7882
|
+
*
|
|
7883
|
+
* @generated from field: bool bool_key = 7;
|
|
7884
|
+
*/
|
|
7885
|
+
boolKey?: boolean;
|
|
7886
|
+
/**
|
|
7887
|
+
* `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.
|
|
7888
|
+
*
|
|
7889
|
+
* @generated from field: int64 int_key = 8;
|
|
7890
|
+
*/
|
|
7891
|
+
intKey?: string;
|
|
7892
|
+
/**
|
|
7893
|
+
* `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.
|
|
7894
|
+
*
|
|
7895
|
+
* @generated from field: uint64 uint_key = 9;
|
|
7896
|
+
*/
|
|
7897
|
+
uintKey?: string;
|
|
7898
|
+
/**
|
|
7899
|
+
* `string_key` specifies a map key of type string.
|
|
7900
|
+
*
|
|
7901
|
+
* @generated from field: string string_key = 10;
|
|
7902
|
+
*/
|
|
7903
|
+
stringKey?: string;
|
|
7904
|
+
};
|
|
4250
7905
|
/**
|
|
4251
7906
|
* Describes the message buf.validate.FieldPathElement.
|
|
4252
7907
|
* Use `create(FieldPathElementSchema)` to create a new message.
|
|
4253
7908
|
*/
|
|
4254
|
-
export declare const FieldPathElementSchema: GenMessage<FieldPathElement>;
|
|
7909
|
+
export declare const FieldPathElementSchema: GenMessage<FieldPathElement, FieldPathElementJson>;
|
|
4255
7910
|
/**
|
|
4256
7911
|
* Specifies how FieldConstraints.ignore behaves. See the documentation for
|
|
4257
7912
|
* FieldConstraints.required for definitions of "populated" and "nullable".
|
|
@@ -4429,10 +8084,17 @@ export declare enum Ignore {
|
|
|
4429
8084
|
*/
|
|
4430
8085
|
DEFAULT = 2
|
|
4431
8086
|
}
|
|
8087
|
+
/**
|
|
8088
|
+
* Specifies how FieldConstraints.ignore behaves. See the documentation for
|
|
8089
|
+
* FieldConstraints.required for definitions of "populated" and "nullable".
|
|
8090
|
+
*
|
|
8091
|
+
* @generated from enum buf.validate.Ignore
|
|
8092
|
+
*/
|
|
8093
|
+
export type IgnoreJson = "IGNORE_UNSPECIFIED" | "IGNORE_IF_UNPOPULATED" | "IGNORE_IF_DEFAULT_VALUE" | "IGNORE_ALWAYS" | "IGNORE_EMPTY" | "IGNORE_DEFAULT";
|
|
4432
8094
|
/**
|
|
4433
8095
|
* Describes the enum buf.validate.Ignore.
|
|
4434
8096
|
*/
|
|
4435
|
-
export declare const IgnoreSchema: GenEnum<Ignore>;
|
|
8097
|
+
export declare const IgnoreSchema: GenEnum<Ignore, IgnoreJson>;
|
|
4436
8098
|
/**
|
|
4437
8099
|
* WellKnownRegex contain some well-known patterns.
|
|
4438
8100
|
*
|
|
@@ -4456,10 +8118,16 @@ export declare enum KnownRegex {
|
|
|
4456
8118
|
*/
|
|
4457
8119
|
HTTP_HEADER_VALUE = 2
|
|
4458
8120
|
}
|
|
8121
|
+
/**
|
|
8122
|
+
* WellKnownRegex contain some well-known patterns.
|
|
8123
|
+
*
|
|
8124
|
+
* @generated from enum buf.validate.KnownRegex
|
|
8125
|
+
*/
|
|
8126
|
+
export type KnownRegexJson = "KNOWN_REGEX_UNSPECIFIED" | "KNOWN_REGEX_HTTP_HEADER_NAME" | "KNOWN_REGEX_HTTP_HEADER_VALUE";
|
|
4459
8127
|
/**
|
|
4460
8128
|
* Describes the enum buf.validate.KnownRegex.
|
|
4461
8129
|
*/
|
|
4462
|
-
export declare const KnownRegexSchema: GenEnum<KnownRegex>;
|
|
8130
|
+
export declare const KnownRegexSchema: GenEnum<KnownRegex, KnownRegexJson>;
|
|
4463
8131
|
/**
|
|
4464
8132
|
* Rules specify the validations to be performed on this message. By default,
|
|
4465
8133
|
* no validation is performed against a message.
|