@authzed/authzed-node
Version:
authzed client for nodejs
1,430 lines (1,429 loc) • 168 kB
TypeScript
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
import type { PartialMessage } from "@protobuf-ts/runtime";
import { MessageType } from "@protobuf-ts/runtime";
import { FieldDescriptorProto_Type } from "../../google/protobuf/descriptor.js";
import { Timestamp } from "../../google/protobuf/timestamp.js";
import { Duration } from "../../google/protobuf/duration.js";
/**
* `Constraint` represents a validation rule written in the Common Expression
* Language (CEL) syntax. Each Constraint includes a unique identifier, an
* optional error message, and the CEL expression to evaluate. For more
* information on CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
* ```proto
* message Foo {
* option (buf.validate.message).cel = {
* id: "foo.bar"
* message: "bar must be greater than 0"
* expression: "this.bar > 0"
* };
* int32 bar = 1;
* }
* ```
*
* @generated from protobuf message buf.validate.Constraint
*/
export interface Constraint {
/**
* `id` is a string that serves as a machine-readable name for this Constraint.
* It should be unique within its scope, which could be either a message or a field.
*
* @generated from protobuf field: optional string id = 1;
*/
id?: string;
/**
* `message` is an optional field that provides a human-readable error message
* for this Constraint when the CEL expression evaluates to false. If a
* non-empty message is provided, any strings resulting from the CEL
* expression evaluation are ignored.
*
* @generated from protobuf field: optional string message = 2;
*/
message?: string;
/**
* `expression` is the actual CEL expression that will be evaluated for
* validation. This string must resolve to either a boolean or a string
* value. If the expression evaluates to false or a non-empty string, the
* validation is considered failed, and the message is rejected.
*
* @generated from protobuf field: optional string expression = 3;
*/
expression?: string;
}
/**
* MessageConstraints represents validation rules that are applied to the entire message.
* It includes disabling options and a list of Constraint messages representing Common Expression Language (CEL) validation rules.
*
* @generated from protobuf message buf.validate.MessageConstraints
*/
export interface MessageConstraints {
/**
* `disabled` is a boolean flag that, when set to true, nullifies any validation rules for this message.
* This includes any fields within the message that would otherwise support validation.
*
* ```proto
* message MyMessage {
* // validation will be bypassed for this message
* option (buf.validate.message).disabled = true;
* }
* ```
*
* @generated from protobuf field: optional bool disabled = 1;
*/
disabled?: boolean;
/**
* `cel` is a repeated field of type Constraint. Each Constraint specifies a validation rule to be applied to this message.
* These constraints are written in Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
*
* ```proto
* message MyMessage {
* // The field `foo` must be greater than 42.
* option (buf.validate.message).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this.foo > 42",
* };
* optional int32 foo = 1;
* }
* ```
*
* @generated from protobuf field: repeated buf.validate.Constraint cel = 3;
*/
cel: Constraint[];
}
/**
* The `OneofConstraints` message type enables you to manage constraints for
* oneof fields in your protobuf messages.
*
* @generated from protobuf message buf.validate.OneofConstraints
*/
export interface OneofConstraints {
/**
* If `required` is true, exactly one field of the oneof must be present. A
* validation error is returned if no fields in the oneof are present. The
* field itself may still be a default value; further constraints
* should be placed on the fields themselves to ensure they are valid values,
* such as `min_len` or `gt`.
*
* ```proto
* message MyMessage {
* oneof value {
* // Either `a` or `b` must be set. If `a` is set, it must also be
* // non-empty; whereas if `b` is set, it can still be an empty string.
* option (buf.validate.oneof).required = true;
* string a = 1 [(buf.validate.field).string.min_len = 1];
* string b = 2;
* }
* }
* ```
*
* @generated from protobuf field: optional bool required = 1;
*/
required?: boolean;
}
/**
* FieldConstraints encapsulates the rules for each type of field. Depending on
* the field, the correct set should be used to ensure proper validations.
*
* @generated from protobuf message buf.validate.FieldConstraints
*/
export interface FieldConstraints {
/**
* `cel` is a repeated field used to represent a textual expression
* in the Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
* ```proto
* message MyMessage {
* // The field `value` must be greater than 42.
* optional int32 value = 1 [(buf.validate.field).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this > 42",
* }];
* }
* ```
*
* @generated from protobuf field: repeated buf.validate.Constraint cel = 23;
*/
cel: Constraint[];
/**
* If `required` is true, the field must be populated. A populated field can be
* described as "serialized in the wire format," which includes:
*
* - the following "nullable" fields must be explicitly set to be considered populated:
* - singular message fields (whose fields may be unpopulated/default values)
* - member fields of a oneof (may be their default value)
* - proto3 optional fields (may be their default value)
* - proto2 scalar fields (both optional and required)
* - proto3 scalar fields must be non-zero to be considered populated
* - repeated and map fields must be non-empty to be considered populated
*
* ```proto
* message MyMessage {
* // The field `value` must be set to a non-null value.
* optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
* }
* ```
*
* @generated from protobuf field: optional bool required = 25;
*/
required?: boolean;
/**
* Skip validation on the field if its value matches the specified criteria.
* See Ignore enum for details.
*
* ```proto
* message UpdateRequest {
* // The uri rule only applies if the field is populated and not an empty
* // string.
* optional string url = 1 [
* (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
* (buf.validate.field).string.uri = true,
* ];
* }
* ```
*
* @generated from protobuf field: optional buf.validate.Ignore ignore = 27;
*/
ignore?: Ignore;
/**
* @generated from protobuf oneof: type
*/
type: {
oneofKind: "float";
/**
* Scalar Field Types
*
* @generated from protobuf field: buf.validate.FloatRules float = 1;
*/
float: FloatRules;
} | {
oneofKind: "double";
/**
* @generated from protobuf field: buf.validate.DoubleRules double = 2;
*/
double: DoubleRules;
} | {
oneofKind: "int32";
/**
* @generated from protobuf field: buf.validate.Int32Rules int32 = 3;
*/
int32: Int32Rules;
} | {
oneofKind: "int64";
/**
* @generated from protobuf field: buf.validate.Int64Rules int64 = 4;
*/
int64: Int64Rules;
} | {
oneofKind: "uint32";
/**
* @generated from protobuf field: buf.validate.UInt32Rules uint32 = 5;
*/
uint32: UInt32Rules;
} | {
oneofKind: "uint64";
/**
* @generated from protobuf field: buf.validate.UInt64Rules uint64 = 6;
*/
uint64: UInt64Rules;
} | {
oneofKind: "sint32";
/**
* @generated from protobuf field: buf.validate.SInt32Rules sint32 = 7;
*/
sint32: SInt32Rules;
} | {
oneofKind: "sint64";
/**
* @generated from protobuf field: buf.validate.SInt64Rules sint64 = 8;
*/
sint64: SInt64Rules;
} | {
oneofKind: "fixed32";
/**
* @generated from protobuf field: buf.validate.Fixed32Rules fixed32 = 9;
*/
fixed32: Fixed32Rules;
} | {
oneofKind: "fixed64";
/**
* @generated from protobuf field: buf.validate.Fixed64Rules fixed64 = 10;
*/
fixed64: Fixed64Rules;
} | {
oneofKind: "sfixed32";
/**
* @generated from protobuf field: buf.validate.SFixed32Rules sfixed32 = 11;
*/
sfixed32: SFixed32Rules;
} | {
oneofKind: "sfixed64";
/**
* @generated from protobuf field: buf.validate.SFixed64Rules sfixed64 = 12;
*/
sfixed64: SFixed64Rules;
} | {
oneofKind: "bool";
/**
* @generated from protobuf field: buf.validate.BoolRules bool = 13;
*/
bool: BoolRules;
} | {
oneofKind: "string";
/**
* @generated from protobuf field: buf.validate.StringRules string = 14;
*/
string: StringRules;
} | {
oneofKind: "bytes";
/**
* @generated from protobuf field: buf.validate.BytesRules bytes = 15;
*/
bytes: BytesRules;
} | {
oneofKind: "enum";
/**
* Complex Field Types
*
* @generated from protobuf field: buf.validate.EnumRules enum = 16;
*/
enum: EnumRules;
} | {
oneofKind: "repeated";
/**
* @generated from protobuf field: buf.validate.RepeatedRules repeated = 18;
*/
repeated: RepeatedRules;
} | {
oneofKind: "map";
/**
* @generated from protobuf field: buf.validate.MapRules map = 19;
*/
map: MapRules;
} | {
oneofKind: "any";
/**
* Well-Known Field Types
*
* @generated from protobuf field: buf.validate.AnyRules any = 20;
*/
any: AnyRules;
} | {
oneofKind: "duration";
/**
* @generated from protobuf field: buf.validate.DurationRules duration = 21;
*/
duration: DurationRules;
} | {
oneofKind: "timestamp";
/**
* @generated from protobuf field: buf.validate.TimestampRules timestamp = 22;
*/
timestamp: TimestampRules;
} | {
oneofKind: undefined;
};
}
/**
* PredefinedConstraints are custom constraints that can be re-used with
* multiple fields.
*
* @generated from protobuf message buf.validate.PredefinedConstraints
*/
export interface PredefinedConstraints {
/**
* `cel` is a repeated field used to represent a textual expression
* in the Common Expression Language (CEL) syntax. For more information on
* CEL, [see our documentation](https://github.com/bufbuild/protovalidate/blob/main/docs/cel.md).
*
* ```proto
* message MyMessage {
* // The field `value` must be greater than 42.
* optional int32 value = 1 [(buf.validate.predefined).cel = {
* id: "my_message.value",
* message: "value must be greater than 42",
* expression: "this > 42",
* }];
* }
* ```
*
* @generated from protobuf field: repeated buf.validate.Constraint cel = 1;
*/
cel: Constraint[];
}
/**
* FloatRules describes the constraints applied to `float` values. These
* rules may also be applied to the `google.protobuf.FloatValue` Well-Known-Type.
*
* @generated from protobuf message buf.validate.FloatRules
*/
export interface FloatRules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyFloat {
* // value must equal 42.0
* float value = 1 [(buf.validate.field).float.const = 42.0];
* }
* ```
*
* @generated from protobuf field: optional float const = 1;
*/
const?: number;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field <
* value). If the field value is equal to or greater than the specified value,
* an error message is generated.
*
* ```proto
* message MyFloat {
* // value must be less than 10.0
* float value = 1 [(buf.validate.field).float.lt = 10.0];
* }
* ```
*
* @generated from protobuf field: float lt = 2;
*/
lt: number;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified
* value (field <= value). If the field value is greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyFloat {
* // value must be less than or equal to 10.0
* float value = 1 [(buf.validate.field).float.lte = 10.0];
* }
* ```
*
* @generated from protobuf field: float lte = 3;
*/
lte: number;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";
/**
* `gt` requires the field value to be greater than the specified value
* (exclusive). If the value of `gt` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyFloat {
* // value must be greater than 5.0 [float.gt]
* float value = 1 [(buf.validate.field).float.gt = 5.0];
*
* // value must be greater than 5 and less than 10.0 [float.gt_lt]
* float other_value = 2 [(buf.validate.field).float = { gt: 5.0, lt: 10.0 }];
*
* // value must be greater than 10 or less than 5.0 [float.gt_lt_exclusive]
* float another_value = 3 [(buf.validate.field).float = { gt: 10.0, lt: 5.0 }];
* }
* ```
*
* @generated from protobuf field: float gt = 4;
*/
gt: number;
} | {
oneofKind: "gte";
/**
* `gte` requires the field value to be greater than or equal to the specified
* value (exclusive). If the value of `gte` is larger than a specified `lt`
* or `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyFloat {
* // value must be greater than or equal to 5.0 [float.gte]
* float value = 1 [(buf.validate.field).float.gte = 5.0];
*
* // value must be greater than or equal to 5.0 and less than 10.0 [float.gte_lt]
* float other_value = 2 [(buf.validate.field).float = { gte: 5.0, lt: 10.0 }];
*
* // value must be greater than or equal to 10.0 or less than 5.0 [float.gte_lt_exclusive]
* float another_value = 3 [(buf.validate.field).float = { gte: 10.0, lt: 5.0 }];
* }
* ```
*
* @generated from protobuf field: float gte = 5;
*/
gte: number;
} | {
oneofKind: undefined;
};
/**
* `in` requires the field value to be equal to one of the specified values.
* If the field value isn't one of the specified values, an error message
* is generated.
*
* ```proto
* message MyFloat {
* // value must be in list [1.0, 2.0, 3.0]
* float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];
* }
* ```
*
* @generated from protobuf field: repeated float in = 6;
*/
in: number[];
/**
* `in` requires the field value to not be equal to any of the specified
* values. If the field value is one of the specified values, an error
* message is generated.
*
* ```proto
* message MyFloat {
* // value must not be in list [1.0, 2.0, 3.0]
* float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];
* }
* ```
*
* @generated from protobuf field: repeated float not_in = 7;
*/
notIn: number[];
/**
* `finite` requires the field value to be finite. If the field value is
* infinite or NaN, an error message is generated.
*
* @generated from protobuf field: optional bool finite = 8;
*/
finite?: boolean;
/**
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyFloat {
* float value = 1 [
* (buf.validate.field).float.example = 1.0,
* (buf.validate.field).float.example = "Infinity"
* ];
* }
* ```
*
* @generated from protobuf field: repeated float example = 9;
*/
example: number[];
}
/**
* DoubleRules describes the constraints applied to `double` values. These
* rules may also be applied to the `google.protobuf.DoubleValue` Well-Known-Type.
*
* @generated from protobuf message buf.validate.DoubleRules
*/
export interface DoubleRules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyDouble {
* // value must equal 42.0
* double value = 1 [(buf.validate.field).double.const = 42.0];
* }
* ```
*
* @generated from protobuf field: optional double const = 1;
*/
const?: number;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field <
* value). If the field value is equal to or greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyDouble {
* // value must be less than 10.0
* double value = 1 [(buf.validate.field).double.lt = 10.0];
* }
* ```
*
* @generated from protobuf field: double lt = 2;
*/
lt: number;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified value
* (field <= value). If the field value is greater than the specified value,
* an error message is generated.
*
* ```proto
* message MyDouble {
* // value must be less than or equal to 10.0
* double value = 1 [(buf.validate.field).double.lte = 10.0];
* }
* ```
*
* @generated from protobuf field: double lte = 3;
*/
lte: number;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";
/**
* `gt` requires the field value to be greater than the specified value
* (exclusive). If the value of `gt` is larger than a specified `lt` or `lte`,
* the range is reversed, and the field value must be outside the specified
* range. If the field value doesn't meet the required conditions, an error
* message is generated.
*
* ```proto
* message MyDouble {
* // value must be greater than 5.0 [double.gt]
* double value = 1 [(buf.validate.field).double.gt = 5.0];
*
* // value must be greater than 5 and less than 10.0 [double.gt_lt]
* double other_value = 2 [(buf.validate.field).double = { gt: 5.0, lt: 10.0 }];
*
* // value must be greater than 10 or less than 5.0 [double.gt_lt_exclusive]
* double another_value = 3 [(buf.validate.field).double = { gt: 10.0, lt: 5.0 }];
* }
* ```
*
* @generated from protobuf field: double gt = 4;
*/
gt: number;
} | {
oneofKind: "gte";
/**
* `gte` requires the field value to be greater than or equal to the specified
* value (exclusive). If the value of `gte` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyDouble {
* // value must be greater than or equal to 5.0 [double.gte]
* double value = 1 [(buf.validate.field).double.gte = 5.0];
*
* // value must be greater than or equal to 5.0 and less than 10.0 [double.gte_lt]
* double other_value = 2 [(buf.validate.field).double = { gte: 5.0, lt: 10.0 }];
*
* // value must be greater than or equal to 10.0 or less than 5.0 [double.gte_lt_exclusive]
* double another_value = 3 [(buf.validate.field).double = { gte: 10.0, lt: 5.0 }];
* }
* ```
*
* @generated from protobuf field: double gte = 5;
*/
gte: number;
} | {
oneofKind: undefined;
};
/**
* `in` requires the field value to be equal to one of the specified values.
* If the field value isn't one of the specified values, an error message is
* generated.
*
* ```proto
* message MyDouble {
* // value must be in list [1.0, 2.0, 3.0]
* double value = 1 [(buf.validate.field).double = { in: [1.0, 2.0, 3.0] }];
* }
* ```
*
* @generated from protobuf field: repeated double in = 6;
*/
in: number[];
/**
* `not_in` requires the field value to not be equal to any of the specified
* values. If the field value is one of the specified values, an error
* message is generated.
*
* ```proto
* message MyDouble {
* // value must not be in list [1.0, 2.0, 3.0]
* double value = 1 [(buf.validate.field).double = { not_in: [1.0, 2.0, 3.0] }];
* }
* ```
*
* @generated from protobuf field: repeated double not_in = 7;
*/
notIn: number[];
/**
* `finite` requires the field value to be finite. If the field value is
* infinite or NaN, an error message is generated.
*
* @generated from protobuf field: optional bool finite = 8;
*/
finite?: boolean;
/**
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyDouble {
* double value = 1 [
* (buf.validate.field).double.example = 1.0,
* (buf.validate.field).double.example = "Infinity"
* ];
* }
* ```
*
* @generated from protobuf field: repeated double example = 9;
*/
example: number[];
}
/**
* Int32Rules describes the constraints applied to `int32` values. These
* rules may also be applied to the `google.protobuf.Int32Value` Well-Known-Type.
*
* @generated from protobuf message buf.validate.Int32Rules
*/
export interface Int32Rules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyInt32 {
* // value must equal 42
* int32 value = 1 [(buf.validate.field).int32.const = 42];
* }
* ```
*
* @generated from protobuf field: optional int32 const = 1;
*/
const?: number;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field
* < value). If the field value is equal to or greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyInt32 {
* // value must be less than 10
* int32 value = 1 [(buf.validate.field).int32.lt = 10];
* }
* ```
*
* @generated from protobuf field: int32 lt = 2;
*/
lt: number;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified
* value (field <= value). If the field value is greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyInt32 {
* // value must be less than or equal to 10
* int32 value = 1 [(buf.validate.field).int32.lte = 10];
* }
* ```
*
* @generated from protobuf field: int32 lte = 3;
*/
lte: number;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";
/**
* `gt` requires the field value to be greater than the specified value
* (exclusive). If the value of `gt` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyInt32 {
* // value must be greater than 5 [int32.gt]
* int32 value = 1 [(buf.validate.field).int32.gt = 5];
*
* // value must be greater than 5 and less than 10 [int32.gt_lt]
* int32 other_value = 2 [(buf.validate.field).int32 = { gt: 5, lt: 10 }];
*
* // value must be greater than 10 or less than 5 [int32.gt_lt_exclusive]
* int32 another_value = 3 [(buf.validate.field).int32 = { gt: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: int32 gt = 4;
*/
gt: number;
} | {
oneofKind: "gte";
/**
* `gte` requires the field value to be greater than or equal to the specified value
* (exclusive). If the value of `gte` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyInt32 {
* // value must be greater than or equal to 5 [int32.gte]
* int32 value = 1 [(buf.validate.field).int32.gte = 5];
*
* // value must be greater than or equal to 5 and less than 10 [int32.gte_lt]
* int32 other_value = 2 [(buf.validate.field).int32 = { gte: 5, lt: 10 }];
*
* // value must be greater than or equal to 10 or less than 5 [int32.gte_lt_exclusive]
* int32 another_value = 3 [(buf.validate.field).int32 = { gte: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: int32 gte = 5;
*/
gte: number;
} | {
oneofKind: undefined;
};
/**
* `in` requires the field value to be equal to one of the specified values.
* If the field value isn't one of the specified values, an error message is
* generated.
*
* ```proto
* message MyInt32 {
* // value must be in list [1, 2, 3]
* int32 value = 1 [(buf.validate.field).int32 = { in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated int32 in = 6;
*/
in: number[];
/**
* `not_in` requires the field value to not be equal to any of the specified
* values. If the field value is one of the specified values, an error message
* is generated.
*
* ```proto
* message MyInt32 {
* // value must not be in list [1, 2, 3]
* int32 value = 1 [(buf.validate.field).int32 = { not_in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated int32 not_in = 7;
*/
notIn: number[];
/**
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyInt32 {
* int32 value = 1 [
* (buf.validate.field).int32.example = 1,
* (buf.validate.field).int32.example = -10
* ];
* }
* ```
*
* @generated from protobuf field: repeated int32 example = 8;
*/
example: number[];
}
/**
* Int64Rules describes the constraints applied to `int64` values. These
* rules may also be applied to the `google.protobuf.Int64Value` Well-Known-Type.
*
* @generated from protobuf message buf.validate.Int64Rules
*/
export interface Int64Rules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyInt64 {
* // value must equal 42
* int64 value = 1 [(buf.validate.field).int64.const = 42];
* }
* ```
*
* @generated from protobuf field: optional int64 const = 1;
*/
const?: string;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field <
* value). If the field value is equal to or greater than the specified value,
* an error message is generated.
*
* ```proto
* message MyInt64 {
* // value must be less than 10
* int64 value = 1 [(buf.validate.field).int64.lt = 10];
* }
* ```
*
* @generated from protobuf field: int64 lt = 2;
*/
lt: string;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified
* value (field <= value). If the field value is greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyInt64 {
* // value must be less than or equal to 10
* int64 value = 1 [(buf.validate.field).int64.lte = 10];
* }
* ```
*
* @generated from protobuf field: int64 lte = 3;
*/
lte: string;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";
/**
* `gt` requires the field value to be greater than the specified value
* (exclusive). If the value of `gt` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyInt64 {
* // value must be greater than 5 [int64.gt]
* int64 value = 1 [(buf.validate.field).int64.gt = 5];
*
* // value must be greater than 5 and less than 10 [int64.gt_lt]
* int64 other_value = 2 [(buf.validate.field).int64 = { gt: 5, lt: 10 }];
*
* // value must be greater than 10 or less than 5 [int64.gt_lt_exclusive]
* int64 another_value = 3 [(buf.validate.field).int64 = { gt: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: int64 gt = 4;
*/
gt: string;
} | {
oneofKind: "gte";
/**
* `gte` requires the field value to be greater than or equal to the specified
* value (exclusive). If the value of `gte` is larger than a specified `lt`
* or `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyInt64 {
* // value must be greater than or equal to 5 [int64.gte]
* int64 value = 1 [(buf.validate.field).int64.gte = 5];
*
* // value must be greater than or equal to 5 and less than 10 [int64.gte_lt]
* int64 other_value = 2 [(buf.validate.field).int64 = { gte: 5, lt: 10 }];
*
* // value must be greater than or equal to 10 or less than 5 [int64.gte_lt_exclusive]
* int64 another_value = 3 [(buf.validate.field).int64 = { gte: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: int64 gte = 5;
*/
gte: string;
} | {
oneofKind: undefined;
};
/**
* `in` requires the field value to be equal to one of the specified values.
* If the field value isn't one of the specified values, an error message is
* generated.
*
* ```proto
* message MyInt64 {
* // value must be in list [1, 2, 3]
* int64 value = 1 [(buf.validate.field).int64 = { in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated int64 in = 6;
*/
in: string[];
/**
* `not_in` requires the field value to not be equal to any of the specified
* values. If the field value is one of the specified values, an error
* message is generated.
*
* ```proto
* message MyInt64 {
* // value must not be in list [1, 2, 3]
* int64 value = 1 [(buf.validate.field).int64 = { not_in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated int64 not_in = 7;
*/
notIn: string[];
/**
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyInt64 {
* int64 value = 1 [
* (buf.validate.field).int64.example = 1,
* (buf.validate.field).int64.example = -10
* ];
* }
* ```
*
* @generated from protobuf field: repeated int64 example = 9;
*/
example: string[];
}
/**
* UInt32Rules describes the constraints applied to `uint32` values. These
* rules may also be applied to the `google.protobuf.UInt32Value` Well-Known-Type.
*
* @generated from protobuf message buf.validate.UInt32Rules
*/
export interface UInt32Rules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyUInt32 {
* // value must equal 42
* uint32 value = 1 [(buf.validate.field).uint32.const = 42];
* }
* ```
*
* @generated from protobuf field: optional uint32 const = 1;
*/
const?: number;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field <
* value). If the field value is equal to or greater than the specified value,
* an error message is generated.
*
* ```proto
* message MyUInt32 {
* // value must be less than 10
* uint32 value = 1 [(buf.validate.field).uint32.lt = 10];
* }
* ```
*
* @generated from protobuf field: uint32 lt = 2;
*/
lt: number;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified
* value (field <= value). If the field value is greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyUInt32 {
* // value must be less than or equal to 10
* uint32 value = 1 [(buf.validate.field).uint32.lte = 10];
* }
* ```
*
* @generated from protobuf field: uint32 lte = 3;
*/
lte: number;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";
/**
* `gt` requires the field value to be greater than the specified value
* (exclusive). If the value of `gt` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyUInt32 {
* // value must be greater than 5 [uint32.gt]
* uint32 value = 1 [(buf.validate.field).uint32.gt = 5];
*
* // value must be greater than 5 and less than 10 [uint32.gt_lt]
* uint32 other_value = 2 [(buf.validate.field).uint32 = { gt: 5, lt: 10 }];
*
* // value must be greater than 10 or less than 5 [uint32.gt_lt_exclusive]
* uint32 another_value = 3 [(buf.validate.field).uint32 = { gt: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: uint32 gt = 4;
*/
gt: number;
} | {
oneofKind: "gte";
/**
* `gte` requires the field value to be greater than or equal to the specified
* value (exclusive). If the value of `gte` is larger than a specified `lt`
* or `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyUInt32 {
* // value must be greater than or equal to 5 [uint32.gte]
* uint32 value = 1 [(buf.validate.field).uint32.gte = 5];
*
* // value must be greater than or equal to 5 and less than 10 [uint32.gte_lt]
* uint32 other_value = 2 [(buf.validate.field).uint32 = { gte: 5, lt: 10 }];
*
* // value must be greater than or equal to 10 or less than 5 [uint32.gte_lt_exclusive]
* uint32 another_value = 3 [(buf.validate.field).uint32 = { gte: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: uint32 gte = 5;
*/
gte: number;
} | {
oneofKind: undefined;
};
/**
* `in` requires the field value to be equal to one of the specified values.
* If the field value isn't one of the specified values, an error message is
* generated.
*
* ```proto
* message MyUInt32 {
* // value must be in list [1, 2, 3]
* uint32 value = 1 [(buf.validate.field).uint32 = { in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated uint32 in = 6;
*/
in: number[];
/**
* `not_in` requires the field value to not be equal to any of the specified
* values. If the field value is one of the specified values, an error
* message is generated.
*
* ```proto
* message MyUInt32 {
* // value must not be in list [1, 2, 3]
* uint32 value = 1 [(buf.validate.field).uint32 = { not_in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated uint32 not_in = 7;
*/
notIn: number[];
/**
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyUInt32 {
* uint32 value = 1 [
* (buf.validate.field).uint32.example = 1,
* (buf.validate.field).uint32.example = 10
* ];
* }
* ```
*
* @generated from protobuf field: repeated uint32 example = 8;
*/
example: number[];
}
/**
* UInt64Rules describes the constraints applied to `uint64` values. These
* rules may also be applied to the `google.protobuf.UInt64Value` Well-Known-Type.
*
* @generated from protobuf message buf.validate.UInt64Rules
*/
export interface UInt64Rules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MyUInt64 {
* // value must equal 42
* uint64 value = 1 [(buf.validate.field).uint64.const = 42];
* }
* ```
*
* @generated from protobuf field: optional uint64 const = 1;
*/
const?: string;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field <
* value). If the field value is equal to or greater than the specified value,
* an error message is generated.
*
* ```proto
* message MyUInt64 {
* // value must be less than 10
* uint64 value = 1 [(buf.validate.field).uint64.lt = 10];
* }
* ```
*
* @generated from protobuf field: uint64 lt = 2;
*/
lt: string;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified
* value (field <= value). If the field value is greater than the specified
* value, an error message is generated.
*
* ```proto
* message MyUInt64 {
* // value must be less than or equal to 10
* uint64 value = 1 [(buf.validate.field).uint64.lte = 10];
* }
* ```
*
* @generated from protobuf field: uint64 lte = 3;
*/
lte: string;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";
/**
* `gt` requires the field value to be greater than the specified value
* (exclusive). If the value of `gt` is larger than a specified `lt` or
* `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyUInt64 {
* // value must be greater than 5 [uint64.gt]
* uint64 value = 1 [(buf.validate.field).uint64.gt = 5];
*
* // value must be greater than 5 and less than 10 [uint64.gt_lt]
* uint64 other_value = 2 [(buf.validate.field).uint64 = { gt: 5, lt: 10 }];
*
* // value must be greater than 10 or less than 5 [uint64.gt_lt_exclusive]
* uint64 another_value = 3 [(buf.validate.field).uint64 = { gt: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: uint64 gt = 4;
*/
gt: string;
} | {
oneofKind: "gte";
/**
* `gte` requires the field value to be greater than or equal to the specified
* value (exclusive). If the value of `gte` is larger than a specified `lt`
* or `lte`, the range is reversed, and the field value must be outside the
* specified range. If the field value doesn't meet the required conditions,
* an error message is generated.
*
* ```proto
* message MyUInt64 {
* // value must be greater than or equal to 5 [uint64.gte]
* uint64 value = 1 [(buf.validate.field).uint64.gte = 5];
*
* // value must be greater than or equal to 5 and less than 10 [uint64.gte_lt]
* uint64 other_value = 2 [(buf.validate.field).uint64 = { gte: 5, lt: 10 }];
*
* // value must be greater than or equal to 10 or less than 5 [uint64.gte_lt_exclusive]
* uint64 another_value = 3 [(buf.validate.field).uint64 = { gte: 10, lt: 5 }];
* }
* ```
*
* @generated from protobuf field: uint64 gte = 5;
*/
gte: string;
} | {
oneofKind: undefined;
};
/**
* `in` requires the field value to be equal to one of the specified values.
* If the field value isn't one of the specified values, an error message is
* generated.
*
* ```proto
* message MyUInt64 {
* // value must be in list [1, 2, 3]
* uint64 value = 1 [(buf.validate.field).uint64 = { in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated uint64 in = 6;
*/
in: string[];
/**
* `not_in` requires the field value to not be equal to any of the specified
* values. If the field value is one of the specified values, an error
* message is generated.
*
* ```proto
* message MyUInt64 {
* // value must not be in list [1, 2, 3]
* uint64 value = 1 [(buf.validate.field).uint64 = { not_in: [1, 2, 3] }];
* }
* ```
*
* @generated from protobuf field: repeated uint64 not_in = 7;
*/
notIn: string[];
/**
* `example` specifies values that the field may have. These values SHOULD
* conform to other constraints. `example` values will not impact validation
* but may be used as helpful guidance on how to populate the given field.
*
* ```proto
* message MyUInt64 {
* uint64 value = 1 [
* (buf.validate.field).uint64.example = 1,
* (buf.validate.field).uint64.example = -10
* ];
* }
* ```
*
* @generated from protobuf field: repeated uint64 example = 8;
*/
example: string[];
}
/**
* SInt32Rules describes the constraints applied to `sint32` values.
*
* @generated from protobuf message buf.validate.SInt32Rules
*/
export interface SInt32Rules {
/**
* `const` requires the field value to exactly match the specified value. If
* the field value doesn't match, an error message is generated.
*
* ```proto
* message MySInt32 {
* // value must equal 42
* sint32 value = 1 [(buf.validate.field).sint32.const = 42];
* }
* ```
*
* @generated from protobuf field: optional sint32 const = 1;
*/
const?: number;
/**
* @generated from protobuf oneof: less_than
*/
lessThan: {
oneofKind: "lt";
/**
* `lt` requires the field value to be less than the specified value (field
* < value). If the field value is equal to or greater than the specified
* value, an error message is generated.
*
* ```proto
* message MySInt32 {
* // value must be less than 10
* sint32 value = 1 [(buf.validate.field).sint32.lt = 10];
* }
* ```
*
* @generated from protobuf field: sint32 lt = 2;
*/
lt: number;
} | {
oneofKind: "lte";
/**
* `lte` requires the field value to be less than or equal to the specified
* value (field <= value). If the field value is greater than the specified
* value, an error message is generated.
*
* ```proto
* message MySInt32 {
* // value must be less than or equal to 10
* sint32 value = 1 [(buf.validate.field).sint32.lte = 10];
* }
* ```
*
* @generated from protobuf field: sint32 lte = 3;
*/
lte: number;
} | {
oneofKind: undefined;
};
/**
* @generated from protobuf oneof: greater_than
*/
greaterThan: {
oneofKind: "gt";