@t-0/provider-sdk 1.0.25 → 1.0.27
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/lib/cjs/client/client.js +46 -0
- package/lib/cjs/client/signer.js +69 -0
- package/lib/cjs/common/gen/buf/validate/validate_pb.d.ts +4590 -0
- package/lib/cjs/common/gen/buf/validate/validate_pb.js +353 -0
- package/lib/{common → cjs/common}/gen/tzero/v1/common/common_pb.d.ts +2 -0
- package/lib/cjs/common/gen/tzero/v1/common/common_pb.js +57 -0
- package/lib/{common → cjs/common}/gen/tzero/v1/common/payment_method_pb.d.ts +40 -22
- package/lib/cjs/common/gen/tzero/v1/common/payment_method_pb.js +67 -0
- package/lib/cjs/common/gen/tzero/v1/common/payment_receipt_pb.d.ts +77 -0
- package/lib/cjs/common/gen/tzero/v1/common/payment_receipt_pb.js +32 -0
- package/lib/{common → cjs/common}/gen/tzero/v1/payment/network_pb.d.ts +98 -59
- package/lib/cjs/common/gen/tzero/v1/payment/network_pb.js +139 -0
- package/lib/{common → cjs/common}/gen/tzero/v1/payment/provider_pb.d.ts +153 -53
- package/lib/cjs/common/gen/tzero/v1/payment/provider_pb.js +241 -0
- package/lib/{common → cjs/common}/gen/tzero/v1/payment_intent/provider/provider_pb.d.ts +22 -0
- package/lib/cjs/common/gen/tzero/v1/payment_intent/provider/provider_pb.js +88 -0
- package/lib/{common → cjs/common}/gen/tzero/v1/payment_intent/recipient/recipient_pb.d.ts +201 -14
- package/lib/cjs/common/gen/tzero/v1/payment_intent/recipient/recipient_pb.js +95 -0
- package/lib/cjs/common/gen/tzero/v1/public/public_pb.js +88 -0
- package/lib/cjs/common/headers.js +10 -0
- package/lib/cjs/examples/payment_intent/pay-in-provider-flow.d.ts +4 -0
- package/lib/cjs/examples/payment_intent/pay-in-provider-flow.js +56 -0
- package/lib/cjs/examples/payment_intent/service.d.ts +1 -0
- package/lib/cjs/examples/payment_intent/service.js +68 -0
- package/lib/cjs/examples/server.d.ts +4 -0
- package/lib/cjs/examples/server.js +93 -0
- package/lib/cjs/examples/update-quote.d.ts +4 -0
- package/lib/cjs/examples/update-quote.js +42 -0
- package/lib/cjs/index.js +50 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/payment_intent/provider/index.js +17 -0
- package/lib/cjs/payment_intent/recipient/index.js +17 -0
- package/lib/cjs/service/node.js +15 -0
- package/lib/cjs/service/service.js +112 -0
- package/lib/esm/client/client.d.ts +16 -0
- package/lib/esm/client/signer.d.ts +3 -0
- package/lib/esm/common/gen/buf/validate/validate_pb.d.ts +4590 -0
- package/lib/esm/common/gen/buf/validate/validate_pb.js +350 -0
- package/lib/esm/common/gen/tzero/v1/common/common_pb.d.ts +66 -0
- package/lib/{common → esm/common}/gen/tzero/v1/common/common_pb.js +2 -1
- package/lib/esm/common/gen/tzero/v1/common/payment_method_pb.d.ts +140 -0
- package/lib/esm/common/gen/tzero/v1/common/payment_method_pb.js +64 -0
- package/lib/esm/common/gen/tzero/v1/common/payment_receipt_pb.d.ts +77 -0
- package/lib/esm/common/gen/tzero/v1/common/payment_receipt_pb.js +29 -0
- package/lib/esm/common/gen/tzero/v1/payment/network_pb.d.ts +606 -0
- package/lib/{common → esm/common}/gen/tzero/v1/payment/network_pb.js +9 -17
- package/lib/esm/common/gen/tzero/v1/payment/provider_pb.d.ts +741 -0
- package/lib/{common → esm/common}/gen/tzero/v1/payment/provider_pb.js +71 -36
- package/lib/esm/common/gen/tzero/v1/payment_intent/provider/provider_pb.d.ts +318 -0
- package/lib/{common → esm/common}/gen/tzero/v1/payment_intent/provider/provider_pb.js +2 -1
- package/lib/esm/common/gen/tzero/v1/payment_intent/recipient/recipient_pb.d.ts +401 -0
- package/lib/esm/common/gen/tzero/v1/payment_intent/recipient/recipient_pb.js +92 -0
- package/lib/esm/common/gen/tzero/v1/public/public_pb.d.ts +234 -0
- package/lib/esm/common/headers.d.ts +6 -0
- package/lib/esm/examples/payment_intent/pay-in-provider-flow.d.ts +4 -0
- package/lib/esm/examples/payment_intent/pay-in-provider-flow.js +51 -0
- package/lib/esm/examples/payment_intent/service.d.ts +1 -0
- package/lib/esm/examples/payment_intent/service.js +30 -0
- package/lib/esm/examples/server.d.ts +4 -0
- package/lib/esm/examples/server.js +55 -0
- package/lib/esm/examples/update-quote.d.ts +4 -0
- package/lib/esm/examples/update-quote.js +37 -0
- package/lib/esm/index.d.ts +11 -0
- package/lib/esm/payment_intent/provider/index.js +1 -0
- package/lib/esm/payment_intent/recipient/index.js +1 -0
- package/lib/esm/service/node.d.ts +3 -0
- package/lib/esm/service/service.d.ts +15 -0
- package/lib/{service → esm/service}/service.js +2 -2
- package/lib/tsconfig.cjs.tsbuildinfo +1 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -0
- package/package.json +16 -7
- package/lib/common/gen/tzero/v1/common/payment_method_pb.js +0 -57
- package/lib/common/gen/tzero/v1/payment_intent/recipient/recipient_pb.js +0 -59
- /package/lib/{client → cjs/client}/client.d.ts +0 -0
- /package/lib/{client → cjs/client}/signer.d.ts +0 -0
- /package/lib/{common → cjs/common}/gen/tzero/v1/public/public_pb.d.ts +0 -0
- /package/lib/{common → cjs/common}/headers.d.ts +0 -0
- /package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/lib/{payment_intent → cjs/payment_intent}/provider/index.d.ts +0 -0
- /package/lib/{payment_intent → cjs/payment_intent}/recipient/index.d.ts +0 -0
- /package/lib/{service → cjs/service}/node.d.ts +0 -0
- /package/lib/{service → cjs/service}/service.d.ts +0 -0
- /package/lib/{client → esm/client}/client.js +0 -0
- /package/lib/{client → esm/client}/signer.js +0 -0
- /package/lib/{common → esm/common}/gen/tzero/v1/public/public_pb.js +0 -0
- /package/lib/{common → esm/common}/headers.js +0 -0
- /package/lib/{index.js → esm/index.js} +0 -0
- /package/lib/{payment_intent/provider/index.js → esm/payment_intent/provider/index.d.ts} +0 -0
- /package/lib/{payment_intent/recipient/index.js → esm/payment_intent/recipient/index.d.ts} +0 -0
- /package/lib/{service → esm/service}/node.js +0 -0
|
@@ -0,0 +1,4590 @@
|
|
|
1
|
+
import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
2
|
+
import type { Duration, FieldDescriptorProto_Type, FieldOptions, MessageOptions, OneofOptions, Timestamp } from "@bufbuild/protobuf/wkt";
|
|
3
|
+
import type { Message } from "@bufbuild/protobuf";
|
|
4
|
+
/**
|
|
5
|
+
* Describes the file buf/validate/validate.proto.
|
|
6
|
+
*/
|
|
7
|
+
export declare const file_buf_validate_validate: GenFile;
|
|
8
|
+
/**
|
|
9
|
+
* `Rule` represents a validation rule written in the Common Expression
|
|
10
|
+
* Language (CEL) syntax. Each Rule includes a unique identifier, an
|
|
11
|
+
* optional error message, and the CEL expression to evaluate. For more
|
|
12
|
+
* information, [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
|
|
13
|
+
*
|
|
14
|
+
* ```proto
|
|
15
|
+
* message Foo {
|
|
16
|
+
* option (buf.validate.message).cel = {
|
|
17
|
+
* id: "foo.bar"
|
|
18
|
+
* message: "bar must be greater than 0"
|
|
19
|
+
* expression: "this.bar > 0"
|
|
20
|
+
* };
|
|
21
|
+
* int32 bar = 1;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @generated from message buf.validate.Rule
|
|
26
|
+
*/
|
|
27
|
+
export type Rule = Message<"buf.validate.Rule"> & {
|
|
28
|
+
/**
|
|
29
|
+
* `id` is a string that serves as a machine-readable name for this Rule.
|
|
30
|
+
* It should be unique within its scope, which could be either a message or a field.
|
|
31
|
+
*
|
|
32
|
+
* @generated from field: optional string id = 1;
|
|
33
|
+
*/
|
|
34
|
+
id: string;
|
|
35
|
+
/**
|
|
36
|
+
* `message` is an optional field that provides a human-readable error message
|
|
37
|
+
* for this Rule when the CEL expression evaluates to false. If a
|
|
38
|
+
* non-empty message is provided, any strings resulting from the CEL
|
|
39
|
+
* expression evaluation are ignored.
|
|
40
|
+
*
|
|
41
|
+
* @generated from field: optional string message = 2;
|
|
42
|
+
*/
|
|
43
|
+
message: string;
|
|
44
|
+
/**
|
|
45
|
+
* `expression` is the actual CEL expression that will be evaluated for
|
|
46
|
+
* validation. This string must resolve to either a boolean or a string
|
|
47
|
+
* value. If the expression evaluates to false or a non-empty string, the
|
|
48
|
+
* validation is considered failed, and the message is rejected.
|
|
49
|
+
*
|
|
50
|
+
* @generated from field: optional string expression = 3;
|
|
51
|
+
*/
|
|
52
|
+
expression: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Describes the message buf.validate.Rule.
|
|
56
|
+
* Use `create(RuleSchema)` to create a new message.
|
|
57
|
+
*/
|
|
58
|
+
export declare const RuleSchema: GenMessage<Rule>;
|
|
59
|
+
/**
|
|
60
|
+
* MessageRules represents validation rules that are applied to the entire message.
|
|
61
|
+
* It includes disabling options and a list of Rule messages representing Common Expression Language (CEL) validation rules.
|
|
62
|
+
*
|
|
63
|
+
* @generated from message buf.validate.MessageRules
|
|
64
|
+
*/
|
|
65
|
+
export type MessageRules = Message<"buf.validate.MessageRules"> & {
|
|
66
|
+
/**
|
|
67
|
+
* `cel` is a repeated field of type Rule. Each Rule specifies a validation rule to be applied to this message.
|
|
68
|
+
* These rules are written in Common Expression Language (CEL) syntax. For more information,
|
|
69
|
+
* [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
|
|
70
|
+
*
|
|
71
|
+
*
|
|
72
|
+
* ```proto
|
|
73
|
+
* message MyMessage {
|
|
74
|
+
* // The field `foo` must be greater than 42.
|
|
75
|
+
* option (buf.validate.message).cel = {
|
|
76
|
+
* id: "my_message.value",
|
|
77
|
+
* message: "value must be greater than 42",
|
|
78
|
+
* expression: "this.foo > 42",
|
|
79
|
+
* };
|
|
80
|
+
* optional int32 foo = 1;
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*
|
|
84
|
+
* @generated from field: repeated buf.validate.Rule cel = 3;
|
|
85
|
+
*/
|
|
86
|
+
cel: Rule[];
|
|
87
|
+
/**
|
|
88
|
+
* `oneof` is a repeated field of type MessageOneofRule that specifies a list of fields
|
|
89
|
+
* of which at most one can be present. If `required` is also specified, then exactly one
|
|
90
|
+
* of the specified fields _must_ be present.
|
|
91
|
+
*
|
|
92
|
+
* This will enforce oneof-like constraints with a few features not provided by
|
|
93
|
+
* actual Protobuf oneof declarations:
|
|
94
|
+
* 1. Repeated and map fields are allowed in this validation. In a Protobuf oneof,
|
|
95
|
+
* only scalar fields are allowed.
|
|
96
|
+
* 2. Fields with implicit presence are allowed. In a Protobuf oneof, all member
|
|
97
|
+
* fields have explicit presence. This means that, for the purpose of determining
|
|
98
|
+
* how many fields are set, explicitly setting such a field to its zero value is
|
|
99
|
+
* effectively the same as not setting it at all.
|
|
100
|
+
* 3. This will always generate validation errors for a message unmarshalled from
|
|
101
|
+
* serialized data that sets more than one field. With a Protobuf oneof, when
|
|
102
|
+
* multiple fields are present in the serialized form, earlier values are usually
|
|
103
|
+
* silently ignored when unmarshalling, with only the last field being set when
|
|
104
|
+
* unmarshalling completes.
|
|
105
|
+
*
|
|
106
|
+
* Note that adding a field to a `oneof` will also set the IGNORE_IF_ZERO_VALUE on the fields. This means
|
|
107
|
+
* only the field that is set will be validated and the unset fields are not validated according to the field rules.
|
|
108
|
+
* This behavior can be overridden by setting `ignore` against a field.
|
|
109
|
+
*
|
|
110
|
+
* ```proto
|
|
111
|
+
* message MyMessage {
|
|
112
|
+
* // Only one of `field1` or `field2` _can_ be present in this message.
|
|
113
|
+
* option (buf.validate.message).oneof = { fields: ["field1", "field2"] };
|
|
114
|
+
* // Exactly one of `field3` or `field4` _must_ be present in this message.
|
|
115
|
+
* option (buf.validate.message).oneof = { fields: ["field3", "field4"], required: true };
|
|
116
|
+
* string field1 = 1;
|
|
117
|
+
* bytes field2 = 2;
|
|
118
|
+
* bool field3 = 3;
|
|
119
|
+
* int32 field4 = 4;
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*
|
|
123
|
+
* @generated from field: repeated buf.validate.MessageOneofRule oneof = 4;
|
|
124
|
+
*/
|
|
125
|
+
oneof: MessageOneofRule[];
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Describes the message buf.validate.MessageRules.
|
|
129
|
+
* Use `create(MessageRulesSchema)` to create a new message.
|
|
130
|
+
*/
|
|
131
|
+
export declare const MessageRulesSchema: GenMessage<MessageRules>;
|
|
132
|
+
/**
|
|
133
|
+
* @generated from message buf.validate.MessageOneofRule
|
|
134
|
+
*/
|
|
135
|
+
export type MessageOneofRule = Message<"buf.validate.MessageOneofRule"> & {
|
|
136
|
+
/**
|
|
137
|
+
* A list of field names to include in the oneof. All field names must be
|
|
138
|
+
* defined in the message. At least one field must be specified, and
|
|
139
|
+
* duplicates are not permitted.
|
|
140
|
+
*
|
|
141
|
+
* @generated from field: repeated string fields = 1;
|
|
142
|
+
*/
|
|
143
|
+
fields: string[];
|
|
144
|
+
/**
|
|
145
|
+
* If true, one of the fields specified _must_ be set.
|
|
146
|
+
*
|
|
147
|
+
* @generated from field: optional bool required = 2;
|
|
148
|
+
*/
|
|
149
|
+
required: boolean;
|
|
150
|
+
};
|
|
151
|
+
/**
|
|
152
|
+
* Describes the message buf.validate.MessageOneofRule.
|
|
153
|
+
* Use `create(MessageOneofRuleSchema)` to create a new message.
|
|
154
|
+
*/
|
|
155
|
+
export declare const MessageOneofRuleSchema: GenMessage<MessageOneofRule>;
|
|
156
|
+
/**
|
|
157
|
+
* The `OneofRules` message type enables you to manage rules for
|
|
158
|
+
* oneof fields in your protobuf messages.
|
|
159
|
+
*
|
|
160
|
+
* @generated from message buf.validate.OneofRules
|
|
161
|
+
*/
|
|
162
|
+
export type OneofRules = Message<"buf.validate.OneofRules"> & {
|
|
163
|
+
/**
|
|
164
|
+
* If `required` is true, exactly one field of the oneof must be set. A
|
|
165
|
+
* validation error is returned if no fields in the oneof are set. Further rules
|
|
166
|
+
* should be placed on the fields themselves to ensure they are valid values,
|
|
167
|
+
* such as `min_len` or `gt`.
|
|
168
|
+
*
|
|
169
|
+
* ```proto
|
|
170
|
+
* message MyMessage {
|
|
171
|
+
* oneof value {
|
|
172
|
+
* // Either `a` or `b` must be set. If `a` is set, it must also be
|
|
173
|
+
* // non-empty; whereas if `b` is set, it can still be an empty string.
|
|
174
|
+
* option (buf.validate.oneof).required = true;
|
|
175
|
+
* string a = 1 [(buf.validate.field).string.min_len = 1];
|
|
176
|
+
* string b = 2;
|
|
177
|
+
* }
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* @generated from field: optional bool required = 1;
|
|
182
|
+
*/
|
|
183
|
+
required: boolean;
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Describes the message buf.validate.OneofRules.
|
|
187
|
+
* Use `create(OneofRulesSchema)` to create a new message.
|
|
188
|
+
*/
|
|
189
|
+
export declare const OneofRulesSchema: GenMessage<OneofRules>;
|
|
190
|
+
/**
|
|
191
|
+
* FieldRules encapsulates the rules for each type of field. Depending on
|
|
192
|
+
* the field, the correct set should be used to ensure proper validations.
|
|
193
|
+
*
|
|
194
|
+
* @generated from message buf.validate.FieldRules
|
|
195
|
+
*/
|
|
196
|
+
export type FieldRules = Message<"buf.validate.FieldRules"> & {
|
|
197
|
+
/**
|
|
198
|
+
* `cel` is a repeated field used to represent a textual expression
|
|
199
|
+
* in the Common Expression Language (CEL) syntax. For more information,
|
|
200
|
+
* [see our documentation](https://buf.build/docs/protovalidate/schemas/custom-rules/).
|
|
201
|
+
*
|
|
202
|
+
* ```proto
|
|
203
|
+
* message MyMessage {
|
|
204
|
+
* // The field `value` must be greater than 42.
|
|
205
|
+
* optional int32 value = 1 [(buf.validate.field).cel = {
|
|
206
|
+
* id: "my_message.value",
|
|
207
|
+
* message: "value must be greater than 42",
|
|
208
|
+
* expression: "this > 42",
|
|
209
|
+
* }];
|
|
210
|
+
* }
|
|
211
|
+
* ```
|
|
212
|
+
*
|
|
213
|
+
* @generated from field: repeated buf.validate.Rule cel = 23;
|
|
214
|
+
*/
|
|
215
|
+
cel: Rule[];
|
|
216
|
+
/**
|
|
217
|
+
* If `required` is true, the field must be set. A validation error is returned
|
|
218
|
+
* if the field is not set.
|
|
219
|
+
*
|
|
220
|
+
* ```proto
|
|
221
|
+
* syntax="proto3";
|
|
222
|
+
*
|
|
223
|
+
* message FieldsWithPresence {
|
|
224
|
+
* // Requires any string to be set, including the empty string.
|
|
225
|
+
* optional string link = 1 [
|
|
226
|
+
* (buf.validate.field).required = true
|
|
227
|
+
* ];
|
|
228
|
+
* // Requires true or false to be set.
|
|
229
|
+
* optional bool disabled = 2 [
|
|
230
|
+
* (buf.validate.field).required = true
|
|
231
|
+
* ];
|
|
232
|
+
* // Requires a message to be set, including the empty message.
|
|
233
|
+
* SomeMessage msg = 4 [
|
|
234
|
+
* (buf.validate.field).required = true
|
|
235
|
+
* ];
|
|
236
|
+
* }
|
|
237
|
+
* ```
|
|
238
|
+
*
|
|
239
|
+
* All fields in the example above track presence. By default, Protovalidate
|
|
240
|
+
* ignores rules on those fields if no value is set. `required` ensures that
|
|
241
|
+
* the fields are set and valid.
|
|
242
|
+
*
|
|
243
|
+
* Fields that don't track presence are always validated by Protovalidate,
|
|
244
|
+
* whether they are set or not. It is not necessary to add `required`:
|
|
245
|
+
*
|
|
246
|
+
* ```proto
|
|
247
|
+
* syntax="proto3";
|
|
248
|
+
*
|
|
249
|
+
* message FieldsWithoutPresence {
|
|
250
|
+
* // `string.email` always applies, even to an empty string.
|
|
251
|
+
* string link = 1 [
|
|
252
|
+
* (buf.validate.field).string.email = true
|
|
253
|
+
* ];
|
|
254
|
+
* // `repeated.min_items` always applies, even to an empty list.
|
|
255
|
+
* repeated string labels = 4 [
|
|
256
|
+
* (buf.validate.field).repeated.min_items = 1
|
|
257
|
+
* ];
|
|
258
|
+
* }
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* To learn which fields track presence, see the
|
|
262
|
+
* [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).
|
|
263
|
+
*
|
|
264
|
+
* Note: While field rules can be applied to repeated items, map keys, and map
|
|
265
|
+
* values, the elements are always considered to be set. Consequently,
|
|
266
|
+
* specifying `repeated.items.required` is redundant.
|
|
267
|
+
*
|
|
268
|
+
* @generated from field: optional bool required = 25;
|
|
269
|
+
*/
|
|
270
|
+
required: boolean;
|
|
271
|
+
/**
|
|
272
|
+
* Ignore validation rules on the field if its value matches the specified
|
|
273
|
+
* criteria. See the `Ignore` enum for details.
|
|
274
|
+
*
|
|
275
|
+
* ```proto
|
|
276
|
+
* message UpdateRequest {
|
|
277
|
+
* // The uri rule only applies if the field is not an empty string.
|
|
278
|
+
* string url = 1 [
|
|
279
|
+
* (buf.validate.field).ignore = IGNORE_IF_ZERO_VALUE,
|
|
280
|
+
* (buf.validate.field).string.uri = true
|
|
281
|
+
* ];
|
|
282
|
+
* }
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @generated from field: optional buf.validate.Ignore ignore = 27;
|
|
286
|
+
*/
|
|
287
|
+
ignore: Ignore;
|
|
288
|
+
/**
|
|
289
|
+
* @generated from oneof buf.validate.FieldRules.type
|
|
290
|
+
*/
|
|
291
|
+
type: {
|
|
292
|
+
/**
|
|
293
|
+
* Scalar Field Types
|
|
294
|
+
*
|
|
295
|
+
* @generated from field: buf.validate.FloatRules float = 1;
|
|
296
|
+
*/
|
|
297
|
+
value: FloatRules;
|
|
298
|
+
case: "float";
|
|
299
|
+
} | {
|
|
300
|
+
/**
|
|
301
|
+
* @generated from field: buf.validate.DoubleRules double = 2;
|
|
302
|
+
*/
|
|
303
|
+
value: DoubleRules;
|
|
304
|
+
case: "double";
|
|
305
|
+
} | {
|
|
306
|
+
/**
|
|
307
|
+
* @generated from field: buf.validate.Int32Rules int32 = 3;
|
|
308
|
+
*/
|
|
309
|
+
value: Int32Rules;
|
|
310
|
+
case: "int32";
|
|
311
|
+
} | {
|
|
312
|
+
/**
|
|
313
|
+
* @generated from field: buf.validate.Int64Rules int64 = 4;
|
|
314
|
+
*/
|
|
315
|
+
value: Int64Rules;
|
|
316
|
+
case: "int64";
|
|
317
|
+
} | {
|
|
318
|
+
/**
|
|
319
|
+
* @generated from field: buf.validate.UInt32Rules uint32 = 5;
|
|
320
|
+
*/
|
|
321
|
+
value: UInt32Rules;
|
|
322
|
+
case: "uint32";
|
|
323
|
+
} | {
|
|
324
|
+
/**
|
|
325
|
+
* @generated from field: buf.validate.UInt64Rules uint64 = 6;
|
|
326
|
+
*/
|
|
327
|
+
value: UInt64Rules;
|
|
328
|
+
case: "uint64";
|
|
329
|
+
} | {
|
|
330
|
+
/**
|
|
331
|
+
* @generated from field: buf.validate.SInt32Rules sint32 = 7;
|
|
332
|
+
*/
|
|
333
|
+
value: SInt32Rules;
|
|
334
|
+
case: "sint32";
|
|
335
|
+
} | {
|
|
336
|
+
/**
|
|
337
|
+
* @generated from field: buf.validate.SInt64Rules sint64 = 8;
|
|
338
|
+
*/
|
|
339
|
+
value: SInt64Rules;
|
|
340
|
+
case: "sint64";
|
|
341
|
+
} | {
|
|
342
|
+
/**
|
|
343
|
+
* @generated from field: buf.validate.Fixed32Rules fixed32 = 9;
|
|
344
|
+
*/
|
|
345
|
+
value: Fixed32Rules;
|
|
346
|
+
case: "fixed32";
|
|
347
|
+
} | {
|
|
348
|
+
/**
|
|
349
|
+
* @generated from field: buf.validate.Fixed64Rules fixed64 = 10;
|
|
350
|
+
*/
|
|
351
|
+
value: Fixed64Rules;
|
|
352
|
+
case: "fixed64";
|
|
353
|
+
} | {
|
|
354
|
+
/**
|
|
355
|
+
* @generated from field: buf.validate.SFixed32Rules sfixed32 = 11;
|
|
356
|
+
*/
|
|
357
|
+
value: SFixed32Rules;
|
|
358
|
+
case: "sfixed32";
|
|
359
|
+
} | {
|
|
360
|
+
/**
|
|
361
|
+
* @generated from field: buf.validate.SFixed64Rules sfixed64 = 12;
|
|
362
|
+
*/
|
|
363
|
+
value: SFixed64Rules;
|
|
364
|
+
case: "sfixed64";
|
|
365
|
+
} | {
|
|
366
|
+
/**
|
|
367
|
+
* @generated from field: buf.validate.BoolRules bool = 13;
|
|
368
|
+
*/
|
|
369
|
+
value: BoolRules;
|
|
370
|
+
case: "bool";
|
|
371
|
+
} | {
|
|
372
|
+
/**
|
|
373
|
+
* @generated from field: buf.validate.StringRules string = 14;
|
|
374
|
+
*/
|
|
375
|
+
value: StringRules;
|
|
376
|
+
case: "string";
|
|
377
|
+
} | {
|
|
378
|
+
/**
|
|
379
|
+
* @generated from field: buf.validate.BytesRules bytes = 15;
|
|
380
|
+
*/
|
|
381
|
+
value: BytesRules;
|
|
382
|
+
case: "bytes";
|
|
383
|
+
} | {
|
|
384
|
+
/**
|
|
385
|
+
* Complex Field Types
|
|
386
|
+
*
|
|
387
|
+
* @generated from field: buf.validate.EnumRules enum = 16;
|
|
388
|
+
*/
|
|
389
|
+
value: EnumRules;
|
|
390
|
+
case: "enum";
|
|
391
|
+
} | {
|
|
392
|
+
/**
|
|
393
|
+
* @generated from field: buf.validate.RepeatedRules repeated = 18;
|
|
394
|
+
*/
|
|
395
|
+
value: RepeatedRules;
|
|
396
|
+
case: "repeated";
|
|
397
|
+
} | {
|
|
398
|
+
/**
|
|
399
|
+
* @generated from field: buf.validate.MapRules map = 19;
|
|
400
|
+
*/
|
|
401
|
+
value: MapRules;
|
|
402
|
+
case: "map";
|
|
403
|
+
} | {
|
|
404
|
+
/**
|
|
405
|
+
* Well-Known Field Types
|
|
406
|
+
*
|
|
407
|
+
* @generated from field: buf.validate.AnyRules any = 20;
|
|
408
|
+
*/
|
|
409
|
+
value: AnyRules;
|
|
410
|
+
case: "any";
|
|
411
|
+
} | {
|
|
412
|
+
/**
|
|
413
|
+
* @generated from field: buf.validate.DurationRules duration = 21;
|
|
414
|
+
*/
|
|
415
|
+
value: DurationRules;
|
|
416
|
+
case: "duration";
|
|
417
|
+
} | {
|
|
418
|
+
/**
|
|
419
|
+
* @generated from field: buf.validate.TimestampRules timestamp = 22;
|
|
420
|
+
*/
|
|
421
|
+
value: TimestampRules;
|
|
422
|
+
case: "timestamp";
|
|
423
|
+
} | {
|
|
424
|
+
case: undefined;
|
|
425
|
+
value?: undefined;
|
|
426
|
+
};
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* Describes the message buf.validate.FieldRules.
|
|
430
|
+
* Use `create(FieldRulesSchema)` to create a new message.
|
|
431
|
+
*/
|
|
432
|
+
export declare const FieldRulesSchema: GenMessage<FieldRules>;
|
|
433
|
+
/**
|
|
434
|
+
* PredefinedRules are custom rules that can be re-used with
|
|
435
|
+
* multiple fields.
|
|
436
|
+
*
|
|
437
|
+
* @generated from message buf.validate.PredefinedRules
|
|
438
|
+
*/
|
|
439
|
+
export type PredefinedRules = Message<"buf.validate.PredefinedRules"> & {
|
|
440
|
+
/**
|
|
441
|
+
* `cel` is a repeated field used to represent a textual expression
|
|
442
|
+
* in the Common Expression Language (CEL) syntax. For more information,
|
|
443
|
+
* [see our documentation](https://buf.build/docs/protovalidate/schemas/predefined-rules/).
|
|
444
|
+
*
|
|
445
|
+
* ```proto
|
|
446
|
+
* message MyMessage {
|
|
447
|
+
* // The field `value` must be greater than 42.
|
|
448
|
+
* optional int32 value = 1 [(buf.validate.predefined).cel = {
|
|
449
|
+
* id: "my_message.value",
|
|
450
|
+
* message: "value must be greater than 42",
|
|
451
|
+
* expression: "this > 42",
|
|
452
|
+
* }];
|
|
453
|
+
* }
|
|
454
|
+
* ```
|
|
455
|
+
*
|
|
456
|
+
* @generated from field: repeated buf.validate.Rule cel = 1;
|
|
457
|
+
*/
|
|
458
|
+
cel: Rule[];
|
|
459
|
+
};
|
|
460
|
+
/**
|
|
461
|
+
* Describes the message buf.validate.PredefinedRules.
|
|
462
|
+
* Use `create(PredefinedRulesSchema)` to create a new message.
|
|
463
|
+
*/
|
|
464
|
+
export declare const PredefinedRulesSchema: GenMessage<PredefinedRules>;
|
|
465
|
+
/**
|
|
466
|
+
* FloatRules describes the rules applied to `float` values. These
|
|
467
|
+
* rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.
|
|
468
|
+
*
|
|
469
|
+
* @generated from message buf.validate.FloatRules
|
|
470
|
+
*/
|
|
471
|
+
export type FloatRules = Message<"buf.validate.FloatRules"> & {
|
|
472
|
+
/**
|
|
473
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
474
|
+
* the field value doesn't match, an error message is generated.
|
|
475
|
+
*
|
|
476
|
+
* ```proto
|
|
477
|
+
* message MyFloat {
|
|
478
|
+
* // value must equal 42.0
|
|
479
|
+
* float value = 1 [(buf.validate.field).float.const = 42.0];
|
|
480
|
+
* }
|
|
481
|
+
* ```
|
|
482
|
+
*
|
|
483
|
+
* @generated from field: optional float const = 1;
|
|
484
|
+
*/
|
|
485
|
+
const: number;
|
|
486
|
+
/**
|
|
487
|
+
* @generated from oneof buf.validate.FloatRules.less_than
|
|
488
|
+
*/
|
|
489
|
+
lessThan: {
|
|
490
|
+
/**
|
|
491
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
492
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
493
|
+
* an error message is generated.
|
|
494
|
+
*
|
|
495
|
+
* ```proto
|
|
496
|
+
* message MyFloat {
|
|
497
|
+
* // value must be less than 10.0
|
|
498
|
+
* float value = 1 [(buf.validate.field).float.lt = 10.0];
|
|
499
|
+
* }
|
|
500
|
+
* ```
|
|
501
|
+
*
|
|
502
|
+
* @generated from field: float lt = 2;
|
|
503
|
+
*/
|
|
504
|
+
value: number;
|
|
505
|
+
case: "lt";
|
|
506
|
+
} | {
|
|
507
|
+
/**
|
|
508
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
509
|
+
* value (field <= value). If the field value is greater than the specified
|
|
510
|
+
* value, an error message is generated.
|
|
511
|
+
*
|
|
512
|
+
* ```proto
|
|
513
|
+
* message MyFloat {
|
|
514
|
+
* // value must be less than or equal to 10.0
|
|
515
|
+
* float value = 1 [(buf.validate.field).float.lte = 10.0];
|
|
516
|
+
* }
|
|
517
|
+
* ```
|
|
518
|
+
*
|
|
519
|
+
* @generated from field: float lte = 3;
|
|
520
|
+
*/
|
|
521
|
+
value: number;
|
|
522
|
+
case: "lte";
|
|
523
|
+
} | {
|
|
524
|
+
case: undefined;
|
|
525
|
+
value?: undefined;
|
|
526
|
+
};
|
|
527
|
+
/**
|
|
528
|
+
* @generated from oneof buf.validate.FloatRules.greater_than
|
|
529
|
+
*/
|
|
530
|
+
greaterThan: {
|
|
531
|
+
/**
|
|
532
|
+
* `gt` requires the field value to be greater than the specified value
|
|
533
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
534
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
535
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
536
|
+
* an error message is generated.
|
|
537
|
+
*
|
|
538
|
+
* ```proto
|
|
539
|
+
* message MyFloat {
|
|
540
|
+
* // value must be greater than 5.0 [float.gt]
|
|
541
|
+
* float value = 1 [(buf.validate.field).float.gt = 5.0];
|
|
542
|
+
*
|
|
543
|
+
* // value must be greater than 5 and less than 10.0 [float.gt_lt]
|
|
544
|
+
* float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];
|
|
545
|
+
*
|
|
546
|
+
* // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]
|
|
547
|
+
* float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];
|
|
548
|
+
* }
|
|
549
|
+
* ```
|
|
550
|
+
*
|
|
551
|
+
* @generated from field: float gt = 4;
|
|
552
|
+
*/
|
|
553
|
+
value: number;
|
|
554
|
+
case: "gt";
|
|
555
|
+
} | {
|
|
556
|
+
/**
|
|
557
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
558
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
559
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
560
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
561
|
+
* an error message is generated.
|
|
562
|
+
*
|
|
563
|
+
* ```proto
|
|
564
|
+
* message MyFloat {
|
|
565
|
+
* // value must be greater than or equal to 5.0 [float.gte]
|
|
566
|
+
* float value = 1 [(buf.validate.field).float.gte = 5.0];
|
|
567
|
+
*
|
|
568
|
+
* // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]
|
|
569
|
+
* float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];
|
|
570
|
+
*
|
|
571
|
+
* // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]
|
|
572
|
+
* float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];
|
|
573
|
+
* }
|
|
574
|
+
* ```
|
|
575
|
+
*
|
|
576
|
+
* @generated from field: float gte = 5;
|
|
577
|
+
*/
|
|
578
|
+
value: number;
|
|
579
|
+
case: "gte";
|
|
580
|
+
} | {
|
|
581
|
+
case: undefined;
|
|
582
|
+
value?: undefined;
|
|
583
|
+
};
|
|
584
|
+
/**
|
|
585
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
586
|
+
* If the field value isn't one of the specified values, an error message
|
|
587
|
+
* is generated.
|
|
588
|
+
*
|
|
589
|
+
* ```proto
|
|
590
|
+
* message MyFloat {
|
|
591
|
+
* // value must be in list [1.0, 2.0, 3.0]
|
|
592
|
+
* float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];
|
|
593
|
+
* }
|
|
594
|
+
* ```
|
|
595
|
+
*
|
|
596
|
+
* @generated from field: repeated float in = 6;
|
|
597
|
+
*/
|
|
598
|
+
in: number[];
|
|
599
|
+
/**
|
|
600
|
+
* `in` requires the field value to not be equal to any of the specified
|
|
601
|
+
* values. If the field value is one of the specified values, an error
|
|
602
|
+
* message is generated.
|
|
603
|
+
*
|
|
604
|
+
* ```proto
|
|
605
|
+
* message MyFloat {
|
|
606
|
+
* // value must not be in list [1.0, 2.0, 3.0]
|
|
607
|
+
* float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];
|
|
608
|
+
* }
|
|
609
|
+
* ```
|
|
610
|
+
*
|
|
611
|
+
* @generated from field: repeated float not_in = 7;
|
|
612
|
+
*/
|
|
613
|
+
notIn: number[];
|
|
614
|
+
/**
|
|
615
|
+
* `finite` requires the field value to be finite. If the field value is
|
|
616
|
+
* infinite or NaN, an error message is generated.
|
|
617
|
+
*
|
|
618
|
+
* @generated from field: optional bool finite = 8;
|
|
619
|
+
*/
|
|
620
|
+
finite: boolean;
|
|
621
|
+
/**
|
|
622
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
623
|
+
* conform to other rules. `example` values will not impact validation
|
|
624
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
625
|
+
*
|
|
626
|
+
* ```proto
|
|
627
|
+
* message MyFloat {
|
|
628
|
+
* float value = 1 [
|
|
629
|
+
* (buf.validate.field).float.example = 1.0,
|
|
630
|
+
* (buf.validate.field).float.example = inf
|
|
631
|
+
* ];
|
|
632
|
+
* }
|
|
633
|
+
* ```
|
|
634
|
+
*
|
|
635
|
+
* @generated from field: repeated float example = 9;
|
|
636
|
+
*/
|
|
637
|
+
example: number[];
|
|
638
|
+
};
|
|
639
|
+
/**
|
|
640
|
+
* Describes the message buf.validate.FloatRules.
|
|
641
|
+
* Use `create(FloatRulesSchema)` to create a new message.
|
|
642
|
+
*/
|
|
643
|
+
export declare const FloatRulesSchema: GenMessage<FloatRules>;
|
|
644
|
+
/**
|
|
645
|
+
* DoubleRules describes the rules applied to `double` values. These
|
|
646
|
+
* rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.
|
|
647
|
+
*
|
|
648
|
+
* @generated from message buf.validate.DoubleRules
|
|
649
|
+
*/
|
|
650
|
+
export type DoubleRules = Message<"buf.validate.DoubleRules"> & {
|
|
651
|
+
/**
|
|
652
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
653
|
+
* the field value doesn't match, an error message is generated.
|
|
654
|
+
*
|
|
655
|
+
* ```proto
|
|
656
|
+
* message MyDouble {
|
|
657
|
+
* // value must equal 42.0
|
|
658
|
+
* double value = 1 [(buf.validate.field).double.const = 42.0];
|
|
659
|
+
* }
|
|
660
|
+
* ```
|
|
661
|
+
*
|
|
662
|
+
* @generated from field: optional double const = 1;
|
|
663
|
+
*/
|
|
664
|
+
const: number;
|
|
665
|
+
/**
|
|
666
|
+
* @generated from oneof buf.validate.DoubleRules.less_than
|
|
667
|
+
*/
|
|
668
|
+
lessThan: {
|
|
669
|
+
/**
|
|
670
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
671
|
+
* value). If the field value is equal to or greater than the specified
|
|
672
|
+
* value, an error message is generated.
|
|
673
|
+
*
|
|
674
|
+
* ```proto
|
|
675
|
+
* message MyDouble {
|
|
676
|
+
* // value must be less than 10.0
|
|
677
|
+
* double value = 1 [(buf.validate.field).double.lt = 10.0];
|
|
678
|
+
* }
|
|
679
|
+
* ```
|
|
680
|
+
*
|
|
681
|
+
* @generated from field: double lt = 2;
|
|
682
|
+
*/
|
|
683
|
+
value: number;
|
|
684
|
+
case: "lt";
|
|
685
|
+
} | {
|
|
686
|
+
/**
|
|
687
|
+
* `lte` requires the field value to be less than or equal to the specified value
|
|
688
|
+
* (field <= value). If the field value is greater than the specified value,
|
|
689
|
+
* an error message is generated.
|
|
690
|
+
*
|
|
691
|
+
* ```proto
|
|
692
|
+
* message MyDouble {
|
|
693
|
+
* // value must be less than or equal to 10.0
|
|
694
|
+
* double value = 1 [(buf.validate.field).double.lte = 10.0];
|
|
695
|
+
* }
|
|
696
|
+
* ```
|
|
697
|
+
*
|
|
698
|
+
* @generated from field: double lte = 3;
|
|
699
|
+
*/
|
|
700
|
+
value: number;
|
|
701
|
+
case: "lte";
|
|
702
|
+
} | {
|
|
703
|
+
case: undefined;
|
|
704
|
+
value?: undefined;
|
|
705
|
+
};
|
|
706
|
+
/**
|
|
707
|
+
* @generated from oneof buf.validate.DoubleRules.greater_than
|
|
708
|
+
*/
|
|
709
|
+
greaterThan: {
|
|
710
|
+
/**
|
|
711
|
+
* `gt` requires the field value to be greater than the specified value
|
|
712
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,
|
|
713
|
+
* the range is reversed, and the field value must be outside the specified
|
|
714
|
+
* range. If the field value doesn't meet the required conditions, an error
|
|
715
|
+
* message is generated.
|
|
716
|
+
*
|
|
717
|
+
* ```proto
|
|
718
|
+
* message MyDouble {
|
|
719
|
+
* // value must be greater than 5.0 [double.gt]
|
|
720
|
+
* double value = 1 [(buf.validate.field).double.gt = 5.0];
|
|
721
|
+
*
|
|
722
|
+
* // value must be greater than 5 and less than 10.0 [double.gt_lt]
|
|
723
|
+
* double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];
|
|
724
|
+
*
|
|
725
|
+
* // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]
|
|
726
|
+
* double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];
|
|
727
|
+
* }
|
|
728
|
+
* ```
|
|
729
|
+
*
|
|
730
|
+
* @generated from field: double gt = 4;
|
|
731
|
+
*/
|
|
732
|
+
value: number;
|
|
733
|
+
case: "gt";
|
|
734
|
+
} | {
|
|
735
|
+
/**
|
|
736
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
737
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt` or
|
|
738
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
739
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
740
|
+
* an error message is generated.
|
|
741
|
+
*
|
|
742
|
+
* ```proto
|
|
743
|
+
* message MyDouble {
|
|
744
|
+
* // value must be greater than or equal to 5.0 [double.gte]
|
|
745
|
+
* double value = 1 [(buf.validate.field).double.gte = 5.0];
|
|
746
|
+
*
|
|
747
|
+
* // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]
|
|
748
|
+
* double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];
|
|
749
|
+
*
|
|
750
|
+
* // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]
|
|
751
|
+
* double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];
|
|
752
|
+
* }
|
|
753
|
+
* ```
|
|
754
|
+
*
|
|
755
|
+
* @generated from field: double gte = 5;
|
|
756
|
+
*/
|
|
757
|
+
value: number;
|
|
758
|
+
case: "gte";
|
|
759
|
+
} | {
|
|
760
|
+
case: undefined;
|
|
761
|
+
value?: undefined;
|
|
762
|
+
};
|
|
763
|
+
/**
|
|
764
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
765
|
+
* If the field value isn't one of the specified values, an error message is
|
|
766
|
+
* generated.
|
|
767
|
+
*
|
|
768
|
+
* ```proto
|
|
769
|
+
* message MyDouble {
|
|
770
|
+
* // value must be in list [1.0, 2.0, 3.0]
|
|
771
|
+
* double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];
|
|
772
|
+
* }
|
|
773
|
+
* ```
|
|
774
|
+
*
|
|
775
|
+
* @generated from field: repeated double in = 6;
|
|
776
|
+
*/
|
|
777
|
+
in: number[];
|
|
778
|
+
/**
|
|
779
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
780
|
+
* values. If the field value is one of the specified values, an error
|
|
781
|
+
* message is generated.
|
|
782
|
+
*
|
|
783
|
+
* ```proto
|
|
784
|
+
* message MyDouble {
|
|
785
|
+
* // value must not be in list [1.0, 2.0, 3.0]
|
|
786
|
+
* double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];
|
|
787
|
+
* }
|
|
788
|
+
* ```
|
|
789
|
+
*
|
|
790
|
+
* @generated from field: repeated double not_in = 7;
|
|
791
|
+
*/
|
|
792
|
+
notIn: number[];
|
|
793
|
+
/**
|
|
794
|
+
* `finite` requires the field value to be finite. If the field value is
|
|
795
|
+
* infinite or NaN, an error message is generated.
|
|
796
|
+
*
|
|
797
|
+
* @generated from field: optional bool finite = 8;
|
|
798
|
+
*/
|
|
799
|
+
finite: boolean;
|
|
800
|
+
/**
|
|
801
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
802
|
+
* conform to other rules. `example` values will not impact validation
|
|
803
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
804
|
+
*
|
|
805
|
+
* ```proto
|
|
806
|
+
* message MyDouble {
|
|
807
|
+
* double value = 1 [
|
|
808
|
+
* (buf.validate.field).double.example = 1.0,
|
|
809
|
+
* (buf.validate.field).double.example = inf
|
|
810
|
+
* ];
|
|
811
|
+
* }
|
|
812
|
+
* ```
|
|
813
|
+
*
|
|
814
|
+
* @generated from field: repeated double example = 9;
|
|
815
|
+
*/
|
|
816
|
+
example: number[];
|
|
817
|
+
};
|
|
818
|
+
/**
|
|
819
|
+
* Describes the message buf.validate.DoubleRules.
|
|
820
|
+
* Use `create(DoubleRulesSchema)` to create a new message.
|
|
821
|
+
*/
|
|
822
|
+
export declare const DoubleRulesSchema: GenMessage<DoubleRules>;
|
|
823
|
+
/**
|
|
824
|
+
* Int32Rules describes the rules applied to `int32` values. These
|
|
825
|
+
* rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.
|
|
826
|
+
*
|
|
827
|
+
* @generated from message buf.validate.Int32Rules
|
|
828
|
+
*/
|
|
829
|
+
export type Int32Rules = Message<"buf.validate.Int32Rules"> & {
|
|
830
|
+
/**
|
|
831
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
832
|
+
* the field value doesn't match, an error message is generated.
|
|
833
|
+
*
|
|
834
|
+
* ```proto
|
|
835
|
+
* message MyInt32 {
|
|
836
|
+
* // value must equal 42
|
|
837
|
+
* int32 value = 1 [(buf.validate.field).int32.const = 42];
|
|
838
|
+
* }
|
|
839
|
+
* ```
|
|
840
|
+
*
|
|
841
|
+
* @generated from field: optional int32 const = 1;
|
|
842
|
+
*/
|
|
843
|
+
const: number;
|
|
844
|
+
/**
|
|
845
|
+
* @generated from oneof buf.validate.Int32Rules.less_than
|
|
846
|
+
*/
|
|
847
|
+
lessThan: {
|
|
848
|
+
/**
|
|
849
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
850
|
+
* < value). If the field value is equal to or greater than the specified
|
|
851
|
+
* value, an error message is generated.
|
|
852
|
+
*
|
|
853
|
+
* ```proto
|
|
854
|
+
* message MyInt32 {
|
|
855
|
+
* // value must be less than 10
|
|
856
|
+
* int32 value = 1 [(buf.validate.field).int32.lt = 10];
|
|
857
|
+
* }
|
|
858
|
+
* ```
|
|
859
|
+
*
|
|
860
|
+
* @generated from field: int32 lt = 2;
|
|
861
|
+
*/
|
|
862
|
+
value: number;
|
|
863
|
+
case: "lt";
|
|
864
|
+
} | {
|
|
865
|
+
/**
|
|
866
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
867
|
+
* value (field <= value). If the field value is greater than the specified
|
|
868
|
+
* value, an error message is generated.
|
|
869
|
+
*
|
|
870
|
+
* ```proto
|
|
871
|
+
* message MyInt32 {
|
|
872
|
+
* // value must be less than or equal to 10
|
|
873
|
+
* int32 value = 1 [(buf.validate.field).int32.lte = 10];
|
|
874
|
+
* }
|
|
875
|
+
* ```
|
|
876
|
+
*
|
|
877
|
+
* @generated from field: int32 lte = 3;
|
|
878
|
+
*/
|
|
879
|
+
value: number;
|
|
880
|
+
case: "lte";
|
|
881
|
+
} | {
|
|
882
|
+
case: undefined;
|
|
883
|
+
value?: undefined;
|
|
884
|
+
};
|
|
885
|
+
/**
|
|
886
|
+
* @generated from oneof buf.validate.Int32Rules.greater_than
|
|
887
|
+
*/
|
|
888
|
+
greaterThan: {
|
|
889
|
+
/**
|
|
890
|
+
* `gt` requires the field value to be greater than the specified value
|
|
891
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
892
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
893
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
894
|
+
* an error message is generated.
|
|
895
|
+
*
|
|
896
|
+
* ```proto
|
|
897
|
+
* message MyInt32 {
|
|
898
|
+
* // value must be greater than 5 [int32.gt]
|
|
899
|
+
* int32 value = 1 [(buf.validate.field).int32.gt = 5];
|
|
900
|
+
*
|
|
901
|
+
* // value must be greater than 5 and less than 10 [int32.gt_lt]
|
|
902
|
+
* int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];
|
|
903
|
+
*
|
|
904
|
+
* // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]
|
|
905
|
+
* int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];
|
|
906
|
+
* }
|
|
907
|
+
* ```
|
|
908
|
+
*
|
|
909
|
+
* @generated from field: int32 gt = 4;
|
|
910
|
+
*/
|
|
911
|
+
value: number;
|
|
912
|
+
case: "gt";
|
|
913
|
+
} | {
|
|
914
|
+
/**
|
|
915
|
+
* `gte` requires the field value to be greater than or equal to the specified value
|
|
916
|
+
* (exclusive). If the value of `gte` is larger than a specified `lt` or
|
|
917
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
918
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
919
|
+
* an error message is generated.
|
|
920
|
+
*
|
|
921
|
+
* ```proto
|
|
922
|
+
* message MyInt32 {
|
|
923
|
+
* // value must be greater than or equal to 5 [int32.gte]
|
|
924
|
+
* int32 value = 1 [(buf.validate.field).int32.gte = 5];
|
|
925
|
+
*
|
|
926
|
+
* // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]
|
|
927
|
+
* int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];
|
|
928
|
+
*
|
|
929
|
+
* // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]
|
|
930
|
+
* int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];
|
|
931
|
+
* }
|
|
932
|
+
* ```
|
|
933
|
+
*
|
|
934
|
+
* @generated from field: int32 gte = 5;
|
|
935
|
+
*/
|
|
936
|
+
value: number;
|
|
937
|
+
case: "gte";
|
|
938
|
+
} | {
|
|
939
|
+
case: undefined;
|
|
940
|
+
value?: undefined;
|
|
941
|
+
};
|
|
942
|
+
/**
|
|
943
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
944
|
+
* If the field value isn't one of the specified values, an error message is
|
|
945
|
+
* generated.
|
|
946
|
+
*
|
|
947
|
+
* ```proto
|
|
948
|
+
* message MyInt32 {
|
|
949
|
+
* // value must be in list [1, 2, 3]
|
|
950
|
+
* int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];
|
|
951
|
+
* }
|
|
952
|
+
* ```
|
|
953
|
+
*
|
|
954
|
+
* @generated from field: repeated int32 in = 6;
|
|
955
|
+
*/
|
|
956
|
+
in: number[];
|
|
957
|
+
/**
|
|
958
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
959
|
+
* values. If the field value is one of the specified values, an error message
|
|
960
|
+
* is generated.
|
|
961
|
+
*
|
|
962
|
+
* ```proto
|
|
963
|
+
* message MyInt32 {
|
|
964
|
+
* // value must not be in list [1, 2, 3]
|
|
965
|
+
* int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];
|
|
966
|
+
* }
|
|
967
|
+
* ```
|
|
968
|
+
*
|
|
969
|
+
* @generated from field: repeated int32 not_in = 7;
|
|
970
|
+
*/
|
|
971
|
+
notIn: number[];
|
|
972
|
+
/**
|
|
973
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
974
|
+
* conform to other rules. `example` values will not impact validation
|
|
975
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
976
|
+
*
|
|
977
|
+
* ```proto
|
|
978
|
+
* message MyInt32 {
|
|
979
|
+
* int32 value = 1 [
|
|
980
|
+
* (buf.validate.field).int32.example = 1,
|
|
981
|
+
* (buf.validate.field).int32.example = -10
|
|
982
|
+
* ];
|
|
983
|
+
* }
|
|
984
|
+
* ```
|
|
985
|
+
*
|
|
986
|
+
* @generated from field: repeated int32 example = 8;
|
|
987
|
+
*/
|
|
988
|
+
example: number[];
|
|
989
|
+
};
|
|
990
|
+
/**
|
|
991
|
+
* Describes the message buf.validate.Int32Rules.
|
|
992
|
+
* Use `create(Int32RulesSchema)` to create a new message.
|
|
993
|
+
*/
|
|
994
|
+
export declare const Int32RulesSchema: GenMessage<Int32Rules>;
|
|
995
|
+
/**
|
|
996
|
+
* Int64Rules describes the rules applied to `int64` values. These
|
|
997
|
+
* rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
|
|
998
|
+
*
|
|
999
|
+
* @generated from message buf.validate.Int64Rules
|
|
1000
|
+
*/
|
|
1001
|
+
export type Int64Rules = Message<"buf.validate.Int64Rules"> & {
|
|
1002
|
+
/**
|
|
1003
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1004
|
+
* the field value doesn't match, an error message is generated.
|
|
1005
|
+
*
|
|
1006
|
+
* ```proto
|
|
1007
|
+
* message MyInt64 {
|
|
1008
|
+
* // value must equal 42
|
|
1009
|
+
* int64 value = 1 [(buf.validate.field).int64.const = 42];
|
|
1010
|
+
* }
|
|
1011
|
+
* ```
|
|
1012
|
+
*
|
|
1013
|
+
* @generated from field: optional int64 const = 1;
|
|
1014
|
+
*/
|
|
1015
|
+
const: bigint;
|
|
1016
|
+
/**
|
|
1017
|
+
* @generated from oneof buf.validate.Int64Rules.less_than
|
|
1018
|
+
*/
|
|
1019
|
+
lessThan: {
|
|
1020
|
+
/**
|
|
1021
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1022
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
1023
|
+
* an error message is generated.
|
|
1024
|
+
*
|
|
1025
|
+
* ```proto
|
|
1026
|
+
* message MyInt64 {
|
|
1027
|
+
* // value must be less than 10
|
|
1028
|
+
* int64 value = 1 [(buf.validate.field).int64.lt = 10];
|
|
1029
|
+
* }
|
|
1030
|
+
* ```
|
|
1031
|
+
*
|
|
1032
|
+
* @generated from field: int64 lt = 2;
|
|
1033
|
+
*/
|
|
1034
|
+
value: bigint;
|
|
1035
|
+
case: "lt";
|
|
1036
|
+
} | {
|
|
1037
|
+
/**
|
|
1038
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1039
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1040
|
+
* value, an error message is generated.
|
|
1041
|
+
*
|
|
1042
|
+
* ```proto
|
|
1043
|
+
* message MyInt64 {
|
|
1044
|
+
* // value must be less than or equal to 10
|
|
1045
|
+
* int64 value = 1 [(buf.validate.field).int64.lte = 10];
|
|
1046
|
+
* }
|
|
1047
|
+
* ```
|
|
1048
|
+
*
|
|
1049
|
+
* @generated from field: int64 lte = 3;
|
|
1050
|
+
*/
|
|
1051
|
+
value: bigint;
|
|
1052
|
+
case: "lte";
|
|
1053
|
+
} | {
|
|
1054
|
+
case: undefined;
|
|
1055
|
+
value?: undefined;
|
|
1056
|
+
};
|
|
1057
|
+
/**
|
|
1058
|
+
* @generated from oneof buf.validate.Int64Rules.greater_than
|
|
1059
|
+
*/
|
|
1060
|
+
greaterThan: {
|
|
1061
|
+
/**
|
|
1062
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1063
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1064
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1065
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1066
|
+
* an error message is generated.
|
|
1067
|
+
*
|
|
1068
|
+
* ```proto
|
|
1069
|
+
* message MyInt64 {
|
|
1070
|
+
* // value must be greater than 5 [int64.gt]
|
|
1071
|
+
* int64 value = 1 [(buf.validate.field).int64.gt = 5];
|
|
1072
|
+
*
|
|
1073
|
+
* // value must be greater than 5 and less than 10 [int64.gt_lt]
|
|
1074
|
+
* int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];
|
|
1075
|
+
*
|
|
1076
|
+
* // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]
|
|
1077
|
+
* int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];
|
|
1078
|
+
* }
|
|
1079
|
+
* ```
|
|
1080
|
+
*
|
|
1081
|
+
* @generated from field: int64 gt = 4;
|
|
1082
|
+
*/
|
|
1083
|
+
value: bigint;
|
|
1084
|
+
case: "gt";
|
|
1085
|
+
} | {
|
|
1086
|
+
/**
|
|
1087
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1088
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1089
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1090
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1091
|
+
* an error message is generated.
|
|
1092
|
+
*
|
|
1093
|
+
* ```proto
|
|
1094
|
+
* message MyInt64 {
|
|
1095
|
+
* // value must be greater than or equal to 5 [int64.gte]
|
|
1096
|
+
* int64 value = 1 [(buf.validate.field).int64.gte = 5];
|
|
1097
|
+
*
|
|
1098
|
+
* // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]
|
|
1099
|
+
* int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];
|
|
1100
|
+
*
|
|
1101
|
+
* // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]
|
|
1102
|
+
* int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];
|
|
1103
|
+
* }
|
|
1104
|
+
* ```
|
|
1105
|
+
*
|
|
1106
|
+
* @generated from field: int64 gte = 5;
|
|
1107
|
+
*/
|
|
1108
|
+
value: bigint;
|
|
1109
|
+
case: "gte";
|
|
1110
|
+
} | {
|
|
1111
|
+
case: undefined;
|
|
1112
|
+
value?: undefined;
|
|
1113
|
+
};
|
|
1114
|
+
/**
|
|
1115
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1116
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1117
|
+
* generated.
|
|
1118
|
+
*
|
|
1119
|
+
* ```proto
|
|
1120
|
+
* message MyInt64 {
|
|
1121
|
+
* // value must be in list [1, 2, 3]
|
|
1122
|
+
* int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];
|
|
1123
|
+
* }
|
|
1124
|
+
* ```
|
|
1125
|
+
*
|
|
1126
|
+
* @generated from field: repeated int64 in = 6;
|
|
1127
|
+
*/
|
|
1128
|
+
in: bigint[];
|
|
1129
|
+
/**
|
|
1130
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1131
|
+
* values. If the field value is one of the specified values, an error
|
|
1132
|
+
* message is generated.
|
|
1133
|
+
*
|
|
1134
|
+
* ```proto
|
|
1135
|
+
* message MyInt64 {
|
|
1136
|
+
* // value must not be in list [1, 2, 3]
|
|
1137
|
+
* int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];
|
|
1138
|
+
* }
|
|
1139
|
+
* ```
|
|
1140
|
+
*
|
|
1141
|
+
* @generated from field: repeated int64 not_in = 7;
|
|
1142
|
+
*/
|
|
1143
|
+
notIn: bigint[];
|
|
1144
|
+
/**
|
|
1145
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1146
|
+
* conform to other rules. `example` values will not impact validation
|
|
1147
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1148
|
+
*
|
|
1149
|
+
* ```proto
|
|
1150
|
+
* message MyInt64 {
|
|
1151
|
+
* int64 value = 1 [
|
|
1152
|
+
* (buf.validate.field).int64.example = 1,
|
|
1153
|
+
* (buf.validate.field).int64.example = -10
|
|
1154
|
+
* ];
|
|
1155
|
+
* }
|
|
1156
|
+
* ```
|
|
1157
|
+
*
|
|
1158
|
+
* @generated from field: repeated int64 example = 9;
|
|
1159
|
+
*/
|
|
1160
|
+
example: bigint[];
|
|
1161
|
+
};
|
|
1162
|
+
/**
|
|
1163
|
+
* Describes the message buf.validate.Int64Rules.
|
|
1164
|
+
* Use `create(Int64RulesSchema)` to create a new message.
|
|
1165
|
+
*/
|
|
1166
|
+
export declare const Int64RulesSchema: GenMessage<Int64Rules>;
|
|
1167
|
+
/**
|
|
1168
|
+
* UInt32Rules describes the rules applied to `uint32` values. These
|
|
1169
|
+
* rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.
|
|
1170
|
+
*
|
|
1171
|
+
* @generated from message buf.validate.UInt32Rules
|
|
1172
|
+
*/
|
|
1173
|
+
export type UInt32Rules = Message<"buf.validate.UInt32Rules"> & {
|
|
1174
|
+
/**
|
|
1175
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1176
|
+
* the field value doesn't match, an error message is generated.
|
|
1177
|
+
*
|
|
1178
|
+
* ```proto
|
|
1179
|
+
* message MyUInt32 {
|
|
1180
|
+
* // value must equal 42
|
|
1181
|
+
* uint32 value = 1 [(buf.validate.field).uint32.const = 42];
|
|
1182
|
+
* }
|
|
1183
|
+
* ```
|
|
1184
|
+
*
|
|
1185
|
+
* @generated from field: optional uint32 const = 1;
|
|
1186
|
+
*/
|
|
1187
|
+
const: number;
|
|
1188
|
+
/**
|
|
1189
|
+
* @generated from oneof buf.validate.UInt32Rules.less_than
|
|
1190
|
+
*/
|
|
1191
|
+
lessThan: {
|
|
1192
|
+
/**
|
|
1193
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1194
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
1195
|
+
* an error message is generated.
|
|
1196
|
+
*
|
|
1197
|
+
* ```proto
|
|
1198
|
+
* message MyUInt32 {
|
|
1199
|
+
* // value must be less than 10
|
|
1200
|
+
* uint32 value = 1 [(buf.validate.field).uint32.lt = 10];
|
|
1201
|
+
* }
|
|
1202
|
+
* ```
|
|
1203
|
+
*
|
|
1204
|
+
* @generated from field: uint32 lt = 2;
|
|
1205
|
+
*/
|
|
1206
|
+
value: number;
|
|
1207
|
+
case: "lt";
|
|
1208
|
+
} | {
|
|
1209
|
+
/**
|
|
1210
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1211
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1212
|
+
* value, an error message is generated.
|
|
1213
|
+
*
|
|
1214
|
+
* ```proto
|
|
1215
|
+
* message MyUInt32 {
|
|
1216
|
+
* // value must be less than or equal to 10
|
|
1217
|
+
* uint32 value = 1 [(buf.validate.field).uint32.lte = 10];
|
|
1218
|
+
* }
|
|
1219
|
+
* ```
|
|
1220
|
+
*
|
|
1221
|
+
* @generated from field: uint32 lte = 3;
|
|
1222
|
+
*/
|
|
1223
|
+
value: number;
|
|
1224
|
+
case: "lte";
|
|
1225
|
+
} | {
|
|
1226
|
+
case: undefined;
|
|
1227
|
+
value?: undefined;
|
|
1228
|
+
};
|
|
1229
|
+
/**
|
|
1230
|
+
* @generated from oneof buf.validate.UInt32Rules.greater_than
|
|
1231
|
+
*/
|
|
1232
|
+
greaterThan: {
|
|
1233
|
+
/**
|
|
1234
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1235
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1236
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1237
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1238
|
+
* an error message is generated.
|
|
1239
|
+
*
|
|
1240
|
+
* ```proto
|
|
1241
|
+
* message MyUInt32 {
|
|
1242
|
+
* // value must be greater than 5 [uint32.gt]
|
|
1243
|
+
* uint32 value = 1 [(buf.validate.field).uint32.gt = 5];
|
|
1244
|
+
*
|
|
1245
|
+
* // value must be greater than 5 and less than 10 [uint32.gt_lt]
|
|
1246
|
+
* uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];
|
|
1247
|
+
*
|
|
1248
|
+
* // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]
|
|
1249
|
+
* uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];
|
|
1250
|
+
* }
|
|
1251
|
+
* ```
|
|
1252
|
+
*
|
|
1253
|
+
* @generated from field: uint32 gt = 4;
|
|
1254
|
+
*/
|
|
1255
|
+
value: number;
|
|
1256
|
+
case: "gt";
|
|
1257
|
+
} | {
|
|
1258
|
+
/**
|
|
1259
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1260
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1261
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1262
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1263
|
+
* an error message is generated.
|
|
1264
|
+
*
|
|
1265
|
+
* ```proto
|
|
1266
|
+
* message MyUInt32 {
|
|
1267
|
+
* // value must be greater than or equal to 5 [uint32.gte]
|
|
1268
|
+
* uint32 value = 1 [(buf.validate.field).uint32.gte = 5];
|
|
1269
|
+
*
|
|
1270
|
+
* // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]
|
|
1271
|
+
* uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];
|
|
1272
|
+
*
|
|
1273
|
+
* // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]
|
|
1274
|
+
* uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];
|
|
1275
|
+
* }
|
|
1276
|
+
* ```
|
|
1277
|
+
*
|
|
1278
|
+
* @generated from field: uint32 gte = 5;
|
|
1279
|
+
*/
|
|
1280
|
+
value: number;
|
|
1281
|
+
case: "gte";
|
|
1282
|
+
} | {
|
|
1283
|
+
case: undefined;
|
|
1284
|
+
value?: undefined;
|
|
1285
|
+
};
|
|
1286
|
+
/**
|
|
1287
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1288
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1289
|
+
* generated.
|
|
1290
|
+
*
|
|
1291
|
+
* ```proto
|
|
1292
|
+
* message MyUInt32 {
|
|
1293
|
+
* // value must be in list [1, 2, 3]
|
|
1294
|
+
* uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];
|
|
1295
|
+
* }
|
|
1296
|
+
* ```
|
|
1297
|
+
*
|
|
1298
|
+
* @generated from field: repeated uint32 in = 6;
|
|
1299
|
+
*/
|
|
1300
|
+
in: number[];
|
|
1301
|
+
/**
|
|
1302
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1303
|
+
* values. If the field value is one of the specified values, an error
|
|
1304
|
+
* message is generated.
|
|
1305
|
+
*
|
|
1306
|
+
* ```proto
|
|
1307
|
+
* message MyUInt32 {
|
|
1308
|
+
* // value must not be in list [1, 2, 3]
|
|
1309
|
+
* uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];
|
|
1310
|
+
* }
|
|
1311
|
+
* ```
|
|
1312
|
+
*
|
|
1313
|
+
* @generated from field: repeated uint32 not_in = 7;
|
|
1314
|
+
*/
|
|
1315
|
+
notIn: number[];
|
|
1316
|
+
/**
|
|
1317
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1318
|
+
* conform to other rules. `example` values will not impact validation
|
|
1319
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1320
|
+
*
|
|
1321
|
+
* ```proto
|
|
1322
|
+
* message MyUInt32 {
|
|
1323
|
+
* uint32 value = 1 [
|
|
1324
|
+
* (buf.validate.field).uint32.example = 1,
|
|
1325
|
+
* (buf.validate.field).uint32.example = 10
|
|
1326
|
+
* ];
|
|
1327
|
+
* }
|
|
1328
|
+
* ```
|
|
1329
|
+
*
|
|
1330
|
+
* @generated from field: repeated uint32 example = 8;
|
|
1331
|
+
*/
|
|
1332
|
+
example: number[];
|
|
1333
|
+
};
|
|
1334
|
+
/**
|
|
1335
|
+
* Describes the message buf.validate.UInt32Rules.
|
|
1336
|
+
* Use `create(UInt32RulesSchema)` to create a new message.
|
|
1337
|
+
*/
|
|
1338
|
+
export declare const UInt32RulesSchema: GenMessage<UInt32Rules>;
|
|
1339
|
+
/**
|
|
1340
|
+
* UInt64Rules describes the rules applied to `uint64` values. These
|
|
1341
|
+
* rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
|
|
1342
|
+
*
|
|
1343
|
+
* @generated from message buf.validate.UInt64Rules
|
|
1344
|
+
*/
|
|
1345
|
+
export type UInt64Rules = Message<"buf.validate.UInt64Rules"> & {
|
|
1346
|
+
/**
|
|
1347
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1348
|
+
* the field value doesn't match, an error message is generated.
|
|
1349
|
+
*
|
|
1350
|
+
* ```proto
|
|
1351
|
+
* message MyUInt64 {
|
|
1352
|
+
* // value must equal 42
|
|
1353
|
+
* uint64 value = 1 [(buf.validate.field).uint64.const = 42];
|
|
1354
|
+
* }
|
|
1355
|
+
* ```
|
|
1356
|
+
*
|
|
1357
|
+
* @generated from field: optional uint64 const = 1;
|
|
1358
|
+
*/
|
|
1359
|
+
const: bigint;
|
|
1360
|
+
/**
|
|
1361
|
+
* @generated from oneof buf.validate.UInt64Rules.less_than
|
|
1362
|
+
*/
|
|
1363
|
+
lessThan: {
|
|
1364
|
+
/**
|
|
1365
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1366
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
1367
|
+
* an error message is generated.
|
|
1368
|
+
*
|
|
1369
|
+
* ```proto
|
|
1370
|
+
* message MyUInt64 {
|
|
1371
|
+
* // value must be less than 10
|
|
1372
|
+
* uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
|
|
1373
|
+
* }
|
|
1374
|
+
* ```
|
|
1375
|
+
*
|
|
1376
|
+
* @generated from field: uint64 lt = 2;
|
|
1377
|
+
*/
|
|
1378
|
+
value: bigint;
|
|
1379
|
+
case: "lt";
|
|
1380
|
+
} | {
|
|
1381
|
+
/**
|
|
1382
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1383
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1384
|
+
* value, an error message is generated.
|
|
1385
|
+
*
|
|
1386
|
+
* ```proto
|
|
1387
|
+
* message MyUInt64 {
|
|
1388
|
+
* // value must be less than or equal to 10
|
|
1389
|
+
* uint64 value = 1 [(buf.validate.field).uint64.lte = 10];
|
|
1390
|
+
* }
|
|
1391
|
+
* ```
|
|
1392
|
+
*
|
|
1393
|
+
* @generated from field: uint64 lte = 3;
|
|
1394
|
+
*/
|
|
1395
|
+
value: bigint;
|
|
1396
|
+
case: "lte";
|
|
1397
|
+
} | {
|
|
1398
|
+
case: undefined;
|
|
1399
|
+
value?: undefined;
|
|
1400
|
+
};
|
|
1401
|
+
/**
|
|
1402
|
+
* @generated from oneof buf.validate.UInt64Rules.greater_than
|
|
1403
|
+
*/
|
|
1404
|
+
greaterThan: {
|
|
1405
|
+
/**
|
|
1406
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1407
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1408
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1409
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1410
|
+
* an error message is generated.
|
|
1411
|
+
*
|
|
1412
|
+
* ```proto
|
|
1413
|
+
* message MyUInt64 {
|
|
1414
|
+
* // value must be greater than 5 [uint64.gt]
|
|
1415
|
+
* uint64 value = 1 [(buf.validate.field).uint64.gt = 5];
|
|
1416
|
+
*
|
|
1417
|
+
* // value must be greater than 5 and less than 10 [uint64.gt_lt]
|
|
1418
|
+
* uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];
|
|
1419
|
+
*
|
|
1420
|
+
* // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]
|
|
1421
|
+
* uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];
|
|
1422
|
+
* }
|
|
1423
|
+
* ```
|
|
1424
|
+
*
|
|
1425
|
+
* @generated from field: uint64 gt = 4;
|
|
1426
|
+
*/
|
|
1427
|
+
value: bigint;
|
|
1428
|
+
case: "gt";
|
|
1429
|
+
} | {
|
|
1430
|
+
/**
|
|
1431
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1432
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1433
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1434
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1435
|
+
* an error message is generated.
|
|
1436
|
+
*
|
|
1437
|
+
* ```proto
|
|
1438
|
+
* message MyUInt64 {
|
|
1439
|
+
* // value must be greater than or equal to 5 [uint64.gte]
|
|
1440
|
+
* uint64 value = 1 [(buf.validate.field).uint64.gte = 5];
|
|
1441
|
+
*
|
|
1442
|
+
* // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]
|
|
1443
|
+
* uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];
|
|
1444
|
+
*
|
|
1445
|
+
* // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]
|
|
1446
|
+
* uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];
|
|
1447
|
+
* }
|
|
1448
|
+
* ```
|
|
1449
|
+
*
|
|
1450
|
+
* @generated from field: uint64 gte = 5;
|
|
1451
|
+
*/
|
|
1452
|
+
value: bigint;
|
|
1453
|
+
case: "gte";
|
|
1454
|
+
} | {
|
|
1455
|
+
case: undefined;
|
|
1456
|
+
value?: undefined;
|
|
1457
|
+
};
|
|
1458
|
+
/**
|
|
1459
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1460
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1461
|
+
* generated.
|
|
1462
|
+
*
|
|
1463
|
+
* ```proto
|
|
1464
|
+
* message MyUInt64 {
|
|
1465
|
+
* // value must be in list [1, 2, 3]
|
|
1466
|
+
* uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];
|
|
1467
|
+
* }
|
|
1468
|
+
* ```
|
|
1469
|
+
*
|
|
1470
|
+
* @generated from field: repeated uint64 in = 6;
|
|
1471
|
+
*/
|
|
1472
|
+
in: bigint[];
|
|
1473
|
+
/**
|
|
1474
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1475
|
+
* values. If the field value is one of the specified values, an error
|
|
1476
|
+
* message is generated.
|
|
1477
|
+
*
|
|
1478
|
+
* ```proto
|
|
1479
|
+
* message MyUInt64 {
|
|
1480
|
+
* // value must not be in list [1, 2, 3]
|
|
1481
|
+
* uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];
|
|
1482
|
+
* }
|
|
1483
|
+
* ```
|
|
1484
|
+
*
|
|
1485
|
+
* @generated from field: repeated uint64 not_in = 7;
|
|
1486
|
+
*/
|
|
1487
|
+
notIn: bigint[];
|
|
1488
|
+
/**
|
|
1489
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1490
|
+
* conform to other rules. `example` values will not impact validation
|
|
1491
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1492
|
+
*
|
|
1493
|
+
* ```proto
|
|
1494
|
+
* message MyUInt64 {
|
|
1495
|
+
* uint64 value = 1 [
|
|
1496
|
+
* (buf.validate.field).uint64.example = 1,
|
|
1497
|
+
* (buf.validate.field).uint64.example = -10
|
|
1498
|
+
* ];
|
|
1499
|
+
* }
|
|
1500
|
+
* ```
|
|
1501
|
+
*
|
|
1502
|
+
* @generated from field: repeated uint64 example = 8;
|
|
1503
|
+
*/
|
|
1504
|
+
example: bigint[];
|
|
1505
|
+
};
|
|
1506
|
+
/**
|
|
1507
|
+
* Describes the message buf.validate.UInt64Rules.
|
|
1508
|
+
* Use `create(UInt64RulesSchema)` to create a new message.
|
|
1509
|
+
*/
|
|
1510
|
+
export declare const UInt64RulesSchema: GenMessage<UInt64Rules>;
|
|
1511
|
+
/**
|
|
1512
|
+
* SInt32Rules describes the rules applied to `sint32` values.
|
|
1513
|
+
*
|
|
1514
|
+
* @generated from message buf.validate.SInt32Rules
|
|
1515
|
+
*/
|
|
1516
|
+
export type SInt32Rules = Message<"buf.validate.SInt32Rules"> & {
|
|
1517
|
+
/**
|
|
1518
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1519
|
+
* the field value doesn't match, an error message is generated.
|
|
1520
|
+
*
|
|
1521
|
+
* ```proto
|
|
1522
|
+
* message MySInt32 {
|
|
1523
|
+
* // value must equal 42
|
|
1524
|
+
* sint32 value = 1 [(buf.validate.field).sint32.const = 42];
|
|
1525
|
+
* }
|
|
1526
|
+
* ```
|
|
1527
|
+
*
|
|
1528
|
+
* @generated from field: optional sint32 const = 1;
|
|
1529
|
+
*/
|
|
1530
|
+
const: number;
|
|
1531
|
+
/**
|
|
1532
|
+
* @generated from oneof buf.validate.SInt32Rules.less_than
|
|
1533
|
+
*/
|
|
1534
|
+
lessThan: {
|
|
1535
|
+
/**
|
|
1536
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
1537
|
+
* < value). If the field value is equal to or greater than the specified
|
|
1538
|
+
* value, an error message is generated.
|
|
1539
|
+
*
|
|
1540
|
+
* ```proto
|
|
1541
|
+
* message MySInt32 {
|
|
1542
|
+
* // value must be less than 10
|
|
1543
|
+
* sint32 value = 1 [(buf.validate.field).sint32.lt = 10];
|
|
1544
|
+
* }
|
|
1545
|
+
* ```
|
|
1546
|
+
*
|
|
1547
|
+
* @generated from field: sint32 lt = 2;
|
|
1548
|
+
*/
|
|
1549
|
+
value: number;
|
|
1550
|
+
case: "lt";
|
|
1551
|
+
} | {
|
|
1552
|
+
/**
|
|
1553
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1554
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1555
|
+
* value, an error message is generated.
|
|
1556
|
+
*
|
|
1557
|
+
* ```proto
|
|
1558
|
+
* message MySInt32 {
|
|
1559
|
+
* // value must be less than or equal to 10
|
|
1560
|
+
* sint32 value = 1 [(buf.validate.field).sint32.lte = 10];
|
|
1561
|
+
* }
|
|
1562
|
+
* ```
|
|
1563
|
+
*
|
|
1564
|
+
* @generated from field: sint32 lte = 3;
|
|
1565
|
+
*/
|
|
1566
|
+
value: number;
|
|
1567
|
+
case: "lte";
|
|
1568
|
+
} | {
|
|
1569
|
+
case: undefined;
|
|
1570
|
+
value?: undefined;
|
|
1571
|
+
};
|
|
1572
|
+
/**
|
|
1573
|
+
* @generated from oneof buf.validate.SInt32Rules.greater_than
|
|
1574
|
+
*/
|
|
1575
|
+
greaterThan: {
|
|
1576
|
+
/**
|
|
1577
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1578
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1579
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1580
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1581
|
+
* an error message is generated.
|
|
1582
|
+
*
|
|
1583
|
+
* ```proto
|
|
1584
|
+
* message MySInt32 {
|
|
1585
|
+
* // value must be greater than 5 [sint32.gt]
|
|
1586
|
+
* sint32 value = 1 [(buf.validate.field).sint32.gt = 5];
|
|
1587
|
+
*
|
|
1588
|
+
* // value must be greater than 5 and less than 10 [sint32.gt_lt]
|
|
1589
|
+
* sint32 other_value = 2 [(buf.validate.field).sint32 = { gt: 5, lt: 10 }];
|
|
1590
|
+
*
|
|
1591
|
+
* // value must be greater than 10 or less than 5 [sint32.gt_lt_exclusive]
|
|
1592
|
+
* sint32 another_value = 3 [(buf.validate.field).sint32 = { gt: 10, lt: 5 }];
|
|
1593
|
+
* }
|
|
1594
|
+
* ```
|
|
1595
|
+
*
|
|
1596
|
+
* @generated from field: sint32 gt = 4;
|
|
1597
|
+
*/
|
|
1598
|
+
value: number;
|
|
1599
|
+
case: "gt";
|
|
1600
|
+
} | {
|
|
1601
|
+
/**
|
|
1602
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1603
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1604
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1605
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1606
|
+
* an error message is generated.
|
|
1607
|
+
*
|
|
1608
|
+
* ```proto
|
|
1609
|
+
* message MySInt32 {
|
|
1610
|
+
* // value must be greater than or equal to 5 [sint32.gte]
|
|
1611
|
+
* sint32 value = 1 [(buf.validate.field).sint32.gte = 5];
|
|
1612
|
+
*
|
|
1613
|
+
* // value must be greater than or equal to 5 and less than 10 [sint32.gte_lt]
|
|
1614
|
+
* sint32 other_value = 2 [(buf.validate.field).sint32 = { gte: 5, lt: 10 }];
|
|
1615
|
+
*
|
|
1616
|
+
* // value must be greater than or equal to 10 or less than 5 [sint32.gte_lt_exclusive]
|
|
1617
|
+
* sint32 another_value = 3 [(buf.validate.field).sint32 = { gte: 10, lt: 5 }];
|
|
1618
|
+
* }
|
|
1619
|
+
* ```
|
|
1620
|
+
*
|
|
1621
|
+
* @generated from field: sint32 gte = 5;
|
|
1622
|
+
*/
|
|
1623
|
+
value: number;
|
|
1624
|
+
case: "gte";
|
|
1625
|
+
} | {
|
|
1626
|
+
case: undefined;
|
|
1627
|
+
value?: undefined;
|
|
1628
|
+
};
|
|
1629
|
+
/**
|
|
1630
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1631
|
+
* If the field value isn't one of the specified values, an error message is
|
|
1632
|
+
* generated.
|
|
1633
|
+
*
|
|
1634
|
+
* ```proto
|
|
1635
|
+
* message MySInt32 {
|
|
1636
|
+
* // value must be in list [1, 2, 3]
|
|
1637
|
+
* sint32 value = 1 [(buf.validate.field).sint32 = { in: [1, 2, 3] }];
|
|
1638
|
+
* }
|
|
1639
|
+
* ```
|
|
1640
|
+
*
|
|
1641
|
+
* @generated from field: repeated sint32 in = 6;
|
|
1642
|
+
*/
|
|
1643
|
+
in: number[];
|
|
1644
|
+
/**
|
|
1645
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1646
|
+
* values. If the field value is one of the specified values, an error
|
|
1647
|
+
* message is generated.
|
|
1648
|
+
*
|
|
1649
|
+
* ```proto
|
|
1650
|
+
* message MySInt32 {
|
|
1651
|
+
* // value must not be in list [1, 2, 3]
|
|
1652
|
+
* sint32 value = 1 [(buf.validate.field).sint32 = { not_in: [1, 2, 3] }];
|
|
1653
|
+
* }
|
|
1654
|
+
* ```
|
|
1655
|
+
*
|
|
1656
|
+
* @generated from field: repeated sint32 not_in = 7;
|
|
1657
|
+
*/
|
|
1658
|
+
notIn: number[];
|
|
1659
|
+
/**
|
|
1660
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1661
|
+
* conform to other rules. `example` values will not impact validation
|
|
1662
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1663
|
+
*
|
|
1664
|
+
* ```proto
|
|
1665
|
+
* message MySInt32 {
|
|
1666
|
+
* sint32 value = 1 [
|
|
1667
|
+
* (buf.validate.field).sint32.example = 1,
|
|
1668
|
+
* (buf.validate.field).sint32.example = -10
|
|
1669
|
+
* ];
|
|
1670
|
+
* }
|
|
1671
|
+
* ```
|
|
1672
|
+
*
|
|
1673
|
+
* @generated from field: repeated sint32 example = 8;
|
|
1674
|
+
*/
|
|
1675
|
+
example: number[];
|
|
1676
|
+
};
|
|
1677
|
+
/**
|
|
1678
|
+
* Describes the message buf.validate.SInt32Rules.
|
|
1679
|
+
* Use `create(SInt32RulesSchema)` to create a new message.
|
|
1680
|
+
*/
|
|
1681
|
+
export declare const SInt32RulesSchema: GenMessage<SInt32Rules>;
|
|
1682
|
+
/**
|
|
1683
|
+
* SInt64Rules describes the rules applied to `sint64` values.
|
|
1684
|
+
*
|
|
1685
|
+
* @generated from message buf.validate.SInt64Rules
|
|
1686
|
+
*/
|
|
1687
|
+
export type SInt64Rules = Message<"buf.validate.SInt64Rules"> & {
|
|
1688
|
+
/**
|
|
1689
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
1690
|
+
* the field value doesn't match, an error message is generated.
|
|
1691
|
+
*
|
|
1692
|
+
* ```proto
|
|
1693
|
+
* message MySInt64 {
|
|
1694
|
+
* // value must equal 42
|
|
1695
|
+
* sint64 value = 1 [(buf.validate.field).sint64.const = 42];
|
|
1696
|
+
* }
|
|
1697
|
+
* ```
|
|
1698
|
+
*
|
|
1699
|
+
* @generated from field: optional sint64 const = 1;
|
|
1700
|
+
*/
|
|
1701
|
+
const: bigint;
|
|
1702
|
+
/**
|
|
1703
|
+
* @generated from oneof buf.validate.SInt64Rules.less_than
|
|
1704
|
+
*/
|
|
1705
|
+
lessThan: {
|
|
1706
|
+
/**
|
|
1707
|
+
* `lt` requires the field value to be less than the specified value (field
|
|
1708
|
+
* < value). If the field value is equal to or greater than the specified
|
|
1709
|
+
* value, an error message is generated.
|
|
1710
|
+
*
|
|
1711
|
+
* ```proto
|
|
1712
|
+
* message MySInt64 {
|
|
1713
|
+
* // value must be less than 10
|
|
1714
|
+
* sint64 value = 1 [(buf.validate.field).sint64.lt = 10];
|
|
1715
|
+
* }
|
|
1716
|
+
* ```
|
|
1717
|
+
*
|
|
1718
|
+
* @generated from field: sint64 lt = 2;
|
|
1719
|
+
*/
|
|
1720
|
+
value: bigint;
|
|
1721
|
+
case: "lt";
|
|
1722
|
+
} | {
|
|
1723
|
+
/**
|
|
1724
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1725
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1726
|
+
* value, an error message is generated.
|
|
1727
|
+
*
|
|
1728
|
+
* ```proto
|
|
1729
|
+
* message MySInt64 {
|
|
1730
|
+
* // value must be less than or equal to 10
|
|
1731
|
+
* sint64 value = 1 [(buf.validate.field).sint64.lte = 10];
|
|
1732
|
+
* }
|
|
1733
|
+
* ```
|
|
1734
|
+
*
|
|
1735
|
+
* @generated from field: sint64 lte = 3;
|
|
1736
|
+
*/
|
|
1737
|
+
value: bigint;
|
|
1738
|
+
case: "lte";
|
|
1739
|
+
} | {
|
|
1740
|
+
case: undefined;
|
|
1741
|
+
value?: undefined;
|
|
1742
|
+
};
|
|
1743
|
+
/**
|
|
1744
|
+
* @generated from oneof buf.validate.SInt64Rules.greater_than
|
|
1745
|
+
*/
|
|
1746
|
+
greaterThan: {
|
|
1747
|
+
/**
|
|
1748
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1749
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1750
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1751
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1752
|
+
* an error message is generated.
|
|
1753
|
+
*
|
|
1754
|
+
* ```proto
|
|
1755
|
+
* message MySInt64 {
|
|
1756
|
+
* // value must be greater than 5 [sint64.gt]
|
|
1757
|
+
* sint64 value = 1 [(buf.validate.field).sint64.gt = 5];
|
|
1758
|
+
*
|
|
1759
|
+
* // value must be greater than 5 and less than 10 [sint64.gt_lt]
|
|
1760
|
+
* sint64 other_value = 2 [(buf.validate.field).sint64 = { gt: 5, lt: 10 }];
|
|
1761
|
+
*
|
|
1762
|
+
* // value must be greater than 10 or less than 5 [sint64.gt_lt_exclusive]
|
|
1763
|
+
* sint64 another_value = 3 [(buf.validate.field).sint64 = { gt: 10, lt: 5 }];
|
|
1764
|
+
* }
|
|
1765
|
+
* ```
|
|
1766
|
+
*
|
|
1767
|
+
* @generated from field: sint64 gt = 4;
|
|
1768
|
+
*/
|
|
1769
|
+
value: bigint;
|
|
1770
|
+
case: "gt";
|
|
1771
|
+
} | {
|
|
1772
|
+
/**
|
|
1773
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1774
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1775
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1776
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1777
|
+
* an error message is generated.
|
|
1778
|
+
*
|
|
1779
|
+
* ```proto
|
|
1780
|
+
* message MySInt64 {
|
|
1781
|
+
* // value must be greater than or equal to 5 [sint64.gte]
|
|
1782
|
+
* sint64 value = 1 [(buf.validate.field).sint64.gte = 5];
|
|
1783
|
+
*
|
|
1784
|
+
* // value must be greater than or equal to 5 and less than 10 [sint64.gte_lt]
|
|
1785
|
+
* sint64 other_value = 2 [(buf.validate.field).sint64 = { gte: 5, lt: 10 }];
|
|
1786
|
+
*
|
|
1787
|
+
* // value must be greater than or equal to 10 or less than 5 [sint64.gte_lt_exclusive]
|
|
1788
|
+
* sint64 another_value = 3 [(buf.validate.field).sint64 = { gte: 10, lt: 5 }];
|
|
1789
|
+
* }
|
|
1790
|
+
* ```
|
|
1791
|
+
*
|
|
1792
|
+
* @generated from field: sint64 gte = 5;
|
|
1793
|
+
*/
|
|
1794
|
+
value: bigint;
|
|
1795
|
+
case: "gte";
|
|
1796
|
+
} | {
|
|
1797
|
+
case: undefined;
|
|
1798
|
+
value?: undefined;
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1802
|
+
* If the field value isn't one of the specified values, an error message
|
|
1803
|
+
* is generated.
|
|
1804
|
+
*
|
|
1805
|
+
* ```proto
|
|
1806
|
+
* message MySInt64 {
|
|
1807
|
+
* // value must be in list [1, 2, 3]
|
|
1808
|
+
* sint64 value = 1 [(buf.validate.field).sint64 = { in: [1, 2, 3] }];
|
|
1809
|
+
* }
|
|
1810
|
+
* ```
|
|
1811
|
+
*
|
|
1812
|
+
* @generated from field: repeated sint64 in = 6;
|
|
1813
|
+
*/
|
|
1814
|
+
in: bigint[];
|
|
1815
|
+
/**
|
|
1816
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1817
|
+
* values. If the field value is one of the specified values, an error
|
|
1818
|
+
* message is generated.
|
|
1819
|
+
*
|
|
1820
|
+
* ```proto
|
|
1821
|
+
* message MySInt64 {
|
|
1822
|
+
* // value must not be in list [1, 2, 3]
|
|
1823
|
+
* sint64 value = 1 [(buf.validate.field).sint64 = { not_in: [1, 2, 3] }];
|
|
1824
|
+
* }
|
|
1825
|
+
* ```
|
|
1826
|
+
*
|
|
1827
|
+
* @generated from field: repeated sint64 not_in = 7;
|
|
1828
|
+
*/
|
|
1829
|
+
notIn: bigint[];
|
|
1830
|
+
/**
|
|
1831
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
1832
|
+
* conform to other rules. `example` values will not impact validation
|
|
1833
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
1834
|
+
*
|
|
1835
|
+
* ```proto
|
|
1836
|
+
* message MySInt64 {
|
|
1837
|
+
* sint64 value = 1 [
|
|
1838
|
+
* (buf.validate.field).sint64.example = 1,
|
|
1839
|
+
* (buf.validate.field).sint64.example = -10
|
|
1840
|
+
* ];
|
|
1841
|
+
* }
|
|
1842
|
+
* ```
|
|
1843
|
+
*
|
|
1844
|
+
* @generated from field: repeated sint64 example = 8;
|
|
1845
|
+
*/
|
|
1846
|
+
example: bigint[];
|
|
1847
|
+
};
|
|
1848
|
+
/**
|
|
1849
|
+
* Describes the message buf.validate.SInt64Rules.
|
|
1850
|
+
* Use `create(SInt64RulesSchema)` to create a new message.
|
|
1851
|
+
*/
|
|
1852
|
+
export declare const SInt64RulesSchema: GenMessage<SInt64Rules>;
|
|
1853
|
+
/**
|
|
1854
|
+
* Fixed32Rules describes the rules applied to `fixed32` values.
|
|
1855
|
+
*
|
|
1856
|
+
* @generated from message buf.validate.Fixed32Rules
|
|
1857
|
+
*/
|
|
1858
|
+
export type Fixed32Rules = Message<"buf.validate.Fixed32Rules"> & {
|
|
1859
|
+
/**
|
|
1860
|
+
* `const` requires the field value to exactly match the specified value.
|
|
1861
|
+
* If the field value doesn't match, an error message is generated.
|
|
1862
|
+
*
|
|
1863
|
+
* ```proto
|
|
1864
|
+
* message MyFixed32 {
|
|
1865
|
+
* // value must equal 42
|
|
1866
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.const = 42];
|
|
1867
|
+
* }
|
|
1868
|
+
* ```
|
|
1869
|
+
*
|
|
1870
|
+
* @generated from field: optional fixed32 const = 1;
|
|
1871
|
+
*/
|
|
1872
|
+
const: number;
|
|
1873
|
+
/**
|
|
1874
|
+
* @generated from oneof buf.validate.Fixed32Rules.less_than
|
|
1875
|
+
*/
|
|
1876
|
+
lessThan: {
|
|
1877
|
+
/**
|
|
1878
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
1879
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
1880
|
+
* an error message is generated.
|
|
1881
|
+
*
|
|
1882
|
+
* ```proto
|
|
1883
|
+
* message MyFixed32 {
|
|
1884
|
+
* // value must be less than 10
|
|
1885
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.lt = 10];
|
|
1886
|
+
* }
|
|
1887
|
+
* ```
|
|
1888
|
+
*
|
|
1889
|
+
* @generated from field: fixed32 lt = 2;
|
|
1890
|
+
*/
|
|
1891
|
+
value: number;
|
|
1892
|
+
case: "lt";
|
|
1893
|
+
} | {
|
|
1894
|
+
/**
|
|
1895
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
1896
|
+
* value (field <= value). If the field value is greater than the specified
|
|
1897
|
+
* value, an error message is generated.
|
|
1898
|
+
*
|
|
1899
|
+
* ```proto
|
|
1900
|
+
* message MyFixed32 {
|
|
1901
|
+
* // value must be less than or equal to 10
|
|
1902
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.lte = 10];
|
|
1903
|
+
* }
|
|
1904
|
+
* ```
|
|
1905
|
+
*
|
|
1906
|
+
* @generated from field: fixed32 lte = 3;
|
|
1907
|
+
*/
|
|
1908
|
+
value: number;
|
|
1909
|
+
case: "lte";
|
|
1910
|
+
} | {
|
|
1911
|
+
case: undefined;
|
|
1912
|
+
value?: undefined;
|
|
1913
|
+
};
|
|
1914
|
+
/**
|
|
1915
|
+
* @generated from oneof buf.validate.Fixed32Rules.greater_than
|
|
1916
|
+
*/
|
|
1917
|
+
greaterThan: {
|
|
1918
|
+
/**
|
|
1919
|
+
* `gt` requires the field value to be greater than the specified value
|
|
1920
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
1921
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
1922
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1923
|
+
* an error message is generated.
|
|
1924
|
+
*
|
|
1925
|
+
* ```proto
|
|
1926
|
+
* message MyFixed32 {
|
|
1927
|
+
* // value must be greater than 5 [fixed32.gt]
|
|
1928
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.gt = 5];
|
|
1929
|
+
*
|
|
1930
|
+
* // value must be greater than 5 and less than 10 [fixed32.gt_lt]
|
|
1931
|
+
* fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gt: 5, lt: 10 }];
|
|
1932
|
+
*
|
|
1933
|
+
* // value must be greater than 10 or less than 5 [fixed32.gt_lt_exclusive]
|
|
1934
|
+
* fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gt: 10, lt: 5 }];
|
|
1935
|
+
* }
|
|
1936
|
+
* ```
|
|
1937
|
+
*
|
|
1938
|
+
* @generated from field: fixed32 gt = 4;
|
|
1939
|
+
*/
|
|
1940
|
+
value: number;
|
|
1941
|
+
case: "gt";
|
|
1942
|
+
} | {
|
|
1943
|
+
/**
|
|
1944
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
1945
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
1946
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
1947
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
1948
|
+
* an error message is generated.
|
|
1949
|
+
*
|
|
1950
|
+
* ```proto
|
|
1951
|
+
* message MyFixed32 {
|
|
1952
|
+
* // value must be greater than or equal to 5 [fixed32.gte]
|
|
1953
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32.gte = 5];
|
|
1954
|
+
*
|
|
1955
|
+
* // value must be greater than or equal to 5 and less than 10 [fixed32.gte_lt]
|
|
1956
|
+
* fixed32 other_value = 2 [(buf.validate.field).fixed32 = { gte: 5, lt: 10 }];
|
|
1957
|
+
*
|
|
1958
|
+
* // value must be greater than or equal to 10 or less than 5 [fixed32.gte_lt_exclusive]
|
|
1959
|
+
* fixed32 another_value = 3 [(buf.validate.field).fixed32 = { gte: 10, lt: 5 }];
|
|
1960
|
+
* }
|
|
1961
|
+
* ```
|
|
1962
|
+
*
|
|
1963
|
+
* @generated from field: fixed32 gte = 5;
|
|
1964
|
+
*/
|
|
1965
|
+
value: number;
|
|
1966
|
+
case: "gte";
|
|
1967
|
+
} | {
|
|
1968
|
+
case: undefined;
|
|
1969
|
+
value?: undefined;
|
|
1970
|
+
};
|
|
1971
|
+
/**
|
|
1972
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
1973
|
+
* If the field value isn't one of the specified values, an error message
|
|
1974
|
+
* is generated.
|
|
1975
|
+
*
|
|
1976
|
+
* ```proto
|
|
1977
|
+
* message MyFixed32 {
|
|
1978
|
+
* // value must be in list [1, 2, 3]
|
|
1979
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32 = { in: [1, 2, 3] }];
|
|
1980
|
+
* }
|
|
1981
|
+
* ```
|
|
1982
|
+
*
|
|
1983
|
+
* @generated from field: repeated fixed32 in = 6;
|
|
1984
|
+
*/
|
|
1985
|
+
in: number[];
|
|
1986
|
+
/**
|
|
1987
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
1988
|
+
* values. If the field value is one of the specified values, an error
|
|
1989
|
+
* message is generated.
|
|
1990
|
+
*
|
|
1991
|
+
* ```proto
|
|
1992
|
+
* message MyFixed32 {
|
|
1993
|
+
* // value must not be in list [1, 2, 3]
|
|
1994
|
+
* fixed32 value = 1 [(buf.validate.field).fixed32 = { not_in: [1, 2, 3] }];
|
|
1995
|
+
* }
|
|
1996
|
+
* ```
|
|
1997
|
+
*
|
|
1998
|
+
* @generated from field: repeated fixed32 not_in = 7;
|
|
1999
|
+
*/
|
|
2000
|
+
notIn: number[];
|
|
2001
|
+
/**
|
|
2002
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2003
|
+
* conform to other rules. `example` values will not impact validation
|
|
2004
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2005
|
+
*
|
|
2006
|
+
* ```proto
|
|
2007
|
+
* message MyFixed32 {
|
|
2008
|
+
* fixed32 value = 1 [
|
|
2009
|
+
* (buf.validate.field).fixed32.example = 1,
|
|
2010
|
+
* (buf.validate.field).fixed32.example = 2
|
|
2011
|
+
* ];
|
|
2012
|
+
* }
|
|
2013
|
+
* ```
|
|
2014
|
+
*
|
|
2015
|
+
* @generated from field: repeated fixed32 example = 8;
|
|
2016
|
+
*/
|
|
2017
|
+
example: number[];
|
|
2018
|
+
};
|
|
2019
|
+
/**
|
|
2020
|
+
* Describes the message buf.validate.Fixed32Rules.
|
|
2021
|
+
* Use `create(Fixed32RulesSchema)` to create a new message.
|
|
2022
|
+
*/
|
|
2023
|
+
export declare const Fixed32RulesSchema: GenMessage<Fixed32Rules>;
|
|
2024
|
+
/**
|
|
2025
|
+
* Fixed64Rules describes the rules applied to `fixed64` values.
|
|
2026
|
+
*
|
|
2027
|
+
* @generated from message buf.validate.Fixed64Rules
|
|
2028
|
+
*/
|
|
2029
|
+
export type Fixed64Rules = Message<"buf.validate.Fixed64Rules"> & {
|
|
2030
|
+
/**
|
|
2031
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2032
|
+
* the field value doesn't match, an error message is generated.
|
|
2033
|
+
*
|
|
2034
|
+
* ```proto
|
|
2035
|
+
* message MyFixed64 {
|
|
2036
|
+
* // value must equal 42
|
|
2037
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.const = 42];
|
|
2038
|
+
* }
|
|
2039
|
+
* ```
|
|
2040
|
+
*
|
|
2041
|
+
* @generated from field: optional fixed64 const = 1;
|
|
2042
|
+
*/
|
|
2043
|
+
const: bigint;
|
|
2044
|
+
/**
|
|
2045
|
+
* @generated from oneof buf.validate.Fixed64Rules.less_than
|
|
2046
|
+
*/
|
|
2047
|
+
lessThan: {
|
|
2048
|
+
/**
|
|
2049
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
2050
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
2051
|
+
* an error message is generated.
|
|
2052
|
+
*
|
|
2053
|
+
* ```proto
|
|
2054
|
+
* message MyFixed64 {
|
|
2055
|
+
* // value must be less than 10
|
|
2056
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.lt = 10];
|
|
2057
|
+
* }
|
|
2058
|
+
* ```
|
|
2059
|
+
*
|
|
2060
|
+
* @generated from field: fixed64 lt = 2;
|
|
2061
|
+
*/
|
|
2062
|
+
value: bigint;
|
|
2063
|
+
case: "lt";
|
|
2064
|
+
} | {
|
|
2065
|
+
/**
|
|
2066
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
2067
|
+
* value (field <= value). If the field value is greater than the specified
|
|
2068
|
+
* value, an error message is generated.
|
|
2069
|
+
*
|
|
2070
|
+
* ```proto
|
|
2071
|
+
* message MyFixed64 {
|
|
2072
|
+
* // value must be less than or equal to 10
|
|
2073
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.lte = 10];
|
|
2074
|
+
* }
|
|
2075
|
+
* ```
|
|
2076
|
+
*
|
|
2077
|
+
* @generated from field: fixed64 lte = 3;
|
|
2078
|
+
*/
|
|
2079
|
+
value: bigint;
|
|
2080
|
+
case: "lte";
|
|
2081
|
+
} | {
|
|
2082
|
+
case: undefined;
|
|
2083
|
+
value?: undefined;
|
|
2084
|
+
};
|
|
2085
|
+
/**
|
|
2086
|
+
* @generated from oneof buf.validate.Fixed64Rules.greater_than
|
|
2087
|
+
*/
|
|
2088
|
+
greaterThan: {
|
|
2089
|
+
/**
|
|
2090
|
+
* `gt` requires the field value to be greater than the specified value
|
|
2091
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
2092
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
2093
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2094
|
+
* an error message is generated.
|
|
2095
|
+
*
|
|
2096
|
+
* ```proto
|
|
2097
|
+
* message MyFixed64 {
|
|
2098
|
+
* // value must be greater than 5 [fixed64.gt]
|
|
2099
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.gt = 5];
|
|
2100
|
+
*
|
|
2101
|
+
* // value must be greater than 5 and less than 10 [fixed64.gt_lt]
|
|
2102
|
+
* fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gt: 5, lt: 10 }];
|
|
2103
|
+
*
|
|
2104
|
+
* // value must be greater than 10 or less than 5 [fixed64.gt_lt_exclusive]
|
|
2105
|
+
* fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gt: 10, lt: 5 }];
|
|
2106
|
+
* }
|
|
2107
|
+
* ```
|
|
2108
|
+
*
|
|
2109
|
+
* @generated from field: fixed64 gt = 4;
|
|
2110
|
+
*/
|
|
2111
|
+
value: bigint;
|
|
2112
|
+
case: "gt";
|
|
2113
|
+
} | {
|
|
2114
|
+
/**
|
|
2115
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
2116
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
2117
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
2118
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2119
|
+
* an error message is generated.
|
|
2120
|
+
*
|
|
2121
|
+
* ```proto
|
|
2122
|
+
* message MyFixed64 {
|
|
2123
|
+
* // value must be greater than or equal to 5 [fixed64.gte]
|
|
2124
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64.gte = 5];
|
|
2125
|
+
*
|
|
2126
|
+
* // value must be greater than or equal to 5 and less than 10 [fixed64.gte_lt]
|
|
2127
|
+
* fixed64 other_value = 2 [(buf.validate.field).fixed64 = { gte: 5, lt: 10 }];
|
|
2128
|
+
*
|
|
2129
|
+
* // value must be greater than or equal to 10 or less than 5 [fixed64.gte_lt_exclusive]
|
|
2130
|
+
* fixed64 another_value = 3 [(buf.validate.field).fixed64 = { gte: 10, lt: 5 }];
|
|
2131
|
+
* }
|
|
2132
|
+
* ```
|
|
2133
|
+
*
|
|
2134
|
+
* @generated from field: fixed64 gte = 5;
|
|
2135
|
+
*/
|
|
2136
|
+
value: bigint;
|
|
2137
|
+
case: "gte";
|
|
2138
|
+
} | {
|
|
2139
|
+
case: undefined;
|
|
2140
|
+
value?: undefined;
|
|
2141
|
+
};
|
|
2142
|
+
/**
|
|
2143
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
2144
|
+
* If the field value isn't one of the specified values, an error message is
|
|
2145
|
+
* generated.
|
|
2146
|
+
*
|
|
2147
|
+
* ```proto
|
|
2148
|
+
* message MyFixed64 {
|
|
2149
|
+
* // value must be in list [1, 2, 3]
|
|
2150
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64 = { in: [1, 2, 3] }];
|
|
2151
|
+
* }
|
|
2152
|
+
* ```
|
|
2153
|
+
*
|
|
2154
|
+
* @generated from field: repeated fixed64 in = 6;
|
|
2155
|
+
*/
|
|
2156
|
+
in: bigint[];
|
|
2157
|
+
/**
|
|
2158
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
2159
|
+
* values. If the field value is one of the specified values, an error
|
|
2160
|
+
* message is generated.
|
|
2161
|
+
*
|
|
2162
|
+
* ```proto
|
|
2163
|
+
* message MyFixed64 {
|
|
2164
|
+
* // value must not be in list [1, 2, 3]
|
|
2165
|
+
* fixed64 value = 1 [(buf.validate.field).fixed64 = { not_in: [1, 2, 3] }];
|
|
2166
|
+
* }
|
|
2167
|
+
* ```
|
|
2168
|
+
*
|
|
2169
|
+
* @generated from field: repeated fixed64 not_in = 7;
|
|
2170
|
+
*/
|
|
2171
|
+
notIn: bigint[];
|
|
2172
|
+
/**
|
|
2173
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2174
|
+
* conform to other rules. `example` values will not impact validation
|
|
2175
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2176
|
+
*
|
|
2177
|
+
* ```proto
|
|
2178
|
+
* message MyFixed64 {
|
|
2179
|
+
* fixed64 value = 1 [
|
|
2180
|
+
* (buf.validate.field).fixed64.example = 1,
|
|
2181
|
+
* (buf.validate.field).fixed64.example = 2
|
|
2182
|
+
* ];
|
|
2183
|
+
* }
|
|
2184
|
+
* ```
|
|
2185
|
+
*
|
|
2186
|
+
* @generated from field: repeated fixed64 example = 8;
|
|
2187
|
+
*/
|
|
2188
|
+
example: bigint[];
|
|
2189
|
+
};
|
|
2190
|
+
/**
|
|
2191
|
+
* Describes the message buf.validate.Fixed64Rules.
|
|
2192
|
+
* Use `create(Fixed64RulesSchema)` to create a new message.
|
|
2193
|
+
*/
|
|
2194
|
+
export declare const Fixed64RulesSchema: GenMessage<Fixed64Rules>;
|
|
2195
|
+
/**
|
|
2196
|
+
* SFixed32Rules describes the rules applied to `fixed32` values.
|
|
2197
|
+
*
|
|
2198
|
+
* @generated from message buf.validate.SFixed32Rules
|
|
2199
|
+
*/
|
|
2200
|
+
export type SFixed32Rules = Message<"buf.validate.SFixed32Rules"> & {
|
|
2201
|
+
/**
|
|
2202
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2203
|
+
* the field value doesn't match, an error message is generated.
|
|
2204
|
+
*
|
|
2205
|
+
* ```proto
|
|
2206
|
+
* message MySFixed32 {
|
|
2207
|
+
* // value must equal 42
|
|
2208
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.const = 42];
|
|
2209
|
+
* }
|
|
2210
|
+
* ```
|
|
2211
|
+
*
|
|
2212
|
+
* @generated from field: optional sfixed32 const = 1;
|
|
2213
|
+
*/
|
|
2214
|
+
const: number;
|
|
2215
|
+
/**
|
|
2216
|
+
* @generated from oneof buf.validate.SFixed32Rules.less_than
|
|
2217
|
+
*/
|
|
2218
|
+
lessThan: {
|
|
2219
|
+
/**
|
|
2220
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
2221
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
2222
|
+
* an error message is generated.
|
|
2223
|
+
*
|
|
2224
|
+
* ```proto
|
|
2225
|
+
* message MySFixed32 {
|
|
2226
|
+
* // value must be less than 10
|
|
2227
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.lt = 10];
|
|
2228
|
+
* }
|
|
2229
|
+
* ```
|
|
2230
|
+
*
|
|
2231
|
+
* @generated from field: sfixed32 lt = 2;
|
|
2232
|
+
*/
|
|
2233
|
+
value: number;
|
|
2234
|
+
case: "lt";
|
|
2235
|
+
} | {
|
|
2236
|
+
/**
|
|
2237
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
2238
|
+
* value (field <= value). If the field value is greater than the specified
|
|
2239
|
+
* value, an error message is generated.
|
|
2240
|
+
*
|
|
2241
|
+
* ```proto
|
|
2242
|
+
* message MySFixed32 {
|
|
2243
|
+
* // value must be less than or equal to 10
|
|
2244
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.lte = 10];
|
|
2245
|
+
* }
|
|
2246
|
+
* ```
|
|
2247
|
+
*
|
|
2248
|
+
* @generated from field: sfixed32 lte = 3;
|
|
2249
|
+
*/
|
|
2250
|
+
value: number;
|
|
2251
|
+
case: "lte";
|
|
2252
|
+
} | {
|
|
2253
|
+
case: undefined;
|
|
2254
|
+
value?: undefined;
|
|
2255
|
+
};
|
|
2256
|
+
/**
|
|
2257
|
+
* @generated from oneof buf.validate.SFixed32Rules.greater_than
|
|
2258
|
+
*/
|
|
2259
|
+
greaterThan: {
|
|
2260
|
+
/**
|
|
2261
|
+
* `gt` requires the field value to be greater than the specified value
|
|
2262
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
2263
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
2264
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2265
|
+
* an error message is generated.
|
|
2266
|
+
*
|
|
2267
|
+
* ```proto
|
|
2268
|
+
* message MySFixed32 {
|
|
2269
|
+
* // value must be greater than 5 [sfixed32.gt]
|
|
2270
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.gt = 5];
|
|
2271
|
+
*
|
|
2272
|
+
* // value must be greater than 5 and less than 10 [sfixed32.gt_lt]
|
|
2273
|
+
* sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gt: 5, lt: 10 }];
|
|
2274
|
+
*
|
|
2275
|
+
* // value must be greater than 10 or less than 5 [sfixed32.gt_lt_exclusive]
|
|
2276
|
+
* sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gt: 10, lt: 5 }];
|
|
2277
|
+
* }
|
|
2278
|
+
* ```
|
|
2279
|
+
*
|
|
2280
|
+
* @generated from field: sfixed32 gt = 4;
|
|
2281
|
+
*/
|
|
2282
|
+
value: number;
|
|
2283
|
+
case: "gt";
|
|
2284
|
+
} | {
|
|
2285
|
+
/**
|
|
2286
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
2287
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
2288
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
2289
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2290
|
+
* an error message is generated.
|
|
2291
|
+
*
|
|
2292
|
+
* ```proto
|
|
2293
|
+
* message MySFixed32 {
|
|
2294
|
+
* // value must be greater than or equal to 5 [sfixed32.gte]
|
|
2295
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32.gte = 5];
|
|
2296
|
+
*
|
|
2297
|
+
* // value must be greater than or equal to 5 and less than 10 [sfixed32.gte_lt]
|
|
2298
|
+
* sfixed32 other_value = 2 [(buf.validate.field).sfixed32 = { gte: 5, lt: 10 }];
|
|
2299
|
+
*
|
|
2300
|
+
* // value must be greater than or equal to 10 or less than 5 [sfixed32.gte_lt_exclusive]
|
|
2301
|
+
* sfixed32 another_value = 3 [(buf.validate.field).sfixed32 = { gte: 10, lt: 5 }];
|
|
2302
|
+
* }
|
|
2303
|
+
* ```
|
|
2304
|
+
*
|
|
2305
|
+
* @generated from field: sfixed32 gte = 5;
|
|
2306
|
+
*/
|
|
2307
|
+
value: number;
|
|
2308
|
+
case: "gte";
|
|
2309
|
+
} | {
|
|
2310
|
+
case: undefined;
|
|
2311
|
+
value?: undefined;
|
|
2312
|
+
};
|
|
2313
|
+
/**
|
|
2314
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
2315
|
+
* If the field value isn't one of the specified values, an error message is
|
|
2316
|
+
* generated.
|
|
2317
|
+
*
|
|
2318
|
+
* ```proto
|
|
2319
|
+
* message MySFixed32 {
|
|
2320
|
+
* // value must be in list [1, 2, 3]
|
|
2321
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32 = { in: [1, 2, 3] }];
|
|
2322
|
+
* }
|
|
2323
|
+
* ```
|
|
2324
|
+
*
|
|
2325
|
+
* @generated from field: repeated sfixed32 in = 6;
|
|
2326
|
+
*/
|
|
2327
|
+
in: number[];
|
|
2328
|
+
/**
|
|
2329
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
2330
|
+
* values. If the field value is one of the specified values, an error
|
|
2331
|
+
* message is generated.
|
|
2332
|
+
*
|
|
2333
|
+
* ```proto
|
|
2334
|
+
* message MySFixed32 {
|
|
2335
|
+
* // value must not be in list [1, 2, 3]
|
|
2336
|
+
* sfixed32 value = 1 [(buf.validate.field).sfixed32 = { not_in: [1, 2, 3] }];
|
|
2337
|
+
* }
|
|
2338
|
+
* ```
|
|
2339
|
+
*
|
|
2340
|
+
* @generated from field: repeated sfixed32 not_in = 7;
|
|
2341
|
+
*/
|
|
2342
|
+
notIn: number[];
|
|
2343
|
+
/**
|
|
2344
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2345
|
+
* conform to other rules. `example` values will not impact validation
|
|
2346
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2347
|
+
*
|
|
2348
|
+
* ```proto
|
|
2349
|
+
* message MySFixed32 {
|
|
2350
|
+
* sfixed32 value = 1 [
|
|
2351
|
+
* (buf.validate.field).sfixed32.example = 1,
|
|
2352
|
+
* (buf.validate.field).sfixed32.example = 2
|
|
2353
|
+
* ];
|
|
2354
|
+
* }
|
|
2355
|
+
* ```
|
|
2356
|
+
*
|
|
2357
|
+
* @generated from field: repeated sfixed32 example = 8;
|
|
2358
|
+
*/
|
|
2359
|
+
example: number[];
|
|
2360
|
+
};
|
|
2361
|
+
/**
|
|
2362
|
+
* Describes the message buf.validate.SFixed32Rules.
|
|
2363
|
+
* Use `create(SFixed32RulesSchema)` to create a new message.
|
|
2364
|
+
*/
|
|
2365
|
+
export declare const SFixed32RulesSchema: GenMessage<SFixed32Rules>;
|
|
2366
|
+
/**
|
|
2367
|
+
* SFixed64Rules describes the rules applied to `fixed64` values.
|
|
2368
|
+
*
|
|
2369
|
+
* @generated from message buf.validate.SFixed64Rules
|
|
2370
|
+
*/
|
|
2371
|
+
export type SFixed64Rules = Message<"buf.validate.SFixed64Rules"> & {
|
|
2372
|
+
/**
|
|
2373
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2374
|
+
* the field value doesn't match, an error message is generated.
|
|
2375
|
+
*
|
|
2376
|
+
* ```proto
|
|
2377
|
+
* message MySFixed64 {
|
|
2378
|
+
* // value must equal 42
|
|
2379
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.const = 42];
|
|
2380
|
+
* }
|
|
2381
|
+
* ```
|
|
2382
|
+
*
|
|
2383
|
+
* @generated from field: optional sfixed64 const = 1;
|
|
2384
|
+
*/
|
|
2385
|
+
const: bigint;
|
|
2386
|
+
/**
|
|
2387
|
+
* @generated from oneof buf.validate.SFixed64Rules.less_than
|
|
2388
|
+
*/
|
|
2389
|
+
lessThan: {
|
|
2390
|
+
/**
|
|
2391
|
+
* `lt` requires the field value to be less than the specified value (field <
|
|
2392
|
+
* value). If the field value is equal to or greater than the specified value,
|
|
2393
|
+
* an error message is generated.
|
|
2394
|
+
*
|
|
2395
|
+
* ```proto
|
|
2396
|
+
* message MySFixed64 {
|
|
2397
|
+
* // value must be less than 10
|
|
2398
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.lt = 10];
|
|
2399
|
+
* }
|
|
2400
|
+
* ```
|
|
2401
|
+
*
|
|
2402
|
+
* @generated from field: sfixed64 lt = 2;
|
|
2403
|
+
*/
|
|
2404
|
+
value: bigint;
|
|
2405
|
+
case: "lt";
|
|
2406
|
+
} | {
|
|
2407
|
+
/**
|
|
2408
|
+
* `lte` requires the field value to be less than or equal to the specified
|
|
2409
|
+
* value (field <= value). If the field value is greater than the specified
|
|
2410
|
+
* value, an error message is generated.
|
|
2411
|
+
*
|
|
2412
|
+
* ```proto
|
|
2413
|
+
* message MySFixed64 {
|
|
2414
|
+
* // value must be less than or equal to 10
|
|
2415
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.lte = 10];
|
|
2416
|
+
* }
|
|
2417
|
+
* ```
|
|
2418
|
+
*
|
|
2419
|
+
* @generated from field: sfixed64 lte = 3;
|
|
2420
|
+
*/
|
|
2421
|
+
value: bigint;
|
|
2422
|
+
case: "lte";
|
|
2423
|
+
} | {
|
|
2424
|
+
case: undefined;
|
|
2425
|
+
value?: undefined;
|
|
2426
|
+
};
|
|
2427
|
+
/**
|
|
2428
|
+
* @generated from oneof buf.validate.SFixed64Rules.greater_than
|
|
2429
|
+
*/
|
|
2430
|
+
greaterThan: {
|
|
2431
|
+
/**
|
|
2432
|
+
* `gt` requires the field value to be greater than the specified value
|
|
2433
|
+
* (exclusive). If the value of `gt` is larger than a specified `lt` or
|
|
2434
|
+
* `lte`, the range is reversed, and the field value must be outside the
|
|
2435
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2436
|
+
* an error message is generated.
|
|
2437
|
+
*
|
|
2438
|
+
* ```proto
|
|
2439
|
+
* message MySFixed64 {
|
|
2440
|
+
* // value must be greater than 5 [sfixed64.gt]
|
|
2441
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.gt = 5];
|
|
2442
|
+
*
|
|
2443
|
+
* // value must be greater than 5 and less than 10 [sfixed64.gt_lt]
|
|
2444
|
+
* sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gt: 5, lt: 10 }];
|
|
2445
|
+
*
|
|
2446
|
+
* // value must be greater than 10 or less than 5 [sfixed64.gt_lt_exclusive]
|
|
2447
|
+
* sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gt: 10, lt: 5 }];
|
|
2448
|
+
* }
|
|
2449
|
+
* ```
|
|
2450
|
+
*
|
|
2451
|
+
* @generated from field: sfixed64 gt = 4;
|
|
2452
|
+
*/
|
|
2453
|
+
value: bigint;
|
|
2454
|
+
case: "gt";
|
|
2455
|
+
} | {
|
|
2456
|
+
/**
|
|
2457
|
+
* `gte` requires the field value to be greater than or equal to the specified
|
|
2458
|
+
* value (exclusive). If the value of `gte` is larger than a specified `lt`
|
|
2459
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
2460
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
2461
|
+
* an error message is generated.
|
|
2462
|
+
*
|
|
2463
|
+
* ```proto
|
|
2464
|
+
* message MySFixed64 {
|
|
2465
|
+
* // value must be greater than or equal to 5 [sfixed64.gte]
|
|
2466
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64.gte = 5];
|
|
2467
|
+
*
|
|
2468
|
+
* // value must be greater than or equal to 5 and less than 10 [sfixed64.gte_lt]
|
|
2469
|
+
* sfixed64 other_value = 2 [(buf.validate.field).sfixed64 = { gte: 5, lt: 10 }];
|
|
2470
|
+
*
|
|
2471
|
+
* // value must be greater than or equal to 10 or less than 5 [sfixed64.gte_lt_exclusive]
|
|
2472
|
+
* sfixed64 another_value = 3 [(buf.validate.field).sfixed64 = { gte: 10, lt: 5 }];
|
|
2473
|
+
* }
|
|
2474
|
+
* ```
|
|
2475
|
+
*
|
|
2476
|
+
* @generated from field: sfixed64 gte = 5;
|
|
2477
|
+
*/
|
|
2478
|
+
value: bigint;
|
|
2479
|
+
case: "gte";
|
|
2480
|
+
} | {
|
|
2481
|
+
case: undefined;
|
|
2482
|
+
value?: undefined;
|
|
2483
|
+
};
|
|
2484
|
+
/**
|
|
2485
|
+
* `in` requires the field value to be equal to one of the specified values.
|
|
2486
|
+
* If the field value isn't one of the specified values, an error message is
|
|
2487
|
+
* generated.
|
|
2488
|
+
*
|
|
2489
|
+
* ```proto
|
|
2490
|
+
* message MySFixed64 {
|
|
2491
|
+
* // value must be in list [1, 2, 3]
|
|
2492
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64 = { in: [1, 2, 3] }];
|
|
2493
|
+
* }
|
|
2494
|
+
* ```
|
|
2495
|
+
*
|
|
2496
|
+
* @generated from field: repeated sfixed64 in = 6;
|
|
2497
|
+
*/
|
|
2498
|
+
in: bigint[];
|
|
2499
|
+
/**
|
|
2500
|
+
* `not_in` requires the field value to not be equal to any of the specified
|
|
2501
|
+
* values. If the field value is one of the specified values, an error
|
|
2502
|
+
* message is generated.
|
|
2503
|
+
*
|
|
2504
|
+
* ```proto
|
|
2505
|
+
* message MySFixed64 {
|
|
2506
|
+
* // value must not be in list [1, 2, 3]
|
|
2507
|
+
* sfixed64 value = 1 [(buf.validate.field).sfixed64 = { not_in: [1, 2, 3] }];
|
|
2508
|
+
* }
|
|
2509
|
+
* ```
|
|
2510
|
+
*
|
|
2511
|
+
* @generated from field: repeated sfixed64 not_in = 7;
|
|
2512
|
+
*/
|
|
2513
|
+
notIn: bigint[];
|
|
2514
|
+
/**
|
|
2515
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2516
|
+
* conform to other rules. `example` values will not impact validation
|
|
2517
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2518
|
+
*
|
|
2519
|
+
* ```proto
|
|
2520
|
+
* message MySFixed64 {
|
|
2521
|
+
* sfixed64 value = 1 [
|
|
2522
|
+
* (buf.validate.field).sfixed64.example = 1,
|
|
2523
|
+
* (buf.validate.field).sfixed64.example = 2
|
|
2524
|
+
* ];
|
|
2525
|
+
* }
|
|
2526
|
+
* ```
|
|
2527
|
+
*
|
|
2528
|
+
* @generated from field: repeated sfixed64 example = 8;
|
|
2529
|
+
*/
|
|
2530
|
+
example: bigint[];
|
|
2531
|
+
};
|
|
2532
|
+
/**
|
|
2533
|
+
* Describes the message buf.validate.SFixed64Rules.
|
|
2534
|
+
* Use `create(SFixed64RulesSchema)` to create a new message.
|
|
2535
|
+
*/
|
|
2536
|
+
export declare const SFixed64RulesSchema: GenMessage<SFixed64Rules>;
|
|
2537
|
+
/**
|
|
2538
|
+
* BoolRules describes the rules applied to `bool` values. These rules
|
|
2539
|
+
* may also be applied to the `google.protobuf.BoolValue` Well-Known-Type.
|
|
2540
|
+
*
|
|
2541
|
+
* @generated from message buf.validate.BoolRules
|
|
2542
|
+
*/
|
|
2543
|
+
export type BoolRules = Message<"buf.validate.BoolRules"> & {
|
|
2544
|
+
/**
|
|
2545
|
+
* `const` requires the field value to exactly match the specified boolean value.
|
|
2546
|
+
* If the field value doesn't match, an error message is generated.
|
|
2547
|
+
*
|
|
2548
|
+
* ```proto
|
|
2549
|
+
* message MyBool {
|
|
2550
|
+
* // value must equal true
|
|
2551
|
+
* bool value = 1 [(buf.validate.field).bool.const = true];
|
|
2552
|
+
* }
|
|
2553
|
+
* ```
|
|
2554
|
+
*
|
|
2555
|
+
* @generated from field: optional bool const = 1;
|
|
2556
|
+
*/
|
|
2557
|
+
const: boolean;
|
|
2558
|
+
/**
|
|
2559
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
2560
|
+
* conform to other rules. `example` values will not impact validation
|
|
2561
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
2562
|
+
*
|
|
2563
|
+
* ```proto
|
|
2564
|
+
* message MyBool {
|
|
2565
|
+
* bool value = 1 [
|
|
2566
|
+
* (buf.validate.field).bool.example = 1,
|
|
2567
|
+
* (buf.validate.field).bool.example = 2
|
|
2568
|
+
* ];
|
|
2569
|
+
* }
|
|
2570
|
+
* ```
|
|
2571
|
+
*
|
|
2572
|
+
* @generated from field: repeated bool example = 2;
|
|
2573
|
+
*/
|
|
2574
|
+
example: boolean[];
|
|
2575
|
+
};
|
|
2576
|
+
/**
|
|
2577
|
+
* Describes the message buf.validate.BoolRules.
|
|
2578
|
+
* Use `create(BoolRulesSchema)` to create a new message.
|
|
2579
|
+
*/
|
|
2580
|
+
export declare const BoolRulesSchema: GenMessage<BoolRules>;
|
|
2581
|
+
/**
|
|
2582
|
+
* StringRules describes the rules applied to `string` values These
|
|
2583
|
+
* rules may also be applied to the `google.protobuf.StringValue` Well-Known-Type.
|
|
2584
|
+
*
|
|
2585
|
+
* @generated from message buf.validate.StringRules
|
|
2586
|
+
*/
|
|
2587
|
+
export type StringRules = Message<"buf.validate.StringRules"> & {
|
|
2588
|
+
/**
|
|
2589
|
+
* `const` requires the field value to exactly match the specified value. If
|
|
2590
|
+
* the field value doesn't match, an error message is generated.
|
|
2591
|
+
*
|
|
2592
|
+
* ```proto
|
|
2593
|
+
* message MyString {
|
|
2594
|
+
* // value must equal `hello`
|
|
2595
|
+
* string value = 1 [(buf.validate.field).string.const = "hello"];
|
|
2596
|
+
* }
|
|
2597
|
+
* ```
|
|
2598
|
+
*
|
|
2599
|
+
* @generated from field: optional string const = 1;
|
|
2600
|
+
*/
|
|
2601
|
+
const: string;
|
|
2602
|
+
/**
|
|
2603
|
+
* `len` dictates that the field value must have the specified
|
|
2604
|
+
* number of characters (Unicode code points), which may differ from the number
|
|
2605
|
+
* of bytes in the string. If the field value does not meet the specified
|
|
2606
|
+
* length, an error message will be generated.
|
|
2607
|
+
*
|
|
2608
|
+
* ```proto
|
|
2609
|
+
* message MyString {
|
|
2610
|
+
* // value length must be 5 characters
|
|
2611
|
+
* string value = 1 [(buf.validate.field).string.len = 5];
|
|
2612
|
+
* }
|
|
2613
|
+
* ```
|
|
2614
|
+
*
|
|
2615
|
+
* @generated from field: optional uint64 len = 19;
|
|
2616
|
+
*/
|
|
2617
|
+
len: bigint;
|
|
2618
|
+
/**
|
|
2619
|
+
* `min_len` specifies that the field value must have at least the specified
|
|
2620
|
+
* number of characters (Unicode code points), which may differ from the number
|
|
2621
|
+
* of bytes in the string. If the field value contains fewer characters, an error
|
|
2622
|
+
* message will be generated.
|
|
2623
|
+
*
|
|
2624
|
+
* ```proto
|
|
2625
|
+
* message MyString {
|
|
2626
|
+
* // value length must be at least 3 characters
|
|
2627
|
+
* string value = 1 [(buf.validate.field).string.min_len = 3];
|
|
2628
|
+
* }
|
|
2629
|
+
* ```
|
|
2630
|
+
*
|
|
2631
|
+
* @generated from field: optional uint64 min_len = 2;
|
|
2632
|
+
*/
|
|
2633
|
+
minLen: bigint;
|
|
2634
|
+
/**
|
|
2635
|
+
* `max_len` specifies that the field value must have no more than the specified
|
|
2636
|
+
* number of characters (Unicode code points), which may differ from the
|
|
2637
|
+
* number of bytes in the string. If the field value contains more characters,
|
|
2638
|
+
* an error message will be generated.
|
|
2639
|
+
*
|
|
2640
|
+
* ```proto
|
|
2641
|
+
* message MyString {
|
|
2642
|
+
* // value length must be at most 10 characters
|
|
2643
|
+
* string value = 1 [(buf.validate.field).string.max_len = 10];
|
|
2644
|
+
* }
|
|
2645
|
+
* ```
|
|
2646
|
+
*
|
|
2647
|
+
* @generated from field: optional uint64 max_len = 3;
|
|
2648
|
+
*/
|
|
2649
|
+
maxLen: bigint;
|
|
2650
|
+
/**
|
|
2651
|
+
* `len_bytes` dictates that the field value must have the specified number of
|
|
2652
|
+
* bytes. If the field value does not match the specified length in bytes,
|
|
2653
|
+
* an error message will be generated.
|
|
2654
|
+
*
|
|
2655
|
+
* ```proto
|
|
2656
|
+
* message MyString {
|
|
2657
|
+
* // value length must be 6 bytes
|
|
2658
|
+
* string value = 1 [(buf.validate.field).string.len_bytes = 6];
|
|
2659
|
+
* }
|
|
2660
|
+
* ```
|
|
2661
|
+
*
|
|
2662
|
+
* @generated from field: optional uint64 len_bytes = 20;
|
|
2663
|
+
*/
|
|
2664
|
+
lenBytes: bigint;
|
|
2665
|
+
/**
|
|
2666
|
+
* `min_bytes` specifies that the field value must have at least the specified
|
|
2667
|
+
* number of bytes. If the field value contains fewer bytes, an error message
|
|
2668
|
+
* will be generated.
|
|
2669
|
+
*
|
|
2670
|
+
* ```proto
|
|
2671
|
+
* message MyString {
|
|
2672
|
+
* // value length must be at least 4 bytes
|
|
2673
|
+
* string value = 1 [(buf.validate.field).string.min_bytes = 4];
|
|
2674
|
+
* }
|
|
2675
|
+
*
|
|
2676
|
+
* ```
|
|
2677
|
+
*
|
|
2678
|
+
* @generated from field: optional uint64 min_bytes = 4;
|
|
2679
|
+
*/
|
|
2680
|
+
minBytes: bigint;
|
|
2681
|
+
/**
|
|
2682
|
+
* `max_bytes` specifies that the field value must have no more than the
|
|
2683
|
+
* specified number of bytes. If the field value contains more bytes, an
|
|
2684
|
+
* error message will be generated.
|
|
2685
|
+
*
|
|
2686
|
+
* ```proto
|
|
2687
|
+
* message MyString {
|
|
2688
|
+
* // value length must be at most 8 bytes
|
|
2689
|
+
* string value = 1 [(buf.validate.field).string.max_bytes = 8];
|
|
2690
|
+
* }
|
|
2691
|
+
* ```
|
|
2692
|
+
*
|
|
2693
|
+
* @generated from field: optional uint64 max_bytes = 5;
|
|
2694
|
+
*/
|
|
2695
|
+
maxBytes: bigint;
|
|
2696
|
+
/**
|
|
2697
|
+
* `pattern` specifies that the field value must match the specified
|
|
2698
|
+
* regular expression (RE2 syntax), with the expression provided without any
|
|
2699
|
+
* delimiters. If the field value doesn't match the regular expression, an
|
|
2700
|
+
* error message will be generated.
|
|
2701
|
+
*
|
|
2702
|
+
* ```proto
|
|
2703
|
+
* message MyString {
|
|
2704
|
+
* // value does not match regex pattern `^[a-zA-Z]//$`
|
|
2705
|
+
* string value = 1 [(buf.validate.field).string.pattern = "^[a-zA-Z]//$"];
|
|
2706
|
+
* }
|
|
2707
|
+
* ```
|
|
2708
|
+
*
|
|
2709
|
+
* @generated from field: optional string pattern = 6;
|
|
2710
|
+
*/
|
|
2711
|
+
pattern: string;
|
|
2712
|
+
/**
|
|
2713
|
+
* `prefix` specifies that the field value must have the
|
|
2714
|
+
* specified substring at the beginning of the string. If the field value
|
|
2715
|
+
* doesn't start with the specified prefix, an error message will be
|
|
2716
|
+
* generated.
|
|
2717
|
+
*
|
|
2718
|
+
* ```proto
|
|
2719
|
+
* message MyString {
|
|
2720
|
+
* // value does not have prefix `pre`
|
|
2721
|
+
* string value = 1 [(buf.validate.field).string.prefix = "pre"];
|
|
2722
|
+
* }
|
|
2723
|
+
* ```
|
|
2724
|
+
*
|
|
2725
|
+
* @generated from field: optional string prefix = 7;
|
|
2726
|
+
*/
|
|
2727
|
+
prefix: string;
|
|
2728
|
+
/**
|
|
2729
|
+
* `suffix` specifies that the field value must have the
|
|
2730
|
+
* specified substring at the end of the string. If the field value doesn't
|
|
2731
|
+
* end with the specified suffix, an error message will be generated.
|
|
2732
|
+
*
|
|
2733
|
+
* ```proto
|
|
2734
|
+
* message MyString {
|
|
2735
|
+
* // value does not have suffix `post`
|
|
2736
|
+
* string value = 1 [(buf.validate.field).string.suffix = "post"];
|
|
2737
|
+
* }
|
|
2738
|
+
* ```
|
|
2739
|
+
*
|
|
2740
|
+
* @generated from field: optional string suffix = 8;
|
|
2741
|
+
*/
|
|
2742
|
+
suffix: string;
|
|
2743
|
+
/**
|
|
2744
|
+
* `contains` specifies that the field value must have the
|
|
2745
|
+
* specified substring anywhere in the string. If the field value doesn't
|
|
2746
|
+
* contain the specified substring, an error message will be generated.
|
|
2747
|
+
*
|
|
2748
|
+
* ```proto
|
|
2749
|
+
* message MyString {
|
|
2750
|
+
* // value does not contain substring `inside`.
|
|
2751
|
+
* string value = 1 [(buf.validate.field).string.contains = "inside"];
|
|
2752
|
+
* }
|
|
2753
|
+
* ```
|
|
2754
|
+
*
|
|
2755
|
+
* @generated from field: optional string contains = 9;
|
|
2756
|
+
*/
|
|
2757
|
+
contains: string;
|
|
2758
|
+
/**
|
|
2759
|
+
* `not_contains` specifies that the field value must not have the
|
|
2760
|
+
* specified substring anywhere in the string. If the field value contains
|
|
2761
|
+
* the specified substring, an error message will be generated.
|
|
2762
|
+
*
|
|
2763
|
+
* ```proto
|
|
2764
|
+
* message MyString {
|
|
2765
|
+
* // value contains substring `inside`.
|
|
2766
|
+
* string value = 1 [(buf.validate.field).string.not_contains = "inside"];
|
|
2767
|
+
* }
|
|
2768
|
+
* ```
|
|
2769
|
+
*
|
|
2770
|
+
* @generated from field: optional string not_contains = 23;
|
|
2771
|
+
*/
|
|
2772
|
+
notContains: string;
|
|
2773
|
+
/**
|
|
2774
|
+
* `in` specifies that the field value must be equal to one of the specified
|
|
2775
|
+
* values. If the field value isn't one of the specified values, an error
|
|
2776
|
+
* message will be generated.
|
|
2777
|
+
*
|
|
2778
|
+
* ```proto
|
|
2779
|
+
* message MyString {
|
|
2780
|
+
* // value must be in list ["apple", "banana"]
|
|
2781
|
+
* string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"];
|
|
2782
|
+
* }
|
|
2783
|
+
* ```
|
|
2784
|
+
*
|
|
2785
|
+
* @generated from field: repeated string in = 10;
|
|
2786
|
+
*/
|
|
2787
|
+
in: string[];
|
|
2788
|
+
/**
|
|
2789
|
+
* `not_in` specifies that the field value cannot be equal to any
|
|
2790
|
+
* of the specified values. If the field value is one of the specified values,
|
|
2791
|
+
* an error message will be generated.
|
|
2792
|
+
* ```proto
|
|
2793
|
+
* message MyString {
|
|
2794
|
+
* // value must not be in list ["orange", "grape"]
|
|
2795
|
+
* string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"];
|
|
2796
|
+
* }
|
|
2797
|
+
* ```
|
|
2798
|
+
*
|
|
2799
|
+
* @generated from field: repeated string not_in = 11;
|
|
2800
|
+
*/
|
|
2801
|
+
notIn: string[];
|
|
2802
|
+
/**
|
|
2803
|
+
* `WellKnown` rules provide advanced rules against common string
|
|
2804
|
+
* patterns.
|
|
2805
|
+
*
|
|
2806
|
+
* @generated from oneof buf.validate.StringRules.well_known
|
|
2807
|
+
*/
|
|
2808
|
+
wellKnown: {
|
|
2809
|
+
/**
|
|
2810
|
+
* `email` specifies that the field value must be a valid email address, for
|
|
2811
|
+
* example "foo@example.com".
|
|
2812
|
+
*
|
|
2813
|
+
* Conforms to the definition for a valid email address from the [HTML standard](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address).
|
|
2814
|
+
* Note that this standard willfully deviates from [RFC 5322](https://datatracker.ietf.org/doc/html/rfc5322),
|
|
2815
|
+
* which allows many unexpected forms of email addresses and will easily match
|
|
2816
|
+
* a typographical error.
|
|
2817
|
+
*
|
|
2818
|
+
* If the field value isn't a valid email address, an error message will be generated.
|
|
2819
|
+
*
|
|
2820
|
+
* ```proto
|
|
2821
|
+
* message MyString {
|
|
2822
|
+
* // value must be a valid email address
|
|
2823
|
+
* string value = 1 [(buf.validate.field).string.email = true];
|
|
2824
|
+
* }
|
|
2825
|
+
* ```
|
|
2826
|
+
*
|
|
2827
|
+
* @generated from field: bool email = 12;
|
|
2828
|
+
*/
|
|
2829
|
+
value: boolean;
|
|
2830
|
+
case: "email";
|
|
2831
|
+
} | {
|
|
2832
|
+
/**
|
|
2833
|
+
* `hostname` specifies that the field value must be a valid hostname, for
|
|
2834
|
+
* example "foo.example.com".
|
|
2835
|
+
*
|
|
2836
|
+
* A valid hostname follows the rules below:
|
|
2837
|
+
* - The name consists of one or more labels, separated by a dot (".").
|
|
2838
|
+
* - Each label can be 1 to 63 alphanumeric characters.
|
|
2839
|
+
* - A label can contain hyphens ("-"), but must not start or end with a hyphen.
|
|
2840
|
+
* - The right-most label must not be digits only.
|
|
2841
|
+
* - The name can have a trailing dot—for example, "foo.example.com.".
|
|
2842
|
+
* - The name can be 253 characters at most, excluding the optional trailing dot.
|
|
2843
|
+
*
|
|
2844
|
+
* If the field value isn't a valid hostname, an error message will be generated.
|
|
2845
|
+
*
|
|
2846
|
+
* ```proto
|
|
2847
|
+
* message MyString {
|
|
2848
|
+
* // value must be a valid hostname
|
|
2849
|
+
* string value = 1 [(buf.validate.field).string.hostname = true];
|
|
2850
|
+
* }
|
|
2851
|
+
* ```
|
|
2852
|
+
*
|
|
2853
|
+
* @generated from field: bool hostname = 13;
|
|
2854
|
+
*/
|
|
2855
|
+
value: boolean;
|
|
2856
|
+
case: "hostname";
|
|
2857
|
+
} | {
|
|
2858
|
+
/**
|
|
2859
|
+
* `ip` specifies that the field value must be a valid IP (v4 or v6) address.
|
|
2860
|
+
*
|
|
2861
|
+
* IPv4 addresses are expected in the dotted decimal format—for example, "192.168.5.21".
|
|
2862
|
+
* IPv6 addresses are expected in their text representation—for example, "::1",
|
|
2863
|
+
* or "2001:0DB8:ABCD:0012::0".
|
|
2864
|
+
*
|
|
2865
|
+
* Both formats are well-defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
|
|
2866
|
+
* Zone identifiers for IPv6 addresses (for example, "fe80::a%en1") are supported.
|
|
2867
|
+
*
|
|
2868
|
+
* If the field value isn't a valid IP address, an error message will be
|
|
2869
|
+
* generated.
|
|
2870
|
+
*
|
|
2871
|
+
* ```proto
|
|
2872
|
+
* message MyString {
|
|
2873
|
+
* // value must be a valid IP address
|
|
2874
|
+
* string value = 1 [(buf.validate.field).string.ip = true];
|
|
2875
|
+
* }
|
|
2876
|
+
* ```
|
|
2877
|
+
*
|
|
2878
|
+
* @generated from field: bool ip = 14;
|
|
2879
|
+
*/
|
|
2880
|
+
value: boolean;
|
|
2881
|
+
case: "ip";
|
|
2882
|
+
} | {
|
|
2883
|
+
/**
|
|
2884
|
+
* `ipv4` specifies that the field value must be a valid IPv4 address—for
|
|
2885
|
+
* example "192.168.5.21". If the field value isn't a valid IPv4 address, an
|
|
2886
|
+
* error message will be generated.
|
|
2887
|
+
*
|
|
2888
|
+
* ```proto
|
|
2889
|
+
* message MyString {
|
|
2890
|
+
* // value must be a valid IPv4 address
|
|
2891
|
+
* string value = 1 [(buf.validate.field).string.ipv4 = true];
|
|
2892
|
+
* }
|
|
2893
|
+
* ```
|
|
2894
|
+
*
|
|
2895
|
+
* @generated from field: bool ipv4 = 15;
|
|
2896
|
+
*/
|
|
2897
|
+
value: boolean;
|
|
2898
|
+
case: "ipv4";
|
|
2899
|
+
} | {
|
|
2900
|
+
/**
|
|
2901
|
+
* `ipv6` specifies that the field value must be a valid IPv6 address—for
|
|
2902
|
+
* example "::1", or "d7a:115c:a1e0:ab12:4843:cd96:626b:430b". If the field
|
|
2903
|
+
* value is not a valid IPv6 address, an error message will be generated.
|
|
2904
|
+
*
|
|
2905
|
+
* ```proto
|
|
2906
|
+
* message MyString {
|
|
2907
|
+
* // value must be a valid IPv6 address
|
|
2908
|
+
* string value = 1 [(buf.validate.field).string.ipv6 = true];
|
|
2909
|
+
* }
|
|
2910
|
+
* ```
|
|
2911
|
+
*
|
|
2912
|
+
* @generated from field: bool ipv6 = 16;
|
|
2913
|
+
*/
|
|
2914
|
+
value: boolean;
|
|
2915
|
+
case: "ipv6";
|
|
2916
|
+
} | {
|
|
2917
|
+
/**
|
|
2918
|
+
* `uri` specifies that the field value must be a valid URI, for example
|
|
2919
|
+
* "https://example.com/foo/bar?baz=quux#frag".
|
|
2920
|
+
*
|
|
2921
|
+
* URI is defined in the internet standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986).
|
|
2922
|
+
* Zone Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
|
|
2923
|
+
*
|
|
2924
|
+
* If the field value isn't a valid URI, an error message will be generated.
|
|
2925
|
+
*
|
|
2926
|
+
* ```proto
|
|
2927
|
+
* message MyString {
|
|
2928
|
+
* // value must be a valid URI
|
|
2929
|
+
* string value = 1 [(buf.validate.field).string.uri = true];
|
|
2930
|
+
* }
|
|
2931
|
+
* ```
|
|
2932
|
+
*
|
|
2933
|
+
* @generated from field: bool uri = 17;
|
|
2934
|
+
*/
|
|
2935
|
+
value: boolean;
|
|
2936
|
+
case: "uri";
|
|
2937
|
+
} | {
|
|
2938
|
+
/**
|
|
2939
|
+
* `uri_ref` specifies that the field value must be a valid URI Reference—either
|
|
2940
|
+
* a URI such as "https://example.com/foo/bar?baz=quux#frag", or a Relative
|
|
2941
|
+
* Reference such as "./foo/bar?query".
|
|
2942
|
+
*
|
|
2943
|
+
* URI, URI Reference, and Relative Reference are defined in the internet
|
|
2944
|
+
* standard [RFC 3986](https://datatracker.ietf.org/doc/html/rfc3986). Zone
|
|
2945
|
+
* Identifiers in IPv6 address literals are supported ([RFC 6874](https://datatracker.ietf.org/doc/html/rfc6874)).
|
|
2946
|
+
*
|
|
2947
|
+
* If the field value isn't a valid URI Reference, an error message will be
|
|
2948
|
+
* generated.
|
|
2949
|
+
*
|
|
2950
|
+
* ```proto
|
|
2951
|
+
* message MyString {
|
|
2952
|
+
* // value must be a valid URI Reference
|
|
2953
|
+
* string value = 1 [(buf.validate.field).string.uri_ref = true];
|
|
2954
|
+
* }
|
|
2955
|
+
* ```
|
|
2956
|
+
*
|
|
2957
|
+
* @generated from field: bool uri_ref = 18;
|
|
2958
|
+
*/
|
|
2959
|
+
value: boolean;
|
|
2960
|
+
case: "uriRef";
|
|
2961
|
+
} | {
|
|
2962
|
+
/**
|
|
2963
|
+
* `address` specifies that the field value must be either a valid hostname
|
|
2964
|
+
* (for example, "example.com"), or a valid IP (v4 or v6) address (for example,
|
|
2965
|
+
* "192.168.0.1", or "::1"). If the field value isn't a valid hostname or IP,
|
|
2966
|
+
* an error message will be generated.
|
|
2967
|
+
*
|
|
2968
|
+
* ```proto
|
|
2969
|
+
* message MyString {
|
|
2970
|
+
* // value must be a valid hostname, or ip address
|
|
2971
|
+
* string value = 1 [(buf.validate.field).string.address = true];
|
|
2972
|
+
* }
|
|
2973
|
+
* ```
|
|
2974
|
+
*
|
|
2975
|
+
* @generated from field: bool address = 21;
|
|
2976
|
+
*/
|
|
2977
|
+
value: boolean;
|
|
2978
|
+
case: "address";
|
|
2979
|
+
} | {
|
|
2980
|
+
/**
|
|
2981
|
+
* `uuid` specifies that the field value must be a valid UUID as defined by
|
|
2982
|
+
* [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2). If the
|
|
2983
|
+
* field value isn't a valid UUID, an error message will be generated.
|
|
2984
|
+
*
|
|
2985
|
+
* ```proto
|
|
2986
|
+
* message MyString {
|
|
2987
|
+
* // value must be a valid UUID
|
|
2988
|
+
* string value = 1 [(buf.validate.field).string.uuid = true];
|
|
2989
|
+
* }
|
|
2990
|
+
* ```
|
|
2991
|
+
*
|
|
2992
|
+
* @generated from field: bool uuid = 22;
|
|
2993
|
+
*/
|
|
2994
|
+
value: boolean;
|
|
2995
|
+
case: "uuid";
|
|
2996
|
+
} | {
|
|
2997
|
+
/**
|
|
2998
|
+
* `tuuid` (trimmed UUID) specifies that the field value must be a valid UUID as
|
|
2999
|
+
* defined by [RFC 4122](https://datatracker.ietf.org/doc/html/rfc4122#section-4.1.2) with all dashes
|
|
3000
|
+
* omitted. If the field value isn't a valid UUID without dashes, an error message
|
|
3001
|
+
* will be generated.
|
|
3002
|
+
*
|
|
3003
|
+
* ```proto
|
|
3004
|
+
* message MyString {
|
|
3005
|
+
* // value must be a valid trimmed UUID
|
|
3006
|
+
* string value = 1 [(buf.validate.field).string.tuuid = true];
|
|
3007
|
+
* }
|
|
3008
|
+
* ```
|
|
3009
|
+
*
|
|
3010
|
+
* @generated from field: bool tuuid = 33;
|
|
3011
|
+
*/
|
|
3012
|
+
value: boolean;
|
|
3013
|
+
case: "tuuid";
|
|
3014
|
+
} | {
|
|
3015
|
+
/**
|
|
3016
|
+
* `ip_with_prefixlen` specifies that the field value must be a valid IP
|
|
3017
|
+
* (v4 or v6) address with prefix length—for example, "192.168.5.21/16" or
|
|
3018
|
+
* "2001:0DB8:ABCD:0012::F1/64". If the field value isn't a valid IP with
|
|
3019
|
+
* prefix length, an error message will be generated.
|
|
3020
|
+
*
|
|
3021
|
+
* ```proto
|
|
3022
|
+
* message MyString {
|
|
3023
|
+
* // value must be a valid IP with prefix length
|
|
3024
|
+
* string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
|
|
3025
|
+
* }
|
|
3026
|
+
* ```
|
|
3027
|
+
*
|
|
3028
|
+
* @generated from field: bool ip_with_prefixlen = 26;
|
|
3029
|
+
*/
|
|
3030
|
+
value: boolean;
|
|
3031
|
+
case: "ipWithPrefixlen";
|
|
3032
|
+
} | {
|
|
3033
|
+
/**
|
|
3034
|
+
* `ipv4_with_prefixlen` specifies that the field value must be a valid
|
|
3035
|
+
* IPv4 address with prefix length—for example, "192.168.5.21/16". If the
|
|
3036
|
+
* field value isn't a valid IPv4 address with prefix length, an error
|
|
3037
|
+
* message will be generated.
|
|
3038
|
+
*
|
|
3039
|
+
* ```proto
|
|
3040
|
+
* message MyString {
|
|
3041
|
+
* // value must be a valid IPv4 address with prefix length
|
|
3042
|
+
* string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
|
|
3043
|
+
* }
|
|
3044
|
+
* ```
|
|
3045
|
+
*
|
|
3046
|
+
* @generated from field: bool ipv4_with_prefixlen = 27;
|
|
3047
|
+
*/
|
|
3048
|
+
value: boolean;
|
|
3049
|
+
case: "ipv4WithPrefixlen";
|
|
3050
|
+
} | {
|
|
3051
|
+
/**
|
|
3052
|
+
* `ipv6_with_prefixlen` specifies that the field value must be a valid
|
|
3053
|
+
* IPv6 address with prefix length—for example, "2001:0DB8:ABCD:0012::F1/64".
|
|
3054
|
+
* If the field value is not a valid IPv6 address with prefix length,
|
|
3055
|
+
* an error message will be generated.
|
|
3056
|
+
*
|
|
3057
|
+
* ```proto
|
|
3058
|
+
* message MyString {
|
|
3059
|
+
* // value must be a valid IPv6 address prefix length
|
|
3060
|
+
* string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
|
|
3061
|
+
* }
|
|
3062
|
+
* ```
|
|
3063
|
+
*
|
|
3064
|
+
* @generated from field: bool ipv6_with_prefixlen = 28;
|
|
3065
|
+
*/
|
|
3066
|
+
value: boolean;
|
|
3067
|
+
case: "ipv6WithPrefixlen";
|
|
3068
|
+
} | {
|
|
3069
|
+
/**
|
|
3070
|
+
* `ip_prefix` specifies that the field value must be a valid IP (v4 or v6)
|
|
3071
|
+
* prefix—for example, "192.168.0.0/16" or "2001:0DB8:ABCD:0012::0/64".
|
|
3072
|
+
*
|
|
3073
|
+
* The prefix must have all zeros for the unmasked bits. For example,
|
|
3074
|
+
* "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
|
|
3075
|
+
* prefix, and the remaining 64 bits must be zero.
|
|
3076
|
+
*
|
|
3077
|
+
* If the field value isn't a valid IP prefix, an error message will be
|
|
3078
|
+
* generated.
|
|
3079
|
+
*
|
|
3080
|
+
* ```proto
|
|
3081
|
+
* message MyString {
|
|
3082
|
+
* // value must be a valid IP prefix
|
|
3083
|
+
* string value = 1 [(buf.validate.field).string.ip_prefix = true];
|
|
3084
|
+
* }
|
|
3085
|
+
* ```
|
|
3086
|
+
*
|
|
3087
|
+
* @generated from field: bool ip_prefix = 29;
|
|
3088
|
+
*/
|
|
3089
|
+
value: boolean;
|
|
3090
|
+
case: "ipPrefix";
|
|
3091
|
+
} | {
|
|
3092
|
+
/**
|
|
3093
|
+
* `ipv4_prefix` specifies that the field value must be a valid IPv4
|
|
3094
|
+
* prefix, for example "192.168.0.0/16".
|
|
3095
|
+
*
|
|
3096
|
+
* The prefix must have all zeros for the unmasked bits. For example,
|
|
3097
|
+
* "192.168.0.0/16" designates the left-most 16 bits for the prefix,
|
|
3098
|
+
* and the remaining 16 bits must be zero.
|
|
3099
|
+
*
|
|
3100
|
+
* If the field value isn't a valid IPv4 prefix, an error message
|
|
3101
|
+
* will be generated.
|
|
3102
|
+
*
|
|
3103
|
+
* ```proto
|
|
3104
|
+
* message MyString {
|
|
3105
|
+
* // value must be a valid IPv4 prefix
|
|
3106
|
+
* string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
|
|
3107
|
+
* }
|
|
3108
|
+
* ```
|
|
3109
|
+
*
|
|
3110
|
+
* @generated from field: bool ipv4_prefix = 30;
|
|
3111
|
+
*/
|
|
3112
|
+
value: boolean;
|
|
3113
|
+
case: "ipv4Prefix";
|
|
3114
|
+
} | {
|
|
3115
|
+
/**
|
|
3116
|
+
* `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix—for
|
|
3117
|
+
* example, "2001:0DB8:ABCD:0012::0/64".
|
|
3118
|
+
*
|
|
3119
|
+
* The prefix must have all zeros for the unmasked bits. For example,
|
|
3120
|
+
* "2001:0DB8:ABCD:0012::0/64" designates the left-most 64 bits for the
|
|
3121
|
+
* prefix, and the remaining 64 bits must be zero.
|
|
3122
|
+
*
|
|
3123
|
+
* If the field value is not a valid IPv6 prefix, an error message will be
|
|
3124
|
+
* generated.
|
|
3125
|
+
*
|
|
3126
|
+
* ```proto
|
|
3127
|
+
* message MyString {
|
|
3128
|
+
* // value must be a valid IPv6 prefix
|
|
3129
|
+
* string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
|
|
3130
|
+
* }
|
|
3131
|
+
* ```
|
|
3132
|
+
*
|
|
3133
|
+
* @generated from field: bool ipv6_prefix = 31;
|
|
3134
|
+
*/
|
|
3135
|
+
value: boolean;
|
|
3136
|
+
case: "ipv6Prefix";
|
|
3137
|
+
} | {
|
|
3138
|
+
/**
|
|
3139
|
+
* `host_and_port` specifies that the field value must be valid host/port
|
|
3140
|
+
* pair—for example, "example.com:8080".
|
|
3141
|
+
*
|
|
3142
|
+
* The host can be one of:
|
|
3143
|
+
* - An IPv4 address in dotted decimal format—for example, "192.168.5.21".
|
|
3144
|
+
* - An IPv6 address enclosed in square brackets—for example, "[2001:0DB8:ABCD:0012::F1]".
|
|
3145
|
+
* - A hostname—for example, "example.com".
|
|
3146
|
+
*
|
|
3147
|
+
* The port is separated by a colon. It must be non-empty, with a decimal number
|
|
3148
|
+
* in the range of 0-65535, inclusive.
|
|
3149
|
+
*
|
|
3150
|
+
* @generated from field: bool host_and_port = 32;
|
|
3151
|
+
*/
|
|
3152
|
+
value: boolean;
|
|
3153
|
+
case: "hostAndPort";
|
|
3154
|
+
} | {
|
|
3155
|
+
/**
|
|
3156
|
+
* `well_known_regex` specifies a common well-known pattern
|
|
3157
|
+
* defined as a regex. If the field value doesn't match the well-known
|
|
3158
|
+
* regex, an error message will be generated.
|
|
3159
|
+
*
|
|
3160
|
+
* ```proto
|
|
3161
|
+
* message MyString {
|
|
3162
|
+
* // value must be a valid HTTP header value
|
|
3163
|
+
* string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
|
|
3164
|
+
* }
|
|
3165
|
+
* ```
|
|
3166
|
+
*
|
|
3167
|
+
* #### KnownRegex
|
|
3168
|
+
*
|
|
3169
|
+
* `well_known_regex` contains some well-known patterns.
|
|
3170
|
+
*
|
|
3171
|
+
* | Name | Number | Description |
|
|
3172
|
+
* |-------------------------------|--------|-------------------------------------------|
|
|
3173
|
+
* | KNOWN_REGEX_UNSPECIFIED | 0 | |
|
|
3174
|
+
* | KNOWN_REGEX_HTTP_HEADER_NAME | 1 | HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2) |
|
|
3175
|
+
* | KNOWN_REGEX_HTTP_HEADER_VALUE | 2 | HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4) |
|
|
3176
|
+
*
|
|
3177
|
+
* @generated from field: buf.validate.KnownRegex well_known_regex = 24;
|
|
3178
|
+
*/
|
|
3179
|
+
value: KnownRegex;
|
|
3180
|
+
case: "wellKnownRegex";
|
|
3181
|
+
} | {
|
|
3182
|
+
case: undefined;
|
|
3183
|
+
value?: undefined;
|
|
3184
|
+
};
|
|
3185
|
+
/**
|
|
3186
|
+
* This applies to regexes `HTTP_HEADER_NAME` and `HTTP_HEADER_VALUE` to
|
|
3187
|
+
* enable strict header validation. By default, this is true, and HTTP header
|
|
3188
|
+
* validations are [RFC-compliant](https://datatracker.ietf.org/doc/html/rfc7230#section-3). Setting to false will enable looser
|
|
3189
|
+
* validations that only disallow `\r\n\0` characters, which can be used to
|
|
3190
|
+
* bypass header matching rules.
|
|
3191
|
+
*
|
|
3192
|
+
* ```proto
|
|
3193
|
+
* message MyString {
|
|
3194
|
+
* // The field `value` must have be a valid HTTP headers, but not enforced with strict rules.
|
|
3195
|
+
* string value = 1 [(buf.validate.field).string.strict = false];
|
|
3196
|
+
* }
|
|
3197
|
+
* ```
|
|
3198
|
+
*
|
|
3199
|
+
* @generated from field: optional bool strict = 25;
|
|
3200
|
+
*/
|
|
3201
|
+
strict: boolean;
|
|
3202
|
+
/**
|
|
3203
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3204
|
+
* conform to other rules. `example` values will not impact validation
|
|
3205
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3206
|
+
*
|
|
3207
|
+
* ```proto
|
|
3208
|
+
* message MyString {
|
|
3209
|
+
* string value = 1 [
|
|
3210
|
+
* (buf.validate.field).string.example = "hello",
|
|
3211
|
+
* (buf.validate.field).string.example = "world"
|
|
3212
|
+
* ];
|
|
3213
|
+
* }
|
|
3214
|
+
* ```
|
|
3215
|
+
*
|
|
3216
|
+
* @generated from field: repeated string example = 34;
|
|
3217
|
+
*/
|
|
3218
|
+
example: string[];
|
|
3219
|
+
};
|
|
3220
|
+
/**
|
|
3221
|
+
* Describes the message buf.validate.StringRules.
|
|
3222
|
+
* Use `create(StringRulesSchema)` to create a new message.
|
|
3223
|
+
*/
|
|
3224
|
+
export declare const StringRulesSchema: GenMessage<StringRules>;
|
|
3225
|
+
/**
|
|
3226
|
+
* BytesRules describe the rules applied to `bytes` values. These rules
|
|
3227
|
+
* may also be applied to the `google.protobuf.BytesValue` Well-Known-Type.
|
|
3228
|
+
*
|
|
3229
|
+
* @generated from message buf.validate.BytesRules
|
|
3230
|
+
*/
|
|
3231
|
+
export type BytesRules = Message<"buf.validate.BytesRules"> & {
|
|
3232
|
+
/**
|
|
3233
|
+
* `const` requires the field value to exactly match the specified bytes
|
|
3234
|
+
* value. If the field value doesn't match, an error message is generated.
|
|
3235
|
+
*
|
|
3236
|
+
* ```proto
|
|
3237
|
+
* message MyBytes {
|
|
3238
|
+
* // value must be "\x01\x02\x03\x04"
|
|
3239
|
+
* bytes value = 1 [(buf.validate.field).bytes.const = "\x01\x02\x03\x04"];
|
|
3240
|
+
* }
|
|
3241
|
+
* ```
|
|
3242
|
+
*
|
|
3243
|
+
* @generated from field: optional bytes const = 1;
|
|
3244
|
+
*/
|
|
3245
|
+
const: Uint8Array;
|
|
3246
|
+
/**
|
|
3247
|
+
* `len` requires the field value to have the specified length in bytes.
|
|
3248
|
+
* If the field value doesn't match, an error message is generated.
|
|
3249
|
+
*
|
|
3250
|
+
* ```proto
|
|
3251
|
+
* message MyBytes {
|
|
3252
|
+
* // value length must be 4 bytes.
|
|
3253
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.len = 4];
|
|
3254
|
+
* }
|
|
3255
|
+
* ```
|
|
3256
|
+
*
|
|
3257
|
+
* @generated from field: optional uint64 len = 13;
|
|
3258
|
+
*/
|
|
3259
|
+
len: bigint;
|
|
3260
|
+
/**
|
|
3261
|
+
* `min_len` requires the field value to have at least the specified minimum
|
|
3262
|
+
* length in bytes.
|
|
3263
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
3264
|
+
*
|
|
3265
|
+
* ```proto
|
|
3266
|
+
* message MyBytes {
|
|
3267
|
+
* // value length must be at least 2 bytes.
|
|
3268
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.min_len = 2];
|
|
3269
|
+
* }
|
|
3270
|
+
* ```
|
|
3271
|
+
*
|
|
3272
|
+
* @generated from field: optional uint64 min_len = 2;
|
|
3273
|
+
*/
|
|
3274
|
+
minLen: bigint;
|
|
3275
|
+
/**
|
|
3276
|
+
* `max_len` requires the field value to have at most the specified maximum
|
|
3277
|
+
* length in bytes.
|
|
3278
|
+
* If the field value exceeds the requirement, an error message is generated.
|
|
3279
|
+
*
|
|
3280
|
+
* ```proto
|
|
3281
|
+
* message MyBytes {
|
|
3282
|
+
* // value must be at most 6 bytes.
|
|
3283
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.max_len = 6];
|
|
3284
|
+
* }
|
|
3285
|
+
* ```
|
|
3286
|
+
*
|
|
3287
|
+
* @generated from field: optional uint64 max_len = 3;
|
|
3288
|
+
*/
|
|
3289
|
+
maxLen: bigint;
|
|
3290
|
+
/**
|
|
3291
|
+
* `pattern` requires the field value to match the specified regular
|
|
3292
|
+
* expression ([RE2 syntax](https://github.com/google/re2/wiki/Syntax)).
|
|
3293
|
+
* The value of the field must be valid UTF-8 or validation will fail with a
|
|
3294
|
+
* runtime error.
|
|
3295
|
+
* If the field value doesn't match the pattern, an error message is generated.
|
|
3296
|
+
*
|
|
3297
|
+
* ```proto
|
|
3298
|
+
* message MyBytes {
|
|
3299
|
+
* // value must match regex pattern "^[a-zA-Z0-9]+$".
|
|
3300
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.pattern = "^[a-zA-Z0-9]+$"];
|
|
3301
|
+
* }
|
|
3302
|
+
* ```
|
|
3303
|
+
*
|
|
3304
|
+
* @generated from field: optional string pattern = 4;
|
|
3305
|
+
*/
|
|
3306
|
+
pattern: string;
|
|
3307
|
+
/**
|
|
3308
|
+
* `prefix` requires the field value to have the specified bytes at the
|
|
3309
|
+
* beginning of the string.
|
|
3310
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
3311
|
+
*
|
|
3312
|
+
* ```proto
|
|
3313
|
+
* message MyBytes {
|
|
3314
|
+
* // value does not have prefix \x01\x02
|
|
3315
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.prefix = "\x01\x02"];
|
|
3316
|
+
* }
|
|
3317
|
+
* ```
|
|
3318
|
+
*
|
|
3319
|
+
* @generated from field: optional bytes prefix = 5;
|
|
3320
|
+
*/
|
|
3321
|
+
prefix: Uint8Array;
|
|
3322
|
+
/**
|
|
3323
|
+
* `suffix` requires the field value to have the specified bytes at the end
|
|
3324
|
+
* of the string.
|
|
3325
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
3326
|
+
*
|
|
3327
|
+
* ```proto
|
|
3328
|
+
* message MyBytes {
|
|
3329
|
+
* // value does not have suffix \x03\x04
|
|
3330
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.suffix = "\x03\x04"];
|
|
3331
|
+
* }
|
|
3332
|
+
* ```
|
|
3333
|
+
*
|
|
3334
|
+
* @generated from field: optional bytes suffix = 6;
|
|
3335
|
+
*/
|
|
3336
|
+
suffix: Uint8Array;
|
|
3337
|
+
/**
|
|
3338
|
+
* `contains` requires the field value to have the specified bytes anywhere in
|
|
3339
|
+
* the string.
|
|
3340
|
+
* If the field value doesn't meet the requirement, an error message is generated.
|
|
3341
|
+
*
|
|
3342
|
+
* ```protobuf
|
|
3343
|
+
* message MyBytes {
|
|
3344
|
+
* // value does not contain \x02\x03
|
|
3345
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.contains = "\x02\x03"];
|
|
3346
|
+
* }
|
|
3347
|
+
* ```
|
|
3348
|
+
*
|
|
3349
|
+
* @generated from field: optional bytes contains = 7;
|
|
3350
|
+
*/
|
|
3351
|
+
contains: Uint8Array;
|
|
3352
|
+
/**
|
|
3353
|
+
* `in` requires the field value to be equal to one of the specified
|
|
3354
|
+
* values. If the field value doesn't match any of the specified values, an
|
|
3355
|
+
* error message is generated.
|
|
3356
|
+
*
|
|
3357
|
+
* ```protobuf
|
|
3358
|
+
* message MyBytes {
|
|
3359
|
+
* // value must in ["\x01\x02", "\x02\x03", "\x03\x04"]
|
|
3360
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
|
|
3361
|
+
* }
|
|
3362
|
+
* ```
|
|
3363
|
+
*
|
|
3364
|
+
* @generated from field: repeated bytes in = 8;
|
|
3365
|
+
*/
|
|
3366
|
+
in: Uint8Array[];
|
|
3367
|
+
/**
|
|
3368
|
+
* `not_in` requires the field value to be not equal to any of the specified
|
|
3369
|
+
* values.
|
|
3370
|
+
* If the field value matches any of the specified values, an error message is
|
|
3371
|
+
* generated.
|
|
3372
|
+
*
|
|
3373
|
+
* ```proto
|
|
3374
|
+
* message MyBytes {
|
|
3375
|
+
* // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"]
|
|
3376
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}];
|
|
3377
|
+
* }
|
|
3378
|
+
* ```
|
|
3379
|
+
*
|
|
3380
|
+
* @generated from field: repeated bytes not_in = 9;
|
|
3381
|
+
*/
|
|
3382
|
+
notIn: Uint8Array[];
|
|
3383
|
+
/**
|
|
3384
|
+
* WellKnown rules provide advanced rules against common byte
|
|
3385
|
+
* patterns
|
|
3386
|
+
*
|
|
3387
|
+
* @generated from oneof buf.validate.BytesRules.well_known
|
|
3388
|
+
*/
|
|
3389
|
+
wellKnown: {
|
|
3390
|
+
/**
|
|
3391
|
+
* `ip` ensures that the field `value` is a valid IP address (v4 or v6) in byte format.
|
|
3392
|
+
* If the field value doesn't meet this rule, an error message is generated.
|
|
3393
|
+
*
|
|
3394
|
+
* ```proto
|
|
3395
|
+
* message MyBytes {
|
|
3396
|
+
* // value must be a valid IP address
|
|
3397
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
|
|
3398
|
+
* }
|
|
3399
|
+
* ```
|
|
3400
|
+
*
|
|
3401
|
+
* @generated from field: bool ip = 10;
|
|
3402
|
+
*/
|
|
3403
|
+
value: boolean;
|
|
3404
|
+
case: "ip";
|
|
3405
|
+
} | {
|
|
3406
|
+
/**
|
|
3407
|
+
* `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
|
|
3408
|
+
* If the field value doesn't meet this rule, an error message is generated.
|
|
3409
|
+
*
|
|
3410
|
+
* ```proto
|
|
3411
|
+
* message MyBytes {
|
|
3412
|
+
* // value must be a valid IPv4 address
|
|
3413
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
|
|
3414
|
+
* }
|
|
3415
|
+
* ```
|
|
3416
|
+
*
|
|
3417
|
+
* @generated from field: bool ipv4 = 11;
|
|
3418
|
+
*/
|
|
3419
|
+
value: boolean;
|
|
3420
|
+
case: "ipv4";
|
|
3421
|
+
} | {
|
|
3422
|
+
/**
|
|
3423
|
+
* `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
|
|
3424
|
+
* If the field value doesn't meet this rule, an error message is generated.
|
|
3425
|
+
* ```proto
|
|
3426
|
+
* message MyBytes {
|
|
3427
|
+
* // value must be a valid IPv6 address
|
|
3428
|
+
* optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
|
|
3429
|
+
* }
|
|
3430
|
+
* ```
|
|
3431
|
+
*
|
|
3432
|
+
* @generated from field: bool ipv6 = 12;
|
|
3433
|
+
*/
|
|
3434
|
+
value: boolean;
|
|
3435
|
+
case: "ipv6";
|
|
3436
|
+
} | {
|
|
3437
|
+
case: undefined;
|
|
3438
|
+
value?: undefined;
|
|
3439
|
+
};
|
|
3440
|
+
/**
|
|
3441
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3442
|
+
* conform to other rules. `example` values will not impact validation
|
|
3443
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3444
|
+
*
|
|
3445
|
+
* ```proto
|
|
3446
|
+
* message MyBytes {
|
|
3447
|
+
* bytes value = 1 [
|
|
3448
|
+
* (buf.validate.field).bytes.example = "\x01\x02",
|
|
3449
|
+
* (buf.validate.field).bytes.example = "\x02\x03"
|
|
3450
|
+
* ];
|
|
3451
|
+
* }
|
|
3452
|
+
* ```
|
|
3453
|
+
*
|
|
3454
|
+
* @generated from field: repeated bytes example = 14;
|
|
3455
|
+
*/
|
|
3456
|
+
example: Uint8Array[];
|
|
3457
|
+
};
|
|
3458
|
+
/**
|
|
3459
|
+
* Describes the message buf.validate.BytesRules.
|
|
3460
|
+
* Use `create(BytesRulesSchema)` to create a new message.
|
|
3461
|
+
*/
|
|
3462
|
+
export declare const BytesRulesSchema: GenMessage<BytesRules>;
|
|
3463
|
+
/**
|
|
3464
|
+
* EnumRules describe the rules applied to `enum` values.
|
|
3465
|
+
*
|
|
3466
|
+
* @generated from message buf.validate.EnumRules
|
|
3467
|
+
*/
|
|
3468
|
+
export type EnumRules = Message<"buf.validate.EnumRules"> & {
|
|
3469
|
+
/**
|
|
3470
|
+
* `const` requires the field value to exactly match the specified enum value.
|
|
3471
|
+
* If the field value doesn't match, an error message is generated.
|
|
3472
|
+
*
|
|
3473
|
+
* ```proto
|
|
3474
|
+
* enum MyEnum {
|
|
3475
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
3476
|
+
* MY_ENUM_VALUE1 = 1;
|
|
3477
|
+
* MY_ENUM_VALUE2 = 2;
|
|
3478
|
+
* }
|
|
3479
|
+
*
|
|
3480
|
+
* message MyMessage {
|
|
3481
|
+
* // The field `value` must be exactly MY_ENUM_VALUE1.
|
|
3482
|
+
* MyEnum value = 1 [(buf.validate.field).enum.const = 1];
|
|
3483
|
+
* }
|
|
3484
|
+
* ```
|
|
3485
|
+
*
|
|
3486
|
+
* @generated from field: optional int32 const = 1;
|
|
3487
|
+
*/
|
|
3488
|
+
const: number;
|
|
3489
|
+
/**
|
|
3490
|
+
* `defined_only` requires the field value to be one of the defined values for
|
|
3491
|
+
* this enum, failing on any undefined value.
|
|
3492
|
+
*
|
|
3493
|
+
* ```proto
|
|
3494
|
+
* enum MyEnum {
|
|
3495
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
3496
|
+
* MY_ENUM_VALUE1 = 1;
|
|
3497
|
+
* MY_ENUM_VALUE2 = 2;
|
|
3498
|
+
* }
|
|
3499
|
+
*
|
|
3500
|
+
* message MyMessage {
|
|
3501
|
+
* // The field `value` must be a defined value of MyEnum.
|
|
3502
|
+
* MyEnum value = 1 [(buf.validate.field).enum.defined_only = true];
|
|
3503
|
+
* }
|
|
3504
|
+
* ```
|
|
3505
|
+
*
|
|
3506
|
+
* @generated from field: optional bool defined_only = 2;
|
|
3507
|
+
*/
|
|
3508
|
+
definedOnly: boolean;
|
|
3509
|
+
/**
|
|
3510
|
+
* `in` requires the field value to be equal to one of the
|
|
3511
|
+
* specified enum values. If the field value doesn't match any of the
|
|
3512
|
+
* specified values, an error message is generated.
|
|
3513
|
+
*
|
|
3514
|
+
* ```proto
|
|
3515
|
+
* enum MyEnum {
|
|
3516
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
3517
|
+
* MY_ENUM_VALUE1 = 1;
|
|
3518
|
+
* MY_ENUM_VALUE2 = 2;
|
|
3519
|
+
* }
|
|
3520
|
+
*
|
|
3521
|
+
* message MyMessage {
|
|
3522
|
+
* // The field `value` must be equal to one of the specified values.
|
|
3523
|
+
* MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
|
|
3524
|
+
* }
|
|
3525
|
+
* ```
|
|
3526
|
+
*
|
|
3527
|
+
* @generated from field: repeated int32 in = 3;
|
|
3528
|
+
*/
|
|
3529
|
+
in: number[];
|
|
3530
|
+
/**
|
|
3531
|
+
* `not_in` requires the field value to be not equal to any of the
|
|
3532
|
+
* specified enum values. If the field value matches one of the specified
|
|
3533
|
+
* values, an error message is generated.
|
|
3534
|
+
*
|
|
3535
|
+
* ```proto
|
|
3536
|
+
* enum MyEnum {
|
|
3537
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
3538
|
+
* MY_ENUM_VALUE1 = 1;
|
|
3539
|
+
* MY_ENUM_VALUE2 = 2;
|
|
3540
|
+
* }
|
|
3541
|
+
*
|
|
3542
|
+
* message MyMessage {
|
|
3543
|
+
* // The field `value` must not be equal to any of the specified values.
|
|
3544
|
+
* MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
|
|
3545
|
+
* }
|
|
3546
|
+
* ```
|
|
3547
|
+
*
|
|
3548
|
+
* @generated from field: repeated int32 not_in = 4;
|
|
3549
|
+
*/
|
|
3550
|
+
notIn: number[];
|
|
3551
|
+
/**
|
|
3552
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3553
|
+
* conform to other rules. `example` values will not impact validation
|
|
3554
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3555
|
+
*
|
|
3556
|
+
* ```proto
|
|
3557
|
+
* enum MyEnum {
|
|
3558
|
+
* MY_ENUM_UNSPECIFIED = 0;
|
|
3559
|
+
* MY_ENUM_VALUE1 = 1;
|
|
3560
|
+
* MY_ENUM_VALUE2 = 2;
|
|
3561
|
+
* }
|
|
3562
|
+
*
|
|
3563
|
+
* message MyMessage {
|
|
3564
|
+
* (buf.validate.field).enum.example = 1,
|
|
3565
|
+
* (buf.validate.field).enum.example = 2
|
|
3566
|
+
* }
|
|
3567
|
+
* ```
|
|
3568
|
+
*
|
|
3569
|
+
* @generated from field: repeated int32 example = 5;
|
|
3570
|
+
*/
|
|
3571
|
+
example: number[];
|
|
3572
|
+
};
|
|
3573
|
+
/**
|
|
3574
|
+
* Describes the message buf.validate.EnumRules.
|
|
3575
|
+
* Use `create(EnumRulesSchema)` to create a new message.
|
|
3576
|
+
*/
|
|
3577
|
+
export declare const EnumRulesSchema: GenMessage<EnumRules>;
|
|
3578
|
+
/**
|
|
3579
|
+
* RepeatedRules describe the rules applied to `repeated` values.
|
|
3580
|
+
*
|
|
3581
|
+
* @generated from message buf.validate.RepeatedRules
|
|
3582
|
+
*/
|
|
3583
|
+
export type RepeatedRules = Message<"buf.validate.RepeatedRules"> & {
|
|
3584
|
+
/**
|
|
3585
|
+
* `min_items` requires that this field must contain at least the specified
|
|
3586
|
+
* minimum number of items.
|
|
3587
|
+
*
|
|
3588
|
+
* Note that `min_items = 1` is equivalent to setting a field as `required`.
|
|
3589
|
+
*
|
|
3590
|
+
* ```proto
|
|
3591
|
+
* message MyRepeated {
|
|
3592
|
+
* // value must contain at least 2 items
|
|
3593
|
+
* repeated string value = 1 [(buf.validate.field).repeated.min_items = 2];
|
|
3594
|
+
* }
|
|
3595
|
+
* ```
|
|
3596
|
+
*
|
|
3597
|
+
* @generated from field: optional uint64 min_items = 1;
|
|
3598
|
+
*/
|
|
3599
|
+
minItems: bigint;
|
|
3600
|
+
/**
|
|
3601
|
+
* `max_items` denotes that this field must not exceed a
|
|
3602
|
+
* certain number of items as the upper limit. If the field contains more
|
|
3603
|
+
* items than specified, an error message will be generated, requiring the
|
|
3604
|
+
* field to maintain no more than the specified number of items.
|
|
3605
|
+
*
|
|
3606
|
+
* ```proto
|
|
3607
|
+
* message MyRepeated {
|
|
3608
|
+
* // value must contain no more than 3 item(s)
|
|
3609
|
+
* repeated string value = 1 [(buf.validate.field).repeated.max_items = 3];
|
|
3610
|
+
* }
|
|
3611
|
+
* ```
|
|
3612
|
+
*
|
|
3613
|
+
* @generated from field: optional uint64 max_items = 2;
|
|
3614
|
+
*/
|
|
3615
|
+
maxItems: bigint;
|
|
3616
|
+
/**
|
|
3617
|
+
* `unique` indicates that all elements in this field must
|
|
3618
|
+
* be unique. This rule is strictly applicable to scalar and enum
|
|
3619
|
+
* types, with message types not being supported.
|
|
3620
|
+
*
|
|
3621
|
+
* ```proto
|
|
3622
|
+
* message MyRepeated {
|
|
3623
|
+
* // repeated value must contain unique items
|
|
3624
|
+
* repeated string value = 1 [(buf.validate.field).repeated.unique = true];
|
|
3625
|
+
* }
|
|
3626
|
+
* ```
|
|
3627
|
+
*
|
|
3628
|
+
* @generated from field: optional bool unique = 3;
|
|
3629
|
+
*/
|
|
3630
|
+
unique: boolean;
|
|
3631
|
+
/**
|
|
3632
|
+
* `items` details the rules to be applied to each item
|
|
3633
|
+
* in the field. Even for repeated message fields, validation is executed
|
|
3634
|
+
* against each item unless `ignore` is specified.
|
|
3635
|
+
*
|
|
3636
|
+
* ```proto
|
|
3637
|
+
* message MyRepeated {
|
|
3638
|
+
* // The items in the field `value` must follow the specified rules.
|
|
3639
|
+
* repeated string value = 1 [(buf.validate.field).repeated.items = {
|
|
3640
|
+
* string: {
|
|
3641
|
+
* min_len: 3
|
|
3642
|
+
* max_len: 10
|
|
3643
|
+
* }
|
|
3644
|
+
* }];
|
|
3645
|
+
* }
|
|
3646
|
+
* ```
|
|
3647
|
+
*
|
|
3648
|
+
* Note that the `required` rule does not apply. Repeated items
|
|
3649
|
+
* cannot be unset.
|
|
3650
|
+
*
|
|
3651
|
+
* @generated from field: optional buf.validate.FieldRules items = 4;
|
|
3652
|
+
*/
|
|
3653
|
+
items?: FieldRules;
|
|
3654
|
+
};
|
|
3655
|
+
/**
|
|
3656
|
+
* Describes the message buf.validate.RepeatedRules.
|
|
3657
|
+
* Use `create(RepeatedRulesSchema)` to create a new message.
|
|
3658
|
+
*/
|
|
3659
|
+
export declare const RepeatedRulesSchema: GenMessage<RepeatedRules>;
|
|
3660
|
+
/**
|
|
3661
|
+
* MapRules describe the rules applied to `map` values.
|
|
3662
|
+
*
|
|
3663
|
+
* @generated from message buf.validate.MapRules
|
|
3664
|
+
*/
|
|
3665
|
+
export type MapRules = Message<"buf.validate.MapRules"> & {
|
|
3666
|
+
/**
|
|
3667
|
+
* Specifies the minimum number of key-value pairs allowed. If the field has
|
|
3668
|
+
* fewer key-value pairs than specified, an error message is generated.
|
|
3669
|
+
*
|
|
3670
|
+
* ```proto
|
|
3671
|
+
* message MyMap {
|
|
3672
|
+
* // The field `value` must have at least 2 key-value pairs.
|
|
3673
|
+
* map<string, string> value = 1 [(buf.validate.field).map.min_pairs = 2];
|
|
3674
|
+
* }
|
|
3675
|
+
* ```
|
|
3676
|
+
*
|
|
3677
|
+
* @generated from field: optional uint64 min_pairs = 1;
|
|
3678
|
+
*/
|
|
3679
|
+
minPairs: bigint;
|
|
3680
|
+
/**
|
|
3681
|
+
* Specifies the maximum number of key-value pairs allowed. If the field has
|
|
3682
|
+
* more key-value pairs than specified, an error message is generated.
|
|
3683
|
+
*
|
|
3684
|
+
* ```proto
|
|
3685
|
+
* message MyMap {
|
|
3686
|
+
* // The field `value` must have at most 3 key-value pairs.
|
|
3687
|
+
* map<string, string> value = 1 [(buf.validate.field).map.max_pairs = 3];
|
|
3688
|
+
* }
|
|
3689
|
+
* ```
|
|
3690
|
+
*
|
|
3691
|
+
* @generated from field: optional uint64 max_pairs = 2;
|
|
3692
|
+
*/
|
|
3693
|
+
maxPairs: bigint;
|
|
3694
|
+
/**
|
|
3695
|
+
* Specifies the rules to be applied to each key in the field.
|
|
3696
|
+
*
|
|
3697
|
+
* ```proto
|
|
3698
|
+
* message MyMap {
|
|
3699
|
+
* // The keys in the field `value` must follow the specified rules.
|
|
3700
|
+
* map<string, string> value = 1 [(buf.validate.field).map.keys = {
|
|
3701
|
+
* string: {
|
|
3702
|
+
* min_len: 3
|
|
3703
|
+
* max_len: 10
|
|
3704
|
+
* }
|
|
3705
|
+
* }];
|
|
3706
|
+
* }
|
|
3707
|
+
* ```
|
|
3708
|
+
*
|
|
3709
|
+
* Note that the `required` rule does not apply. Map keys cannot be unset.
|
|
3710
|
+
*
|
|
3711
|
+
* @generated from field: optional buf.validate.FieldRules keys = 4;
|
|
3712
|
+
*/
|
|
3713
|
+
keys?: FieldRules;
|
|
3714
|
+
/**
|
|
3715
|
+
* Specifies the rules to be applied to the value of each key in the
|
|
3716
|
+
* field. Message values will still have their validations evaluated unless
|
|
3717
|
+
* `ignore` is specified.
|
|
3718
|
+
*
|
|
3719
|
+
* ```proto
|
|
3720
|
+
* message MyMap {
|
|
3721
|
+
* // The values in the field `value` must follow the specified rules.
|
|
3722
|
+
* map<string, string> value = 1 [(buf.validate.field).map.values = {
|
|
3723
|
+
* string: {
|
|
3724
|
+
* min_len: 5
|
|
3725
|
+
* max_len: 20
|
|
3726
|
+
* }
|
|
3727
|
+
* }];
|
|
3728
|
+
* }
|
|
3729
|
+
* ```
|
|
3730
|
+
* Note that the `required` rule does not apply. Map values cannot be unset.
|
|
3731
|
+
*
|
|
3732
|
+
* @generated from field: optional buf.validate.FieldRules values = 5;
|
|
3733
|
+
*/
|
|
3734
|
+
values?: FieldRules;
|
|
3735
|
+
};
|
|
3736
|
+
/**
|
|
3737
|
+
* Describes the message buf.validate.MapRules.
|
|
3738
|
+
* Use `create(MapRulesSchema)` to create a new message.
|
|
3739
|
+
*/
|
|
3740
|
+
export declare const MapRulesSchema: GenMessage<MapRules>;
|
|
3741
|
+
/**
|
|
3742
|
+
* AnyRules describe rules applied exclusively to the `google.protobuf.Any` well-known type.
|
|
3743
|
+
*
|
|
3744
|
+
* @generated from message buf.validate.AnyRules
|
|
3745
|
+
*/
|
|
3746
|
+
export type AnyRules = Message<"buf.validate.AnyRules"> & {
|
|
3747
|
+
/**
|
|
3748
|
+
* `in` requires the field's `type_url` to be equal to one of the
|
|
3749
|
+
* specified values. If it doesn't match any of the specified values, an error
|
|
3750
|
+
* message is generated.
|
|
3751
|
+
*
|
|
3752
|
+
* ```proto
|
|
3753
|
+
* message MyAny {
|
|
3754
|
+
* // The `value` field must have a `type_url` equal to one of the specified values.
|
|
3755
|
+
* google.protobuf.Any value = 1 [(buf.validate.field).any = {
|
|
3756
|
+
* in: ["type.googleapis.com/MyType1", "type.googleapis.com/MyType2"]
|
|
3757
|
+
* }];
|
|
3758
|
+
* }
|
|
3759
|
+
* ```
|
|
3760
|
+
*
|
|
3761
|
+
* @generated from field: repeated string in = 2;
|
|
3762
|
+
*/
|
|
3763
|
+
in: string[];
|
|
3764
|
+
/**
|
|
3765
|
+
* 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.
|
|
3766
|
+
*
|
|
3767
|
+
* ```proto
|
|
3768
|
+
* message MyAny {
|
|
3769
|
+
* // The `value` field must not have a `type_url` equal to any of the specified values.
|
|
3770
|
+
* google.protobuf.Any value = 1 [(buf.validate.field).any = {
|
|
3771
|
+
* not_in: ["type.googleapis.com/ForbiddenType1", "type.googleapis.com/ForbiddenType2"]
|
|
3772
|
+
* }];
|
|
3773
|
+
* }
|
|
3774
|
+
* ```
|
|
3775
|
+
*
|
|
3776
|
+
* @generated from field: repeated string not_in = 3;
|
|
3777
|
+
*/
|
|
3778
|
+
notIn: string[];
|
|
3779
|
+
};
|
|
3780
|
+
/**
|
|
3781
|
+
* Describes the message buf.validate.AnyRules.
|
|
3782
|
+
* Use `create(AnyRulesSchema)` to create a new message.
|
|
3783
|
+
*/
|
|
3784
|
+
export declare const AnyRulesSchema: GenMessage<AnyRules>;
|
|
3785
|
+
/**
|
|
3786
|
+
* DurationRules describe the rules applied exclusively to the `google.protobuf.Duration` well-known type.
|
|
3787
|
+
*
|
|
3788
|
+
* @generated from message buf.validate.DurationRules
|
|
3789
|
+
*/
|
|
3790
|
+
export type DurationRules = Message<"buf.validate.DurationRules"> & {
|
|
3791
|
+
/**
|
|
3792
|
+
* `const` dictates that the field must match the specified value of the `google.protobuf.Duration` type exactly.
|
|
3793
|
+
* If the field's value deviates from the specified value, an error message
|
|
3794
|
+
* will be generated.
|
|
3795
|
+
*
|
|
3796
|
+
* ```proto
|
|
3797
|
+
* message MyDuration {
|
|
3798
|
+
* // value must equal 5s
|
|
3799
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"];
|
|
3800
|
+
* }
|
|
3801
|
+
* ```
|
|
3802
|
+
*
|
|
3803
|
+
* @generated from field: optional google.protobuf.Duration const = 2;
|
|
3804
|
+
*/
|
|
3805
|
+
const?: Duration;
|
|
3806
|
+
/**
|
|
3807
|
+
* @generated from oneof buf.validate.DurationRules.less_than
|
|
3808
|
+
*/
|
|
3809
|
+
lessThan: {
|
|
3810
|
+
/**
|
|
3811
|
+
* `lt` stipulates that the field must be less than the specified value of the `google.protobuf.Duration` type,
|
|
3812
|
+
* exclusive. If the field's value is greater than or equal to the specified
|
|
3813
|
+
* value, an error message will be generated.
|
|
3814
|
+
*
|
|
3815
|
+
* ```proto
|
|
3816
|
+
* message MyDuration {
|
|
3817
|
+
* // value must be less than 5s
|
|
3818
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"];
|
|
3819
|
+
* }
|
|
3820
|
+
* ```
|
|
3821
|
+
*
|
|
3822
|
+
* @generated from field: google.protobuf.Duration lt = 3;
|
|
3823
|
+
*/
|
|
3824
|
+
value: Duration;
|
|
3825
|
+
case: "lt";
|
|
3826
|
+
} | {
|
|
3827
|
+
/**
|
|
3828
|
+
* `lte` indicates that the field must be less than or equal to the specified
|
|
3829
|
+
* value of the `google.protobuf.Duration` type, inclusive. If the field's value is greater than the specified value,
|
|
3830
|
+
* an error message will be generated.
|
|
3831
|
+
*
|
|
3832
|
+
* ```proto
|
|
3833
|
+
* message MyDuration {
|
|
3834
|
+
* // value must be less than or equal to 10s
|
|
3835
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"];
|
|
3836
|
+
* }
|
|
3837
|
+
* ```
|
|
3838
|
+
*
|
|
3839
|
+
* @generated from field: google.protobuf.Duration lte = 4;
|
|
3840
|
+
*/
|
|
3841
|
+
value: Duration;
|
|
3842
|
+
case: "lte";
|
|
3843
|
+
} | {
|
|
3844
|
+
case: undefined;
|
|
3845
|
+
value?: undefined;
|
|
3846
|
+
};
|
|
3847
|
+
/**
|
|
3848
|
+
* @generated from oneof buf.validate.DurationRules.greater_than
|
|
3849
|
+
*/
|
|
3850
|
+
greaterThan: {
|
|
3851
|
+
/**
|
|
3852
|
+
* `gt` requires the duration field value to be greater than the specified
|
|
3853
|
+
* value (exclusive). If the value of `gt` is larger than a specified `lt`
|
|
3854
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
3855
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
3856
|
+
* an error message is generated.
|
|
3857
|
+
*
|
|
3858
|
+
* ```proto
|
|
3859
|
+
* message MyDuration {
|
|
3860
|
+
* // duration must be greater than 5s [duration.gt]
|
|
3861
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.gt = { seconds: 5 }];
|
|
3862
|
+
*
|
|
3863
|
+
* // duration must be greater than 5s and less than 10s [duration.gt_lt]
|
|
3864
|
+
* google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gt: { seconds: 5 }, lt: { seconds: 10 } }];
|
|
3865
|
+
*
|
|
3866
|
+
* // duration must be greater than 10s or less than 5s [duration.gt_lt_exclusive]
|
|
3867
|
+
* google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gt: { seconds: 10 }, lt: { seconds: 5 } }];
|
|
3868
|
+
* }
|
|
3869
|
+
* ```
|
|
3870
|
+
*
|
|
3871
|
+
* @generated from field: google.protobuf.Duration gt = 5;
|
|
3872
|
+
*/
|
|
3873
|
+
value: Duration;
|
|
3874
|
+
case: "gt";
|
|
3875
|
+
} | {
|
|
3876
|
+
/**
|
|
3877
|
+
* `gte` requires the duration field value to be greater than or equal to the
|
|
3878
|
+
* specified value (exclusive). If the value of `gte` is larger than a
|
|
3879
|
+
* specified `lt` or `lte`, the range is reversed, and the field value must
|
|
3880
|
+
* be outside the specified range. If the field value doesn't meet the
|
|
3881
|
+
* required conditions, an error message is generated.
|
|
3882
|
+
*
|
|
3883
|
+
* ```proto
|
|
3884
|
+
* message MyDuration {
|
|
3885
|
+
* // duration must be greater than or equal to 5s [duration.gte]
|
|
3886
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.gte = { seconds: 5 }];
|
|
3887
|
+
*
|
|
3888
|
+
* // duration must be greater than or equal to 5s and less than 10s [duration.gte_lt]
|
|
3889
|
+
* google.protobuf.Duration another_value = 2 [(buf.validate.field).duration = { gte: { seconds: 5 }, lt: { seconds: 10 } }];
|
|
3890
|
+
*
|
|
3891
|
+
* // duration must be greater than or equal to 10s or less than 5s [duration.gte_lt_exclusive]
|
|
3892
|
+
* google.protobuf.Duration other_value = 3 [(buf.validate.field).duration = { gte: { seconds: 10 }, lt: { seconds: 5 } }];
|
|
3893
|
+
* }
|
|
3894
|
+
* ```
|
|
3895
|
+
*
|
|
3896
|
+
* @generated from field: google.protobuf.Duration gte = 6;
|
|
3897
|
+
*/
|
|
3898
|
+
value: Duration;
|
|
3899
|
+
case: "gte";
|
|
3900
|
+
} | {
|
|
3901
|
+
case: undefined;
|
|
3902
|
+
value?: undefined;
|
|
3903
|
+
};
|
|
3904
|
+
/**
|
|
3905
|
+
* `in` asserts that the field must be equal to one of the specified values of the `google.protobuf.Duration` type.
|
|
3906
|
+
* If the field's value doesn't correspond to any of the specified values,
|
|
3907
|
+
* an error message will be generated.
|
|
3908
|
+
*
|
|
3909
|
+
* ```proto
|
|
3910
|
+
* message MyDuration {
|
|
3911
|
+
* // value must be in list [1s, 2s, 3s]
|
|
3912
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]];
|
|
3913
|
+
* }
|
|
3914
|
+
* ```
|
|
3915
|
+
*
|
|
3916
|
+
* @generated from field: repeated google.protobuf.Duration in = 7;
|
|
3917
|
+
*/
|
|
3918
|
+
in: Duration[];
|
|
3919
|
+
/**
|
|
3920
|
+
* `not_in` denotes that the field must not be equal to
|
|
3921
|
+
* any of the specified values of the `google.protobuf.Duration` type.
|
|
3922
|
+
* If the field's value matches any of these values, an error message will be
|
|
3923
|
+
* generated.
|
|
3924
|
+
*
|
|
3925
|
+
* ```proto
|
|
3926
|
+
* message MyDuration {
|
|
3927
|
+
* // value must not be in list [1s, 2s, 3s]
|
|
3928
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]];
|
|
3929
|
+
* }
|
|
3930
|
+
* ```
|
|
3931
|
+
*
|
|
3932
|
+
* @generated from field: repeated google.protobuf.Duration not_in = 8;
|
|
3933
|
+
*/
|
|
3934
|
+
notIn: Duration[];
|
|
3935
|
+
/**
|
|
3936
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
3937
|
+
* conform to other rules. `example` values will not impact validation
|
|
3938
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
3939
|
+
*
|
|
3940
|
+
* ```proto
|
|
3941
|
+
* message MyDuration {
|
|
3942
|
+
* google.protobuf.Duration value = 1 [
|
|
3943
|
+
* (buf.validate.field).duration.example = { seconds: 1 },
|
|
3944
|
+
* (buf.validate.field).duration.example = { seconds: 2 },
|
|
3945
|
+
* ];
|
|
3946
|
+
* }
|
|
3947
|
+
* ```
|
|
3948
|
+
*
|
|
3949
|
+
* @generated from field: repeated google.protobuf.Duration example = 9;
|
|
3950
|
+
*/
|
|
3951
|
+
example: Duration[];
|
|
3952
|
+
};
|
|
3953
|
+
/**
|
|
3954
|
+
* Describes the message buf.validate.DurationRules.
|
|
3955
|
+
* Use `create(DurationRulesSchema)` to create a new message.
|
|
3956
|
+
*/
|
|
3957
|
+
export declare const DurationRulesSchema: GenMessage<DurationRules>;
|
|
3958
|
+
/**
|
|
3959
|
+
* TimestampRules describe the rules applied exclusively to the `google.protobuf.Timestamp` well-known type.
|
|
3960
|
+
*
|
|
3961
|
+
* @generated from message buf.validate.TimestampRules
|
|
3962
|
+
*/
|
|
3963
|
+
export type TimestampRules = Message<"buf.validate.TimestampRules"> & {
|
|
3964
|
+
/**
|
|
3965
|
+
* `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.
|
|
3966
|
+
*
|
|
3967
|
+
* ```proto
|
|
3968
|
+
* message MyTimestamp {
|
|
3969
|
+
* // value must equal 2023-05-03T10:00:00Z
|
|
3970
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.const = {seconds: 1727998800}];
|
|
3971
|
+
* }
|
|
3972
|
+
* ```
|
|
3973
|
+
*
|
|
3974
|
+
* @generated from field: optional google.protobuf.Timestamp const = 2;
|
|
3975
|
+
*/
|
|
3976
|
+
const?: Timestamp;
|
|
3977
|
+
/**
|
|
3978
|
+
* @generated from oneof buf.validate.TimestampRules.less_than
|
|
3979
|
+
*/
|
|
3980
|
+
lessThan: {
|
|
3981
|
+
/**
|
|
3982
|
+
* 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.
|
|
3983
|
+
*
|
|
3984
|
+
* ```proto
|
|
3985
|
+
* message MyDuration {
|
|
3986
|
+
* // duration must be less than 'P3D' [duration.lt]
|
|
3987
|
+
* google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 259200 }];
|
|
3988
|
+
* }
|
|
3989
|
+
* ```
|
|
3990
|
+
*
|
|
3991
|
+
* @generated from field: google.protobuf.Timestamp lt = 3;
|
|
3992
|
+
*/
|
|
3993
|
+
value: Timestamp;
|
|
3994
|
+
case: "lt";
|
|
3995
|
+
} | {
|
|
3996
|
+
/**
|
|
3997
|
+
* 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.
|
|
3998
|
+
*
|
|
3999
|
+
* ```proto
|
|
4000
|
+
* message MyTimestamp {
|
|
4001
|
+
* // timestamp must be less than or equal to '2023-05-14T00:00:00Z' [timestamp.lte]
|
|
4002
|
+
* google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.lte = { seconds: 1678867200 }];
|
|
4003
|
+
* }
|
|
4004
|
+
* ```
|
|
4005
|
+
*
|
|
4006
|
+
* @generated from field: google.protobuf.Timestamp lte = 4;
|
|
4007
|
+
*/
|
|
4008
|
+
value: Timestamp;
|
|
4009
|
+
case: "lte";
|
|
4010
|
+
} | {
|
|
4011
|
+
/**
|
|
4012
|
+
* `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.
|
|
4013
|
+
*
|
|
4014
|
+
* ```proto
|
|
4015
|
+
* message MyTimestamp {
|
|
4016
|
+
* // value must be less than now
|
|
4017
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.lt_now = true];
|
|
4018
|
+
* }
|
|
4019
|
+
* ```
|
|
4020
|
+
*
|
|
4021
|
+
* @generated from field: bool lt_now = 7;
|
|
4022
|
+
*/
|
|
4023
|
+
value: boolean;
|
|
4024
|
+
case: "ltNow";
|
|
4025
|
+
} | {
|
|
4026
|
+
case: undefined;
|
|
4027
|
+
value?: undefined;
|
|
4028
|
+
};
|
|
4029
|
+
/**
|
|
4030
|
+
* @generated from oneof buf.validate.TimestampRules.greater_than
|
|
4031
|
+
*/
|
|
4032
|
+
greaterThan: {
|
|
4033
|
+
/**
|
|
4034
|
+
* `gt` requires the timestamp field value to be greater than the specified
|
|
4035
|
+
* value (exclusive). If the value of `gt` is larger than a specified `lt`
|
|
4036
|
+
* or `lte`, the range is reversed, and the field value must be outside the
|
|
4037
|
+
* specified range. If the field value doesn't meet the required conditions,
|
|
4038
|
+
* an error message is generated.
|
|
4039
|
+
*
|
|
4040
|
+
* ```proto
|
|
4041
|
+
* message MyTimestamp {
|
|
4042
|
+
* // timestamp must be greater than '2023-01-01T00:00:00Z' [timestamp.gt]
|
|
4043
|
+
* google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gt = { seconds: 1672444800 }];
|
|
4044
|
+
*
|
|
4045
|
+
* // timestamp must be greater than '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gt_lt]
|
|
4046
|
+
* google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gt: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
|
|
4047
|
+
*
|
|
4048
|
+
* // timestamp must be greater than '2023-01-02T00:00:00Z' or less than '2023-01-01T00:00:00Z' [timestamp.gt_lt_exclusive]
|
|
4049
|
+
* google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gt: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
|
|
4050
|
+
* }
|
|
4051
|
+
* ```
|
|
4052
|
+
*
|
|
4053
|
+
* @generated from field: google.protobuf.Timestamp gt = 5;
|
|
4054
|
+
*/
|
|
4055
|
+
value: Timestamp;
|
|
4056
|
+
case: "gt";
|
|
4057
|
+
} | {
|
|
4058
|
+
/**
|
|
4059
|
+
* `gte` requires the timestamp field value to be greater than or equal to the
|
|
4060
|
+
* specified value (exclusive). If the value of `gte` is larger than a
|
|
4061
|
+
* specified `lt` or `lte`, the range is reversed, and the field value
|
|
4062
|
+
* must be outside the specified range. If the field value doesn't meet
|
|
4063
|
+
* the required conditions, an error message is generated.
|
|
4064
|
+
*
|
|
4065
|
+
* ```proto
|
|
4066
|
+
* message MyTimestamp {
|
|
4067
|
+
* // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' [timestamp.gte]
|
|
4068
|
+
* google.protobuf.Timestamp value = 1 [(buf.validate.field).timestamp.gte = { seconds: 1672444800 }];
|
|
4069
|
+
*
|
|
4070
|
+
* // timestamp must be greater than or equal to '2023-01-01T00:00:00Z' and less than '2023-01-02T00:00:00Z' [timestamp.gte_lt]
|
|
4071
|
+
* google.protobuf.Timestamp another_value = 2 [(buf.validate.field).timestamp = { gte: { seconds: 1672444800 }, lt: { seconds: 1672531200 } }];
|
|
4072
|
+
*
|
|
4073
|
+
* // 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]
|
|
4074
|
+
* google.protobuf.Timestamp other_value = 3 [(buf.validate.field).timestamp = { gte: { seconds: 1672531200 }, lt: { seconds: 1672444800 } }];
|
|
4075
|
+
* }
|
|
4076
|
+
* ```
|
|
4077
|
+
*
|
|
4078
|
+
* @generated from field: google.protobuf.Timestamp gte = 6;
|
|
4079
|
+
*/
|
|
4080
|
+
value: Timestamp;
|
|
4081
|
+
case: "gte";
|
|
4082
|
+
} | {
|
|
4083
|
+
/**
|
|
4084
|
+
* `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.
|
|
4085
|
+
*
|
|
4086
|
+
* ```proto
|
|
4087
|
+
* message MyTimestamp {
|
|
4088
|
+
* // value must be greater than now
|
|
4089
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.gt_now = true];
|
|
4090
|
+
* }
|
|
4091
|
+
* ```
|
|
4092
|
+
*
|
|
4093
|
+
* @generated from field: bool gt_now = 8;
|
|
4094
|
+
*/
|
|
4095
|
+
value: boolean;
|
|
4096
|
+
case: "gtNow";
|
|
4097
|
+
} | {
|
|
4098
|
+
case: undefined;
|
|
4099
|
+
value?: undefined;
|
|
4100
|
+
};
|
|
4101
|
+
/**
|
|
4102
|
+
* `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.
|
|
4103
|
+
*
|
|
4104
|
+
* ```proto
|
|
4105
|
+
* message MyTimestamp {
|
|
4106
|
+
* // value must be within 1 hour of now
|
|
4107
|
+
* google.protobuf.Timestamp created_at = 1 [(buf.validate.field).timestamp.within = {seconds: 3600}];
|
|
4108
|
+
* }
|
|
4109
|
+
* ```
|
|
4110
|
+
*
|
|
4111
|
+
* @generated from field: optional google.protobuf.Duration within = 9;
|
|
4112
|
+
*/
|
|
4113
|
+
within?: Duration;
|
|
4114
|
+
/**
|
|
4115
|
+
* `example` specifies values that the field may have. These values SHOULD
|
|
4116
|
+
* conform to other rules. `example` values will not impact validation
|
|
4117
|
+
* but may be used as helpful guidance on how to populate the given field.
|
|
4118
|
+
*
|
|
4119
|
+
* ```proto
|
|
4120
|
+
* message MyTimestamp {
|
|
4121
|
+
* google.protobuf.Timestamp value = 1 [
|
|
4122
|
+
* (buf.validate.field).timestamp.example = { seconds: 1672444800 },
|
|
4123
|
+
* (buf.validate.field).timestamp.example = { seconds: 1672531200 },
|
|
4124
|
+
* ];
|
|
4125
|
+
* }
|
|
4126
|
+
* ```
|
|
4127
|
+
*
|
|
4128
|
+
* @generated from field: repeated google.protobuf.Timestamp example = 10;
|
|
4129
|
+
*/
|
|
4130
|
+
example: Timestamp[];
|
|
4131
|
+
};
|
|
4132
|
+
/**
|
|
4133
|
+
* Describes the message buf.validate.TimestampRules.
|
|
4134
|
+
* Use `create(TimestampRulesSchema)` to create a new message.
|
|
4135
|
+
*/
|
|
4136
|
+
export declare const TimestampRulesSchema: GenMessage<TimestampRules>;
|
|
4137
|
+
/**
|
|
4138
|
+
* `Violations` is a collection of `Violation` messages. This message type is returned by
|
|
4139
|
+
* Protovalidate when a proto message fails to meet the requirements set by the `Rule` validation rules.
|
|
4140
|
+
* Each individual violation is represented by a `Violation` message.
|
|
4141
|
+
*
|
|
4142
|
+
* @generated from message buf.validate.Violations
|
|
4143
|
+
*/
|
|
4144
|
+
export type Violations = Message<"buf.validate.Violations"> & {
|
|
4145
|
+
/**
|
|
4146
|
+
* `violations` is a repeated field that contains all the `Violation` messages corresponding to the violations detected.
|
|
4147
|
+
*
|
|
4148
|
+
* @generated from field: repeated buf.validate.Violation violations = 1;
|
|
4149
|
+
*/
|
|
4150
|
+
violations: Violation[];
|
|
4151
|
+
};
|
|
4152
|
+
/**
|
|
4153
|
+
* Describes the message buf.validate.Violations.
|
|
4154
|
+
* Use `create(ViolationsSchema)` to create a new message.
|
|
4155
|
+
*/
|
|
4156
|
+
export declare const ViolationsSchema: GenMessage<Violations>;
|
|
4157
|
+
/**
|
|
4158
|
+
* `Violation` represents a single instance where a validation rule, expressed
|
|
4159
|
+
* as a `Rule`, was not met. It provides information about the field that
|
|
4160
|
+
* caused the violation, the specific rule that wasn't fulfilled, and a
|
|
4161
|
+
* human-readable error message.
|
|
4162
|
+
*
|
|
4163
|
+
* For example, consider the following message:
|
|
4164
|
+
*
|
|
4165
|
+
* ```proto
|
|
4166
|
+
* message User {
|
|
4167
|
+
* int32 age = 1 [(buf.validate.field).cel = {
|
|
4168
|
+
* id: "user.age",
|
|
4169
|
+
* expression: "this < 18 ? 'User must be at least 18 years old' : ''",
|
|
4170
|
+
* }];
|
|
4171
|
+
* }
|
|
4172
|
+
* ```
|
|
4173
|
+
*
|
|
4174
|
+
* It could produce the following violation:
|
|
4175
|
+
*
|
|
4176
|
+
* ```json
|
|
4177
|
+
* {
|
|
4178
|
+
* "ruleId": "user.age",
|
|
4179
|
+
* "message": "User must be at least 18 years old",
|
|
4180
|
+
* "field": {
|
|
4181
|
+
* "elements": [
|
|
4182
|
+
* {
|
|
4183
|
+
* "fieldNumber": 1,
|
|
4184
|
+
* "fieldName": "age",
|
|
4185
|
+
* "fieldType": "TYPE_INT32"
|
|
4186
|
+
* }
|
|
4187
|
+
* ]
|
|
4188
|
+
* },
|
|
4189
|
+
* "rule": {
|
|
4190
|
+
* "elements": [
|
|
4191
|
+
* {
|
|
4192
|
+
* "fieldNumber": 23,
|
|
4193
|
+
* "fieldName": "cel",
|
|
4194
|
+
* "fieldType": "TYPE_MESSAGE",
|
|
4195
|
+
* "index": "0"
|
|
4196
|
+
* }
|
|
4197
|
+
* ]
|
|
4198
|
+
* }
|
|
4199
|
+
* }
|
|
4200
|
+
* ```
|
|
4201
|
+
*
|
|
4202
|
+
* @generated from message buf.validate.Violation
|
|
4203
|
+
*/
|
|
4204
|
+
export type Violation = Message<"buf.validate.Violation"> & {
|
|
4205
|
+
/**
|
|
4206
|
+
* `field` is a machine-readable path to the field that failed validation.
|
|
4207
|
+
* 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.
|
|
4208
|
+
*
|
|
4209
|
+
* For example, consider the following message:
|
|
4210
|
+
*
|
|
4211
|
+
* ```proto
|
|
4212
|
+
* message Message {
|
|
4213
|
+
* bool a = 1 [(buf.validate.field).required = true];
|
|
4214
|
+
* }
|
|
4215
|
+
* ```
|
|
4216
|
+
*
|
|
4217
|
+
* It could produce the following violation:
|
|
4218
|
+
*
|
|
4219
|
+
* ```textproto
|
|
4220
|
+
* violation {
|
|
4221
|
+
* field { element { field_number: 1, field_name: "a", field_type: 8 } }
|
|
4222
|
+
* ...
|
|
4223
|
+
* }
|
|
4224
|
+
* ```
|
|
4225
|
+
*
|
|
4226
|
+
* @generated from field: optional buf.validate.FieldPath field = 5;
|
|
4227
|
+
*/
|
|
4228
|
+
field?: FieldPath;
|
|
4229
|
+
/**
|
|
4230
|
+
* `rule` is a machine-readable path that points to the specific rule that failed validation.
|
|
4231
|
+
* This will be a nested field starting from the FieldRules of the field that failed validation.
|
|
4232
|
+
* For custom rules, this will provide the path of the rule, e.g. `cel[0]`.
|
|
4233
|
+
*
|
|
4234
|
+
* For example, consider the following message:
|
|
4235
|
+
*
|
|
4236
|
+
* ```proto
|
|
4237
|
+
* message Message {
|
|
4238
|
+
* bool a = 1 [(buf.validate.field).required = true];
|
|
4239
|
+
* bool b = 2 [(buf.validate.field).cel = {
|
|
4240
|
+
* id: "custom_rule",
|
|
4241
|
+
* expression: "!this ? 'b must be true': ''"
|
|
4242
|
+
* }]
|
|
4243
|
+
* }
|
|
4244
|
+
* ```
|
|
4245
|
+
*
|
|
4246
|
+
* It could produce the following violations:
|
|
4247
|
+
*
|
|
4248
|
+
* ```textproto
|
|
4249
|
+
* violation {
|
|
4250
|
+
* rule { element { field_number: 25, field_name: "required", field_type: 8 } }
|
|
4251
|
+
* ...
|
|
4252
|
+
* }
|
|
4253
|
+
* violation {
|
|
4254
|
+
* rule { element { field_number: 23, field_name: "cel", field_type: 11, index: 0 } }
|
|
4255
|
+
* ...
|
|
4256
|
+
* }
|
|
4257
|
+
* ```
|
|
4258
|
+
*
|
|
4259
|
+
* @generated from field: optional buf.validate.FieldPath rule = 6;
|
|
4260
|
+
*/
|
|
4261
|
+
rule?: FieldPath;
|
|
4262
|
+
/**
|
|
4263
|
+
* `rule_id` is the unique identifier of the `Rule` that was not fulfilled.
|
|
4264
|
+
* This is the same `id` that was specified in the `Rule` message, allowing easy tracing of which rule was violated.
|
|
4265
|
+
*
|
|
4266
|
+
* @generated from field: optional string rule_id = 2;
|
|
4267
|
+
*/
|
|
4268
|
+
ruleId: string;
|
|
4269
|
+
/**
|
|
4270
|
+
* `message` is a human-readable error message that describes the nature of the violation.
|
|
4271
|
+
* This can be the default error message from the violated `Rule`, or it can be a custom message that gives more context about the violation.
|
|
4272
|
+
*
|
|
4273
|
+
* @generated from field: optional string message = 3;
|
|
4274
|
+
*/
|
|
4275
|
+
message: string;
|
|
4276
|
+
/**
|
|
4277
|
+
* `for_key` indicates whether the violation was caused by a map key, rather than a value.
|
|
4278
|
+
*
|
|
4279
|
+
* @generated from field: optional bool for_key = 4;
|
|
4280
|
+
*/
|
|
4281
|
+
forKey: boolean;
|
|
4282
|
+
};
|
|
4283
|
+
/**
|
|
4284
|
+
* Describes the message buf.validate.Violation.
|
|
4285
|
+
* Use `create(ViolationSchema)` to create a new message.
|
|
4286
|
+
*/
|
|
4287
|
+
export declare const ViolationSchema: GenMessage<Violation>;
|
|
4288
|
+
/**
|
|
4289
|
+
* `FieldPath` provides a path to a nested protobuf field.
|
|
4290
|
+
*
|
|
4291
|
+
* This message provides enough information to render a dotted field path even without protobuf descriptors.
|
|
4292
|
+
* It also provides enough information to resolve a nested field through unknown wire data.
|
|
4293
|
+
*
|
|
4294
|
+
* @generated from message buf.validate.FieldPath
|
|
4295
|
+
*/
|
|
4296
|
+
export type FieldPath = Message<"buf.validate.FieldPath"> & {
|
|
4297
|
+
/**
|
|
4298
|
+
* `elements` contains each element of the path, starting from the root and recursing downward.
|
|
4299
|
+
*
|
|
4300
|
+
* @generated from field: repeated buf.validate.FieldPathElement elements = 1;
|
|
4301
|
+
*/
|
|
4302
|
+
elements: FieldPathElement[];
|
|
4303
|
+
};
|
|
4304
|
+
/**
|
|
4305
|
+
* Describes the message buf.validate.FieldPath.
|
|
4306
|
+
* Use `create(FieldPathSchema)` to create a new message.
|
|
4307
|
+
*/
|
|
4308
|
+
export declare const FieldPathSchema: GenMessage<FieldPath>;
|
|
4309
|
+
/**
|
|
4310
|
+
* `FieldPathElement` provides enough information to nest through a single protobuf field.
|
|
4311
|
+
*
|
|
4312
|
+
* If the selected field is a map or repeated field, the `subscript` value selects a specific element from it.
|
|
4313
|
+
* A path that refers to a value nested under a map key or repeated field index will have a `subscript` value.
|
|
4314
|
+
* The `field_type` field allows unambiguous resolution of a field even if descriptors are not available.
|
|
4315
|
+
*
|
|
4316
|
+
* @generated from message buf.validate.FieldPathElement
|
|
4317
|
+
*/
|
|
4318
|
+
export type FieldPathElement = Message<"buf.validate.FieldPathElement"> & {
|
|
4319
|
+
/**
|
|
4320
|
+
* `field_number` is the field number this path element refers to.
|
|
4321
|
+
*
|
|
4322
|
+
* @generated from field: optional int32 field_number = 1;
|
|
4323
|
+
*/
|
|
4324
|
+
fieldNumber: number;
|
|
4325
|
+
/**
|
|
4326
|
+
* `field_name` contains the field name this path element refers to.
|
|
4327
|
+
* This can be used to display a human-readable path even if the field number is unknown.
|
|
4328
|
+
*
|
|
4329
|
+
* @generated from field: optional string field_name = 2;
|
|
4330
|
+
*/
|
|
4331
|
+
fieldName: string;
|
|
4332
|
+
/**
|
|
4333
|
+
* `field_type` specifies the type of this field. When using reflection, this value is not needed.
|
|
4334
|
+
*
|
|
4335
|
+
* This value is provided to make it possible to traverse unknown fields through wire data.
|
|
4336
|
+
* When traversing wire data, be mindful of both packed[1] and delimited[2] encoding schemes.
|
|
4337
|
+
*
|
|
4338
|
+
* [1]: https://protobuf.dev/programming-guides/encoding/#packed
|
|
4339
|
+
* [2]: https://protobuf.dev/programming-guides/encoding/#groups
|
|
4340
|
+
*
|
|
4341
|
+
* N.B.: Although groups are deprecated, the corresponding delimited encoding scheme is not, and
|
|
4342
|
+
* can be explicitly used in Protocol Buffers 2023 Edition.
|
|
4343
|
+
*
|
|
4344
|
+
* @generated from field: optional google.protobuf.FieldDescriptorProto.Type field_type = 3;
|
|
4345
|
+
*/
|
|
4346
|
+
fieldType: FieldDescriptorProto_Type;
|
|
4347
|
+
/**
|
|
4348
|
+
* `key_type` specifies the map key type of this field. This value is useful when traversing
|
|
4349
|
+
* unknown fields through wire data: specifically, it allows handling the differences between
|
|
4350
|
+
* different integer encodings.
|
|
4351
|
+
*
|
|
4352
|
+
* @generated from field: optional google.protobuf.FieldDescriptorProto.Type key_type = 4;
|
|
4353
|
+
*/
|
|
4354
|
+
keyType: FieldDescriptorProto_Type;
|
|
4355
|
+
/**
|
|
4356
|
+
* `value_type` specifies map value type of this field. This is useful if you want to display a
|
|
4357
|
+
* value inside unknown fields through wire data.
|
|
4358
|
+
*
|
|
4359
|
+
* @generated from field: optional google.protobuf.FieldDescriptorProto.Type value_type = 5;
|
|
4360
|
+
*/
|
|
4361
|
+
valueType: FieldDescriptorProto_Type;
|
|
4362
|
+
/**
|
|
4363
|
+
* `subscript` contains a repeated index or map key, if this path element nests into a repeated or map field.
|
|
4364
|
+
*
|
|
4365
|
+
* @generated from oneof buf.validate.FieldPathElement.subscript
|
|
4366
|
+
*/
|
|
4367
|
+
subscript: {
|
|
4368
|
+
/**
|
|
4369
|
+
* `index` specifies a 0-based index into a repeated field.
|
|
4370
|
+
*
|
|
4371
|
+
* @generated from field: uint64 index = 6;
|
|
4372
|
+
*/
|
|
4373
|
+
value: bigint;
|
|
4374
|
+
case: "index";
|
|
4375
|
+
} | {
|
|
4376
|
+
/**
|
|
4377
|
+
* `bool_key` specifies a map key of type bool.
|
|
4378
|
+
*
|
|
4379
|
+
* @generated from field: bool bool_key = 7;
|
|
4380
|
+
*/
|
|
4381
|
+
value: boolean;
|
|
4382
|
+
case: "boolKey";
|
|
4383
|
+
} | {
|
|
4384
|
+
/**
|
|
4385
|
+
* `int_key` specifies a map key of type int32, int64, sint32, sint64, sfixed32 or sfixed64.
|
|
4386
|
+
*
|
|
4387
|
+
* @generated from field: int64 int_key = 8;
|
|
4388
|
+
*/
|
|
4389
|
+
value: bigint;
|
|
4390
|
+
case: "intKey";
|
|
4391
|
+
} | {
|
|
4392
|
+
/**
|
|
4393
|
+
* `uint_key` specifies a map key of type uint32, uint64, fixed32 or fixed64.
|
|
4394
|
+
*
|
|
4395
|
+
* @generated from field: uint64 uint_key = 9;
|
|
4396
|
+
*/
|
|
4397
|
+
value: bigint;
|
|
4398
|
+
case: "uintKey";
|
|
4399
|
+
} | {
|
|
4400
|
+
/**
|
|
4401
|
+
* `string_key` specifies a map key of type string.
|
|
4402
|
+
*
|
|
4403
|
+
* @generated from field: string string_key = 10;
|
|
4404
|
+
*/
|
|
4405
|
+
value: string;
|
|
4406
|
+
case: "stringKey";
|
|
4407
|
+
} | {
|
|
4408
|
+
case: undefined;
|
|
4409
|
+
value?: undefined;
|
|
4410
|
+
};
|
|
4411
|
+
};
|
|
4412
|
+
/**
|
|
4413
|
+
* Describes the message buf.validate.FieldPathElement.
|
|
4414
|
+
* Use `create(FieldPathElementSchema)` to create a new message.
|
|
4415
|
+
*/
|
|
4416
|
+
export declare const FieldPathElementSchema: GenMessage<FieldPathElement>;
|
|
4417
|
+
/**
|
|
4418
|
+
* Specifies how `FieldRules.ignore` behaves, depending on the field's value, and
|
|
4419
|
+
* whether the field tracks presence.
|
|
4420
|
+
*
|
|
4421
|
+
* @generated from enum buf.validate.Ignore
|
|
4422
|
+
*/
|
|
4423
|
+
export declare enum Ignore {
|
|
4424
|
+
/**
|
|
4425
|
+
* Ignore rules if the field tracks presence and is unset. This is the default
|
|
4426
|
+
* behavior.
|
|
4427
|
+
*
|
|
4428
|
+
* In proto3, only message fields, members of a Protobuf `oneof`, and fields
|
|
4429
|
+
* with the `optional` label track presence. Consequently, the following fields
|
|
4430
|
+
* are always validated, whether a value is set or not:
|
|
4431
|
+
*
|
|
4432
|
+
* ```proto
|
|
4433
|
+
* syntax="proto3";
|
|
4434
|
+
*
|
|
4435
|
+
* message RulesApply {
|
|
4436
|
+
* string email = 1 [
|
|
4437
|
+
* (buf.validate.field).string.email = true
|
|
4438
|
+
* ];
|
|
4439
|
+
* int32 age = 2 [
|
|
4440
|
+
* (buf.validate.field).int32.gt = 0
|
|
4441
|
+
* ];
|
|
4442
|
+
* repeated string labels = 3 [
|
|
4443
|
+
* (buf.validate.field).repeated.min_items = 1
|
|
4444
|
+
* ];
|
|
4445
|
+
* }
|
|
4446
|
+
* ```
|
|
4447
|
+
*
|
|
4448
|
+
* In contrast, the following fields track presence, and are only validated if
|
|
4449
|
+
* a value is set:
|
|
4450
|
+
*
|
|
4451
|
+
* ```proto
|
|
4452
|
+
* syntax="proto3";
|
|
4453
|
+
*
|
|
4454
|
+
* message RulesApplyIfSet {
|
|
4455
|
+
* optional string email = 1 [
|
|
4456
|
+
* (buf.validate.field).string.email = true
|
|
4457
|
+
* ];
|
|
4458
|
+
* oneof ref {
|
|
4459
|
+
* string reference = 2 [
|
|
4460
|
+
* (buf.validate.field).string.uuid = true
|
|
4461
|
+
* ];
|
|
4462
|
+
* string name = 3 [
|
|
4463
|
+
* (buf.validate.field).string.min_len = 4
|
|
4464
|
+
* ];
|
|
4465
|
+
* }
|
|
4466
|
+
* SomeMessage msg = 4 [
|
|
4467
|
+
* (buf.validate.field).cel = {/* ... *\/}
|
|
4468
|
+
* ];
|
|
4469
|
+
* }
|
|
4470
|
+
* ```
|
|
4471
|
+
*
|
|
4472
|
+
* To ensure that such a field is set, add the `required` rule.
|
|
4473
|
+
*
|
|
4474
|
+
* To learn which fields track presence, see the
|
|
4475
|
+
* [Field Presence cheat sheet](https://protobuf.dev/programming-guides/field_presence/#cheat).
|
|
4476
|
+
*
|
|
4477
|
+
* @generated from enum value: IGNORE_UNSPECIFIED = 0;
|
|
4478
|
+
*/
|
|
4479
|
+
UNSPECIFIED = 0,
|
|
4480
|
+
/**
|
|
4481
|
+
* Ignore rules if the field is unset, or set to the zero value.
|
|
4482
|
+
*
|
|
4483
|
+
* The zero value depends on the field type:
|
|
4484
|
+
* - For strings, the zero value is the empty string.
|
|
4485
|
+
* - For bytes, the zero value is empty bytes.
|
|
4486
|
+
* - For bool, the zero value is false.
|
|
4487
|
+
* - For numeric types, the zero value is zero.
|
|
4488
|
+
* - For enums, the zero value is the first defined enum value.
|
|
4489
|
+
* - For repeated fields, the zero is an empty list.
|
|
4490
|
+
* - For map fields, the zero is an empty map.
|
|
4491
|
+
* - For message fields, absence of the message (typically a null-value) is considered zero value.
|
|
4492
|
+
*
|
|
4493
|
+
* For fields that track presence (e.g. adding the `optional` label in proto3),
|
|
4494
|
+
* this a no-op and behavior is the same as the default `IGNORE_UNSPECIFIED`.
|
|
4495
|
+
*
|
|
4496
|
+
* @generated from enum value: IGNORE_IF_ZERO_VALUE = 1;
|
|
4497
|
+
*/
|
|
4498
|
+
IF_ZERO_VALUE = 1,
|
|
4499
|
+
/**
|
|
4500
|
+
* Always ignore rules, including the `required` rule.
|
|
4501
|
+
*
|
|
4502
|
+
* This is useful for ignoring the rules of a referenced message, or to
|
|
4503
|
+
* temporarily ignore rules during development.
|
|
4504
|
+
*
|
|
4505
|
+
* ```proto
|
|
4506
|
+
* message MyMessage {
|
|
4507
|
+
* // The field's rules will always be ignored, including any validations
|
|
4508
|
+
* // on value's fields.
|
|
4509
|
+
* MyOtherMessage value = 1 [
|
|
4510
|
+
* (buf.validate.field).ignore = IGNORE_ALWAYS];
|
|
4511
|
+
* }
|
|
4512
|
+
* ```
|
|
4513
|
+
*
|
|
4514
|
+
* @generated from enum value: IGNORE_ALWAYS = 3;
|
|
4515
|
+
*/
|
|
4516
|
+
ALWAYS = 3
|
|
4517
|
+
}
|
|
4518
|
+
/**
|
|
4519
|
+
* Describes the enum buf.validate.Ignore.
|
|
4520
|
+
*/
|
|
4521
|
+
export declare const IgnoreSchema: GenEnum<Ignore>;
|
|
4522
|
+
/**
|
|
4523
|
+
* KnownRegex contains some well-known patterns.
|
|
4524
|
+
*
|
|
4525
|
+
* @generated from enum buf.validate.KnownRegex
|
|
4526
|
+
*/
|
|
4527
|
+
export declare enum KnownRegex {
|
|
4528
|
+
/**
|
|
4529
|
+
* @generated from enum value: KNOWN_REGEX_UNSPECIFIED = 0;
|
|
4530
|
+
*/
|
|
4531
|
+
UNSPECIFIED = 0,
|
|
4532
|
+
/**
|
|
4533
|
+
* HTTP header name as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2).
|
|
4534
|
+
*
|
|
4535
|
+
* @generated from enum value: KNOWN_REGEX_HTTP_HEADER_NAME = 1;
|
|
4536
|
+
*/
|
|
4537
|
+
HTTP_HEADER_NAME = 1,
|
|
4538
|
+
/**
|
|
4539
|
+
* HTTP header value as defined by [RFC 7230](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4).
|
|
4540
|
+
*
|
|
4541
|
+
* @generated from enum value: KNOWN_REGEX_HTTP_HEADER_VALUE = 2;
|
|
4542
|
+
*/
|
|
4543
|
+
HTTP_HEADER_VALUE = 2
|
|
4544
|
+
}
|
|
4545
|
+
/**
|
|
4546
|
+
* Describes the enum buf.validate.KnownRegex.
|
|
4547
|
+
*/
|
|
4548
|
+
export declare const KnownRegexSchema: GenEnum<KnownRegex>;
|
|
4549
|
+
/**
|
|
4550
|
+
* Rules specify the validations to be performed on this message. By default,
|
|
4551
|
+
* no validation is performed against a message.
|
|
4552
|
+
*
|
|
4553
|
+
* @generated from extension: optional buf.validate.MessageRules message = 1159;
|
|
4554
|
+
*/
|
|
4555
|
+
export declare const message: GenExtension<MessageOptions, MessageRules>;
|
|
4556
|
+
/**
|
|
4557
|
+
* Rules specify the validations to be performed on this oneof. By default,
|
|
4558
|
+
* no validation is performed against a oneof.
|
|
4559
|
+
*
|
|
4560
|
+
* @generated from extension: optional buf.validate.OneofRules oneof = 1159;
|
|
4561
|
+
*/
|
|
4562
|
+
export declare const oneof: GenExtension<OneofOptions, OneofRules>;
|
|
4563
|
+
/**
|
|
4564
|
+
* Rules specify the validations to be performed on this field. By default,
|
|
4565
|
+
* no validation is performed against a field.
|
|
4566
|
+
*
|
|
4567
|
+
* @generated from extension: optional buf.validate.FieldRules field = 1159;
|
|
4568
|
+
*/
|
|
4569
|
+
export declare const field: GenExtension<FieldOptions, FieldRules>;
|
|
4570
|
+
/**
|
|
4571
|
+
* Specifies predefined rules. When extending a standard rule message,
|
|
4572
|
+
* this adds additional CEL expressions that apply when the extension is used.
|
|
4573
|
+
*
|
|
4574
|
+
* ```proto
|
|
4575
|
+
* extend buf.validate.Int32Rules {
|
|
4576
|
+
* bool is_zero [(buf.validate.predefined).cel = {
|
|
4577
|
+
* id: "int32.is_zero",
|
|
4578
|
+
* message: "value must be zero",
|
|
4579
|
+
* expression: "!rule || this == 0",
|
|
4580
|
+
* }];
|
|
4581
|
+
* }
|
|
4582
|
+
*
|
|
4583
|
+
* message Foo {
|
|
4584
|
+
* int32 reserved = 1 [(buf.validate.field).int32.(is_zero) = true];
|
|
4585
|
+
* }
|
|
4586
|
+
* ```
|
|
4587
|
+
*
|
|
4588
|
+
* @generated from extension: optional buf.validate.PredefinedRules predefined = 1160;
|
|
4589
|
+
*/
|
|
4590
|
+
export declare const predefined: GenExtension<FieldOptions, PredefinedRules>;
|